| 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; |
| 44 | 45 |
| 45 namespace protocol { | 46 namespace protocol { |
| 46 class DictionaryValue; | 47 class DictionaryValue; |
| 47 } | 48 } |
| 48 | 49 |
| 49 | 50 |
| 50 using protocol::Maybe; | 51 using protocol::Maybe; |
| 51 | 52 |
| 52 class InjectedScript final { | 53 class InjectedScript final { |
| 53 public: | 54 public: |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 int contextId() { return m_contextId; } | 107 int contextId() { return m_contextId; } |
| 107 String16 origin() const { return m_origin; } | 108 String16 origin() const { return m_origin; } |
| 108 void setOrigin(const String16& origin) { m_origin = origin; } | 109 void setOrigin(const String16& origin) { m_origin = origin; } |
| 109 | 110 |
| 110 v8::Isolate* isolate() { return m_isolate; } | 111 v8::Isolate* isolate() { return m_isolate; } |
| 111 v8::Local<v8::Context> context() const; | 112 v8::Local<v8::Context> context() const; |
| 112 void dispose(); | 113 void dispose(); |
| 113 | 114 |
| 114 private: | 115 private: |
| 115 friend InjectedScript* InjectedScriptManager::injectedScriptFor(v8::Local<v8
::Context>); | 116 friend InjectedScript* InjectedScriptManager::injectedScriptFor(v8::Local<v8
::Context>); |
| 116 InjectedScript(InjectedScriptManager*, v8::Local<v8::Context>, v8::Local<v8:
:Object>, PassOwnPtr<InjectedScriptNative>, int contextId); | 117 InjectedScript(InjectedScriptManager*, v8::Local<v8::Context>, v8::Local<v8:
:Object>, V8DebuggerClient*, PassOwnPtr<InjectedScriptNative>, int contextId); |
| 117 | 118 |
| 118 bool canAccessInspectedWindow() const; | 119 bool canAccessInspectedWindow() const; |
| 119 v8::Local<v8::Value> v8Value() const; | 120 v8::Local<v8::Value> v8Value() const; |
| 120 v8::Local<v8::Value> callFunctionWithEvalEnabled(V8FunctionCall&, bool& hadE
xception) const; | 121 v8::Local<v8::Value> callFunctionWithEvalEnabled(V8FunctionCall&, bool& hadE
xception) const; |
| 121 PassOwnPtr<protocol::Value> makeCall(V8FunctionCall&); | 122 PassOwnPtr<protocol::Value> makeCall(V8FunctionCall&); |
| 122 PassOwnPtr<protocol::Runtime::RemoteObject> makeEvalCall(ErrorString*, V8Fun
ctionCall&, Maybe<bool>* wasThrown, Maybe<protocol::Runtime::ExceptionDetails>*
= 0); | 123 PassOwnPtr<protocol::Runtime::RemoteObject> makeEvalCall(ErrorString*, V8Fun
ctionCall&, Maybe<bool>* wasThrown, Maybe<protocol::Runtime::ExceptionDetails>*
= 0); |
| 123 PassOwnPtr<protocol::Value> makeCallWithExceptionDetails(V8FunctionCall&, Ma
ybe<protocol::Runtime::ExceptionDetails>*); | 124 PassOwnPtr<protocol::Value> makeCallWithExceptionDetails(V8FunctionCall&, Ma
ybe<protocol::Runtime::ExceptionDetails>*); |
| 124 v8::MaybeLocal<v8::Value> wrapValue(ErrorString*, v8::Local<v8::Value>, cons
t String16& groupName, bool generatePreview) const; | 125 v8::MaybeLocal<v8::Value> wrapValue(ErrorString*, v8::Local<v8::Value>, cons
t String16& groupName, bool generatePreview) const; |
| 125 | 126 |
| 126 InjectedScriptManager* m_manager; | 127 InjectedScriptManager* m_manager; |
| 127 v8::Isolate* m_isolate; | 128 v8::Isolate* m_isolate; |
| 128 v8::Global<v8::Context> m_context; | 129 v8::Global<v8::Context> m_context; |
| 129 v8::Global<v8::Value> m_value; | 130 v8::Global<v8::Value> m_value; |
| 131 V8DebuggerClient* m_client; |
| 130 OwnPtr<InjectedScriptNative> m_native; | 132 OwnPtr<InjectedScriptNative> m_native; |
| 131 int m_contextId; | 133 int m_contextId; |
| 132 String16 m_origin; | 134 String16 m_origin; |
| 133 }; | 135 }; |
| 134 | 136 |
| 135 } // namespace blink | 137 } // namespace blink |
| 136 | 138 |
| 137 #endif | 139 #endif |
| OLD | NEW |