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

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

Issue 7655002: Convert the pp::proxy namespace to the ppapi::proxy namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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 13 matching lines...) Expand all
24 #include "ppapi/proxy/ppb_url_response_info_proxy.h" 24 #include "ppapi/proxy/ppb_url_response_info_proxy.h"
25 #include "ppapi/thunk/enter.h" 25 #include "ppapi/thunk/enter.h"
26 #include "ppapi/thunk/ppb_url_loader_api.h" 26 #include "ppapi/thunk/ppb_url_loader_api.h"
27 #include "ppapi/thunk/resource_creation_api.h" 27 #include "ppapi/thunk/resource_creation_api.h"
28 #include "ppapi/thunk/thunk.h" 28 #include "ppapi/thunk/thunk.h"
29 29
30 #if defined(OS_LINUX) 30 #if defined(OS_LINUX)
31 #include <sys/shm.h> 31 #include <sys/shm.h>
32 #endif 32 #endif
33 33
34 using ppapi::HostResource;
35 using ppapi::Resource;
36 using ppapi::thunk::EnterFunctionNoLock; 34 using ppapi::thunk::EnterFunctionNoLock;
37 using ppapi::thunk::EnterResourceNoLock; 35 using ppapi::thunk::EnterResourceNoLock;
38 using ppapi::thunk::PPB_URLLoader_API; 36 using ppapi::thunk::PPB_URLLoader_API;
39 using ppapi::thunk::ResourceCreationAPI; 37 using ppapi::thunk::ResourceCreationAPI;
40 38
41 namespace pp { 39 namespace ppapi {
42 namespace proxy { 40 namespace proxy {
43 41
44 namespace { 42 namespace {
45 43
46 // The maximum size we'll read into the plugin without being explicitly 44 // The maximum size we'll read into the plugin without being explicitly
47 // asked for a larger buffer. 45 // asked for a larger buffer.
48 const int32_t kMaxReadBufferSize = 16777216; // 16MB 46 const int32_t kMaxReadBufferSize = 16777216; // 16MB
49 47
50 // Called in the renderer when the byte counts have changed. We send a message 48 // Called in the renderer when the byte counts have changed. We send a message
51 // to the plugin to synchronize its counts so it can respond to status polls 49 // to the plugin to synchronize its counts so it can respond to status polls
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 359
362 // static 360 // static
363 PP_Resource PPB_URLLoader_Proxy::TrackPluginResource( 361 PP_Resource PPB_URLLoader_Proxy::TrackPluginResource(
364 const HostResource& url_loader_resource) { 362 const HostResource& url_loader_resource) {
365 return (new URLLoader(url_loader_resource))->GetReference(); 363 return (new URLLoader(url_loader_resource))->GetReference();
366 } 364 }
367 365
368 // static 366 // static
369 const InterfaceProxy::Info* PPB_URLLoader_Proxy::GetInfo() { 367 const InterfaceProxy::Info* PPB_URLLoader_Proxy::GetInfo() {
370 static const Info info = { 368 static const Info info = {
371 ::ppapi::thunk::GetPPB_URLLoader_Thunk(), 369 thunk::GetPPB_URLLoader_Thunk(),
372 PPB_URLLOADER_INTERFACE, 370 PPB_URLLOADER_INTERFACE,
373 INTERFACE_ID_PPB_URL_LOADER, 371 INTERFACE_ID_PPB_URL_LOADER,
374 false, 372 false,
375 &CreateURLLoaderProxy, 373 &CreateURLLoaderProxy,
376 }; 374 };
377 return &info; 375 return &info;
378 } 376 }
379 377
380 // static 378 // static
381 const InterfaceProxy::Info* PPB_URLLoader_Proxy::GetTrustedInfo() { 379 const InterfaceProxy::Info* PPB_URLLoader_Proxy::GetTrustedInfo() {
382 static const Info info = { 380 static const Info info = {
383 ::ppapi::thunk::GetPPB_URLLoaderTrusted_Thunk(), 381 thunk::GetPPB_URLLoaderTrusted_Thunk(),
384 PPB_URLLOADERTRUSTED_INTERFACE, 382 PPB_URLLOADERTRUSTED_INTERFACE,
385 INTERFACE_ID_NONE, // URL_LOADER is the canonical one. 383 INTERFACE_ID_NONE, // URL_LOADER is the canonical one.
386 false, 384 false,
387 &CreateURLLoaderProxy 385 &CreateURLLoaderProxy
388 }; 386 };
389 return &info; 387 return &info;
390 } 388 }
391 389
392 // static 390 // static
393 PP_Resource PPB_URLLoader_Proxy::CreateProxyResource(PP_Instance pp_instance) { 391 PP_Resource PPB_URLLoader_Proxy::CreateProxyResource(PP_Instance pp_instance) {
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 bytes_read = result; // Positive results indicate bytes read. 578 bytes_read = result; // Positive results indicate bytes read.
581 info->read_buffer.resize(bytes_read); 579 info->read_buffer.resize(bytes_read);
582 580
583 dispatcher()->Send(new PpapiMsg_PPBURLLoader_ReadResponseBody_Ack( 581 dispatcher()->Send(new PpapiMsg_PPBURLLoader_ReadResponseBody_Ack(
584 INTERFACE_ID_PPB_URL_LOADER, info->resource, result, info->read_buffer)); 582 INTERFACE_ID_PPB_URL_LOADER, info->resource, result, info->read_buffer));
585 583
586 delete info; 584 delete info;
587 } 585 }
588 586
589 } // namespace proxy 587 } // namespace proxy
590 } // namespace pp 588 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698