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

Side by Side Diff: third_party/WebKit/Source/platform/v8_inspector/V8InjectedScriptHost.cpp

Issue 2151273003: [DevTools] Move browser logging from Console domain to Log domain. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@internals-method
Patch Set: protocol improvements Created 4 years, 5 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "platform/v8_inspector/V8InjectedScriptHost.h" 5 #include "platform/v8_inspector/V8InjectedScriptHost.h"
6 6
7 #include "platform/inspector_protocol/String16.h" 7 #include "platform/inspector_protocol/String16.h"
8 #include "platform/v8_inspector/InjectedScriptNative.h" 8 #include "platform/v8_inspector/InjectedScriptNative.h"
9 #include "platform/v8_inspector/V8Compat.h" 9 #include "platform/v8_inspector/V8Compat.h"
10 #include "platform/v8_inspector/V8DebuggerImpl.h" 10 #include "platform/v8_inspector/V8DebuggerImpl.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 v8::Local<v8::Array> arguments = info[2].As<v8::Array>(); 173 v8::Local<v8::Array> arguments = info[2].As<v8::Array>();
174 argc = arguments->Length(); 174 argc = arguments->Length();
175 argv.reset(new v8::Local<v8::Value>[argc]); 175 argv.reset(new v8::Local<v8::Value>[argc]);
176 for (size_t i = 0; i < argc; ++i) { 176 for (size_t i = 0; i < argc; ++i) {
177 if (!arguments->Get(context, i).ToLocal(&argv[i])) 177 if (!arguments->Get(context, i).ToLocal(&argv[i]))
178 return; 178 return;
179 } 179 }
180 } 180 }
181 181
182 V8DebuggerImpl* debugger = unwrapDebugger(info); 182 V8DebuggerImpl* debugger = unwrapDebugger(info);
183 debugger->client()->muteWarningsAndDeprecations(); 183 int contextGroupId = V8DebuggerImpl::getGroupId(context);
184 if (contextGroupId)
185 debugger->client()->muteWarningsAndDeprecations(contextGroupId);
184 186
185 v8::MicrotasksScope microtasks(isolate, v8::MicrotasksScope::kDoNotRunMicrot asks); 187 v8::MicrotasksScope microtasks(isolate, v8::MicrotasksScope::kDoNotRunMicrot asks);
186 v8::Local<v8::Value> result; 188 v8::Local<v8::Value> result;
187 if (function->Call(context, receiver, argc, argv.get()).ToLocal(&result)) 189 if (function->Call(context, receiver, argc, argv.get()).ToLocal(&result))
188 info.GetReturnValue().Set(result); 190 info.GetReturnValue().Set(result);
189 191
190 debugger->client()->unmuteWarningsAndDeprecations(); 192 if (contextGroupId)
193 debugger->client()->unmuteWarningsAndDeprecations(contextGroupId);
191 } 194 }
192 195
193 void V8InjectedScriptHost::bindCallback(const v8::FunctionCallbackInfo<v8::Value >& info) 196 void V8InjectedScriptHost::bindCallback(const v8::FunctionCallbackInfo<v8::Value >& info)
194 { 197 {
195 if (info.Length() < 2 || !info[1]->IsString()) 198 if (info.Length() < 2 || !info[1]->IsString())
196 return; 199 return;
197 InjectedScriptNative* injectedScriptNative = InjectedScriptNative::fromInjec tedScriptHost(info.Holder()); 200 InjectedScriptNative* injectedScriptNative = InjectedScriptNative::fromInjec tedScriptHost(info.Holder());
198 if (!injectedScriptNative) 201 if (!injectedScriptNative)
199 return; 202 return;
200 203
(...skipping 15 matching lines...) Expand all
216 info.GetReturnValue().Set(target); 219 info.GetReturnValue().Set(target);
217 } 220 }
218 221
219 void V8InjectedScriptHost::prototypeCallback(const v8::FunctionCallbackInfo<v8:: Value>& info) 222 void V8InjectedScriptHost::prototypeCallback(const v8::FunctionCallbackInfo<v8:: Value>& info)
220 { 223 {
221 DCHECK(info.Length() > 0 && info[0]->IsObject()); 224 DCHECK(info.Length() > 0 && info[0]->IsObject());
222 info.GetReturnValue().Set(info[0].As<v8::Object>()->GetPrototype()); 225 info.GetReturnValue().Set(info[0].As<v8::Object>()->GetPrototype());
223 } 226 }
224 227
225 } // namespace blink 228 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698