Diff
Modified: trunk/Source/WebCore/ChangeLog (101155 => 101156)
--- trunk/Source/WebCore/ChangeLog 2011-11-25 09:25:52 UTC (rev 101155)
+++ trunk/Source/WebCore/ChangeLog 2011-11-25 09:29:30 UTC (rev 101156)
@@ -1,3 +1,18 @@
+2011-11-24 Yury Semikhatsky <yu...@chromium.org>
+
+ [Chromium] Web Inspector: remove legacy debugger support
+ https://bugs.webkit.org/show_bug.cgi?id=73081
+
+ Removed classed providing access to V8 debugging protocol. Clients should
+ use Web Inspector protocol instead.
+
+ Reviewed by Pavel Feldman.
+
+ * bindings/v8/PageScriptDebugServer.cpp:
+ (WebCore::PageScriptDebugServer::PageScriptDebugServer):
+ (WebCore::PageScriptDebugServer::addListener):
+ * bindings/v8/PageScriptDebugServer.h:
+
2011-11-24 Pavel Feldman <pfeld...@google.com>
Web Inspector: refactor resource tree model and introduce explicit class for ResourceTreeFrame.
Modified: trunk/Source/WebCore/bindings/v8/PageScriptDebugServer.cpp (101155 => 101156)
--- trunk/Source/WebCore/bindings/v8/PageScriptDebugServer.cpp 2011-11-25 09:25:52 UTC (rev 101155)
+++ trunk/Source/WebCore/bindings/v8/PageScriptDebugServer.cpp 2011-11-25 09:29:30 UTC (rev 101156)
@@ -71,15 +71,11 @@
PageScriptDebugServer::PageScriptDebugServer()
: ScriptDebugServer()
, m_pausedPage(0)
- , m_enabled(true)
{
}
void PageScriptDebugServer::addListener(ScriptDebugListener* listener, Page* page)
{
- if (!m_enabled)
- return;
-
V8Proxy* proxy = V8Proxy::retrieve(page->mainFrame());
if (!proxy)
return;
Modified: trunk/Source/WebCore/bindings/v8/PageScriptDebugServer.h (101155 => 101156)
--- trunk/Source/WebCore/bindings/v8/PageScriptDebugServer.h 2011-11-25 09:25:52 UTC (rev 101155)
+++ trunk/Source/WebCore/bindings/v8/PageScriptDebugServer.h 2011-11-25 09:29:30 UTC (rev 101156)
@@ -48,9 +48,6 @@
void addListener(ScriptDebugListener*, Page*);
void removeListener(ScriptDebugListener*, Page*);
- // v8-specific methods.
- void setEnabled(bool value) { m_enabled = value; }
-
class ClientMessageLoop {
public:
virtual ~ClientMessageLoop() { }
@@ -71,7 +68,6 @@
ListenersMap m_listenersMap;
OwnPtr<ClientMessageLoop> m_clientMessageLoop;
Page* m_pausedPage;
- bool m_enabled;
};
} // namespace WebCore
Modified: trunk/Source/WebKit/chromium/ChangeLog (101155 => 101156)
--- trunk/Source/WebKit/chromium/ChangeLog 2011-11-25 09:25:52 UTC (rev 101155)
+++ trunk/Source/WebKit/chromium/ChangeLog 2011-11-25 09:29:30 UTC (rev 101156)
@@ -1,3 +1,29 @@
+2011-11-24 Yury Semikhatsky <yu...@chromium.org>
+
+ [Chromium] Web Inspector: remove legacy debugger support
+ https://bugs.webkit.org/show_bug.cgi?id=73081
+
+ Removed classed providing access to V8 debugging protocol. Clients should
+ use Web Inspector protocol instead.
+
+ Reviewed by Pavel Feldman.
+
+ * WebKit.gyp:
+ * public/WebDevToolsAgent.h:
+ * public/WebDevToolsAgentClient.h:
+ * src/DebuggerAgentImpl.cpp: Removed.
+ * src/DebuggerAgentImpl.h: Removed.
+ * src/DebuggerAgentManager.cpp: Removed.
+ * src/DebuggerAgentManager.h: Removed.
+ * src/WebDevToolsAgentImpl.cpp:
+ (WebKit::WebDevToolsAgentImpl::WebDevToolsAgentImpl):
+ (WebKit::WebDevToolsAgentImpl::~WebDevToolsAgentImpl):
+ (WebKit::WebDevToolsAgentImpl::attach):
+ (WebKit::WebDevToolsAgentImpl::detach):
+ (WebKit::WebDevToolsAgentImpl::didNavigate):
+ (WebKit::WebDevToolsAgentImpl::didClearWindowObject):
+ * src/WebDevToolsAgentImpl.h:
+
2011-11-25 Yury Semikhatsky <yu...@chromium.org>
Unreviewed. Update Chromium deps revision to 111575
Modified: trunk/Source/WebKit/chromium/WebKit.gyp (101155 => 101156)
--- trunk/Source/WebKit/chromium/WebKit.gyp 2011-11-25 09:25:52 UTC (rev 101155)
+++ trunk/Source/WebKit/chromium/WebKit.gyp 2011-11-25 09:29:30 UTC (rev 101156)
@@ -372,10 +372,6 @@
'src/ContextMenuClientImpl.cpp',
'src/ContextMenuClientImpl.h',
'src/DatabaseObserver.cpp',
- 'src/DebuggerAgentImpl.cpp',
- 'src/DebuggerAgentImpl.h',
- 'src/DebuggerAgentManager.cpp',
- 'src/DebuggerAgentManager.h',
'src/DeviceOrientationClientProxy.cpp',
'src/DeviceOrientationClientProxy.h',
'src/DOMUtilitiesPrivate.cpp',
Modified: trunk/Source/WebKit/chromium/public/WebDevToolsAgent.h (101155 => 101156)
--- trunk/Source/WebKit/chromium/public/WebDevToolsAgent.h 2011-11-25 09:25:52 UTC (rev 101155)
+++ trunk/Source/WebKit/chromium/public/WebDevToolsAgent.h 2011-11-25 09:29:30 UTC (rev 101156)
@@ -71,14 +71,6 @@
virtual void evaluateInWebInspector(long callId, const WebString& script) = 0;
virtual void setJavaScriptProfilingEnabled(bool) = 0;
- // Asynchronously executes debugger command in the render thread.
- // |callerIdentifier| will be used for sending response.
- WEBKIT_EXPORT static void executeDebuggerCommand(
- const WebString& command, int callerIdentifier);
-
- // Asynchronously request debugger to pause immediately.
- WEBKIT_EXPORT static void debuggerPauseScript();
-
class MessageDescriptor {
public:
virtual ~MessageDescriptor() { }
@@ -93,12 +85,6 @@
// Returns a disconnect event that can be dispatched on the front-end
// in order to let it know that it has disconnected from the agent.
WEBKIT_EXPORT static WebString disconnectEventAsText();
-
- typedef void (*MessageLoopDispatchHandler)();
-
- // Installs dispatch handle that is going to be called periodically
- // while on a breakpoint.
- WEBKIT_EXPORT static void setMessageLoopDispatchHandler(MessageLoopDispatchHandler);
};
} // namespace WebKit
Modified: trunk/Source/WebKit/chromium/public/WebDevToolsAgentClient.h (101155 => 101156)
--- trunk/Source/WebKit/chromium/public/WebDevToolsAgentClient.h 2011-11-25 09:25:52 UTC (rev 101155)
+++ trunk/Source/WebKit/chromium/public/WebDevToolsAgentClient.h 2011-11-25 09:29:30 UTC (rev 101156)
@@ -58,8 +58,6 @@
};
virtual WebKitClientMessageLoop* createClientMessageLoop() { return 0; }
- virtual bool exposeV8DebuggerProtocol() { return false; }
-
virtual void clearBrowserCache() { }
virtual void clearBrowserCookies() { }
Modified: trunk/Source/WebKit/chromium/public/WebDevToolsFrontendClient.h (101155 => 101156)
--- trunk/Source/WebKit/chromium/public/WebDevToolsFrontendClient.h 2011-11-25 09:25:52 UTC (rev 101155)
+++ trunk/Source/WebKit/chromium/public/WebDevToolsFrontendClient.h 2011-11-25 09:29:30 UTC (rev 101156)
@@ -43,8 +43,6 @@
virtual void sendFrontendLoaded() { }
virtual void sendMessageToBackend(const WebString&) { }
- virtual void sendDebuggerCommandToAgent(const WebString& command) { }
- virtual void sendDebuggerPauseScript() { }
virtual void activateWindow() { }
virtual void closeWindow() { }
@@ -53,8 +51,6 @@
virtual void moveWindowBy(const WebFloatPoint&) { }
virtual void saveAs(const WebString& fileName, const WebString& content) { }
- virtual bool shouldHideScriptsPanel() { return false; }
-
protected:
virtual ~WebDevToolsFrontendClient() {}
};
Deleted: trunk/Source/WebKit/chromium/src/DebuggerAgentImpl.cpp (101155 => 101156)
--- trunk/Source/WebKit/chromium/src/DebuggerAgentImpl.cpp 2011-11-25 09:25:52 UTC (rev 101155)
+++ trunk/Source/WebKit/chromium/src/DebuggerAgentImpl.cpp 2011-11-25 09:29:30 UTC (rev 101156)
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "DebuggerAgentImpl.h"
-
-#include "DebuggerAgentManager.h"
-#include "WebDevToolsAgentClient.h"
-#include "WebDevToolsAgentImpl.h"
-#include "WebViewImpl.h"
-
-using WTF::String;
-
-namespace WebKit {
-
-DebuggerAgentImpl::DebuggerAgentImpl(
- WebViewImpl* webViewImpl,
- WebDevToolsAgentImpl* webdevtoolsAgent,
- WebDevToolsAgentClient* webdevtoolsAgentClient)
- : m_webViewImpl(webViewImpl)
- , m_webdevtoolsAgent(webdevtoolsAgent)
- , m_webdevtoolsAgentClient(webdevtoolsAgentClient)
- , m_autoContinueOnException(false)
-{
- DebuggerAgentManager::debugAttach(this);
-}
-
-DebuggerAgentImpl::~DebuggerAgentImpl()
-{
- DebuggerAgentManager::debugDetach(this);
-}
-
-void DebuggerAgentImpl::debuggerOutput(const String& command)
-{
- m_webdevtoolsAgentClient->sendDebuggerOutput(command);
-}
-
-WebCore::Page* DebuggerAgentImpl::page()
-{
- return m_webViewImpl->page();
-}
-
-} // namespace WebKit
Deleted: trunk/Source/WebKit/chromium/src/DebuggerAgentImpl.h (101155 => 101156)
--- trunk/Source/WebKit/chromium/src/DebuggerAgentImpl.h 2011-11-25 09:25:52 UTC (rev 101155)
+++ trunk/Source/WebKit/chromium/src/DebuggerAgentImpl.h 2011-11-25 09:29:30 UTC (rev 101156)
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef DebuggerAgentImpl_h
-#define DebuggerAgentImpl_h
-
-#include <wtf/Forward.h>
-
-namespace WebCore {
-class Page;
-}
-
-namespace WebKit {
-
-class WebDevToolsAgentClient;
-class WebDevToolsAgentImpl;
-class WebViewImpl;
-
-class DebuggerAgentImpl {
-public:
- DebuggerAgentImpl(WebKit::WebViewImpl* webViewImpl,
- WebDevToolsAgentImpl* webdevtoolsAgent,
- WebDevToolsAgentClient* webdevtoolsAgentClient);
- virtual ~DebuggerAgentImpl();
-
- void debuggerOutput(const WTF::String& out);
-
- void setAutoContinueOnException(bool autoContinue) { m_autoContinueOnException = autoContinue; }
-
- bool autoContinueOnException() { return m_autoContinueOnException; }
-
- WebCore::Page* page();
- WebDevToolsAgentImpl* webdevtoolsAgent() { return m_webdevtoolsAgent; }
-
- WebKit::WebViewImpl* webView() { return m_webViewImpl; }
-
-private:
- WebKit::WebViewImpl* m_webViewImpl;
- WebDevToolsAgentImpl* m_webdevtoolsAgent;
- WebDevToolsAgentClient* m_webdevtoolsAgentClient;
- bool m_autoContinueOnException;
-};
-
-} // namespace WebKit
-
-#endif
Deleted: trunk/Source/WebKit/chromium/src/DebuggerAgentManager.cpp (101155 => 101156)
--- trunk/Source/WebKit/chromium/src/DebuggerAgentManager.cpp 2011-11-25 09:25:52 UTC (rev 101155)
+++ trunk/Source/WebKit/chromium/src/DebuggerAgentManager.cpp 2011-11-25 09:29:30 UTC (rev 101156)
@@ -1,316 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "DebuggerAgentManager.h"
-
-#include "DebuggerAgentImpl.h"
-#include "Frame.h"
-#include "PageGroupLoadDeferrer.h"
-#include "PageScriptDebugServer.h"
-#include "V8Proxy.h"
-#include "WebDevToolsAgentImpl.h"
-#include "WebFrameImpl.h"
-#include "WebViewImpl.h"
-#include <wtf/HashSet.h>
-#include <wtf/Noncopyable.h>
-#include <wtf/text/StringConcatenate.h>
-
-namespace WebKit {
-
-WebDevToolsAgent::MessageLoopDispatchHandler DebuggerAgentManager::s_messageLoopDispatchHandler = 0;
-
-bool DebuggerAgentManager::s_inHostDispatchHandler = false;
-
-bool DebuggerAgentManager::s_exposeV8DebuggerProtocol = false;
-
-typedef HashMap<WebViewImpl*, WebCore::PageGroupLoadDeferrer*> DeferrersMap;
-
-namespace {
-
-class CallerIdWrapper : public v8::Debug::ClientData {
- WTF_MAKE_NONCOPYABLE(CallerIdWrapper);
-public:
- CallerIdWrapper() : m_callerIsMananager(true), m_callerId(0) { }
- explicit CallerIdWrapper(int callerId)
- : m_callerIsMananager(false)
- , m_callerId(callerId) { }
- ~CallerIdWrapper() { }
- bool callerIsMananager() const { return m_callerIsMananager; }
- int callerId() const { return m_callerId; }
-private:
- bool m_callerIsMananager;
- int m_callerId;
-};
-
-DeferrersMap& pageDeferrers()
-{
- DEFINE_STATIC_LOCAL(DeferrersMap, deferrers, ());
- return deferrers;
-}
-
-} // namespace
-
-
-void DebuggerAgentManager::debugHostDispatchHandler()
-{
- if (!s_messageLoopDispatchHandler || !s_attachedAgentsMap)
- return;
-
- if (s_inHostDispatchHandler)
- return;
-
- s_inHostDispatchHandler = true;
-
- Vector<WebViewImpl*> views;
- // 1. Disable active objects and input events.
- for (AttachedAgentsMap::iterator it = s_attachedAgentsMap->begin(); it != s_attachedAgentsMap->end(); ++it) {
- DebuggerAgentImpl* agent = it->second;
- pageDeferrers().set(agent->webView(), new WebCore::PageGroupLoadDeferrer(agent->page(), true));
- views.append(agent->webView());
- agent->webView()->setIgnoreInputEvents(true);
- }
-
- // 2. Process messages.
- s_messageLoopDispatchHandler();
-
- // 3. Bring things back.
- for (Vector<WebViewImpl*>::iterator it = views.begin(); it != views.end(); ++it) {
- if (pageDeferrers().contains(*it)) {
- // The view was not closed during the dispatch.
- (*it)->setIgnoreInputEvents(false);
- }
- }
- deleteAllValues(pageDeferrers());
- pageDeferrers().clear();
-
- s_inHostDispatchHandler = false;
- if (!s_attachedAgentsMap) {
- // Remove handlers if all agents were detached within host dispatch.
- v8::Debug::SetMessageHandler(0);
- v8::Debug::SetHostDispatchHandler(0);
- }
-}
-
-DebuggerAgentManager::AttachedAgentsMap* DebuggerAgentManager::s_attachedAgentsMap = 0;
-
-void DebuggerAgentManager::debugAttach(DebuggerAgentImpl* debuggerAgent)
-{
- if (!s_exposeV8DebuggerProtocol)
- return;
- if (!s_attachedAgentsMap) {
- s_attachedAgentsMap = new AttachedAgentsMap();
- v8::Debug::SetMessageHandler2(&DebuggerAgentManager::onV8DebugMessage);
- v8::Debug::SetHostDispatchHandler(&DebuggerAgentManager::debugHostDispatchHandler, 100 /* ms */);
- }
- int hostId = debuggerAgent->webdevtoolsAgent()->hostId();
- ASSERT(hostId);
- s_attachedAgentsMap->set(hostId, debuggerAgent);
-}
-
-void DebuggerAgentManager::debugDetach(DebuggerAgentImpl* debuggerAgent)
-{
- if (!s_exposeV8DebuggerProtocol)
- return;
- if (!s_attachedAgentsMap) {
- ASSERT_NOT_REACHED();
- return;
- }
- int hostId = debuggerAgent->webdevtoolsAgent()->hostId();
- ASSERT(s_attachedAgentsMap->get(hostId) == debuggerAgent);
- bool isOnBreakpoint = (findAgentForCurrentV8Context() == debuggerAgent);
- s_attachedAgentsMap->remove(hostId);
-
- if (s_attachedAgentsMap->isEmpty()) {
- delete s_attachedAgentsMap;
- s_attachedAgentsMap = 0;
- // Note that we do not empty handlers while in dispatch - we schedule
- // continue and do removal once we are out of the dispatch. Also there is
- // no need to send continue command in this case since removing message
- // handler will cause debugger unload and all breakpoints will be cleared.
- if (!s_inHostDispatchHandler) {
- v8::Debug::SetMessageHandler2(0);
- v8::Debug::SetHostDispatchHandler(0);
- }
- } else {
- // Remove all breakpoints set by the agent.
- String clearBreakpointGroupCmd = makeString(
- "{\"seq\":1,\"type\":\"request\",\"command\":\"clearbreakpointgroup\","
- "\"arguments\":{\"groupId\":", String::number(hostId), "}}");
- sendCommandToV8(clearBreakpointGroupCmd, new CallerIdWrapper());
-
- if (isOnBreakpoint) {
- // Force continue if detach happened in nessted message loop while
- // debugger was paused on a breakpoint(as long as there are other
- // attached agents v8 will wait for explicit'continue' message).
- sendContinueCommandToV8();
- }
- }
-}
-
-void DebuggerAgentManager::onV8DebugMessage(const v8::Debug::Message& message)
-{
- v8::HandleScope scope;
- v8::String::Value value(message.GetJSON());
- WTF::String out(reinterpret_cast<const UChar*>(*value), value.length());
-
- // If callerData is not 0 the message is a response to a debugger command.
- if (v8::Debug::ClientData* callerData = message.GetClientData()) {
- CallerIdWrapper* wrapper = static_cast<CallerIdWrapper*>(callerData);
- if (wrapper->callerIsMananager()) {
- // Just ignore messages sent by this manager.
- return;
- }
- DebuggerAgentImpl* debuggerAgent = debuggerAgentForHostId(wrapper->callerId());
- if (debuggerAgent)
- debuggerAgent->debuggerOutput(out);
- else if (!message.WillStartRunning()) {
- // Autocontinue execution if there is no handler.
- sendContinueCommandToV8();
- }
- return;
- } // Otherwise it's an event message.
- ASSERT(message.IsEvent());
-
- // Ignore unsupported event types.
- if (message.GetEvent() != v8::AfterCompile && message.GetEvent() != v8::Break && message.GetEvent() != v8::Exception)
- return;
-
- v8::Handle<v8::Context> context = message.GetEventContext();
- // If the context is from one of the inpected tabs it should have its context
- // data.
- if (context.IsEmpty()) {
- // Unknown context, skip the event.
- return;
- }
-
- // If the context is from one of the inpected tabs or injected extension
- // scripts it must have hostId in the data field.
- int hostId = WebCore::V8Proxy::contextDebugId(context);
- if (hostId != -1) {
- DebuggerAgentImpl* agent = debuggerAgentForHostId(hostId);
- if (agent) {
- if (agent->autoContinueOnException()
- && message.GetEvent() == v8::Exception) {
- sendContinueCommandToV8();
- return;
- }
-
- agent->debuggerOutput(out);
- return;
- }
- }
-
- if (!message.WillStartRunning()) {
- // Autocontinue execution on break and exception events if there is no
- // handler.
- sendContinueCommandToV8();
- }
-}
-
-void DebuggerAgentManager::pauseScript()
-{
- v8::Debug::DebugBreak();
-}
-
-void DebuggerAgentManager::executeDebuggerCommand(const WTF::String& command, int callerId)
-{
- sendCommandToV8(command, new CallerIdWrapper(callerId));
-}
-
-void DebuggerAgentManager::setMessageLoopDispatchHandler(WebDevToolsAgent::MessageLoopDispatchHandler handler)
-{
- s_messageLoopDispatchHandler = handler;
-}
-
-void DebuggerAgentManager::setExposeV8DebuggerProtocol(bool value)
-{
- s_exposeV8DebuggerProtocol = value;
- WebCore::PageScriptDebugServer::shared().setEnabled(!s_exposeV8DebuggerProtocol);
-}
-
-void DebuggerAgentManager::setHostId(WebFrameImpl* webframe, int hostId)
-{
- ASSERT(hostId > 0);
- WebCore::V8Proxy* proxy = WebCore::V8Proxy::retrieve(webframe->frame());
- if (proxy)
- proxy->setContextDebugId(hostId);
-}
-
-void DebuggerAgentManager::onWebViewClosed(WebViewImpl* webview)
-{
- if (pageDeferrers().contains(webview)) {
- delete pageDeferrers().get(webview);
- pageDeferrers().remove(webview);
- }
-}
-
-void DebuggerAgentManager::onNavigate()
-{
- if (s_inHostDispatchHandler)
- DebuggerAgentManager::sendContinueCommandToV8();
-}
-
-void DebuggerAgentManager::sendCommandToV8(const WTF::String& cmd, v8::Debug::ClientData* data)
-{
- v8::Debug::SendCommand(reinterpret_cast<const uint16_t*>(cmd.characters()), cmd.length(), data);
-}
-
-void DebuggerAgentManager::sendContinueCommandToV8()
-{
- WTF::String continueCmd("{\"seq\":1,\"type\":\"request\",\"command\":\"continue\"}");
- sendCommandToV8(continueCmd, new CallerIdWrapper());
-}
-
-DebuggerAgentImpl* DebuggerAgentManager::findAgentForCurrentV8Context()
-{
- if (!s_attachedAgentsMap)
- return 0;
- ASSERT(!s_attachedAgentsMap->isEmpty());
-
- WebCore::Frame* frame = WebCore::V8Proxy::retrieveFrameForEnteredContext();
- if (!frame)
- return 0;
- WebCore::Page* page = frame->page();
- for (AttachedAgentsMap::iterator it = s_attachedAgentsMap->begin(); it != s_attachedAgentsMap->end(); ++it) {
- if (it->second->page() == page)
- return it->second;
- }
- return 0;
-}
-
-DebuggerAgentImpl* DebuggerAgentManager::debuggerAgentForHostId(int hostId)
-{
- if (!s_attachedAgentsMap)
- return 0;
- return s_attachedAgentsMap->get(hostId);
-}
-
-} // namespace WebKit
Deleted: trunk/Source/WebKit/chromium/src/DebuggerAgentManager.h (101155 => 101156)
--- trunk/Source/WebKit/chromium/src/DebuggerAgentManager.h 2011-11-25 09:25:52 UTC (rev 101155)
+++ trunk/Source/WebKit/chromium/src/DebuggerAgentManager.h 2011-11-25 09:29:30 UTC (rev 101156)
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef DebuggerAgentManager_h
-#define DebuggerAgentManager_h
-
-#include "WebCString.h"
-#include "WebDevToolsAgent.h"
-#include <v8-debug.h>
-#include <wtf/Forward.h>
-#include <wtf/HashMap.h>
-#include <wtf/Noncopyable.h>
-#include <wtf/Vector.h>
-
-namespace WebCore {
-class Page;
-class PageGroupLoadDeferrer;
-}
-
-namespace WebKit {
-
-class DebuggerAgentImpl;
-class DictionaryValue;
-class WebFrameImpl;
-class WebViewImpl;
-
-// There is single v8 instance per render process. Also there may be several
-// RenderViews and consequently devtools agents in the process that want to talk
-// to the v8 debugger. This class coordinates communication between the debug
-// agents and v8 debugger. It will set debug output handler as long as at least
-// one debugger agent is attached and remove it when last debugger agent is
-// detached. When message is received from debugger it will route it to the
-// right debugger agent if there is one otherwise the message will be ignored.
-//
-// v8 may send a message(e.g. exception event) after which it
-// would expect some actions from the handler. If there is no appropriate
-// debugger agent to handle such messages the manager will perform the action
-// itself, otherwise v8 may hang waiting for the action.
-class DebuggerAgentManager {
- WTF_MAKE_NONCOPYABLE(DebuggerAgentManager);
-public:
- static void debugAttach(DebuggerAgentImpl* debuggerAgent);
- static void debugDetach(DebuggerAgentImpl* debuggerAgent);
- static void pauseScript();
- static void executeDebuggerCommand(const WTF::String& command, int callerId);
- static void setMessageLoopDispatchHandler(WebDevToolsAgent::MessageLoopDispatchHandler handler);
- static void setExposeV8DebuggerProtocol(bool);
-
- // Sets |hostId| as the frame context data. This id is used to filter scripts
- // related to the inspected page.
- static void setHostId(WebFrameImpl* webframe, int hostId);
-
- static void onWebViewClosed(WebViewImpl* webview);
-
- static void onNavigate();
-
-private:
- DebuggerAgentManager();
- ~DebuggerAgentManager();
-
- static void debugHostDispatchHandler();
- static void onV8DebugMessage(const v8::Debug::Message& message);
- static void sendCommandToV8(const WTF::String& cmd,
- v8::Debug::ClientData* data);
- static void sendContinueCommandToV8();
-
- static DebuggerAgentImpl* findAgentForCurrentV8Context();
- static DebuggerAgentImpl* debuggerAgentForHostId(int hostId);
-
- typedef HashMap<int, DebuggerAgentImpl*> AttachedAgentsMap;
- static AttachedAgentsMap* s_attachedAgentsMap;
-
- static WebDevToolsAgent::MessageLoopDispatchHandler s_messageLoopDispatchHandler;
- static bool s_inHostDispatchHandler;
-
- static bool s_exposeV8DebuggerProtocol;
-};
-
-} // namespace WebKit
-
-#endif
Modified: trunk/Source/WebKit/chromium/src/InspectorFrontendClientImpl.cpp (101155 => 101156)
--- trunk/Source/WebKit/chromium/src/InspectorFrontendClientImpl.cpp 2011-11-25 09:25:52 UTC (rev 101155)
+++ trunk/Source/WebKit/chromium/src/InspectorFrontendClientImpl.cpp 2011-11-25 09:29:30 UTC (rev 101156)
@@ -92,8 +92,6 @@
String InspectorFrontendClientImpl::hiddenPanels()
{
- if (m_client->shouldHideScriptsPanel())
- return "scripts";
return "";
}
Modified: trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp (101155 => 101156)
--- trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp 2011-11-25 09:25:52 UTC (rev 101155)
+++ trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp 2011-11-25 09:29:30 UTC (rev 101156)
@@ -31,8 +31,6 @@
#include "config.h"
#include "WebDevToolsAgentImpl.h"
-#include "DebuggerAgentImpl.h"
-#include "DebuggerAgentManager.h"
#include "ExceptionCode.h"
#include "GraphicsContext.h"
#include "InjectedScriptHost.h"
@@ -183,13 +181,11 @@
, m_webViewImpl(webViewImpl)
, m_attached(false)
{
- DebuggerAgentManager::setExposeV8DebuggerProtocol(
- client->exposeV8DebuggerProtocol());
+ ASSERT(m_hostId > 0);
}
WebDevToolsAgentImpl::~WebDevToolsAgentImpl()
{
- DebuggerAgentManager::onWebViewClosed(m_webViewImpl);
ClientMessageLoopAdapter::inspectedViewClosed(m_webViewImpl);
}
@@ -198,10 +194,7 @@
if (m_attached)
return;
- if (!m_client->exposeV8DebuggerProtocol())
- ClientMessageLoopAdapter::ensureClientMessageLoopCreated(m_client);
-
- m_debuggerAgentImpl = adoptPtr(new DebuggerAgentImpl(m_webViewImpl, this, m_client));
+ ClientMessageLoopAdapter::ensureClientMessageLoopCreated(m_client);
m_attached = true;
}
@@ -218,7 +211,6 @@
ic->disconnectFrontend();
ic->hideHighlight();
ic->close();
- m_debuggerAgentImpl.clear();
m_attached = false;
}
@@ -230,12 +222,13 @@
void WebDevToolsAgentImpl::didNavigate()
{
ClientMessageLoopAdapter::didNavigate();
- DebuggerAgentManager::onNavigate();
}
void WebDevToolsAgentImpl::didClearWindowObject(WebFrameImpl* webframe)
{
- DebuggerAgentManager::setHostId(webframe, m_hostId);
+ WebCore::V8Proxy* proxy = WebCore::V8Proxy::retrieve(webframe->frame());
+ if (proxy)
+ proxy->setContextDebugId(m_hostId);
}
void WebDevToolsAgentImpl::dispatchOnInspectorBackend(const WebString& message)
@@ -348,16 +341,6 @@
return WebCore::supportsInspectorProtocolVersion(version);
}
-void WebDevToolsAgent::executeDebuggerCommand(const WebString& command, int callerId)
-{
- DebuggerAgentManager::executeDebuggerCommand(command, callerId);
-}
-
-void WebDevToolsAgent::debuggerPauseScript()
-{
- DebuggerAgentManager::pauseScript();
-}
-
void WebDevToolsAgent::interruptAndDispatch(MessageDescriptor* rawDescriptor)
{
// rawDescriptor can't be a PassOwnPtr because interruptAndDispatch is a WebKit API function.
@@ -402,9 +385,4 @@
return channel.m_message;
}
-void WebDevToolsAgent::setMessageLoopDispatchHandler(MessageLoopDispatchHandler handler)
-{
- DebuggerAgentManager::setMessageLoopDispatchHandler(handler);
-}
-
} // namespace WebKit
Modified: trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h (101155 => 101156)
--- trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h 2011-11-25 09:25:52 UTC (rev 101155)
+++ trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h 2011-11-25 09:29:30 UTC (rev 101156)
@@ -50,7 +50,6 @@
namespace WebKit {
-class DebuggerAgentImpl;
class WebDevToolsAgentClient;
class WebFrame;
class WebFrameImpl;
@@ -107,7 +106,6 @@
int m_hostId;
WebDevToolsAgentClient* m_client;
WebViewImpl* m_webViewImpl;
- OwnPtr<DebuggerAgentImpl> m_debuggerAgentImpl;
bool m_attached;
};
Modified: trunk/Tools/DumpRenderTree/chromium/DRTDevToolsAgent.cpp (101155 => 101156)
--- trunk/Tools/DumpRenderTree/chromium/DRTDevToolsAgent.cpp 2011-11-25 09:25:52 UTC (rev 101155)
+++ trunk/Tools/DumpRenderTree/chromium/DRTDevToolsAgent.cpp 2011-11-25 09:29:30 UTC (rev 101156)
@@ -47,8 +47,6 @@
static int devToolsAgentCounter = 0;
m_routingID = ++devToolsAgentCounter;
- if (m_routingID == 1)
- WebDevToolsAgent::setMessageLoopDispatchHandler(&DRTDevToolsAgent::dispatchMessageLoop);
}
void DRTDevToolsAgent::reset()
@@ -144,9 +142,3 @@
agent->evaluateInWebInspector(callID, WebString::fromUTF8(script));
return true;
}
-
-// static method
-void DRTDevToolsAgent::dispatchMessageLoop()
-{
- webkit_support::DispatchMessageLoop();
-}
Modified: trunk/Tools/DumpRenderTree/chromium/DRTDevToolsAgent.h (101155 => 101156)
--- trunk/Tools/DumpRenderTree/chromium/DRTDevToolsAgent.h 2011-11-25 09:25:52 UTC (rev 101155)
+++ trunk/Tools/DumpRenderTree/chromium/DRTDevToolsAgent.h 2011-11-25 09:29:30 UTC (rev 101156)
@@ -76,7 +76,6 @@
private:
void call(const WebKit::WebString& args);
void delayedFrontendLoaded();
- static void dispatchMessageLoop();
WebKit::WebDevToolsAgent* webDevToolsAgent();
class AsyncCallTask: public MethodTask<DRTDevToolsAgent> {
Modified: trunk/Tools/DumpRenderTree/chromium/DRTDevToolsClient.cpp (101155 => 101156)
--- trunk/Tools/DumpRenderTree/chromium/DRTDevToolsClient.cpp 2011-11-25 09:25:52 UTC (rev 101155)
+++ trunk/Tools/DumpRenderTree/chromium/DRTDevToolsClient.cpp 2011-11-25 09:29:30 UTC (rev 101156)
@@ -76,11 +76,6 @@
m_drtDevToolsAgent->asyncCall(data);
}
-void DRTDevToolsClient::sendDebuggerCommandToAgent(const WebString& command)
-{
- WebDevToolsAgent::executeDebuggerCommand(command, 1);
-}
-
void DRTDevToolsClient::activateWindow()
{
// Not implemented.
Modified: trunk/Tools/DumpRenderTree/chromium/DRTDevToolsClient.h (101155 => 101156)
--- trunk/Tools/DumpRenderTree/chromium/DRTDevToolsClient.h 2011-11-25 09:25:52 UTC (rev 101155)
+++ trunk/Tools/DumpRenderTree/chromium/DRTDevToolsClient.h 2011-11-25 09:29:30 UTC (rev 101156)
@@ -56,7 +56,6 @@
// WebDevToolsFrontendClient implementation
virtual void sendFrontendLoaded();
virtual void sendMessageToBackend(const WebKit::WebString&);
- virtual void sendDebuggerCommandToAgent(const WebKit::WebString& command);
virtual void activateWindow();
virtual void closeWindow();