Chromium Code Reviews| Index: content/browser/browser_plugin/renderer_host/browser_plugin_message_filter.h |
| diff --git a/content/browser/browser_plugin/renderer_host/browser_plugin_message_filter.h b/content/browser/browser_plugin/renderer_host/browser_plugin_message_filter.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e53136d73e8debe597a1d4bc28eb896f087e3da1 |
| --- /dev/null |
| +++ b/content/browser/browser_plugin/renderer_host/browser_plugin_message_filter.h |
| @@ -0,0 +1,74 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
|
jam
2012/03/30 05:44:11
nit: no renderer_host subdirectory
Fady Samuel
2012/04/03 17:01:45
File Deleted.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_BROWSER_BROWSER_PLUGIN_RENDERER_HOST_BROWSER_PLUGIN_MESSAGE_FILTER_H_ |
| +#define CONTENT_BROWSER_BROWSER_PLUGIN_RENDERER_HOST_BROWSER_PLUGIN_MESSAGE_FILTER_H_ |
| +#pragma once |
| + |
| +#include "base/hash_tables.h" |
| +#include "content/public/browser/browser_message_filter.h" |
| +#include "ui/gfx/size.h" |
| + |
| +namespace base { |
| +class WaitableEvent; |
| +} |
| + |
| +namespace content { |
| +class WebContents; |
| +} |
| + |
| +class BrowserPluginWebContentsObserver; |
| +class GuestRenderViewHostObserver; |
| + |
| +struct hash_web_contents { |
|
jam
2012/03/30 05:44:11
nit: this doesn't follow our convention for struct
Fady Samuel
2012/04/03 17:01:45
Deleted..
|
| + std::size_t operator()(content::WebContents* ptr) const { |
| + return reinterpret_cast<size_t>(ptr); |
| + } |
| +}; |
| + |
| +// This class filters out incoming IPC messages for the browser plugin on the |
|
jam
2012/03/30 05:44:11
nit: for new classes in content, put them in the c
|
| +// browser process. |
| + class BrowserPluginMessageFilter : public content::BrowserMessageFilter { |
|
jam
2012/03/30 05:44:11
nit: no tabbing
|
| + public: |
| + // Create the filter. |
|
jam
2012/03/30 05:44:11
nit: this comment is unnecessary (see style guide
Fady Samuel
2012/04/03 17:01:45
Done.
|
| + BrowserPluginMessageFilter(int render_process_id); |
| + |
| + // content::BrowserMessageFilter methods: |
| + virtual bool OnMessageReceived(const IPC::Message& message, |
| + bool* message_was_ok) OVERRIDE; |
| + |
| + int render_process_id() const { return render_process_id_; } |
| + |
| + private: |
| + virtual ~BrowserPluginMessageFilter(); |
| + // Handler for ViewHostMsg_OpenChannelToBrowserPlugin |
|
jam
2012/03/30 05:44:11
nit: we don't document the message handlers in hea
|
| + // host_id is the routing id of the host RenderView. |
| + // instance_id is a unique identifier for the particular |
| + // box hosting the browser plugin that's about to be instantiated. |
| + // This identifier is generated in BrowserPluginPlaceholder. |
| + // src is the URL to navigate to on initial navigation. |
| + void OnOpenChannelToBrowserPlugin(int32 host_id, |
| + int32 instance_id, |
| + long long frame_id, |
| + const std::string& src, |
| + const gfx::Size& size); |
| + // SiteInstance and WebContents need to run on the UI thread. |
| + // OnOpenChannelToBrowserPlugin PostTasks what it needs to do |
| + // on the UI thread, calling this method. |
| + void InitBrowserPluginOnUIThread( |
| + int32 routing_id, |
| + int32 instance_id, |
| + long long frame_id, |
| + const std::string& src, |
| + const gfx::Size& size); |
| + |
| + int render_process_id_; |
| + base::hash_map<content::WebContents*, |
| + BrowserPluginWebContentsObserver*, |
| + hash_web_contents> hosts_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(BrowserPluginMessageFilter); |
| +}; |
| + |
| +#endif // CONTENT_BROWSER_BROWSER_PLUGIN_RENDERER_HOST_BROWSER_PLUGIN_MESSAGE_FILTER_H_ |