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

Side by Side Diff: chrome/browser/plugin_process_host.h

Issue 149062: mac/linux: rework plugin channel file descriptor creation (Closed)
Patch Set: address review comments Created 11 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/plugin_process_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 CHROME_BROWSER_PLUGIN_PROCESS_HOST_H_ 5 #ifndef CHROME_BROWSER_PLUGIN_PROCESS_HOST_H_
6 #define CHROME_BROWSER_PLUGIN_PROCESS_HOST_H_ 6 #define CHROME_BROWSER_PLUGIN_PROCESS_HOST_H_
7 7
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 9
10 #include <set> 10 #include <set>
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 virtual URLRequestContext* GetRequestContext( 90 virtual URLRequestContext* GetRequestContext(
91 uint32 request_id, 91 uint32 request_id,
92 const ViewHostMsg_Resource_Request& request_data); 92 const ViewHostMsg_Resource_Request& request_data);
93 93
94 // Sends a message to the plugin process to request creation of a new channel 94 // Sends a message to the plugin process to request creation of a new channel
95 // for the given mime type. 95 // for the given mime type.
96 void RequestPluginChannel(ResourceMessageFilter* renderer_message_filter, 96 void RequestPluginChannel(ResourceMessageFilter* renderer_message_filter,
97 const std::string& mime_type, 97 const std::string& mime_type,
98 IPC::Message* reply_msg); 98 IPC::Message* reply_msg);
99 // Message handlers. 99 // Message handlers.
100 void OnChannelCreated(const std::string& channel_name); 100 void OnChannelCreated(const IPC::ChannelHandle& channel_handle);
101 void OnGetPluginFinderUrl(std::string* plugin_finder_url); 101 void OnGetPluginFinderUrl(std::string* plugin_finder_url);
102 void OnGetCookies(uint32 request_context, const GURL& url, 102 void OnGetCookies(uint32 request_context, const GURL& url,
103 std::string* cookies); 103 std::string* cookies);
104 void OnResolveProxy(const GURL& url, IPC::Message* reply_msg); 104 void OnResolveProxy(const GURL& url, IPC::Message* reply_msg);
105 void OnPluginMessage(const std::vector<uint8>& data); 105 void OnPluginMessage(const std::vector<uint8>& data);
106 106
107 #if defined(OS_WIN) 107 #if defined(OS_WIN)
108 void OnPluginWindowDestroyed(HWND window, HWND parent); 108 void OnPluginWindowDestroyed(HWND window, HWND parent);
109 void OnDownloadUrl(const std::string& url, int source_pid, 109 void OnDownloadUrl(const std::string& url, int source_pid,
110 gfx::NativeWindow caller_window); 110 gfx::NativeWindow caller_window);
111 #endif 111 #endif
112 112
113 virtual bool CanShutdown() { return sent_requests_.empty(); } 113 virtual bool CanShutdown() { return sent_requests_.empty(); }
114 114
115 struct ChannelRequest { 115 struct ChannelRequest {
116 ChannelRequest(ResourceMessageFilter* renderer_message_filter, 116 ChannelRequest(ResourceMessageFilter* renderer_message_filter,
117 const std::string& m, IPC::Message* r, 117 const std::string& m, IPC::Message* r) :
118 int s) :
119 mime_type(m), reply_msg(r), 118 mime_type(m), reply_msg(r),
120 renderer_message_filter_(renderer_message_filter), 119 renderer_message_filter_(renderer_message_filter) { }
121 socket(s) { }
122 std::string mime_type; 120 std::string mime_type;
123 IPC::Message* reply_msg; 121 IPC::Message* reply_msg;
124 scoped_refptr<ResourceMessageFilter> renderer_message_filter_; 122 scoped_refptr<ResourceMessageFilter> renderer_message_filter_;
125 int socket;
126 }; 123 };
127 124
128 // These are channel requests that we are waiting to send to the 125 // These are channel requests that we are waiting to send to the
129 // plugin process once the channel is opened. 126 // plugin process once the channel is opened.
130 std::vector<ChannelRequest> pending_requests_; 127 std::vector<ChannelRequest> pending_requests_;
131 128
132 // These are the channel requests that we have already sent to 129 // These are the channel requests that we have already sent to
133 // the plugin process, but haven't heard back about yet. 130 // the plugin process, but haven't heard back about yet.
134 std::queue<ChannelRequest> sent_requests_; 131 std::queue<ChannelRequest> sent_requests_;
135 132
136 // Information about the plugin. 133 // Information about the plugin.
137 WebPluginInfo info_; 134 WebPluginInfo info_;
138 135
139 // Helper class for handling PluginProcessHost_ResolveProxy messages (manages 136 // Helper class for handling PluginProcessHost_ResolveProxy messages (manages
140 // the requests to the proxy service). 137 // the requests to the proxy service).
141 ResolveProxyMsgHelper resolve_proxy_msg_helper_; 138 ResolveProxyMsgHelper resolve_proxy_msg_helper_;
142 139
143 #if defined(OS_WIN) 140 #if defined(OS_WIN)
144 // Tracks plugin parent windows created on the UI thread. 141 // Tracks plugin parent windows created on the UI thread.
145 std::set<HWND> plugin_parent_windows_set_; 142 std::set<HWND> plugin_parent_windows_set_;
146 #endif 143 #endif
147 144
148 DISALLOW_EVIL_CONSTRUCTORS(PluginProcessHost); 145 DISALLOW_EVIL_CONSTRUCTORS(PluginProcessHost);
149 }; 146 };
150 147
151 #endif // CHROME_BROWSER_PLUGIN_PROCESS_HOST_H_ 148 #endif // CHROME_BROWSER_PLUGIN_PROCESS_HOST_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/plugin_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698