OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 23 matching lines...) Expand all Loading... |
34 #include "platform/inspector_protocol/TypeBuilder.h" | 34 #include "platform/inspector_protocol/TypeBuilder.h" |
35 #include "platform/v8_inspector/InjectedScriptManager.h" | 35 #include "platform/v8_inspector/InjectedScriptManager.h" |
36 #include "platform/v8_inspector/InjectedScriptNative.h" | 36 #include "platform/v8_inspector/InjectedScriptNative.h" |
37 #include <v8.h> | 37 #include <v8.h> |
38 | 38 |
39 namespace blink { | 39 namespace blink { |
40 | 40 |
41 class InjectedScriptManager; | 41 class InjectedScriptManager; |
42 class RemoteObjectId; | 42 class RemoteObjectId; |
43 class V8FunctionCall; | 43 class V8FunctionCall; |
44 class V8DebuggerClient; | |
45 | 44 |
46 namespace protocol { | 45 namespace protocol { |
47 class DictionaryValue; | 46 class DictionaryValue; |
48 } | 47 } |
49 | 48 |
50 | 49 |
51 using protocol::Maybe; | 50 using protocol::Maybe; |
52 | 51 |
53 class InjectedScript final { | 52 class InjectedScript final { |
54 public: | 53 public: |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 void setOrigin(const String16& origin) { m_origin = origin; } | 106 void setOrigin(const String16& origin) { m_origin = origin; } |
108 | 107 |
109 v8::Isolate* isolate() { return m_isolate; } | 108 v8::Isolate* isolate() { return m_isolate; } |
110 v8::Local<v8::Context> context() const; | 109 v8::Local<v8::Context> context() const; |
111 void dispose(); | 110 void dispose(); |
112 | 111 |
113 v8::MaybeLocal<v8::Value> resolveCallArgument(ErrorString*, protocol::Runtim
e::CallArgument*); | 112 v8::MaybeLocal<v8::Value> resolveCallArgument(ErrorString*, protocol::Runtim
e::CallArgument*); |
114 | 113 |
115 private: | 114 private: |
116 friend InjectedScript* InjectedScriptManager::injectedScriptFor(v8::Local<v8
::Context>); | 115 friend InjectedScript* InjectedScriptManager::injectedScriptFor(v8::Local<v8
::Context>); |
117 InjectedScript(InjectedScriptManager*, v8::Local<v8::Context>, v8::Local<v8:
:Object>, V8DebuggerClient*, PassOwnPtr<InjectedScriptNative>, int contextId); | 116 InjectedScript(InjectedScriptManager*, v8::Local<v8::Context>, v8::Local<v8:
:Object>, PassOwnPtr<InjectedScriptNative>, int contextId); |
118 | 117 |
119 bool canAccessInspectedWindow() const; | 118 bool canAccessInspectedWindow() const; |
120 v8::Local<v8::Value> v8Value() const; | 119 v8::Local<v8::Value> v8Value() const; |
121 v8::Local<v8::Value> callFunctionWithEvalEnabled(V8FunctionCall&, bool& hadE
xception) const; | 120 v8::Local<v8::Value> callFunctionWithEvalEnabled(V8FunctionCall&, bool& hadE
xception) const; |
122 PassOwnPtr<protocol::Value> makeCall(V8FunctionCall&); | 121 PassOwnPtr<protocol::Value> makeCall(V8FunctionCall&); |
123 PassOwnPtr<protocol::Runtime::RemoteObject> makeEvalCall(ErrorString*, V8Fun
ctionCall&, Maybe<bool>* wasThrown, Maybe<protocol::Runtime::ExceptionDetails>*
= 0); | 122 PassOwnPtr<protocol::Runtime::RemoteObject> makeEvalCall(ErrorString*, V8Fun
ctionCall&, Maybe<bool>* wasThrown, Maybe<protocol::Runtime::ExceptionDetails>*
= 0); |
124 PassOwnPtr<protocol::Value> makeCallWithExceptionDetails(V8FunctionCall&, Ma
ybe<protocol::Runtime::ExceptionDetails>*); | 123 PassOwnPtr<protocol::Value> makeCallWithExceptionDetails(V8FunctionCall&, Ma
ybe<protocol::Runtime::ExceptionDetails>*); |
125 v8::MaybeLocal<v8::Value> wrapValue(ErrorString*, v8::Local<v8::Value>, cons
t String16& groupName, bool generatePreview) const; | 124 v8::MaybeLocal<v8::Value> wrapValue(ErrorString*, v8::Local<v8::Value>, cons
t String16& groupName, bool generatePreview) const; |
126 | 125 |
127 InjectedScriptManager* m_manager; | 126 InjectedScriptManager* m_manager; |
128 v8::Isolate* m_isolate; | 127 v8::Isolate* m_isolate; |
129 v8::Global<v8::Context> m_context; | 128 v8::Global<v8::Context> m_context; |
130 v8::Global<v8::Value> m_value; | 129 v8::Global<v8::Value> m_value; |
131 V8DebuggerClient* m_client; | |
132 OwnPtr<InjectedScriptNative> m_native; | 130 OwnPtr<InjectedScriptNative> m_native; |
133 int m_contextId; | 131 int m_contextId; |
134 String16 m_origin; | 132 String16 m_origin; |
135 }; | 133 }; |
136 | 134 |
137 } // namespace blink | 135 } // namespace blink |
138 | 136 |
139 #endif | 137 #endif |
OLD | NEW |