diff options
author | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-19 11:44:19 +0000 |
---|---|---|
committer | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-19 11:44:19 +0000 |
commit | 70019150e9f7f53074cacb335de0d238bbc37380 (patch) | |
tree | 444eddb81717f95b38585bfedde240d9643ba6a2 /content/renderer/devtools/devtools_agent_filter.h | |
parent | 08b035b9918342155f54549486d6108807c3bfad (diff) | |
download | chromium_src-70019150e9f7f53074cacb335de0d238bbc37380.zip chromium_src-70019150e9f7f53074cacb335de0d238bbc37380.tar.gz chromium_src-70019150e9f7f53074cacb335de0d238bbc37380.tar.bz2 |
DevTools: rename debugger/ to devtools/, move DevTools files into content/renderer/devtools.
Review URL: https://codereview.chromium.org/11630004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173903 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/devtools/devtools_agent_filter.h')
-rw-r--r-- | content/renderer/devtools/devtools_agent_filter.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/content/renderer/devtools/devtools_agent_filter.h b/content/renderer/devtools/devtools_agent_filter.h new file mode 100644 index 0000000..9e4f8ae --- /dev/null +++ b/content/renderer/devtools/devtools_agent_filter.h @@ -0,0 +1,48 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_FILTER_H_ +#define CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_FILTER_H_ + +#include <string> + +#include "ipc/ipc_channel_proxy.h" + +class MessageLoop; +struct DevToolsMessageData; + +namespace content { + +// DevToolsAgentFilter is registered as an IPC filter in order to be able to +// dispatch messages while on the IO thread. The reason for that is that while +// debugging, Render thread is being held by the v8 and hence no messages +// are being dispatched there. While holding the thread in a tight loop, +// v8 provides thread-safe Api for controlling debugger. In our case v8's Api +// is being used from this communication agent on the IO thread. +class DevToolsAgentFilter : public IPC::ChannelProxy::MessageFilter { + public: + // There is a single instance of this class instantiated by the RenderThread. + DevToolsAgentFilter(); + + static void SendRpcMessage(const DevToolsMessageData& data); + + // IPC::ChannelProxy::MessageFilter override. Called on IO thread. + virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; + + protected: + virtual ~DevToolsAgentFilter(); + + private: + void OnDispatchOnInspectorBackend(const std::string& message); + + bool message_handled_; + MessageLoop* render_thread_loop_; + int current_routing_id_; + + DISALLOW_COPY_AND_ASSIGN(DevToolsAgentFilter); +}; + +} // namespace content + +#endif // CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_FILTER_H_ |