Title: [107229] branches/chromium/1025/Source/WebCore
Revision
107229
Author
[email protected]
Date
2012-02-09 05:53:18 -0800 (Thu, 09 Feb 2012)

Log Message

Merge 106662 - inspector/debugger/pause-in-inline-script.html asserts in chromium debug
https://bugs.webkit.org/show_bug.cgi?id=77663

Source/WebCore:

Make ASSERT in MainResourceLoader not fail if debugger hits breakpoint
in the main resource inline script.

Reviewed by Pavel Feldman.

Test: inspector/debugger/pause-in-inline-script.html

* bindings/js/ScriptDebugServer.h:
(WebCore::ScriptDebugServer::isPaused):
(ScriptDebugServer):
* bindings/v8/ScriptDebugServer.h:
(ScriptDebugServer):
* inspector/InspectorDebuggerAgent.cpp:
(WebCore::InspectorDebuggerAgent::didClearMainFrameWindowObject):
(WebCore):
(WebCore::InspectorDebuggerAgent::isPaused):
* inspector/InspectorDebuggerAgent.h:
(InspectorDebuggerAgent):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::isDebuggerPausedImpl):
(WebCore):
* inspector/InspectorInstrumentation.h:
(InspectorInstrumentation):
(WebCore::InspectorInstrumentation::isDebuggerPaused):
(WebCore):
* loader/MainResourceLoader.cpp:
(WebCore::MainResourceLoader::didFinishLoading):

LayoutTests:

Reviewed by Pavel Feldman.

* platform/chromium/test_expectations.txt: assert was fixed, remove
  custom expectation for inspector/debugger/pause-in-inline-script.html

[email protected]
Review URL: https://chromiumcodereview.appspot.com/9375012

Modified Paths

Diff

Modified: branches/chromium/1025/Source/WebCore/bindings/js/ScriptDebugServer.h (107228 => 107229)


--- branches/chromium/1025/Source/WebCore/bindings/js/ScriptDebugServer.h	2012-02-09 13:46:45 UTC (rev 107228)
+++ branches/chromium/1025/Source/WebCore/bindings/js/ScriptDebugServer.h	2012-02-09 13:53:18 UTC (rev 107229)
@@ -90,6 +90,8 @@
     void recompileAllJSFunctionsSoon();
     virtual void recompileAllJSFunctions(Timer<ScriptDebugServer>* = 0) = 0;
 
+    bool isPaused() { return m_paused; }
+
 protected:
     typedef HashSet<ScriptDebugListener*> ListenerSet;
     typedef void (ScriptDebugServer::*_javascript_ExecutionCallback)(ScriptDebugListener*);

Modified: branches/chromium/1025/Source/WebCore/bindings/v8/ScriptDebugServer.h (107228 => 107229)


--- branches/chromium/1025/Source/WebCore/bindings/v8/ScriptDebugServer.h	2012-02-09 13:46:45 UTC (rev 107228)
+++ branches/chromium/1025/Source/WebCore/bindings/v8/ScriptDebugServer.h	2012-02-09 13:53:18 UTC (rev 107229)
@@ -92,6 +92,8 @@
     static void interruptAndRun(PassOwnPtr<Task>);
     void runPendingTasks();
 
+    bool isPaused();
+
 protected:
     ScriptDebugServer();
     ~ScriptDebugServer() { }
@@ -112,8 +114,6 @@
 
     void ensureDebuggerScriptCompiled();
     
-    bool isPaused();
-
     PauseOnExceptionsState m_pauseOnExceptionsState;
     OwnHandle<v8::Object> m_debuggerScript;
     OwnHandle<v8::Object> m_executionState;

Modified: branches/chromium/1025/Source/WebCore/inspector/InspectorDebuggerAgent.cpp (107228 => 107229)


--- branches/chromium/1025/Source/WebCore/inspector/InspectorDebuggerAgent.cpp	2012-02-09 13:46:45 UTC (rev 107228)
+++ branches/chromium/1025/Source/WebCore/inspector/InspectorDebuggerAgent.cpp	2012-02-09 13:53:18 UTC (rev 107229)
@@ -179,6 +179,11 @@
         m_frontend->globalObjectCleared();
 }
 
+bool InspectorDebuggerAgent::isPaused()
+{
+    return scriptDebugServer().isPaused();
+}
+
 static PassRefPtr<InspectorObject> buildObjectForBreakpointCookie(const String& url, int lineNumber, int columnNumber, const String& condition, bool isRegex)
 {
     RefPtr<InspectorObject> breakpointObject = InspectorObject::create();

Modified: branches/chromium/1025/Source/WebCore/inspector/InspectorDebuggerAgent.h (107228 => 107229)


--- branches/chromium/1025/Source/WebCore/inspector/InspectorDebuggerAgent.h	2012-02-09 13:46:45 UTC (rev 107228)
+++ branches/chromium/1025/Source/WebCore/inspector/InspectorDebuggerAgent.h	2012-02-09 13:53:18 UTC (rev 107229)
@@ -77,6 +77,7 @@
     virtual void restore();
 
     void didClearMainFrameWindowObject();
+    bool isPaused();
 
     // Part of the protocol.
     void setBreakpointsActive(ErrorString*, bool active);

Modified: branches/chromium/1025/Source/WebCore/inspector/InspectorInstrumentation.cpp (107228 => 107229)


--- branches/chromium/1025/Source/WebCore/inspector/InspectorInstrumentation.cpp	2012-02-09 13:46:45 UTC (rev 107228)
+++ branches/chromium/1025/Source/WebCore/inspector/InspectorInstrumentation.cpp	2012-02-09 13:53:18 UTC (rev 107229)
@@ -112,6 +112,15 @@
 #endif
 }
 
+bool InspectorInstrumentation::isDebuggerPausedImpl(InstrumentingAgents* instrumentingAgents)
+{
+#if ENABLE(_javascript__DEBUGGER)
+    if (InspectorDebuggerAgent* debuggerAgent = instrumentingAgents->inspectorDebuggerAgent())
+        return debuggerAgent->isPaused();
+#endif
+    return false;
+}
+
 void InspectorInstrumentation::willInsertDOMNodeImpl(InstrumentingAgents* instrumentingAgents, Node* node, Node* parent)
 {
 #if ENABLE(_javascript__DEBUGGER)

Modified: branches/chromium/1025/Source/WebCore/inspector/InspectorInstrumentation.h (107228 => 107229)


--- branches/chromium/1025/Source/WebCore/inspector/InspectorInstrumentation.h	2012-02-09 13:46:45 UTC (rev 107228)
+++ branches/chromium/1025/Source/WebCore/inspector/InspectorInstrumentation.h	2012-02-09 13:53:18 UTC (rev 107229)
@@ -80,6 +80,7 @@
 class InspectorInstrumentation {
 public:
     static void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld*);
+    static bool isDebuggerPaused(Frame*);
 
     static void willInsertDOMNode(Document*, Node*, Node* parent);
     static void didInsertDOMNode(Document*, Node*);
@@ -226,6 +227,7 @@
 private:
 #if ENABLE(INSPECTOR)
     static void didClearWindowObjectInWorldImpl(InstrumentingAgents*, Frame*, DOMWrapperWorld*);
+    static bool isDebuggerPausedImpl(InstrumentingAgents*);
 
     static void willInsertDOMNodeImpl(InstrumentingAgents*, Node*, Node* parent);
     static void didInsertDOMNodeImpl(InstrumentingAgents*, Node*);
@@ -379,6 +381,16 @@
 #endif
 }
 
+inline bool InspectorInstrumentation::isDebuggerPaused(Frame* frame)
+{
+#if ENABLE(INSPECTOR)
+    FAST_RETURN_IF_NO_FRONTENDS(false);
+    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
+        return isDebuggerPausedImpl(instrumentingAgents);
+#endif
+    return false;
+}
+
 inline void InspectorInstrumentation::willInsertDOMNode(Document* document, Node* node, Node* parent)
 {
 #if ENABLE(INSPECTOR)

Modified: branches/chromium/1025/Source/WebCore/loader/MainResourceLoader.cpp (107228 => 107229)


--- branches/chromium/1025/Source/WebCore/loader/MainResourceLoader.cpp	2012-02-09 13:46:45 UTC (rev 107228)
+++ branches/chromium/1025/Source/WebCore/loader/MainResourceLoader.cpp	2012-02-09 13:53:18 UTC (rev 107229)
@@ -469,7 +469,7 @@
     // There is a bug in CFNetwork where callbacks can be dispatched even when loads are deferred.
     // See <rdar://problem/6304600> for more details.
 #if !USE(CF)
-    ASSERT(shouldLoadAsEmptyDocument(frameLoader()->activeDocumentLoader()->url()) || !defersLoading());
+    ASSERT(shouldLoadAsEmptyDocument(frameLoader()->activeDocumentLoader()->url()) || !defersLoading() || InspectorInstrumentation::isDebuggerPaused(m_frame.get()));
 #endif
 
     // The additional processing can do anything including possibly removing the last
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to