OLD | NEW |
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_PPB_URL_LOADER_PROXY_H_ | 5 #ifndef PPAPI_PPB_URL_LOADER_PROXY_H_ |
6 #define PPAPI_PPB_URL_LOADER_PROXY_H_ | 6 #define PPAPI_PPB_URL_LOADER_PROXY_H_ |
7 | 7 |
8 #include "ppapi/c/pp_completion_callback.h" | 8 #include "ppapi/c/pp_completion_callback.h" |
9 #include "ppapi/c/pp_instance.h" | 9 #include "ppapi/c/pp_instance.h" |
10 #include "ppapi/c/pp_module.h" | 10 #include "ppapi/c/pp_module.h" |
11 #include "ppapi/c/pp_resource.h" | 11 #include "ppapi/c/pp_resource.h" |
12 #include "ppapi/c/pp_size.h" | 12 #include "ppapi/c/pp_size.h" |
13 #include "ppapi/c/pp_var.h" | 13 #include "ppapi/c/pp_var.h" |
14 #include "ppapi/cpp/completion_callback.h" | 14 #include "ppapi/cpp/completion_callback.h" |
15 #include "ppapi/proxy/interface_proxy.h" | 15 #include "ppapi/proxy/interface_proxy.h" |
16 #include "ppapi/proxy/proxy_non_thread_safe_ref_count.h" | 16 #include "ppapi/proxy/proxy_non_thread_safe_ref_count.h" |
17 #include "ppapi/shared_impl/host_resource.h" | 17 #include "ppapi/shared_impl/host_resource.h" |
18 | 18 |
19 struct PPB_URLLoader; | 19 struct PPB_URLLoader; |
20 struct PPB_URLLoaderTrusted; | 20 struct PPB_URLLoaderTrusted; |
21 | 21 |
22 namespace pp { | 22 namespace ppapi { |
23 namespace proxy { | 23 namespace proxy { |
24 | 24 |
25 struct PPBURLLoader_UpdateProgress_Params; | 25 struct PPBURLLoader_UpdateProgress_Params; |
26 | 26 |
27 class PPB_URLLoader_Proxy : public InterfaceProxy { | 27 class PPB_URLLoader_Proxy : public InterfaceProxy { |
28 public: | 28 public: |
29 PPB_URLLoader_Proxy(Dispatcher* dispatcher, const void* target_interface); | 29 PPB_URLLoader_Proxy(Dispatcher* dispatcher, const void* target_interface); |
30 virtual ~PPB_URLLoader_Proxy(); | 30 virtual ~PPB_URLLoader_Proxy(); |
31 | 31 |
32 static const Info* GetInfo(); | 32 static const Info* GetInfo(); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 void OnMsgUpdateProgress( | 79 void OnMsgUpdateProgress( |
80 const PPBURLLoader_UpdateProgress_Params& params); | 80 const PPBURLLoader_UpdateProgress_Params& params); |
81 void OnMsgReadResponseBodyAck(const ppapi::HostResource& pp_resource, | 81 void OnMsgReadResponseBodyAck(const ppapi::HostResource& pp_resource, |
82 int32_t result, | 82 int32_t result, |
83 const std::string& data); | 83 const std::string& data); |
84 | 84 |
85 // Handles callbacks for read complete messages. Takes ownership of the info | 85 // Handles callbacks for read complete messages. Takes ownership of the info |
86 // pointer. | 86 // pointer. |
87 void OnReadCallback(int32_t result, ReadCallbackInfo* info); | 87 void OnReadCallback(int32_t result, ReadCallbackInfo* info); |
88 | 88 |
89 CompletionCallbackFactory<PPB_URLLoader_Proxy, | 89 pp::CompletionCallbackFactory<PPB_URLLoader_Proxy, |
90 ProxyNonThreadSafeRefCount> callback_factory_; | 90 ProxyNonThreadSafeRefCount> callback_factory_; |
91 | 91 |
92 // Valid only in the host, this lazily-initialized pointer indicates the | 92 // Valid only in the host, this lazily-initialized pointer indicates the |
93 // URLLoaderTrusted interface. | 93 // URLLoaderTrusted interface. |
94 const PPB_URLLoaderTrusted* host_urlloader_trusted_interface_; | 94 const PPB_URLLoaderTrusted* host_urlloader_trusted_interface_; |
95 }; | 95 }; |
96 | 96 |
97 } // namespace proxy | 97 } // namespace proxy |
98 } // namespace pp | 98 } // namespace ppapi |
99 | 99 |
100 #endif // PPAPI_PPB_URL_LOADER_PROXY_H_ | 100 #endif // PPAPI_PPB_URL_LOADER_PROXY_H_ |
OLD | NEW |