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

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

Issue 2035653006: [DevTools] Move Console to v8 inspector. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: improved api a bit 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 if (info.Length() > 2 && info[2]->IsArray()) { 176 if (info.Length() > 2 && info[2]->IsArray()) {
177 v8::Local<v8::Array> arguments = info[2].As<v8::Array>(); 177 v8::Local<v8::Array> arguments = info[2].As<v8::Array>();
178 argc = arguments->Length(); 178 argc = arguments->Length();
179 argv.reset(new v8::Local<v8::Value>[argc]); 179 argv.reset(new v8::Local<v8::Value>[argc]);
180 for (size_t i = 0; i < argc; ++i) { 180 for (size_t i = 0; i < argc; ++i) {
181 if (!arguments->Get(context, i).ToLocal(&argv[i])) 181 if (!arguments->Get(context, i).ToLocal(&argv[i]))
182 return; 182 return;
183 } 183 }
184 } 184 }
185 185
186 V8DebuggerClient* client = unwrapDebugger(info)->client(); 186 V8DebuggerImpl* debugger = unwrapDebugger(info);
187 client->muteWarningsAndDeprecations(); 187 debugger->client()->muteWarningsAndDeprecations();
188 debugger->muteConsole();
188 189
189 v8::MicrotasksScope microtasks(isolate, v8::MicrotasksScope::kDoNotRunMicrot asks); 190 v8::MicrotasksScope microtasks(isolate, v8::MicrotasksScope::kDoNotRunMicrot asks);
190 v8::Local<v8::Value> result; 191 v8::Local<v8::Value> result;
191 if (function->Call(context, receiver, argc, argv.get()).ToLocal(&result)) 192 if (function->Call(context, receiver, argc, argv.get()).ToLocal(&result))
192 info.GetReturnValue().Set(result); 193 info.GetReturnValue().Set(result);
193 194
194 client->unmuteWarningsAndDeprecations(); 195 debugger->unmuteConsole();
196 debugger->client()->unmuteWarningsAndDeprecations();
195 } 197 }
196 198
197 void V8InjectedScriptHost::bindCallback(const v8::FunctionCallbackInfo<v8::Value >& info) 199 void V8InjectedScriptHost::bindCallback(const v8::FunctionCallbackInfo<v8::Value >& info)
198 { 200 {
199 if (info.Length() < 2 || !info[1]->IsString()) 201 if (info.Length() < 2 || !info[1]->IsString())
200 return; 202 return;
201 InjectedScriptNative* injectedScriptNative = InjectedScriptNative::fromInjec tedScriptHost(info.Holder()); 203 InjectedScriptNative* injectedScriptNative = InjectedScriptNative::fromInjec tedScriptHost(info.Holder());
202 if (!injectedScriptNative) 204 if (!injectedScriptNative)
203 return; 205 return;
204 206
(...skipping 15 matching lines...) Expand all
220 info.GetReturnValue().Set(target); 222 info.GetReturnValue().Set(target);
221 } 223 }
222 224
223 void V8InjectedScriptHost::prototypeCallback(const v8::FunctionCallbackInfo<v8:: Value>& info) 225 void V8InjectedScriptHost::prototypeCallback(const v8::FunctionCallbackInfo<v8:: Value>& info)
224 { 226 {
225 DCHECK(info.Length() > 0 && info[0]->IsObject()); 227 DCHECK(info.Length() > 0 && info[0]->IsObject());
226 info.GetReturnValue().Set(info[0].As<v8::Object>()->GetPrototype()); 228 info.GetReturnValue().Set(info[0].As<v8::Object>()->GetPrototype());
227 } 229 }
228 230
229 } // namespace blink 231 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698