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

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

Issue 6286070: Remove all uses of the global Dispatcher Get function. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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
« no previous file with comments | « ppapi/proxy/ppb_url_request_info_proxy.h ('k') | ppapi/proxy/ppb_url_response_info_proxy.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_url_request_info_proxy.h" 5 #include "ppapi/proxy/ppb_url_request_info_proxy.h"
6 6
7 #include "ppapi/c/ppb_url_request_info.h" 7 #include "ppapi/c/ppb_url_request_info.h"
8 #include "ppapi/proxy/plugin_dispatcher.h" 8 #include "ppapi/proxy/plugin_dispatcher.h"
9 #include "ppapi/proxy/plugin_resource.h" 9 #include "ppapi/proxy/plugin_resource.h"
10 #include "ppapi/proxy/ppapi_messages.h" 10 #include "ppapi/proxy/ppapi_messages.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 dispatcher->Send(new PpapiHostMsg_PPBURLRequestInfo_AppendFileToBody( 111 dispatcher->Send(new PpapiHostMsg_PPBURLRequestInfo_AppendFileToBody(
112 INTERFACE_ID_PPB_URL_REQUEST_INFO, request_info->host_resource(), 112 INTERFACE_ID_PPB_URL_REQUEST_INFO, request_info->host_resource(),
113 file_ref_object->host_resource(), 113 file_ref_object->host_resource(),
114 start_offset, number_of_bytes, expected_last_modified_time)); 114 start_offset, number_of_bytes, expected_last_modified_time));
115 115
116 // TODO(brettw) do some validation. We should be able to tell on the plugin 116 // TODO(brettw) do some validation. We should be able to tell on the plugin
117 // side whether the request will succeed or fail in the renderer. 117 // side whether the request will succeed or fail in the renderer.
118 return PP_TRUE; 118 return PP_TRUE;
119 } 119 }
120 120
121 const PPB_URLRequestInfo ppb_urlrequestinfo = { 121 const PPB_URLRequestInfo urlrequestinfo_interface = {
122 &Create, 122 &Create,
123 &IsURLRequestInfo, 123 &IsURLRequestInfo,
124 &SetProperty, 124 &SetProperty,
125 &AppendDataToBody, 125 &AppendDataToBody,
126 &AppendFileToBody 126 &AppendFileToBody
127 }; 127 };
128 128
129 InterfaceProxy* CreateURLRequestInfoProxy(Dispatcher* dispatcher,
130 const void* target_interface) {
131 return new PPB_URLRequestInfo_Proxy(dispatcher, target_interface);
132 }
133
129 } // namespace 134 } // namespace
130 135
131 PPB_URLRequestInfo_Proxy::PPB_URLRequestInfo_Proxy( 136 PPB_URLRequestInfo_Proxy::PPB_URLRequestInfo_Proxy(
132 Dispatcher* dispatcher, 137 Dispatcher* dispatcher,
133 const void* target_interface) 138 const void* target_interface)
134 : InterfaceProxy(dispatcher, target_interface) { 139 : InterfaceProxy(dispatcher, target_interface) {
135 } 140 }
136 141
137 PPB_URLRequestInfo_Proxy::~PPB_URLRequestInfo_Proxy() { 142 PPB_URLRequestInfo_Proxy::~PPB_URLRequestInfo_Proxy() {
138 } 143 }
139 144
140 const void* PPB_URLRequestInfo_Proxy::GetSourceInterface() const { 145 // static
141 return &ppb_urlrequestinfo; 146 const InterfaceProxy::Info* PPB_URLRequestInfo_Proxy::GetInfo() {
142 } 147 static const Info info = {
143 148 &urlrequestinfo_interface,
144 InterfaceID PPB_URLRequestInfo_Proxy::GetInterfaceId() const { 149 PPB_URLREQUESTINFO_INTERFACE,
145 return INTERFACE_ID_PPB_URL_REQUEST_INFO; 150 INTERFACE_ID_PPB_URL_REQUEST_INFO,
151 false,
152 &CreateURLRequestInfoProxy,
153 };
154 return &info;
146 } 155 }
147 156
148 bool PPB_URLRequestInfo_Proxy::OnMessageReceived(const IPC::Message& msg) { 157 bool PPB_URLRequestInfo_Proxy::OnMessageReceived(const IPC::Message& msg) {
149 bool handled = true; 158 bool handled = true;
150 IPC_BEGIN_MESSAGE_MAP(PPB_URLRequestInfo_Proxy, msg) 159 IPC_BEGIN_MESSAGE_MAP(PPB_URLRequestInfo_Proxy, msg)
151 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLRequestInfo_Create, OnMsgCreate) 160 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLRequestInfo_Create, OnMsgCreate)
152 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLRequestInfo_SetProperty, 161 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLRequestInfo_SetProperty,
153 OnMsgSetProperty) 162 OnMsgSetProperty)
154 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLRequestInfo_AppendDataToBody, 163 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLRequestInfo_AppendDataToBody,
155 OnMsgAppendDataToBody) 164 OnMsgAppendDataToBody)
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 int64_t start_offset, 199 int64_t start_offset,
191 int64_t number_of_bytes, 200 int64_t number_of_bytes,
192 double expected_last_modified_time) { 201 double expected_last_modified_time) {
193 ppb_url_request_info_target()->AppendFileToBody( 202 ppb_url_request_info_target()->AppendFileToBody(
194 request.host_resource(), file_ref.host_resource(), 203 request.host_resource(), file_ref.host_resource(),
195 start_offset, number_of_bytes, expected_last_modified_time); 204 start_offset, number_of_bytes, expected_last_modified_time);
196 } 205 }
197 206
198 } // namespace proxy 207 } // namespace proxy
199 } // namespace pp 208 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_url_request_info_proxy.h ('k') | ppapi/proxy/ppb_url_response_info_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698