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 19 matching lines...) Expand all Loading... |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "bindings/core/v8/PageScriptDebugServer.h" | 32 #include "bindings/core/v8/PageScriptDebugServer.h" |
33 | 33 |
34 #include "bindings/core/v8/DOMWrapperWorld.h" | 34 #include "bindings/core/v8/DOMWrapperWorld.h" |
35 #include "bindings/core/v8/ScriptController.h" | 35 #include "bindings/core/v8/ScriptController.h" |
36 #include "bindings/core/v8/ScriptSourceCode.h" | 36 #include "bindings/core/v8/ScriptSourceCode.h" |
37 #include "bindings/core/v8/V8Binding.h" | 37 #include "bindings/core/v8/V8Binding.h" |
38 #include "bindings/core/v8/V8ScriptRunner.h" | 38 #include "bindings/core/v8/V8ScriptRunner.h" |
39 #include "bindings/core/v8/V8Window.h" | 39 #include "bindings/core/v8/V8Window.h" |
40 #include "bindings/core/v8/V8WindowShell.h" | 40 #include "bindings/core/v8/WindowProxy.h" |
41 #include "core/frame/FrameConsole.h" | 41 #include "core/frame/FrameConsole.h" |
42 #include "core/frame/FrameHost.h" | 42 #include "core/frame/FrameHost.h" |
43 #include "core/frame/LocalFrame.h" | 43 #include "core/frame/LocalFrame.h" |
44 #include "core/frame/UseCounter.h" | 44 #include "core/frame/UseCounter.h" |
45 #include "core/inspector/InspectorInstrumentation.h" | 45 #include "core/inspector/InspectorInstrumentation.h" |
46 #include "core/inspector/InspectorTraceEvents.h" | 46 #include "core/inspector/InspectorTraceEvents.h" |
47 #include "core/inspector/ScriptDebugListener.h" | 47 #include "core/inspector/ScriptDebugListener.h" |
48 #include "core/page/Page.h" | 48 #include "core/page/Page.h" |
49 #include "wtf/OwnPtr.h" | 49 #include "wtf/OwnPtr.h" |
50 #include "wtf/PassOwnPtr.h" | 50 #include "wtf/PassOwnPtr.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 ensureDebuggerScriptCompiled(); | 119 ensureDebuggerScriptCompiled(); |
120 } | 120 } |
121 | 121 |
122 v8::Local<v8::Context> debuggerContext = v8::Debug::GetDebugContext(); | 122 v8::Local<v8::Context> debuggerContext = v8::Debug::GetDebugContext(); |
123 v8::Context::Scope contextScope(debuggerContext); | 123 v8::Context::Scope contextScope(debuggerContext); |
124 | 124 |
125 v8::Local<v8::Object> debuggerScript = m_debuggerScript.newLocal(m_isolate); | 125 v8::Local<v8::Object> debuggerScript = m_debuggerScript.newLocal(m_isolate); |
126 ASSERT(!debuggerScript->IsUndefined()); | 126 ASSERT(!debuggerScript->IsUndefined()); |
127 m_listenersMap.set(page, listener); | 127 m_listenersMap.set(page, listener); |
128 | 128 |
129 V8WindowShell* shell = scriptController.existingWindowShell(DOMWrapperWorld:
:mainWorld()); | 129 WindowProxy* windowProxy = scriptController.existingWindowProxy(DOMWrapperWo
rld::mainWorld()); |
130 if (!shell || !shell->isContextInitialized()) | 130 if (!windowProxy || !windowProxy->isContextInitialized()) |
131 return; | 131 return; |
132 v8::Local<v8::Context> context = shell->context(); | 132 v8::Local<v8::Context> context = windowProxy->context(); |
133 v8::Handle<v8::Function> getScriptsFunction = v8::Local<v8::Function>::Cast(
debuggerScript->Get(v8AtomicString(m_isolate, "getScripts"))); | 133 v8::Handle<v8::Function> getScriptsFunction = v8::Local<v8::Function>::Cast(
debuggerScript->Get(v8AtomicString(m_isolate, "getScripts"))); |
134 v8::Handle<v8::Value> argv[] = { context->GetEmbedderData(0) }; | 134 v8::Handle<v8::Value> argv[] = { context->GetEmbedderData(0) }; |
135 v8::Handle<v8::Value> value = V8ScriptRunner::callInternalFunction(getScript
sFunction, debuggerScript, WTF_ARRAY_LENGTH(argv), argv, m_isolate); | 135 v8::Handle<v8::Value> value = V8ScriptRunner::callInternalFunction(getScript
sFunction, debuggerScript, WTF_ARRAY_LENGTH(argv), argv, m_isolate); |
136 if (value.IsEmpty()) | 136 if (value.IsEmpty()) |
137 return; | 137 return; |
138 ASSERT(!value->IsUndefined() && value->IsArray()); | 138 ASSERT(!value->IsUndefined() && value->IsArray()); |
139 v8::Handle<v8::Array> scriptsArray = v8::Handle<v8::Array>::Cast(value); | 139 v8::Handle<v8::Array> scriptsArray = v8::Handle<v8::Array>::Cast(value); |
140 for (unsigned i = 0; i < scriptsArray->Length(); ++i) | 140 for (unsigned i = 0; i < scriptsArray->Length(); ++i) |
141 dispatchDidParseSource(listener, v8::Handle<v8::Object>::Cast(scriptsArr
ay->Get(v8::Integer::New(m_isolate, i))), CompileSuccess); | 141 dispatchDidParseSource(listener, v8::Handle<v8::Object>::Cast(scriptsArr
ay->Get(v8::Integer::New(m_isolate, i))), CompileSuccess); |
142 } | 142 } |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 UseCounter::muteForInspector(); | 314 UseCounter::muteForInspector(); |
315 } | 315 } |
316 | 316 |
317 void PageScriptDebugServer::unmuteWarningsAndDeprecations() | 317 void PageScriptDebugServer::unmuteWarningsAndDeprecations() |
318 { | 318 { |
319 FrameConsole::unmute(); | 319 FrameConsole::unmute(); |
320 UseCounter::unmuteForInspector(); | 320 UseCounter::unmuteForInspector(); |
321 } | 321 } |
322 | 322 |
323 } // namespace blink | 323 } // namespace blink |
OLD | NEW |