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

Side by Side Diff: ppapi/proxy/ppb_host_resolver_private_proxy.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 "ppapi/proxy/ppb_host_resolver_private_proxy.h" 5 #include "ppapi/proxy/ppb_host_resolver_private_proxy.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 #include <map> 8 #include <map>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "ppapi/proxy/plugin_dispatcher.h" 11 #include "ppapi/proxy/plugin_dispatcher.h"
12 #include "ppapi/proxy/plugin_globals.h" 12 #include "ppapi/proxy/plugin_globals.h"
13 #include "ppapi/proxy/plugin_proxy_delegate.h"
14 #include "ppapi/proxy/ppapi_messages.h" 13 #include "ppapi/proxy/ppapi_messages.h"
15 #include "ppapi/shared_impl/host_resource.h" 14 #include "ppapi/shared_impl/host_resource.h"
16 15
17 namespace ppapi { 16 namespace ppapi {
18 namespace proxy { 17 namespace proxy {
19 18
20 namespace { 19 namespace {
21 20
22 typedef std::map<uint32, PPB_HostResolver_Shared*> IDToHostResolverMap; 21 typedef std::map<uint32, PPB_HostResolver_Shared*> IDToHostResolverMap;
23 IDToHostResolverMap* g_id_to_host_resolver = NULL; 22 IDToHostResolverMap* g_id_to_host_resolver = NULL;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 const PP_HostResolver_Private_Hint* hint) { 57 const PP_HostResolver_Private_Hint* hint) {
59 SendToBrowser(new PpapiHostMsg_PPBHostResolver_Resolve( 58 SendToBrowser(new PpapiHostMsg_PPBHostResolver_Resolve(
60 API_ID_PPB_HOSTRESOLVER_PRIVATE, 59 API_ID_PPB_HOSTRESOLVER_PRIVATE,
61 plugin_dispatcher_id_, 60 plugin_dispatcher_id_,
62 host_resolver_id_, 61 host_resolver_id_,
63 host_port, 62 host_port,
64 *hint)); 63 *hint));
65 } 64 }
66 65
67 void HostResolver::SendToBrowser(IPC::Message* msg) { 66 void HostResolver::SendToBrowser(IPC::Message* msg) {
68 PluginGlobals::Get()->plugin_proxy_delegate()->SendToBrowser(msg); 67 PluginGlobals::Get()->GetBrowserSender()->Send(msg);
69 } 68 }
70 69
71 } // namespace 70 } // namespace
72 71
73 //------------------------------------------------------------------------------ 72 //------------------------------------------------------------------------------
74 73
75 PPB_HostResolver_Private_Proxy::PPB_HostResolver_Private_Proxy( 74 PPB_HostResolver_Private_Proxy::PPB_HostResolver_Private_Proxy(
76 Dispatcher* dispatcher) : InterfaceProxy(dispatcher) { 75 Dispatcher* dispatcher) : InterfaceProxy(dispatcher) {
77 } 76 }
78 77
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 } 113 }
115 IDToHostResolverMap::iterator it = 114 IDToHostResolverMap::iterator it =
116 g_id_to_host_resolver->find(host_resolver_id); 115 g_id_to_host_resolver->find(host_resolver_id);
117 if (it == g_id_to_host_resolver->end()) 116 if (it == g_id_to_host_resolver->end())
118 return; 117 return;
119 it->second->OnResolveCompleted(succeeded, canonical_name, net_address_list); 118 it->second->OnResolveCompleted(succeeded, canonical_name, net_address_list);
120 } 119 }
121 120
122 } // namespace proxy 121 } // namespace proxy
123 } // namespace ppapi 122 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698