Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(487)

Side by Side Diff: extensions/renderer/logging_native_handler.cc

Issue 842523002: base: Change DCHECK_IS_ON to a macro DCHECK_IS_ON(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dcheck2: withoutandroidchange Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "extensions/renderer/logging_native_handler.h" 5 #include "extensions/renderer/logging_native_handler.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 9
10 namespace extensions { 10 namespace extensions {
(...skipping 29 matching lines...) Expand all
40 void LoggingNativeHandler::Dcheck( 40 void LoggingNativeHandler::Dcheck(
41 const v8::FunctionCallbackInfo<v8::Value>& args) { 41 const v8::FunctionCallbackInfo<v8::Value>& args) {
42 bool check_value; 42 bool check_value;
43 std::string error_message; 43 std::string error_message;
44 ParseArgs(args, &check_value, &error_message); 44 ParseArgs(args, &check_value, &error_message);
45 DCHECK(check_value) << error_message; 45 DCHECK(check_value) << error_message;
46 } 46 }
47 47
48 void LoggingNativeHandler::DcheckIsOn( 48 void LoggingNativeHandler::DcheckIsOn(
49 const v8::FunctionCallbackInfo<v8::Value>& args) { 49 const v8::FunctionCallbackInfo<v8::Value>& args) {
50 args.GetReturnValue().Set(DCHECK_IS_ON); 50 args.GetReturnValue().Set(DCHECK_IS_ON());
51 } 51 }
52 52
53 void LoggingNativeHandler::Log( 53 void LoggingNativeHandler::Log(
54 const v8::FunctionCallbackInfo<v8::Value>& args) { 54 const v8::FunctionCallbackInfo<v8::Value>& args) {
55 CHECK_EQ(1, args.Length()); 55 CHECK_EQ(1, args.Length());
56 LOG(INFO) << *v8::String::Utf8Value(args[0]); 56 LOG(INFO) << *v8::String::Utf8Value(args[0]);
57 } 57 }
58 58
59 void LoggingNativeHandler::Warning( 59 void LoggingNativeHandler::Warning(
60 const v8::FunctionCallbackInfo<v8::Value>& args) { 60 const v8::FunctionCallbackInfo<v8::Value>& args) {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 std::string LoggingNativeHandler::ToStringOrDefault( 93 std::string LoggingNativeHandler::ToStringOrDefault(
94 const v8::Handle<v8::String>& v8_string, 94 const v8::Handle<v8::String>& v8_string,
95 const std::string& dflt) { 95 const std::string& dflt) {
96 if (v8_string.IsEmpty()) 96 if (v8_string.IsEmpty())
97 return dflt; 97 return dflt;
98 std::string ascii_value = *v8::String::Utf8Value(v8_string); 98 std::string ascii_value = *v8::String::Utf8Value(v8_string);
99 return ascii_value.empty() ? dflt : ascii_value; 99 return ascii_value.empty() ? dflt : ascii_value;
100 } 100 }
101 101
102 } // namespace extensions 102 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698