kMaxBlockSize -> kMaxHeaderBlockSize to avoid shadowing warning on VS2015
[chromium-blink-merge.git] / extensions / renderer / logging_native_handler.h
blob7ae7ef5190947d0f3622b3bc95836fed0f363c87
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef EXTENSIONS_RENDERER_LOGGING_NATIVE_HANDLER_H_
6 #define EXTENSIONS_RENDERER_LOGGING_NATIVE_HANDLER_H_
8 #include <string>
10 #include "extensions/renderer/object_backed_native_handler.h"
12 namespace extensions {
13 class ScriptContext;
15 // Exposes logging.h macros to JavaScript bindings.
16 class LoggingNativeHandler : public ObjectBackedNativeHandler {
17 public:
18 explicit LoggingNativeHandler(ScriptContext* context);
19 ~LoggingNativeHandler() override;
21 // Equivalent to CHECK(predicate) << message.
23 // void(predicate, message?)
24 void Check(const v8::FunctionCallbackInfo<v8::Value>& args);
26 // Equivalent to DCHECK(predicate) << message.
28 // void(predicate, message?)
29 void Dcheck(const v8::FunctionCallbackInfo<v8::Value>& args);
31 // Equivalent to DCHECK_IS_ON().
33 // bool()
34 void DcheckIsOn(const v8::FunctionCallbackInfo<v8::Value>& args);
36 // Equivalent to LOG(INFO) << message.
38 // void(message)
39 void Log(const v8::FunctionCallbackInfo<v8::Value>& args);
41 // Equivalent to LOG(WARNING) << message.
43 // void(message)
44 void Warning(const v8::FunctionCallbackInfo<v8::Value>& args);
46 void ParseArgs(const v8::FunctionCallbackInfo<v8::Value>& args,
47 bool* check_value,
48 std::string* error_message);
50 std::string ToStringOrDefault(const v8::Handle<v8::String>& v8_string,
51 const std::string& dflt);
54 } // namespace extensions
56 #endif // EXTENSIONS_RENDERER_LOGGING_NATIVE_HANDLER_H_