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

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

Issue 7608030: Convert the PluginResource to be refcounted. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 4 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
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_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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698