| 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 V8RuntimeAgent_h | 5 #ifndef V8RuntimeAgent_h |
| 6 #define V8RuntimeAgent_h | 6 #define V8RuntimeAgent_h |
| 7 | 7 |
| 8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
| 9 #include "platform/inspector_protocol/Dispatcher.h" | 9 #include "platform/inspector_protocol/Dispatcher.h" |
| 10 #include "platform/v8_inspector/public/V8ContextInfo.h" | 10 #include "platform/v8_inspector/public/V8ContextInfo.h" |
| 11 #include "platform/v8_inspector/public/V8Debugger.h" | 11 #include "platform/v8_inspector/public/V8Debugger.h" |
| 12 #include "wtf/Functional.h" | |
| 13 | 12 |
| 14 #include <v8.h> | 13 #include <v8.h> |
| 15 | 14 |
| 16 namespace blink { | 15 namespace blink { |
| 17 | 16 |
| 18 class InjectedScriptManager; | 17 class InjectedScriptManager; |
| 19 | 18 |
| 20 class PLATFORM_EXPORT V8RuntimeAgent : public protocol::Backend::Runtime, public
V8Debugger::Agent<protocol::Frontend::Runtime> { | 19 class PLATFORM_EXPORT V8RuntimeAgent : public protocol::Backend::Runtime, public
V8Debugger::Agent<protocol::Frontend::Runtime> { |
| 21 public: | 20 public: |
| 22 // Cross-context inspectable values (DOM nodes in different worlds, etc.). | 21 // Cross-context inspectable values (DOM nodes in different worlds, etc.). |
| 23 class Inspectable { | 22 class Inspectable { |
| 24 public: | 23 public: |
| 25 virtual v8::Local<v8::Value> get(v8::Local<v8::Context>) = 0; | 24 virtual v8::Local<v8::Value> get(v8::Local<v8::Context>) = 0; |
| 26 virtual ~Inspectable() { } | 25 virtual ~Inspectable() { } |
| 27 }; | 26 }; |
| 28 | 27 |
| 29 virtual ~V8RuntimeAgent() { } | 28 virtual ~V8RuntimeAgent() { } |
| 30 | 29 |
| 31 // Embedder API. | 30 // Embedder API. |
| 32 using ClearConsoleCallback = Function<void()>; | |
| 33 virtual void setClearConsoleCallback(PassOwnPtr<ClearConsoleCallback>) = 0; | |
| 34 virtual PassOwnPtr<protocol::Runtime::RemoteObject> wrapObject(v8::Local<v8:
:Context>, v8::Local<v8::Value>, const String16& groupName, bool generatePreview
= false) = 0; | 31 virtual PassOwnPtr<protocol::Runtime::RemoteObject> wrapObject(v8::Local<v8:
:Context>, v8::Local<v8::Value>, const String16& groupName, bool generatePreview
= false) = 0; |
| 35 // FIXME: remove when console.table moves into V8 inspector. | 32 // FIXME: remove when InspectorConsoleAgent moves into V8 inspector. |
| 36 virtual PassOwnPtr<protocol::Runtime::RemoteObject> wrapTable(v8::Local<v8::
Context>, v8::Local<v8::Value> table, v8::Local<v8::Value> columns) = 0; | 33 virtual PassOwnPtr<protocol::Runtime::RemoteObject> wrapTable(v8::Local<v8::
Context>, v8::Local<v8::Value> table, v8::Local<v8::Value> columns) = 0; |
| 37 virtual v8::Local<v8::Value> findObject(ErrorString*, const String16& object
Id, v8::Local<v8::Context>* = nullptr, String16* objectGroup = nullptr) = 0; | 34 virtual v8::Local<v8::Value> findObject(ErrorString*, const String16& object
Id, v8::Local<v8::Context>* = nullptr, String16* objectGroup = nullptr) = 0; |
| 38 virtual void disposeObjectGroup(const String16&) = 0; | 35 virtual void disposeObjectGroup(const String16&) = 0; |
| 39 virtual void addInspectedObject(PassOwnPtr<Inspectable>) = 0; | 36 virtual void addInspectedObject(PassOwnPtr<Inspectable>) = 0; |
| 40 }; | 37 }; |
| 41 | 38 |
| 42 } // namespace blink | 39 } // namespace blink |
| 43 | 40 |
| 44 #endif // V8RuntimeAgent_h | 41 #endif // V8RuntimeAgent_h |
| OLD | NEW |