| 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 23 matching lines...) Expand all Loading... |
| 34 #include "gen/sky/bindings/core/v8/V8Window.h" | 34 #include "gen/sky/bindings/core/v8/V8Window.h" |
| 35 #include "sky/engine/bindings/core/v8/DOMWrapperWorld.h" | 35 #include "sky/engine/bindings/core/v8/DOMWrapperWorld.h" |
| 36 #include "sky/engine/bindings/core/v8/ScriptController.h" | 36 #include "sky/engine/bindings/core/v8/ScriptController.h" |
| 37 #include "sky/engine/bindings/core/v8/ScriptSourceCode.h" | 37 #include "sky/engine/bindings/core/v8/ScriptSourceCode.h" |
| 38 #include "sky/engine/bindings/core/v8/V8Binding.h" | 38 #include "sky/engine/bindings/core/v8/V8Binding.h" |
| 39 #include "sky/engine/bindings/core/v8/V8ScriptRunner.h" | 39 #include "sky/engine/bindings/core/v8/V8ScriptRunner.h" |
| 40 #include "sky/engine/bindings/core/v8/WindowProxy.h" | 40 #include "sky/engine/bindings/core/v8/WindowProxy.h" |
| 41 #include "sky/engine/core/dom/ExecutionContext.h" | 41 #include "sky/engine/core/dom/ExecutionContext.h" |
| 42 #include "sky/engine/core/frame/FrameConsole.h" | 42 #include "sky/engine/core/frame/FrameConsole.h" |
| 43 #include "sky/engine/core/frame/LocalFrame.h" | 43 #include "sky/engine/core/frame/LocalFrame.h" |
| 44 #include "sky/engine/core/frame/UseCounter.h" | |
| 45 #include "sky/engine/core/inspector/InspectorTraceEvents.h" | 44 #include "sky/engine/core/inspector/InspectorTraceEvents.h" |
| 46 #include "sky/engine/core/inspector/ScriptDebugListener.h" | |
| 47 #include "sky/engine/core/page/Page.h" | |
| 48 #include "sky/engine/v8_inspector/inspector_host.h" | 45 #include "sky/engine/v8_inspector/inspector_host.h" |
| 46 #include "sky/engine/v8_inspector/ScriptDebugListener.h" |
| 49 #include "sky/engine/wtf/OwnPtr.h" | 47 #include "sky/engine/wtf/OwnPtr.h" |
| 50 #include "sky/engine/wtf/PassOwnPtr.h" | 48 #include "sky/engine/wtf/PassOwnPtr.h" |
| 51 #include "sky/engine/wtf/StdLibExtras.h" | 49 #include "sky/engine/wtf/StdLibExtras.h" |
| 52 #include "sky/engine/wtf/TemporaryChange.h" | 50 #include "sky/engine/wtf/TemporaryChange.h" |
| 53 #include "sky/engine/wtf/text/StringBuilder.h" | |
| 54 | 51 |
| 55 namespace blink { | 52 namespace blink { |
| 56 | 53 |
| 57 static LocalFrame* retrieveFrameWithGlobalObjectCheck(v8::Handle<v8::Context> co
ntext) | 54 static LocalFrame* retrieveFrameWithGlobalObjectCheck(v8::Handle<v8::Context> co
ntext) |
| 58 { | 55 { |
| 59 if (context.IsEmpty()) | 56 if (context.IsEmpty()) |
| 60 return 0; | 57 return 0; |
| 61 | 58 |
| 62 // FIXME: This is a temporary hack for crbug.com/345014. | 59 // FIXME: This is a temporary hack for crbug.com/345014. |
| 63 // Currently it's possible that V8 can trigger Debugger::ProcessDebugEvent f
or a context | 60 // Currently it's possible that V8 can trigger Debugger::ProcessDebugEvent f
or a context |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 v8::Handle<v8::Value> argvPreprocessedScript[] = { eventData, v8String(debug
Context->GetIsolate(), preprocessedSource) }; | 251 v8::Handle<v8::Value> argvPreprocessedScript[] = { eventData, v8String(debug
Context->GetIsolate(), preprocessedSource) }; |
| 255 callDebuggerMethod("setScriptSource", WTF_ARRAY_LENGTH(argvPreprocessedScrip
t), argvPreprocessedScript); | 252 callDebuggerMethod("setScriptSource", WTF_ARRAY_LENGTH(argvPreprocessedScrip
t), argvPreprocessedScript); |
| 256 } | 253 } |
| 257 | 254 |
| 258 static bool isCreatingPreprocessor = false; | 255 static bool isCreatingPreprocessor = false; |
| 259 | 256 |
| 260 bool PageScriptDebugServer::canPreprocess(LocalFrame* frame) | 257 bool PageScriptDebugServer::canPreprocess(LocalFrame* frame) |
| 261 { | 258 { |
| 262 ASSERT(frame); | 259 ASSERT(frame); |
| 263 | 260 |
| 264 if (!m_preprocessorSourceCode || !frame->page() || isCreatingPreprocessor) | 261 if (!m_preprocessorSourceCode || isCreatingPreprocessor) |
| 265 return false; | 262 return false; |
| 266 | 263 |
| 267 // We delay the creation of the preprocessor until just before the first JS
from the | 264 // We delay the creation of the preprocessor until just before the first JS
from the |
| 268 // Web page to ensure that the debugger's console initialization code has co
mpleted. | 265 // Web page to ensure that the debugger's console initialization code has co
mpleted. |
| 269 if (!m_scriptPreprocessor) { | 266 if (!m_scriptPreprocessor) { |
| 270 TemporaryChange<bool> isPreprocessing(isCreatingPreprocessor, true); | 267 TemporaryChange<bool> isPreprocessing(isCreatingPreprocessor, true); |
| 271 m_scriptPreprocessor = adoptPtr(new ScriptPreprocessor(*m_preprocessorSo
urceCode.get(), frame)); | 268 m_scriptPreprocessor = adoptPtr(new ScriptPreprocessor(*m_preprocessorSo
urceCode.get(), frame)); |
| 272 } | 269 } |
| 273 | 270 |
| 274 if (m_scriptPreprocessor->isValid()) | 271 if (m_scriptPreprocessor->isValid()) |
| (...skipping 24 matching lines...) Expand all Loading... |
| 299 } | 296 } |
| 300 | 297 |
| 301 void PageScriptDebugServer::clearPreprocessor() | 298 void PageScriptDebugServer::clearPreprocessor() |
| 302 { | 299 { |
| 303 m_scriptPreprocessor.clear(); | 300 m_scriptPreprocessor.clear(); |
| 304 } | 301 } |
| 305 | 302 |
| 306 void PageScriptDebugServer::muteWarningsAndDeprecations() | 303 void PageScriptDebugServer::muteWarningsAndDeprecations() |
| 307 { | 304 { |
| 308 FrameConsole::mute(); | 305 FrameConsole::mute(); |
| 309 UseCounter::muteForInspector(); | 306 // Used to mute UseCounter too. |
| 310 } | 307 } |
| 311 | 308 |
| 312 void PageScriptDebugServer::unmuteWarningsAndDeprecations() | 309 void PageScriptDebugServer::unmuteWarningsAndDeprecations() |
| 313 { | 310 { |
| 314 FrameConsole::unmute(); | 311 FrameConsole::unmute(); |
| 315 UseCounter::unmuteForInspector(); | 312 // Used to unmute UseCounter too. |
| 316 } | 313 } |
| 317 | 314 |
| 318 } // namespace blink | 315 } // namespace blink |
| OLD | NEW |