Pepper_56_C++_interfaces
Pepper_56_C++_interfaces
 All Classes Namespaces Files Functions Typedefs Enumerations Macros Groups
url_loader.h
Go to the documentation of this file.
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
3 // found in the LICENSE file.
4 
5 #ifndef PPAPI_CPP_URL_LOADER_H_
6 #define PPAPI_CPP_URL_LOADER_H_
7 
8 #include "ppapi/c/pp_stdint.h"
9 #include "ppapi/cpp/resource.h"
10 
13 namespace pp {
14 
15 class CompletionCallback;
16 class InstanceHandle;
17 class URLRequestInfo;
18 class URLResponseInfo;
19 
23 class URLLoader : public Resource {
24  public:
27  URLLoader() {}
28 
34  explicit URLLoader(PP_Resource resource);
35 
41  explicit URLLoader(const InstanceHandle& instance);
42 
46  URLLoader(const URLLoader& other);
47 
62  int32_t Open(const URLRequestInfo& request_info,
63  const CompletionCallback& cc);
64 
76  int32_t FollowRedirect(const CompletionCallback& cc);
77 
92  bool GetUploadProgress(int64_t* bytes_sent,
93  int64_t* total_bytes_to_be_sent) const;
94 
111  bool GetDownloadProgress(int64_t* bytes_received,
112  int64_t* total_bytes_to_be_received) const;
113 
122 
136  int32_t ReadResponseBody(void* buffer,
137  int32_t bytes_to_read,
138  const CompletionCallback& cc);
139 
153  int32_t FinishStreamingToFile(const CompletionCallback& cc);
154 
163  void Close();
164 };
165 
166 } // namespace pp
167 
168 #endif // PPAPI_CPP_URL_LOADER_H_
URLLoader()
Definition: url_loader.h:27
bool GetDownloadProgress(int64_t *bytes_received, int64_t *total_bytes_to_be_received) const
Definition: completion_callback.h:26
Definition: url_loader.h:23
Definition: instance_handle.h:44
URLResponseInfo provides an API for examining URL responses.
Definition: url_response_info.h:21
int32_t FinishStreamingToFile(const CompletionCallback &cc)
URLRequestInfo provides an API for creating and manipulating URL requests.
Definition: url_request_info.h:22
int32_t ReadResponseBody(void *buffer, int32_t bytes_to_read, const CompletionCallback &cc)
bool GetUploadProgress(int64_t *bytes_sent, int64_t *total_bytes_to_be_sent) const
int32_t Open(const URLRequestInfo &request_info, const CompletionCallback &cc)
A reference counted module resource.
Definition: resource.h:20
URLResponseInfo GetResponseInfo() const
int32_t FollowRedirect(const CompletionCallback &cc)