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

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

Issue 5513001: Add a base class for objects that want to filter messages on the UI thread. ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Fix possible race condition Created 10 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
« ipc/ipc_channel_proxy.cc ('K') | « ipc/ipc_tests.cc ('k') | no next file » | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "ppapi/proxy/dispatcher.h" 5 #include "ppapi/proxy/dispatcher.h"
6 6
7 #include <string.h> // For memset. 7 #include <string.h> // For memset.
8 8
9 #include <map> 9 #include <map>
10 10
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 Dispatcher::~Dispatcher() { 67 Dispatcher::~Dispatcher() {
68 } 68 }
69 69
70 bool Dispatcher::InitWithChannel(MessageLoop* ipc_message_loop, 70 bool Dispatcher::InitWithChannel(MessageLoop* ipc_message_loop,
71 const std::string& channel_name, 71 const std::string& channel_name,
72 bool is_client, 72 bool is_client,
73 base::WaitableEvent* shutdown_event) { 73 base::WaitableEvent* shutdown_event) {
74 IPC::Channel::Mode mode = is_client ? IPC::Channel::MODE_CLIENT 74 IPC::Channel::Mode mode = is_client ? IPC::Channel::MODE_CLIENT
75 : IPC::Channel::MODE_SERVER; 75 : IPC::Channel::MODE_SERVER;
76 channel_.reset(new IPC::SyncChannel(channel_name, mode, this, NULL, 76 channel_.reset(new IPC::SyncChannel(channel_name, mode, this,
77 ipc_message_loop, false, shutdown_event)); 77 ipc_message_loop, false, shutdown_event));
78 return true; 78 return true;
79 } 79 }
80 80
81 void Dispatcher::OnMessageReceived(const IPC::Message& msg) { 81 void Dispatcher::OnMessageReceived(const IPC::Message& msg) {
82 // Control messages. 82 // Control messages.
83 if (msg.routing_id() == MSG_ROUTING_CONTROL) { 83 if (msg.routing_id() == MSG_ROUTING_CONTROL) {
84 IPC_BEGIN_MESSAGE_MAP(Dispatcher, msg) 84 IPC_BEGIN_MESSAGE_MAP(Dispatcher, msg)
85 IPC_MESSAGE_HANDLER(PpapiMsg_DeclareInterfaces, 85 IPC_MESSAGE_HANDLER(PpapiMsg_DeclareInterfaces,
86 OnMsgDeclareInterfaces) 86 OnMsgDeclareInterfaces)
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 return new PPB_Var_Deprecated_Proxy(this, interface_functions); 248 return new PPB_Var_Deprecated_Proxy(this, interface_functions);
249 if (interface_name == PPP_INSTANCE_INTERFACE) 249 if (interface_name == PPP_INSTANCE_INTERFACE)
250 return new PPP_Instance_Proxy(this, interface_functions); 250 return new PPP_Instance_Proxy(this, interface_functions);
251 251
252 return NULL; 252 return NULL;
253 } 253 }
254 254
255 } // namespace proxy 255 } // namespace proxy
256 } // namespace pp 256 } // namespace pp
257 257
OLDNEW
« ipc/ipc_channel_proxy.cc ('K') | « ipc/ipc_tests.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698