| OLD | NEW |
| 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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 debugger->client()->muteWarningsAndDeprecations(); |
| 184 debugger->muteConsole(); | |
| 185 | 184 |
| 186 v8::MicrotasksScope microtasks(isolate, v8::MicrotasksScope::kDoNotRunMicrot
asks); | 185 v8::MicrotasksScope microtasks(isolate, v8::MicrotasksScope::kDoNotRunMicrot
asks); |
| 187 v8::Local<v8::Value> result; | 186 v8::Local<v8::Value> result; |
| 188 if (function->Call(context, receiver, argc, argv.get()).ToLocal(&result)) | 187 if (function->Call(context, receiver, argc, argv.get()).ToLocal(&result)) |
| 189 info.GetReturnValue().Set(result); | 188 info.GetReturnValue().Set(result); |
| 190 | 189 |
| 191 debugger->unmuteConsole(); | |
| 192 debugger->client()->unmuteWarningsAndDeprecations(); | 190 debugger->client()->unmuteWarningsAndDeprecations(); |
| 193 } | 191 } |
| 194 | 192 |
| 195 void V8InjectedScriptHost::bindCallback(const v8::FunctionCallbackInfo<v8::Value
>& info) | 193 void V8InjectedScriptHost::bindCallback(const v8::FunctionCallbackInfo<v8::Value
>& info) |
| 196 { | 194 { |
| 197 if (info.Length() < 2 || !info[1]->IsString()) | 195 if (info.Length() < 2 || !info[1]->IsString()) |
| 198 return; | 196 return; |
| 199 InjectedScriptNative* injectedScriptNative = InjectedScriptNative::fromInjec
tedScriptHost(info.Holder()); | 197 InjectedScriptNative* injectedScriptNative = InjectedScriptNative::fromInjec
tedScriptHost(info.Holder()); |
| 200 if (!injectedScriptNative) | 198 if (!injectedScriptNative) |
| 201 return; | 199 return; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 218 info.GetReturnValue().Set(target); | 216 info.GetReturnValue().Set(target); |
| 219 } | 217 } |
| 220 | 218 |
| 221 void V8InjectedScriptHost::prototypeCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) | 219 void V8InjectedScriptHost::prototypeCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) |
| 222 { | 220 { |
| 223 DCHECK(info.Length() > 0 && info[0]->IsObject()); | 221 DCHECK(info.Length() > 0 && info[0]->IsObject()); |
| 224 info.GetReturnValue().Set(info[0].As<v8::Object>()->GetPrototype()); | 222 info.GetReturnValue().Set(info[0].As<v8::Object>()->GetPrototype()); |
| 225 } | 223 } |
| 226 | 224 |
| 227 } // namespace blink | 225 } // namespace blink |
| OLD | NEW |