| 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_response_info_proxy.h" | 5 #include "ppapi/proxy/ppb_url_response_info_proxy.h" |
| 6 | 6 |
| 7 #include "ppapi/c/ppb_url_response_info.h" | 7 #include "ppapi/c/ppb_url_response_info.h" |
| 8 #include "ppapi/proxy/enter_proxy.h" | 8 #include "ppapi/proxy/enter_proxy.h" |
| 9 #include "ppapi/proxy/host_dispatcher.h" | 9 #include "ppapi/proxy/host_dispatcher.h" |
| 10 #include "ppapi/proxy/plugin_dispatcher.h" | 10 #include "ppapi/proxy/plugin_dispatcher.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 INTERFACE_ID_PPB_URL_RESPONSE_INFO, | 96 INTERFACE_ID_PPB_URL_RESPONSE_INFO, |
| 97 false, | 97 false, |
| 98 &CreateURLResponseInfoProxy, | 98 &CreateURLResponseInfoProxy, |
| 99 }; | 99 }; |
| 100 return &info; | 100 return &info; |
| 101 } | 101 } |
| 102 | 102 |
| 103 // static | 103 // static |
| 104 PP_Resource PPB_URLResponseInfo_Proxy::CreateResponseForResource( | 104 PP_Resource PPB_URLResponseInfo_Proxy::CreateResponseForResource( |
| 105 const HostResource& resource) { | 105 const HostResource& resource) { |
| 106 linked_ptr<URLResponseInfo> object(new URLResponseInfo(resource)); | 106 return PluginResourceTracker::GetInstance()->AddResource( |
| 107 return PluginResourceTracker::GetInstance()->AddResource(object); | 107 new URLResponseInfo(resource)); |
| 108 } | 108 } |
| 109 | 109 |
| 110 bool PPB_URLResponseInfo_Proxy::OnMessageReceived(const IPC::Message& msg) { | 110 bool PPB_URLResponseInfo_Proxy::OnMessageReceived(const IPC::Message& msg) { |
| 111 bool handled = true; | 111 bool handled = true; |
| 112 IPC_BEGIN_MESSAGE_MAP(PPB_URLResponseInfo_Proxy, msg) | 112 IPC_BEGIN_MESSAGE_MAP(PPB_URLResponseInfo_Proxy, msg) |
| 113 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLResponseInfo_GetProperty, | 113 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLResponseInfo_GetProperty, |
| 114 OnMsgGetProperty) | 114 OnMsgGetProperty) |
| 115 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLResponseInfo_GetBodyAsFileRef, | 115 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLResponseInfo_GetBodyAsFileRef, |
| 116 OnMsgGetBodyAsFileRef) | 116 OnMsgGetBodyAsFileRef) |
| 117 IPC_MESSAGE_UNHANDLED(handled = false) | 117 IPC_MESSAGE_UNHANDLED(handled = false) |
| (...skipping 26 matching lines...) Expand all Loading... |
| 144 // Use the FileRef proxy to serialize. | 144 // Use the FileRef proxy to serialize. |
| 145 DCHECK(!dispatcher()->IsPlugin()); | 145 DCHECK(!dispatcher()->IsPlugin()); |
| 146 HostDispatcher* host_disp = static_cast<HostDispatcher*>(dispatcher()); | 146 HostDispatcher* host_disp = static_cast<HostDispatcher*>(dispatcher()); |
| 147 PPB_FileRef_Proxy* file_ref_proxy = static_cast<PPB_FileRef_Proxy*>( | 147 PPB_FileRef_Proxy* file_ref_proxy = static_cast<PPB_FileRef_Proxy*>( |
| 148 host_disp->GetOrCreatePPBInterfaceProxy(INTERFACE_ID_PPB_FILE_REF)); | 148 host_disp->GetOrCreatePPBInterfaceProxy(INTERFACE_ID_PPB_FILE_REF)); |
| 149 file_ref_proxy->SerializeFileRef(file_ref, result); | 149 file_ref_proxy->SerializeFileRef(file_ref, result); |
| 150 } | 150 } |
| 151 | 151 |
| 152 } // namespace proxy | 152 } // namespace proxy |
| 153 } // namespace pp | 153 } // namespace pp |
| OLD | NEW |