| 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 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 v8::Local<v8::FunctionTemplate> InspectorWrapperBase::createWrapperTemplate(v8::
Isolate* isolate, const char* className, const Vector<V8MethodConfiguration>& me
thods, const Vector<V8AttributeConfiguration>& attributes) | 13 v8::Local<v8::FunctionTemplate> InspectorWrapperBase::createWrapperTemplate(v8::
Isolate* isolate, const char* className, const protocol::Vector<V8MethodConfigur
ation>& methods, const protocol::Vector<V8AttributeConfiguration>& attributes) |
| 14 { | 14 { |
| 15 v8::Local<v8::FunctionTemplate> functionTemplate = v8::FunctionTemplate::New
(isolate); | 15 v8::Local<v8::FunctionTemplate> functionTemplate = v8::FunctionTemplate::New
(isolate); |
| 16 | 16 |
| 17 functionTemplate->SetClassName(v8::String::NewFromUtf8(isolate, className, v
8::NewStringType::kInternalized).ToLocalChecked()); | 17 functionTemplate->SetClassName(v8::String::NewFromUtf8(isolate, className, v
8::NewStringType::kInternalized).ToLocalChecked()); |
| 18 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); | 18 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); |
| 19 | 19 |
| 20 for (auto& config : attributes) { | 20 for (auto& config : attributes) { |
| 21 v8::Local<v8::Name> v8name = v8::String::NewFromUtf8(isolate, config.nam
e, v8::NewStringType::kInternalized).ToLocalChecked(); | 21 v8::Local<v8::Name> v8name = v8::String::NewFromUtf8(isolate, config.nam
e, v8::NewStringType::kInternalized).ToLocalChecked(); |
| 22 instanceTemplate->SetAccessor(v8name, config.callback); | 22 instanceTemplate->SetAccessor(v8name, config.callback); |
| 23 } | 23 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 return nullptr; | 58 return nullptr; |
| 59 return value.As<v8::External>()->Value(); | 59 return value.As<v8::External>()->Value(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 v8::Local<v8::String> InspectorWrapperBase::v8InternalizedString(v8::Isolate* is
olate, const char* name) | 62 v8::Local<v8::String> InspectorWrapperBase::v8InternalizedString(v8::Isolate* is
olate, const char* name) |
| 63 { | 63 { |
| 64 return v8::String::NewFromUtf8(isolate, name, v8::NewStringType::kInternaliz
ed).ToLocalChecked(); | 64 return v8::String::NewFromUtf8(isolate, name, v8::NewStringType::kInternaliz
ed).ToLocalChecked(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 } // namespace blink | 67 } // namespace blink |
| OLD | NEW |