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 #include "ppapi/cpp/url_response_info.h" | 5 #include "ppapi/cpp/url_response_info.h" |
6 | 6 |
7 #include "ppapi/cpp/file_ref.h" | 7 #include "ppapi/cpp/file_ref.h" |
8 #include "ppapi/cpp/module.h" | 8 #include "ppapi/cpp/module.h" |
9 #include "ppapi/cpp/module_impl.h" | 9 #include "ppapi/cpp/module_impl.h" |
10 | 10 |
11 namespace pp { | 11 namespace pp { |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 template <> const char* interface_name<PPB_URLResponseInfo>() { | 15 template <> const char* interface_name<PPB_URLResponseInfo>() { |
16 return PPB_URLRESPONSEINFO_INTERFACE; | 16 return PPB_URLRESPONSEINFO_INTERFACE; |
17 } | 17 } |
18 | 18 |
19 } // namespace | 19 } // namespace |
20 | 20 |
21 URLResponseInfo::URLResponseInfo(const URLResponseInfo& other) | 21 URLResponseInfo::URLResponseInfo(const URLResponseInfo& other) |
22 : Resource(other) { | 22 : Resource(other) { |
23 } | 23 } |
24 | 24 |
25 URLResponseInfo::URLResponseInfo(PassRef, PP_Resource resource) { | 25 URLResponseInfo::URLResponseInfo(PassRef, PP_Resource resource) |
26 PassRefFromConstructor(resource); | 26 : Resource(PASS_REF, resource) { |
27 } | 27 } |
28 | 28 |
29 Var URLResponseInfo::GetProperty(PP_URLResponseProperty property) const { | 29 Var URLResponseInfo::GetProperty(PP_URLResponseProperty property) const { |
30 if (!has_interface<PPB_URLResponseInfo>()) | 30 if (!has_interface<PPB_URLResponseInfo>()) |
31 return Var(); | 31 return Var(); |
32 return Var(Var::PassRef(), | 32 return Var(PASS_REF, |
33 get_interface<PPB_URLResponseInfo>()->GetProperty(pp_resource(), | 33 get_interface<PPB_URLResponseInfo>()->GetProperty(pp_resource(), |
34 property)); | 34 property)); |
35 } | 35 } |
36 | 36 |
37 FileRef URLResponseInfo::GetBodyAsFileRef() const { | 37 FileRef URLResponseInfo::GetBodyAsFileRef() const { |
38 if (!has_interface<PPB_URLResponseInfo>()) | 38 if (!has_interface<PPB_URLResponseInfo>()) |
39 return FileRef(); | 39 return FileRef(); |
40 return FileRef(FileRef::PassRef(), | 40 return FileRef(PASS_REF, |
41 get_interface<PPB_URLResponseInfo>()->GetBodyAsFileRef( | 41 get_interface<PPB_URLResponseInfo>()->GetBodyAsFileRef( |
42 pp_resource())); | 42 pp_resource())); |
43 } | 43 } |
44 | 44 |
45 } // namespace pp | 45 } // namespace pp |
OLD | NEW |