OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 14 matching lines...) Expand all Loading... |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "core/inspector/PageRuntimeAgent.h" | 32 #include "core/inspector/PageRuntimeAgent.h" |
33 | 33 |
34 #include "bindings/core/dart/DartController.h" | 34 #include "bindings/core/dart/DartController.h" |
| 35 #include "bindings/core/dart/DartInspectorRuntimeAgent.h" |
35 #include "bindings/core/v8/DOMWrapperWorld.h" | 36 #include "bindings/core/v8/DOMWrapperWorld.h" |
36 #include "bindings/core/v8/ScriptController.h" | 37 #include "bindings/core/v8/ScriptController.h" |
37 #include "bindings/core/v8/ScriptState.h" | 38 #include "bindings/core/v8/ScriptState.h" |
38 #include "core/frame/FrameConsole.h" | 39 #include "core/frame/FrameConsole.h" |
39 #include "core/frame/LocalFrame.h" | 40 #include "core/frame/LocalFrame.h" |
40 #include "core/inspector/IdentifiersFactory.h" | 41 #include "core/inspector/IdentifiersFactory.h" |
41 #include "core/inspector/InjectedScript.h" | 42 #include "core/inspector/InjectedScript.h" |
42 #include "core/inspector/InjectedScriptManager.h" | 43 #include "core/inspector/InjectedScriptManager.h" |
43 #include "core/inspector/InspectorPageAgent.h" | 44 #include "core/inspector/InspectorPageAgent.h" |
44 #include "core/inspector/InstrumentingAgents.h" | 45 #include "core/inspector/InstrumentingAgents.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 } | 184 } |
184 isolatedContexts.clear(); | 185 isolatedContexts.clear(); |
185 } | 186 } |
186 } | 187 } |
187 | 188 |
188 // WARNING: this had to be rewritten due to the ScriptState refactor. | 189 // WARNING: this had to be rewritten due to the ScriptState refactor. |
189 // Dart specific method. | 190 // Dart specific method. |
190 void PageRuntimeAgent::notifyDartContextCreated(const String& frameId, ScriptSta
te* v8ScriptState) | 191 void PageRuntimeAgent::notifyDartContextCreated(const String& frameId, ScriptSta
te* v8ScriptState) |
191 { | 192 { |
192 ExecutionContext* executionContext = v8ScriptState->executionContext(); | 193 ExecutionContext* executionContext = v8ScriptState->executionContext(); |
193 int executionContextId = injectedScriptManager()->injectedScriptIdFor(v8Scri
ptState); | |
194 DartController* dartController = DartController::retrieve(executionContext); | 194 DartController* dartController = DartController::retrieve(executionContext); |
195 if (dartController) { | 195 if (dartController) { |
196 Vector<DartScriptState*> scriptStates; | 196 Vector<DartScriptState*> scriptStates; |
197 dartController->collectScriptStates(v8ScriptState, scriptStates); | 197 dartController->collectScriptStates(v8ScriptState, scriptStates); |
198 // TODO(jacobr): now that there is a human readable name field we could
possibly leave orign blank. | 198 // TODO(jacobr): now that there is a human readable name field we could
possibly leave orign blank. |
199 for (size_t i = 0; i< scriptStates.size(); i++) { | 199 for (size_t i = 0; i< scriptStates.size(); i++) { |
200 DartScriptState* state = scriptStates[i]; | 200 DartScriptState* state = scriptStates[i]; |
201 addExecutionContextToFrontendDart(executionContextId, "", *(state->n
ame()), *(state->name()), frameId, "Dart", state->libraryId()); | 201 m_dart->addExecutionContextToFrontendHelper(state, true, *(state->na
me()), frameId); |
202 } | 202 } |
203 } | 203 } |
204 } | 204 } |
205 // End Dart specific method. | 205 // End Dart specific method. |
206 | 206 |
207 void PageRuntimeAgent::reportExecutionContext(ScriptState* scriptState, bool isP
ageContext, const String& origin, const String& frameId) | 207 void PageRuntimeAgent::reportExecutionContext(ScriptState* scriptState, bool isP
ageContext, const String& origin, const String& frameId) |
208 { | 208 { |
209 int executionContextId = injectedScriptManager()->injectedScriptIdFor(script
State); | 209 int executionContextId = injectedScriptManager()->injectedScriptIdFor(script
State); |
210 m_scriptStateToId.set(scriptState, executionContextId); | 210 m_scriptStateToId.set(scriptState, executionContextId); |
211 DOMWrapperWorld& world = scriptState->world(); | 211 DOMWrapperWorld& world = scriptState->world(); |
212 String humanReadableName = world.isIsolatedWorld() ? world.isolatedWorldHuma
nReadableName() : ""; | 212 String humanReadableName = world.isIsolatedWorld() ? world.isolatedWorldHuma
nReadableName() : ""; |
213 String type = isPageContext ? "" : "Extension"; | 213 String type = isPageContext ? "" : "Extension"; |
214 InspectorRuntimeAgent::addExecutionContextToFrontend(executionContextId, typ
e, origin, humanReadableName, frameId); | 214 InspectorRuntimeAgent::addExecutionContextToFrontend(executionContextId, typ
e, origin, humanReadableName, frameId); |
215 } | 215 } |
216 | 216 |
217 } // namespace blink | 217 } // namespace blink |
218 | 218 |
OLD | NEW |