| OLD | NEW |
| 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/enter_proxy.h" | 8 #include "ppapi/proxy/enter_proxy.h" |
| 9 #include "ppapi/proxy/plugin_dispatcher.h" | 9 #include "ppapi/proxy/plugin_dispatcher.h" |
| 10 #include "ppapi/proxy/plugin_resource.h" | 10 #include "ppapi/proxy/plugin_resource.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); | 132 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); |
| 133 if (!dispatcher) | 133 if (!dispatcher) |
| 134 return 0; | 134 return 0; |
| 135 | 135 |
| 136 HostResource result; | 136 HostResource result; |
| 137 dispatcher->Send(new PpapiHostMsg_PPBURLRequestInfo_Create( | 137 dispatcher->Send(new PpapiHostMsg_PPBURLRequestInfo_Create( |
| 138 INTERFACE_ID_PPB_URL_REQUEST_INFO, instance, &result)); | 138 INTERFACE_ID_PPB_URL_REQUEST_INFO, instance, &result)); |
| 139 if (result.is_null()) | 139 if (result.is_null()) |
| 140 return 0; | 140 return 0; |
| 141 | 141 |
| 142 linked_ptr<URLRequestInfo> object(new URLRequestInfo(result)); | 142 return PluginResourceTracker::GetInstance()->AddResource( |
| 143 return PluginResourceTracker::GetInstance()->AddResource(object); | 143 new URLRequestInfo(result)); |
| 144 } | 144 } |
| 145 | 145 |
| 146 bool PPB_URLRequestInfo_Proxy::OnMessageReceived(const IPC::Message& msg) { | 146 bool PPB_URLRequestInfo_Proxy::OnMessageReceived(const IPC::Message& msg) { |
| 147 bool handled = true; | 147 bool handled = true; |
| 148 IPC_BEGIN_MESSAGE_MAP(PPB_URLRequestInfo_Proxy, msg) | 148 IPC_BEGIN_MESSAGE_MAP(PPB_URLRequestInfo_Proxy, msg) |
| 149 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLRequestInfo_Create, OnMsgCreate) | 149 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLRequestInfo_Create, OnMsgCreate) |
| 150 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLRequestInfo_SetProperty, | 150 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLRequestInfo_SetProperty, |
| 151 OnMsgSetProperty) | 151 OnMsgSetProperty) |
| 152 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLRequestInfo_AppendDataToBody, | 152 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLRequestInfo_AppendDataToBody, |
| 153 OnMsgAppendDataToBody) | 153 OnMsgAppendDataToBody) |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 EnterHostFromHostResource<PPB_URLRequestInfo_API> enter(request); | 197 EnterHostFromHostResource<PPB_URLRequestInfo_API> enter(request); |
| 198 if (enter.succeeded()) { | 198 if (enter.succeeded()) { |
| 199 enter.object()->AppendFileToBody( | 199 enter.object()->AppendFileToBody( |
| 200 file_ref.host_resource(), start_offset, number_of_bytes, | 200 file_ref.host_resource(), start_offset, number_of_bytes, |
| 201 expected_last_modified_time); | 201 expected_last_modified_time); |
| 202 } | 202 } |
| 203 } | 203 } |
| 204 | 204 |
| 205 } // namespace proxy | 205 } // namespace proxy |
| 206 } // namespace pp | 206 } // namespace pp |
| OLD | NEW |