OLD | NEW |
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 WEBKIT_GLUE_PLUGINS_PEPPER_URL_LOADER_H_ | 5 #ifndef WEBKIT_GLUE_PLUGINS_PEPPER_URL_LOADER_H_ |
6 #define WEBKIT_GLUE_PLUGINS_PEPPER_URL_LOADER_H_ | 6 #define WEBKIT_GLUE_PLUGINS_PEPPER_URL_LOADER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 | 9 |
10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
11 #include "third_party/ppapi/c/pp_completion_callback.h" | 11 #include "third_party/ppapi/c/pp_completion_callback.h" |
12 #include "third_party/WebKit/WebKit/chromium/public/WebURLLoader.h" | 12 #include "third_party/WebKit/WebKit/chromium/public/WebURLLoader.h" |
13 #include "third_party/WebKit/WebKit/chromium/public/WebURLLoaderClient.h" | 13 #include "third_party/WebKit/WebKit/chromium/public/WebURLLoaderClient.h" |
14 #include "webkit/glue/plugins/pepper_resource.h" | 14 #include "webkit/glue/plugins/pepper_resource.h" |
15 | 15 |
16 typedef struct _ppb_URLLoader PPB_URLLoader; | 16 struct PPB_URLLoader_Dev; |
17 | 17 |
18 namespace pepper { | 18 namespace pepper { |
19 | 19 |
20 class PluginInstance; | 20 class PluginInstance; |
21 class URLRequestInfo; | 21 class URLRequestInfo; |
22 class URLResponseInfo; | 22 class URLResponseInfo; |
23 | 23 |
24 class URLLoader : public Resource, public WebKit::WebURLLoaderClient { | 24 class URLLoader : public Resource, public WebKit::WebURLLoaderClient { |
25 public: | 25 public: |
26 explicit URLLoader(PluginInstance* instance); | 26 explicit URLLoader(PluginInstance* instance); |
27 virtual ~URLLoader(); | 27 virtual ~URLLoader(); |
28 | 28 |
29 // Returns a pointer to the interface implementing PPB_URLLoader that is | 29 // Returns a pointer to the interface implementing PPB_URLLoader that is |
30 // exposed to the plugin. | 30 // exposed to the plugin. |
31 static const PPB_URLLoader* GetInterface(); | 31 static const PPB_URLLoader_Dev* GetInterface(); |
32 | 32 |
33 // Resource overrides. | 33 // Resource overrides. |
34 URLLoader* AsURLLoader() { return this; } | 34 URLLoader* AsURLLoader() { return this; } |
35 | 35 |
36 // PPB_URLLoader implementation. | 36 // PPB_URLLoader implementation. |
37 int32_t Open(URLRequestInfo* request, PP_CompletionCallback callback); | 37 int32_t Open(URLRequestInfo* request, PP_CompletionCallback callback); |
38 int32_t FollowRedirect(PP_CompletionCallback callback); | 38 int32_t FollowRedirect(PP_CompletionCallback callback); |
39 int32_t ReadResponseBody(char* buffer, int32_t bytes_to_read, | 39 int32_t ReadResponseBody(char* buffer, int32_t bytes_to_read, |
40 PP_CompletionCallback callback); | 40 PP_CompletionCallback callback); |
41 int32_t FinishStreamingToFile(PP_CompletionCallback callback); | 41 int32_t FinishStreamingToFile(PP_CompletionCallback callback); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 int64_t bytes_received_; | 83 int64_t bytes_received_; |
84 int64_t total_bytes_to_be_received_; | 84 int64_t total_bytes_to_be_received_; |
85 char* user_buffer_; | 85 char* user_buffer_; |
86 size_t user_buffer_size_; | 86 size_t user_buffer_size_; |
87 int32_t done_status_; | 87 int32_t done_status_; |
88 }; | 88 }; |
89 | 89 |
90 } // namespace pepper | 90 } // namespace pepper |
91 | 91 |
92 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_URL_LOADER_H_ | 92 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_URL_LOADER_H_ |
OLD | NEW |