Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(404)

Unified Diff: content/renderer/browser_plugin/browser_plugin_channel_manager.h

Issue 9968097: Browser Plugin: Renderer-side changes (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Updated to compile with clang Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/browser_plugin/browser_plugin_channel_manager.h
diff --git a/content/renderer/browser_plugin/browser_plugin_channel_manager.h b/content/renderer/browser_plugin/browser_plugin_channel_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..a3bff24781b9b7e110bd02552c0dcf1c8d40bfec
--- /dev/null
+++ b/content/renderer/browser_plugin/browser_plugin_channel_manager.h
@@ -0,0 +1,70 @@
+// 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_BROWSER_PLUGIN_BROWSER_PLUGIN_CHANNEL_MANAGER_H_
+#define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_CHANNEL_MANAGER_H_
+#pragma once
+
+#include <set>
+
+#include "base/id_map.h"
+#include "content/public/renderer/render_process_observer.h"
+#include "content/renderer/browser_plugin/guest_to_embedder_channel.h"
+#include "content/renderer/render_view_impl.h"
+
+class GuestToEmbedderChannel;
+struct ViewMsg_New_Params;
+
+namespace content {
+
+// BrowserPluginChannelManager manages the lifetime of GuestToEmbedderChannels.
+// When a new RenderView is requested, it checks the embedder channel name
+// in ViewMsg_New_Params and decides whether to reuse an existing channel or
+// create a new channel. On the guest renderer process, it informs a
+// RenderView once a channel has been established with its embedder.
+// On the embedder side, it tells BrowserPlugin to load the guest
+// PluginInstance once a channel has been established.
+class BrowserPluginChannelManager
+ : public RenderProcessObserver {
+ public:
+ BrowserPluginChannelManager();
+
+ virtual ~BrowserPluginChannelManager();
+
+ void CreateRenderView(const ViewMsg_New_Params& params);
+
+ // Get the GuestToEmbedderChannel associated with the given
+ // embedder_channel_name.
+ GuestToEmbedderChannel* GetChannelByName(
+ const std::string& embedder_channel_name);
+
+ // Remove the pointer to the GuestToEmbedderChannel associated with the given
+ // routing_id.
+ void RemoveChannelByName(const std::string& embedder_channel_name);
+
+ private:
+ typedef std::map<std::string, scoped_refptr<GuestToEmbedderChannel> >
+ EmbedderChannelNameToChannelMap;
+
+ void OnCompleteNavigation(int guest_routing_id,
+ PP_Instance instance);
+
+ void OnLoadGuest(int instance_id,
+ int guest_renderer_id,
+ const IPC::ChannelHandle& channel_handle);
+
+ // RenderProcessObserver override. Call on render thread.
+ virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE;
+
+ // Map from Host process ID to GuestToEmbedderChannel
+ EmbedderChannelNameToChannelMap embedder_channels_;
+
+ std::map<int, base::WeakPtr<RenderViewImpl> > pending_navigations_;
Charlie Reis 2012/05/17 20:36:47 Please comment what this is used for.
Fady Samuel 2012/05/17 22:18:03 Done. Renamed to pending_guests_ too because pendi
+
+ DISALLOW_COPY_AND_ASSIGN(BrowserPluginChannelManager);
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_CHANNEL_MANAGER_H_

Powered by Google App Engine
This is Rietveld 408576698