| 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 #ifndef V8InjectedScriptHost_h | 5 #ifndef V8InjectedScriptHost_h |
| 6 #define V8InjectedScriptHost_h | 6 #define V8InjectedScriptHost_h |
| 7 | 7 |
| 8 #include "platform/inspector_protocol/InspectorProtocol.h" | |
| 9 #include <v8.h> | 8 #include <v8.h> |
| 10 | 9 |
| 11 namespace v8_inspector { | 10 namespace v8_inspector { |
| 12 | 11 |
| 13 class V8InspectorImpl; | 12 class V8InspectorImpl; |
| 14 | 13 |
| 15 namespace protocol = blink::protocol; | |
| 16 | |
| 17 // SECURITY NOTE: Although the InjectedScriptHost is intended for use solely by
the inspector, | 14 // SECURITY NOTE: Although the InjectedScriptHost is intended for use solely by
the inspector, |
| 18 // a reference to the InjectedScriptHost may be leaked to the page being inspect
ed. Thus, the | 15 // a reference to the InjectedScriptHost may be leaked to the page being inspect
ed. Thus, the |
| 19 // InjectedScriptHost must never implemment methods that have more power over th
e page than the | 16 // InjectedScriptHost must never implemment methods that have more power over th
e page than the |
| 20 // page already has itself (e.g. origin restriction bypasses). | 17 // page already has itself (e.g. origin restriction bypasses). |
| 21 | 18 |
| 22 class V8InjectedScriptHost { | 19 class V8InjectedScriptHost { |
| 23 public: | 20 public: |
| 24 // We expect that debugger outlives any JS context and thus V8InjectedScript
Host (owned by JS) | 21 // We expect that debugger outlives any JS context and thus V8InjectedScript
Host (owned by JS) |
| 25 // is destroyed before inspector. | 22 // is destroyed before inspector. |
| 26 static v8::Local<v8::Object> create(v8::Local<v8::Context>, V8InspectorImpl*
); | 23 static v8::Local<v8::Object> create(v8::Local<v8::Context>, V8InspectorImpl*
); |
| 27 private: | 24 private: |
| 28 static void internalConstructorNameCallback(const v8::FunctionCallbackInfo<v
8::Value>&); | 25 static void internalConstructorNameCallback(const v8::FunctionCallbackInfo<v
8::Value>&); |
| 29 static void formatAccessorsAsProperties(const v8::FunctionCallbackInfo<v8::V
alue>&); | 26 static void formatAccessorsAsProperties(const v8::FunctionCallbackInfo<v8::V
alue>&); |
| 30 static void subtypeCallback(const v8::FunctionCallbackInfo<v8::Value>&); | 27 static void subtypeCallback(const v8::FunctionCallbackInfo<v8::Value>&); |
| 31 static void getInternalPropertiesCallback(const v8::FunctionCallbackInfo<v8:
:Value>&); | 28 static void getInternalPropertiesCallback(const v8::FunctionCallbackInfo<v8:
:Value>&); |
| 32 static void objectHasOwnPropertyCallback(const v8::FunctionCallbackInfo<v8::
Value>&); | 29 static void objectHasOwnPropertyCallback(const v8::FunctionCallbackInfo<v8::
Value>&); |
| 33 static void bindCallback(const v8::FunctionCallbackInfo<v8::Value>&); | 30 static void bindCallback(const v8::FunctionCallbackInfo<v8::Value>&); |
| 34 static void proxyTargetValueCallback(const v8::FunctionCallbackInfo<v8::Valu
e>&); | 31 static void proxyTargetValueCallback(const v8::FunctionCallbackInfo<v8::Valu
e>&); |
| 35 }; | 32 }; |
| 36 | 33 |
| 37 } // namespace v8_inspector | 34 } // namespace v8_inspector |
| 38 | 35 |
| 39 #endif // V8InjectedScriptHost_h | 36 #endif // V8InjectedScriptHost_h |
| OLD | NEW |