OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_PROXY_URL_LOADER_RESOURCE_H_ | 5 #ifndef PPAPI_PROXY_URL_LOADER_RESOURCE_H_ |
6 #define PPAPI_PROXY_URL_LOADER_RESOURCE_H_ | 6 #define PPAPI_PROXY_URL_LOADER_RESOURCE_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 // pending host ID for the already-created host in the renderer, and the | 32 // pending host ID for the already-created host in the renderer, and the |
33 // response data is the response for the already-opened connection. | 33 // response data is the response for the already-opened connection. |
34 URLLoaderResource(Connection connection, | 34 URLLoaderResource(Connection connection, |
35 PP_Instance instance, | 35 PP_Instance instance, |
36 int pending_main_document_loader_id, | 36 int pending_main_document_loader_id, |
37 const URLResponseInfoData& data); | 37 const URLResponseInfoData& data); |
38 | 38 |
39 virtual ~URLLoaderResource(); | 39 virtual ~URLLoaderResource(); |
40 | 40 |
41 // Resource override. | 41 // Resource override. |
42 thunk::PPB_URLLoader_API* AsPPB_URLLoader_API() OVERRIDE; | 42 thunk::PPB_URLLoader_API* AsPPB_URLLoader_API() override; |
43 | 43 |
44 // PPB_URLLoader_API implementation. | 44 // PPB_URLLoader_API implementation. |
45 virtual int32_t Open(PP_Resource request_id, | 45 virtual int32_t Open(PP_Resource request_id, |
46 scoped_refptr<TrackedCallback> callback) OVERRIDE; | 46 scoped_refptr<TrackedCallback> callback) override; |
47 virtual int32_t Open(const URLRequestInfoData& data, | 47 virtual int32_t Open(const URLRequestInfoData& data, |
48 int requestor_pid, | 48 int requestor_pid, |
49 scoped_refptr<TrackedCallback> callback) OVERRIDE; | 49 scoped_refptr<TrackedCallback> callback) override; |
50 virtual int32_t FollowRedirect( | 50 virtual int32_t FollowRedirect( |
51 scoped_refptr<TrackedCallback> callback) OVERRIDE; | 51 scoped_refptr<TrackedCallback> callback) override; |
52 virtual PP_Bool GetUploadProgress(int64_t* bytes_sent, | 52 virtual PP_Bool GetUploadProgress(int64_t* bytes_sent, |
53 int64_t* total_bytes_to_be_sent) OVERRIDE; | 53 int64_t* total_bytes_to_be_sent) override; |
54 virtual PP_Bool GetDownloadProgress( | 54 virtual PP_Bool GetDownloadProgress( |
55 int64_t* bytes_received, | 55 int64_t* bytes_received, |
56 int64_t* total_bytes_to_be_received) OVERRIDE; | 56 int64_t* total_bytes_to_be_received) override; |
57 virtual PP_Resource GetResponseInfo() OVERRIDE; | 57 virtual PP_Resource GetResponseInfo() override; |
58 virtual int32_t ReadResponseBody( | 58 virtual int32_t ReadResponseBody( |
59 void* buffer, | 59 void* buffer, |
60 int32_t bytes_to_read, | 60 int32_t bytes_to_read, |
61 scoped_refptr<TrackedCallback> callback) OVERRIDE; | 61 scoped_refptr<TrackedCallback> callback) override; |
62 virtual int32_t FinishStreamingToFile( | 62 virtual int32_t FinishStreamingToFile( |
63 scoped_refptr<TrackedCallback> callback) OVERRIDE; | 63 scoped_refptr<TrackedCallback> callback) override; |
64 virtual void Close() OVERRIDE; | 64 virtual void Close() override; |
65 virtual void GrantUniversalAccess() OVERRIDE; | 65 virtual void GrantUniversalAccess() override; |
66 virtual void RegisterStatusCallback( | 66 virtual void RegisterStatusCallback( |
67 PP_URLLoaderTrusted_StatusCallback callback) OVERRIDE; | 67 PP_URLLoaderTrusted_StatusCallback callback) override; |
68 | 68 |
69 // PluginResource implementation. | 69 // PluginResource implementation. |
70 virtual void OnReplyReceived(const ResourceMessageReplyParams& params, | 70 virtual void OnReplyReceived(const ResourceMessageReplyParams& params, |
71 const IPC::Message& msg) OVERRIDE; | 71 const IPC::Message& msg) override; |
72 | 72 |
73 private: | 73 private: |
74 enum Mode { | 74 enum Mode { |
75 // The plugin has not called Open() yet. | 75 // The plugin has not called Open() yet. |
76 MODE_WAITING_TO_OPEN, | 76 MODE_WAITING_TO_OPEN, |
77 | 77 |
78 // The plugin is waiting for the Open() or FollowRedirect callback. | 78 // The plugin is waiting for the Open() or FollowRedirect callback. |
79 MODE_OPENING, | 79 MODE_OPENING, |
80 | 80 |
81 // We've started to receive data and may receive more. | 81 // We've started to receive data and may receive more. |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 // The response info if we've received it. | 137 // The response info if we've received it. |
138 scoped_refptr<URLResponseInfoResource> response_info_; | 138 scoped_refptr<URLResponseInfoResource> response_info_; |
139 | 139 |
140 DISALLOW_COPY_AND_ASSIGN(URLLoaderResource); | 140 DISALLOW_COPY_AND_ASSIGN(URLLoaderResource); |
141 }; | 141 }; |
142 | 142 |
143 } // namespace proxy | 143 } // namespace proxy |
144 } // namespace ppapi | 144 } // namespace ppapi |
145 | 145 |
146 #endif // PPAPI_PROXY_URL_LOADER_RESOURCE_H_ | 146 #endif // PPAPI_PROXY_URL_LOADER_RESOURCE_H_ |
OLD | NEW |