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

Side by Side Diff: ppapi/thunk/ppb_url_loader_api.h

Issue 10081020: PPAPI: Make blocking completion callbacks work. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleaned up for review. Created 8 years, 8 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 #ifndef PPAPI_THUNK_URL_LOADER_API_H_ 5 #ifndef PPAPI_THUNK_URL_LOADER_API_H_
6 #define PPAPI_THUNK_URL_LOADER_API_H_ 6 #define PPAPI_THUNK_URL_LOADER_API_H_
7 7
8 #include "ppapi/c/ppb_url_loader.h" 8 #include "ppapi/c/ppb_url_loader.h"
9 #include "ppapi/shared_impl/api_callback_type.h"
9 #include "ppapi/c/trusted/ppb_url_loader_trusted.h" 10 #include "ppapi/c/trusted/ppb_url_loader_trusted.h"
10 11
11 namespace ppapi { 12 namespace ppapi {
12 namespace thunk { 13 namespace thunk {
13 14
14 class PPB_URLLoader_API { 15 class PPB_URLLoader_API {
15 public: 16 public:
16 virtual ~PPB_URLLoader_API() {} 17 virtual ~PPB_URLLoader_API() {}
17 18
18 virtual int32_t Open(PP_Resource request_id, 19 virtual int32_t Open(PP_Resource request_id,
19 PP_CompletionCallback callback) = 0; 20 ApiCallbackType callback) = 0;
20 virtual int32_t FollowRedirect(PP_CompletionCallback callback) = 0; 21 virtual int32_t FollowRedirect(ApiCallbackType callback) = 0;
21 virtual PP_Bool GetUploadProgress(int64_t* bytes_sent, 22 virtual PP_Bool GetUploadProgress(int64_t* bytes_sent,
22 int64_t* total_bytes_to_be_sent) = 0; 23 int64_t* total_bytes_to_be_sent) = 0;
23 virtual PP_Bool GetDownloadProgress(int64_t* bytes_received, 24 virtual PP_Bool GetDownloadProgress(int64_t* bytes_received,
24 int64_t* total_bytes_to_be_received) = 0; 25 int64_t* total_bytes_to_be_received) = 0;
25 virtual PP_Resource GetResponseInfo() = 0; 26 virtual PP_Resource GetResponseInfo() = 0;
26 virtual int32_t ReadResponseBody(void* buffer, 27 virtual int32_t ReadResponseBody(void* buffer,
27 int32_t bytes_to_read, 28 int32_t bytes_to_read,
28 PP_CompletionCallback callback) = 0; 29 ApiCallbackType callback) = 0;
29 virtual int32_t FinishStreamingToFile(PP_CompletionCallback callback) = 0; 30 virtual int32_t FinishStreamingToFile(ApiCallbackType callback) = 0;
30 virtual void Close() = 0; 31 virtual void Close() = 0;
31 32
32 // Trusted API. 33 // Trusted API.
33 virtual void GrantUniversalAccess() = 0; 34 virtual void GrantUniversalAccess() = 0;
34 virtual void SetStatusCallback(PP_URLLoaderTrusted_StatusCallback cb) = 0; 35 virtual void SetStatusCallback(PP_URLLoaderTrusted_StatusCallback cb) = 0;
35 }; 36 };
36 37
37 } // namespace thunk 38 } // namespace thunk
38 } // namespace ppapi 39 } // namespace ppapi
39 40
40 #endif // PPAPI_THUNK_URL_LOADER_API_H_ 41 #endif // PPAPI_THUNK_URL_LOADER_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698