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

Side by Side Diff: ppapi/proxy/plugin_main_nacl.cc

Issue 11299147: Pepper proxy: make the browser sender handle the proxy lock properly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 #include <map> 5 #include <map>
6 #include <set> 6 #include <set>
7 7
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 // Need to include this before most other files because it defines 9 // Need to include this before most other files because it defines
10 // IPC_MESSAGE_LOG_ENABLED. We need to use it to define 10 // IPC_MESSAGE_LOG_ENABLED. We need to use it to define
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 virtual base::WaitableEvent* GetShutdownEvent() OVERRIDE; 65 virtual base::WaitableEvent* GetShutdownEvent() OVERRIDE;
66 virtual IPC::PlatformFileForTransit ShareHandleWithRemote( 66 virtual IPC::PlatformFileForTransit ShareHandleWithRemote(
67 base::PlatformFile handle, 67 base::PlatformFile handle,
68 const IPC::SyncChannel& channel, 68 const IPC::SyncChannel& channel,
69 bool should_close_source) OVERRIDE; 69 bool should_close_source) OVERRIDE;
70 virtual std::set<PP_Instance>* GetGloballySeenInstanceIDSet() OVERRIDE; 70 virtual std::set<PP_Instance>* GetGloballySeenInstanceIDSet() OVERRIDE;
71 virtual uint32 Register(PluginDispatcher* plugin_dispatcher) OVERRIDE; 71 virtual uint32 Register(PluginDispatcher* plugin_dispatcher) OVERRIDE;
72 virtual void Unregister(uint32 plugin_dispatcher_id) OVERRIDE; 72 virtual void Unregister(uint32 plugin_dispatcher_id) OVERRIDE;
73 73
74 // PluginProxyDelegate implementation. 74 // PluginProxyDelegate implementation.
75 virtual bool SendToBrowser(IPC::Message* msg) OVERRIDE;
76 virtual IPC::Sender* GetBrowserSender() OVERRIDE; 75 virtual IPC::Sender* GetBrowserSender() OVERRIDE;
77 virtual std::string GetUILanguage() OVERRIDE; 76 virtual std::string GetUILanguage() OVERRIDE;
78 virtual void PreCacheFont(const void* logfontw) OVERRIDE; 77 virtual void PreCacheFont(const void* logfontw) OVERRIDE;
79 virtual void SetActiveURL(const std::string& url) OVERRIDE; 78 virtual void SetActiveURL(const std::string& url) OVERRIDE;
80 79
81 // IPC::Listener implementation. 80 // IPC::Listener implementation.
82 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 81 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
83 82
84 private: 83 private:
85 void OnMsgCreateNaClChannel(int renderer_id, 84 void OnMsgCreateNaClChannel(int renderer_id,
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 } while (id == 0 || 136 } while (id == 0 ||
138 plugin_dispatchers_.find(id) != plugin_dispatchers_.end()); 137 plugin_dispatchers_.find(id) != plugin_dispatchers_.end());
139 plugin_dispatchers_[id] = plugin_dispatcher; 138 plugin_dispatchers_[id] = plugin_dispatcher;
140 return id; 139 return id;
141 } 140 }
142 141
143 void PpapiDispatcher::Unregister(uint32 plugin_dispatcher_id) { 142 void PpapiDispatcher::Unregister(uint32 plugin_dispatcher_id) {
144 plugin_dispatchers_.erase(plugin_dispatcher_id); 143 plugin_dispatchers_.erase(plugin_dispatcher_id);
145 } 144 }
146 145
147 bool PpapiDispatcher::SendToBrowser(IPC::Message* msg) {
148 return Send(msg);
149 }
150
151 IPC::Sender* PpapiDispatcher::GetBrowserSender() { 146 IPC::Sender* PpapiDispatcher::GetBrowserSender() {
152 return this; 147 return this;
153 } 148 }
154 149
155 std::string PpapiDispatcher::GetUILanguage() { 150 std::string PpapiDispatcher::GetUILanguage() {
156 NOTIMPLEMENTED(); 151 NOTIMPLEMENTED();
157 return std::string(); 152 return std::string();
158 } 153 }
159 154
160 void PpapiDispatcher::PreCacheFont(const void* logfontw) { 155 void PpapiDispatcher::PreCacheFont(const void* logfontw) {
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 256
262 PpapiDispatcher ppapi_dispatcher(io_thread.message_loop_proxy()); 257 PpapiDispatcher ppapi_dispatcher(io_thread.message_loop_proxy());
263 plugin_globals.set_plugin_proxy_delegate(&ppapi_dispatcher); 258 plugin_globals.set_plugin_proxy_delegate(&ppapi_dispatcher);
264 259
265 loop.Run(); 260 loop.Run();
266 261
267 NaClSrpcModuleFini(); 262 NaClSrpcModuleFini();
268 263
269 return 0; 264 return 0;
270 } 265 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698