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

Side by Side Diff: content/renderer/browser_plugin/browser_plugin_channel_manager.h

Issue 10412056: Browser Plugin: Remove MapInstance from BrowserPluginHost + More cross-process navigation work (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Simplified size logic 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_CHANNEL_MANAGER_H_ 5 #ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_CHANNEL_MANAGER_H_
6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_CHANNEL_MANAGER_H_ 6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_CHANNEL_MANAGER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <set> 9 #include <set>
10 10
(...skipping 16 matching lines...) Expand all
27 // PluginInstance once a channel has been established. 27 // PluginInstance once a channel has been established.
28 class BrowserPluginChannelManager 28 class BrowserPluginChannelManager
29 : public RenderProcessObserver { 29 : public RenderProcessObserver {
30 public: 30 public:
31 BrowserPluginChannelManager(); 31 BrowserPluginChannelManager();
32 32
33 virtual ~BrowserPluginChannelManager(); 33 virtual ~BrowserPluginChannelManager();
34 34
35 void CreateRenderView(const ViewMsg_New_Params& params); 35 void CreateRenderView(const ViewMsg_New_Params& params);
36 36
37 void ReportChannelToEmbedder(
38 RenderViewImpl* render_view,
39 const IPC::ChannelHandle& embedder_channel_handle,
40 const std::string& embedder_channel_name,
41 int embedder_container_id);
42
37 // Get the GuestToEmbedderChannel associated with the given 43 // Get the GuestToEmbedderChannel associated with the given
38 // embedder_channel_name. 44 // embedder_channel_name.
39 GuestToEmbedderChannel* GetChannelByName( 45 GuestToEmbedderChannel* GetChannelByName(
40 const std::string& embedder_channel_name); 46 const std::string& embedder_channel_name);
41 47
42 // Remove the pointer to the GuestToEmbedderChannel associated with the given 48 // Remove the pointer to the GuestToEmbedderChannel associated with the given
43 // routing_id. 49 // routing_id.
44 void RemoveChannelByName(const std::string& embedder_channel_name); 50 void RemoveChannelByName(const std::string& embedder_channel_name);
45 51
52 void GuestReady(PP_Instance instance,
53 const std::string& embedder_channel_name,
54 int embedder_container_id);
55
46 private: 56 private:
47 typedef std::map<std::string, scoped_refptr<GuestToEmbedderChannel> > 57 typedef std::map<std::string, scoped_refptr<GuestToEmbedderChannel> >
48 EmbedderChannelNameToChannelMap; 58 EmbedderChannelNameToChannelMap;
49 59
50 void OnCompleteNavigation(int guest_routing_id,
51 PP_Instance instance);
52
53 void OnLoadGuest(int instance_id, 60 void OnLoadGuest(int instance_id,
54 int guest_renderer_id, 61 int guest_renderer_id,
55 const IPC::ChannelHandle& channel_handle); 62 const IPC::ChannelHandle& channel_handle);
56 63
57 // RenderProcessObserver override. Call on render thread. 64 // RenderProcessObserver override. Call on render thread.
58 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; 65 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE;
59 66
60 // Map from Host process ID to GuestToEmbedderChannel 67 // Map from Host process ID to GuestToEmbedderChannel
61 EmbedderChannelNameToChannelMap embedder_channels_; 68 EmbedderChannelNameToChannelMap embedder_channels_;
62 69
63 // Map from Routing ID to RenderViewImpl that points to RenderViewImpl 70 // Map from <embedder_channel_name, embedder_container_id> to RenderViewImpl
64 // guests that have been constructed but don't have a PP_Instance and 71 // that points to RenderViewImpl guests that have been constructed but don't
65 // so they aren't yet ready to composite. 72 // have a PP_Instance and so they aren't yet ready to composite.
66 std::map<int, base::WeakPtr<RenderViewImpl> > pending_guests_; 73 std::map<std::pair<std::string, int>,
74 base::WeakPtr<RenderViewImpl> > pending_guests_;
67 75
68 DISALLOW_COPY_AND_ASSIGN(BrowserPluginChannelManager); 76 DISALLOW_COPY_AND_ASSIGN(BrowserPluginChannelManager);
69 }; 77 };
70 78
71 } // namespace content 79 } // namespace content
72 80
73 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_CHANNEL_MANAGER_H_ 81 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_CHANNEL_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698