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

Side by Side Diff: ppapi/proxy/ppb_url_loader_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_loader_proxy.h" 5 #include "ppapi/proxy/ppb_url_loader_proxy.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <deque> 8 #include <deque>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), 350 callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
351 host_urlloader_trusted_interface_(NULL) { 351 host_urlloader_trusted_interface_(NULL) {
352 } 352 }
353 353
354 PPB_URLLoader_Proxy::~PPB_URLLoader_Proxy() { 354 PPB_URLLoader_Proxy::~PPB_URLLoader_Proxy() {
355 } 355 }
356 356
357 // static 357 // static
358 PP_Resource PPB_URLLoader_Proxy::TrackPluginResource( 358 PP_Resource PPB_URLLoader_Proxy::TrackPluginResource(
359 const HostResource& url_loader_resource) { 359 const HostResource& url_loader_resource) {
360 linked_ptr<URLLoader> object(new URLLoader(url_loader_resource)); 360 return PluginResourceTracker::GetInstance()->AddResource(
361 return PluginResourceTracker::GetInstance()->AddResource(object); 361 new URLLoader(url_loader_resource));
362 } 362 }
363 363
364 // static 364 // static
365 const InterfaceProxy::Info* PPB_URLLoader_Proxy::GetInfo() { 365 const InterfaceProxy::Info* PPB_URLLoader_Proxy::GetInfo() {
366 static const Info info = { 366 static const Info info = {
367 ::ppapi::thunk::GetPPB_URLLoader_Thunk(), 367 ::ppapi::thunk::GetPPB_URLLoader_Thunk(),
368 PPB_URLLOADER_INTERFACE, 368 PPB_URLLOADER_INTERFACE,
369 INTERFACE_ID_PPB_URL_LOADER, 369 INTERFACE_ID_PPB_URL_LOADER,
370 false, 370 false,
371 &CreateURLLoaderProxy, 371 &CreateURLLoaderProxy,
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 info->read_buffer.resize(bytes_read); 577 info->read_buffer.resize(bytes_read);
578 578
579 dispatcher()->Send(new PpapiMsg_PPBURLLoader_ReadResponseBody_Ack( 579 dispatcher()->Send(new PpapiMsg_PPBURLLoader_ReadResponseBody_Ack(
580 INTERFACE_ID_PPB_URL_LOADER, info->resource, result, info->read_buffer)); 580 INTERFACE_ID_PPB_URL_LOADER, info->resource, result, info->read_buffer));
581 581
582 delete info; 582 delete info;
583 } 583 }
584 584
585 } // namespace proxy 585 } // namespace proxy
586 } // namespace pp 586 } // namespace pp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698