OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 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_PROXY_URL_RESPONSE_INFO_RESOURCE_H_ | |
6 #define PPAPI_PROXY_URL_RESPONSE_INFO_RESOURCE_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "base/compiler_specific.h" | |
10 #include "ppapi/proxy/plugin_resource.h" | |
11 #include "ppapi/proxy/ppapi_proxy_export.h" | |
12 #include "ppapi/shared_impl/scoped_pp_resource.h" | |
13 #include "ppapi/shared_impl/url_response_info_data.h" | |
14 #include "ppapi/thunk/ppb_url_response_info_api.h" | |
15 | |
16 namespace ppapi { | |
17 namespace proxy { | |
18 | |
19 class PPAPI_PROXY_EXPORT URLResponseInfoResource | |
20 : public PluginResource, | |
21 public NON_EXPORTED_BASE(thunk::PPB_URLResponseInfo_API) { | |
22 public: | |
23 // Will take an additional reference to the file ref data if there is one. | |
bbudge
2012/10/12 01:27:06
This is repeated below.
brettw
2012/10/12 19:34:53
Actually not. It's completely contradicted below!
| |
24 // | |
25 // The file_ref_resource should be the body_as_file_ref host resource in the | |
26 // |data| converted to a resource valid in the current process. A reference | |
27 // is passed from the caller and is taken over by this object. | |
bbudge
2012/10/12 01:27:06
It might be helpful to state that file_ref_resourc
| |
28 URLResponseInfoResource(Connection connection, | |
29 PP_Instance instance, | |
30 const URLResponseInfoData& data, | |
31 PP_Resource file_ref_resource); | |
32 virtual ~URLResponseInfoResource(); | |
33 | |
34 // Resource override. | |
35 virtual PPB_URLResponseInfo_API* AsPPB_URLResponseInfo_API() OVERRIDE; | |
36 | |
37 // PPB_URLResponseInfo_API implementation. | |
38 virtual PP_Var GetProperty(PP_URLResponseProperty property) OVERRIDE; | |
39 virtual PP_Resource GetBodyAsFileRef() OVERRIDE; | |
40 virtual URLResponseInfoData GetData() OVERRIDE; | |
41 | |
42 private: | |
43 URLResponseInfoData data_; | |
44 | |
45 // Non-zero when the load is being streamed to a file. | |
46 ScopedPPResource body_as_file_ref_; | |
47 | |
48 DISALLOW_COPY_AND_ASSIGN(URLResponseInfoResource); | |
49 }; | |
50 | |
51 } // namespace proxy | |
52 } // namespace ppapi | |
53 | |
54 #endif // PPAPI_PROXY_URL_RESPONSE_INFO_RESOURCE_H_ | |
OLD | NEW |