Commit 0a0e576d authored by yurys@chromium.org's avatar yurys@chromium.org

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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106662 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a3ad8394
2012-02-03 Yury Semikhatsky <yurys@chromium.org>
inspector/debugger/pause-in-inline-script.html asserts in chromium debug
https://bugs.webkit.org/show_bug.cgi?id=77663
Reviewed by Pavel Feldman.
* platform/chromium/test_expectations.txt: assert was fixed, remove
custom expectation for inspector/debugger/pause-in-inline-script.html
2012-01-27 Yury Semikhatsky <yurys@chromium.org>
Web Inspector: console evaluation doesn't work on breakpoint in pages with CSP
......@@ -4047,7 +4047,6 @@ BUGWK77565 WIN LINUX : fast/box-shadow/box-shadow-clipped-slices.html = PASS IMA
BUGWK77641 MAC : fast/speech/bubble-position.html = TEXT
BUGWK77661 WIN LINUX : http/tests/inspector/indexeddb/database-structure.html = TEXT
BUGWK77663 WIN LINUX DEBUG : inspector/debugger/pause-in-inline-script.html = CRASH
// Hitting ASSERT_NOT_REACHED in EventHandler::handleTouchEvent() as of r106554.
BUGWK77620 DEBUG : fast/events/touch/touch-target.html = CRASH
......
2012-02-03 Yury Semikhatsky <yurys@chromium.org>
inspector/debugger/pause-in-inline-script.html asserts in chromium debug
https://bugs.webkit.org/show_bug.cgi?id=77663
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):
2012-02-03 Kentaro Hara <haraken@chromium.org>
Fix typo
......@@ -90,6 +90,8 @@ public:
void recompileAllJSFunctionsSoon();
virtual void recompileAllJSFunctions(Timer<ScriptDebugServer>* = 0) = 0;
bool isPaused() { return m_paused; }
protected:
typedef HashSet<ScriptDebugListener*> ListenerSet;
typedef void (ScriptDebugServer::*JavaScriptExecutionCallback)(ScriptDebugListener*);
......
......@@ -92,6 +92,8 @@ public:
static void interruptAndRun(PassOwnPtr<Task>);
void runPendingTasks();
bool isPaused();
protected:
ScriptDebugServer();
~ScriptDebugServer() { }
......@@ -112,8 +114,6 @@ protected:
void ensureDebuggerScriptCompiled();
bool isPaused();
PauseOnExceptionsState m_pauseOnExceptionsState;
OwnHandle<v8::Object> m_debuggerScript;
OwnHandle<v8::Object> m_executionState;
......
......@@ -185,6 +185,11 @@ void InspectorDebuggerAgent::didClearMainFrameWindowObject()
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();
......
......@@ -77,6 +77,7 @@ public:
virtual void restore();
void didClearMainFrameWindowObject();
bool isPaused();
// Part of the protocol.
void setBreakpointsActive(ErrorString*, bool active);
......
......@@ -109,6 +109,15 @@ void InspectorInstrumentation::didClearWindowObjectInWorldImpl(InstrumentingAgen
#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)
......
......@@ -80,6 +80,7 @@ typedef pair<InstrumentingAgents*, int> InspectorInstrumentationCookie;
class InspectorInstrumentation {
public:
static void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld*);
static bool isDebuggerPaused(Frame*);
static void willInsertDOMNode(Document*, Node*, Node* parent);
static void didInsertDOMNode(Document*, Node*);
......@@ -228,6 +229,7 @@ public:
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*);
......@@ -383,6 +385,16 @@ inline void InspectorInstrumentation::didClearWindowObjectInWorld(Frame* frame,
#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)
......
......@@ -469,7 +469,7 @@ void MainResourceLoader::didFinishLoading(double finishTime)
// 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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment