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

Side by Side Diff: src/shared/ppapi_proxy/plugin_url_loader.cc

Issue 6177007: ppapi_proxy: Support loading and reading urls. Proxy URLLoader.... (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: '' Created 9 years, 11 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
« no previous file with comments | « src/shared/ppapi_proxy/plugin_url_loader.h ('k') | src/shared/ppapi_proxy/plugin_var.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2010 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can
4 * be found in the LICENSE file.
5 */
6
7 #include "native_client/src/shared/ppapi_proxy/plugin_url_loader.h"
8
9 #include <stdio.h>
10 #include <string.h>
11 #include "srpcgen/ppb_rpc.h"
12 #include "native_client/src/include/portability.h"
13 #include "native_client/src/shared/ppapi_proxy/plugin_globals.h"
14 #include "native_client/src/shared/ppapi_proxy/utility.h"
15 #include "native_client/src/shared/srpc/nacl_srpc.h"
16 #include "ppapi/c/pp_errors.h"
17 #include "ppapi/c/pp_completion_callback.h"
18 #include "ppapi/c/ppb_url_loader.h"
19
20 namespace ppapi_proxy {
21
22 namespace {
23 PP_Resource Create(PP_Instance instance) {
24 UNREFERENCED_PARAMETER(instance);
25 return kInvalidResourceId;
26 }
27
28 PP_Bool IsURLLoader(PP_Resource resource) {
29 UNREFERENCED_PARAMETER(resource);
30 return PP_FALSE;
31 }
32
33 int32_t Open(PP_Resource loader,
34 PP_Resource request_info,
35 struct PP_CompletionCallback callback) {
36 UNREFERENCED_PARAMETER(loader);
37 UNREFERENCED_PARAMETER(request_info);
38 UNREFERENCED_PARAMETER(callback);
39 return PP_ERROR_BADRESOURCE;
40 }
41
42 int32_t FollowRedirect(PP_Resource loader,
43 struct PP_CompletionCallback callback) {
44 UNREFERENCED_PARAMETER(loader);
45 UNREFERENCED_PARAMETER(callback);
46 return PP_ERROR_BADRESOURCE;
47 }
48
49 PP_Bool GetUploadProgress(PP_Resource loader,
50 int64_t* bytes_sent,
51 int64_t* total_bytes_to_be_sent) {
52 UNREFERENCED_PARAMETER(loader);
53 UNREFERENCED_PARAMETER(bytes_sent);
54 UNREFERENCED_PARAMETER(total_bytes_to_be_sent);
55 return PP_FALSE;
56 }
57
58 PP_Bool GetDownloadProgress(PP_Resource loader,
59 int64_t* bytes_received,
60 int64_t* total_bytes_to_be_received) {
61 UNREFERENCED_PARAMETER(loader);
62 UNREFERENCED_PARAMETER(bytes_received);
63 UNREFERENCED_PARAMETER(total_bytes_to_be_received);
64 return PP_FALSE;
65 }
66
67 PP_Resource GetResponseInfo(PP_Resource loader) {
68 UNREFERENCED_PARAMETER(loader);
69 return kInvalidResourceId;
70 }
71
72 int32_t ReadResponseBody(PP_Resource loader,
73 char* buffer,
74 int32_t bytes_to_read,
75 struct PP_CompletionCallback callback) {
76 UNREFERENCED_PARAMETER(loader);
77 UNREFERENCED_PARAMETER(buffer);
78 UNREFERENCED_PARAMETER(bytes_to_read);
79 UNREFERENCED_PARAMETER(callback);
80 return PP_ERROR_BADRESOURCE;
81 }
82
83 int32_t FinishStreamingToFile(PP_Resource loader,
84 struct PP_CompletionCallback callback) {
85 UNREFERENCED_PARAMETER(loader);
86 UNREFERENCED_PARAMETER(callback);
87 return PP_ERROR_BADRESOURCE;
88 }
89
90 void Close(PP_Resource loader) {
91 UNREFERENCED_PARAMETER(loader);
92 }
93 } // namespace
94
95 const PPB_URLLoader* PluginURLLoader::GetInterface() {
96 static const PPB_URLLoader intf = {
97 Create,
98 IsURLLoader,
99 Open,
100 FollowRedirect,
101 GetUploadProgress,
102 GetDownloadProgress,
103 GetResponseInfo,
104 ReadResponseBody,
105 FinishStreamingToFile,
106 Close,
107 };
108 return &intf;
109 }
110
111 } // namespace ppapi_proxy
OLDNEW
« no previous file with comments | « src/shared/ppapi_proxy/plugin_url_loader.h ('k') | src/shared/ppapi_proxy/plugin_var.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698