| 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/InspectorWrapper.h" | 5 #include "platform/v8_inspector/InspectorWrapper.h" |
| 6 | 6 |
| 7 #include "platform/v8_inspector/public/V8DebuggerClient.h" | 7 #include "platform/v8_inspector/public/V8DebuggerClient.h" |
| 8 | 8 |
| 9 #include <v8-debug.h> | 9 #include <v8-debug.h> |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 v8::Local<v8::FunctionTemplate> functionTemplate = v8::FunctionTemplate:
:New(isolate, config.callback); | 27 v8::Local<v8::FunctionTemplate> functionTemplate = v8::FunctionTemplate:
:New(isolate, config.callback); |
| 28 functionTemplate->RemovePrototype(); | 28 functionTemplate->RemovePrototype(); |
| 29 instanceTemplate->Set(v8name, functionTemplate, static_cast<v8::Property
Attribute>(v8::DontDelete | v8::DontEnum | v8::ReadOnly)); | 29 instanceTemplate->Set(v8name, functionTemplate, static_cast<v8::Property
Attribute>(v8::DontDelete | v8::DontEnum | v8::ReadOnly)); |
| 30 } | 30 } |
| 31 | 31 |
| 32 return functionTemplate; | 32 return functionTemplate; |
| 33 } | 33 } |
| 34 | 34 |
| 35 v8::Local<v8::Object> InspectorWrapperBase::createWrapper(v8::Local<v8::Function
Template> constructorTemplate, v8::Local<v8::Context> context) | 35 v8::Local<v8::Object> InspectorWrapperBase::createWrapper(v8::Local<v8::Function
Template> constructorTemplate, v8::Local<v8::Context> context) |
| 36 { | 36 { |
| 37 v8::MicrotasksScope microtasks(context->GetIsolate(), v8::MicrotasksScope::k
DoNotRunMicrotasks); |
| 37 v8::Local<v8::Function> function; | 38 v8::Local<v8::Function> function; |
| 38 if (!constructorTemplate->GetFunction(context).ToLocal(&function)) | 39 if (!constructorTemplate->GetFunction(context).ToLocal(&function)) |
| 39 return v8::Local<v8::Object>(); | 40 return v8::Local<v8::Object>(); |
| 40 | 41 |
| 41 v8::Local<v8::Object> result; | 42 v8::Local<v8::Object> result; |
| 42 if (!function->NewInstance(context).ToLocal(&result)) | 43 if (!function->NewInstance(context).ToLocal(&result)) |
| 43 return v8::Local<v8::Object>(); | 44 return v8::Local<v8::Object>(); |
| 44 return result; | 45 return result; |
| 45 } | 46 } |
| 46 | 47 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 58 return nullptr; | 59 return nullptr; |
| 59 return value.As<v8::External>()->Value(); | 60 return value.As<v8::External>()->Value(); |
| 60 } | 61 } |
| 61 | 62 |
| 62 v8::Local<v8::String> InspectorWrapperBase::v8InternalizedString(v8::Isolate* is
olate, const char* name) | 63 v8::Local<v8::String> InspectorWrapperBase::v8InternalizedString(v8::Isolate* is
olate, const char* name) |
| 63 { | 64 { |
| 64 return v8::String::NewFromUtf8(isolate, name, v8::NewStringType::kInternaliz
ed).ToLocalChecked(); | 65 return v8::String::NewFromUtf8(isolate, name, v8::NewStringType::kInternaliz
ed).ToLocalChecked(); |
| 65 } | 66 } |
| 66 | 67 |
| 67 } // namespace blink | 68 } // namespace blink |
| OLD | NEW |