OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 V8InspectorSession_h | 5 #ifndef V8InspectorSession_h |
6 #define V8InspectorSession_h | 6 #define V8InspectorSession_h |
7 | 7 |
8 #include "platform/inspector_protocol/InspectorProtocol.h" | 8 #include "platform/v8_inspector/public/StringBuffer.h" |
| 9 #include "platform/v8_inspector/public/StringView.h" |
9 #include "platform/v8_inspector/public/protocol/Debugger.h" | 10 #include "platform/v8_inspector/public/protocol/Debugger.h" |
10 #include "platform/v8_inspector/public/protocol/Runtime.h" | 11 #include "platform/v8_inspector/public/protocol/Runtime.h" |
11 #include "platform/v8_inspector/public/protocol/Schema.h" | 12 #include "platform/v8_inspector/public/protocol/Schema.h" |
12 | 13 |
13 #include <v8.h> | 14 #include <v8.h> |
14 | 15 |
15 namespace v8_inspector { | 16 namespace v8_inspector { |
16 | 17 |
17 class PLATFORM_EXPORT V8InspectorSession { | 18 class PLATFORM_EXPORT V8InspectorSession { |
18 public: | 19 public: |
19 virtual ~V8InspectorSession() { } | 20 virtual ~V8InspectorSession() { } |
20 | 21 |
21 // Cross-context inspectable values (DOM nodes in different worlds, etc.). | 22 // Cross-context inspectable values (DOM nodes in different worlds, etc.). |
22 class Inspectable { | 23 class Inspectable { |
23 public: | 24 public: |
24 virtual v8::Local<v8::Value> get(v8::Local<v8::Context>) = 0; | 25 virtual v8::Local<v8::Value> get(v8::Local<v8::Context>) = 0; |
25 virtual ~Inspectable() { } | 26 virtual ~Inspectable() { } |
26 }; | 27 }; |
27 virtual void addInspectedObject(std::unique_ptr<Inspectable>) = 0; | 28 virtual void addInspectedObject(std::unique_ptr<Inspectable>) = 0; |
28 | 29 |
29 // Dispatching protocol messages. | 30 // Dispatching protocol messages. |
30 static bool canDispatchMethod(const String16& method); | 31 static bool canDispatchMethod(const StringView& method); |
31 virtual void dispatchProtocolMessage(const String16& message) = 0; | 32 virtual void dispatchProtocolMessage(const StringView& message) = 0; |
32 virtual String16 stateJSON() = 0; | 33 virtual std::unique_ptr<StringBuffer> stateJSON() = 0; |
33 virtual std::unique_ptr<blink::protocol::Array<blink::protocol::Schema::API:
:Domain>> supportedDomains() = 0; | 34 virtual std::unique_ptr<blink::protocol::Array<blink::protocol::Schema::API:
:Domain>> supportedDomains() = 0; |
34 | 35 |
35 // Debugger actions. | 36 // Debugger actions. |
36 virtual void schedulePauseOnNextStatement(const String16& breakReason, const
String16& breakDetails) = 0; | 37 virtual void schedulePauseOnNextStatement(const StringView& breakReason, con
st StringView& breakDetails) = 0; |
37 virtual void cancelPauseOnNextStatement() = 0; | 38 virtual void cancelPauseOnNextStatement() = 0; |
38 virtual void breakProgram(const String16& breakReason, const String16& break
Details) = 0; | 39 virtual void breakProgram(const StringView& breakReason, const StringView& b
reakDetails) = 0; |
39 virtual void setSkipAllPauses(bool) = 0; | 40 virtual void setSkipAllPauses(bool) = 0; |
40 virtual void resume() = 0; | 41 virtual void resume() = 0; |
41 virtual void stepOver() = 0; | 42 virtual void stepOver() = 0; |
42 virtual std::unique_ptr<blink::protocol::Array<blink::protocol::Debugger::AP
I::SearchMatch>> searchInTextByLines(const String16& text, const String16& query
, bool caseSensitive, bool isRegex) = 0; | 43 virtual std::unique_ptr<blink::protocol::Array<blink::protocol::Debugger::AP
I::SearchMatch>> searchInTextByLines(const StringView& text, const StringView& q
uery, bool caseSensitive, bool isRegex) = 0; |
43 | 44 |
44 // Remote objects. | 45 // Remote objects. |
45 virtual std::unique_ptr<blink::protocol::Runtime::API::RemoteObject> wrapObj
ect(v8::Local<v8::Context>, v8::Local<v8::Value>, const String16& groupName) = 0
; | 46 virtual std::unique_ptr<blink::protocol::Runtime::API::RemoteObject> wrapObj
ect(v8::Local<v8::Context>, v8::Local<v8::Value>, const StringView& groupName) =
0; |
46 virtual bool unwrapObject(ErrorString*, const String16& objectId, v8::Local<
v8::Value>*, v8::Local<v8::Context>*, String16* objectGroup) = 0; | 47 virtual bool unwrapObject(ErrorString*, const StringView& objectId, v8::Loca
l<v8::Value>*, v8::Local<v8::Context>*, std::unique_ptr<StringBuffer>* objectGro
up) = 0; |
47 virtual void releaseObjectGroup(const String16&) = 0; | 48 virtual void releaseObjectGroup(const StringView&) = 0; |
48 }; | 49 }; |
49 | 50 |
50 } // namespace v8_inspector | 51 } // namespace v8_inspector |
51 | 52 |
52 #endif // V8InspectorSession_h | 53 #endif // V8InspectorSession_h |
OLD | NEW |