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

Side by Side Diff: ppapi/cpp/url_loader.h

Issue 6899055: PPAPI: Force async callback invocation option. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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 | « ppapi/cpp/private/flash_net_connector.cc ('k') | ppapi/cpp/url_loader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_CPP_URL_LOADER_H_ 5 #ifndef PPAPI_CPP_URL_LOADER_H_
6 #define PPAPI_CPP_URL_LOADER_H_ 6 #define PPAPI_CPP_URL_LOADER_H_
7 7
8 #include "ppapi/c/pp_stdint.h" 8 #include "ppapi/c/pp_stdint.h"
9 #include "ppapi/cpp/resource.h" 9 #include "ppapi/cpp/resource.h"
10 10
(...skipping 16 matching lines...) Expand all
27 // did_open_(false) { 27 // did_open_(false) {
28 // } 28 // }
29 // void ProcessURL(const char* url) { 29 // void ProcessURL(const char* url) {
30 // CompletionCallback* cc = NewCallback(); 30 // CompletionCallback* cc = NewCallback();
31 // int32_t rv = loader_.Open(MakeRequest(url), cc); 31 // int32_t rv = loader_.Open(MakeRequest(url), cc);
32 // if (rv != PP_Error_WouldBlock) 32 // if (rv != PP_Error_WouldBlock)
33 // cc->Run(rv); 33 // cc->Run(rv);
34 // } 34 // }
35 // private: 35 // private:
36 // CompletionCallback* NewCallback() { 36 // CompletionCallback* NewCallback() {
37 // return factory_.NewCallback(&MyHandler::DidCompleteIO); 37 // return factory_.NewOptionalCallback(&MyHandler::DidCompleteIO);
38 // } 38 // }
39 // URLRequestInfo MakeRequest(const char* url) { 39 // URLRequestInfo MakeRequest(const char* url) {
40 // URLRequestInfo request; 40 // URLRequestInfo request;
41 // request.SetURL(url); 41 // request.SetURL(url);
42 // request.SetMethod("GET"); 42 // request.SetMethod("GET");
43 // request.SetFollowRedirects(true); 43 // request.SetFollowRedirects(true);
44 // return request; 44 // return request;
45 // } 45 // }
46 // void DidCompleteIO(int32_t result) { 46 // void DidCompleteIO(int32_t result) {
47 // if (result > 0) { 47 // if (result > 0) {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 int32_t ReadResponseBody(void* buffer, 100 int32_t ReadResponseBody(void* buffer,
101 int32_t bytes_to_read, 101 int32_t bytes_to_read,
102 const CompletionCallback& cc); 102 const CompletionCallback& cc);
103 int32_t FinishStreamingToFile(const CompletionCallback& cc); 103 int32_t FinishStreamingToFile(const CompletionCallback& cc);
104 void Close(); 104 void Close();
105 }; 105 };
106 106
107 } // namespace pp 107 } // namespace pp
108 108
109 #endif // PPAPI_CPP_URL_LOADER_H_ 109 #endif // PPAPI_CPP_URL_LOADER_H_
OLDNEW
« no previous file with comments | « ppapi/cpp/private/flash_net_connector.cc ('k') | ppapi/cpp/url_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698