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 #include "webkit/glue/plugins/pepper_url_response_info.h" | 5 #include "webkit/glue/plugins/pepper_url_response_info.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "third_party/ppapi/c/pp_var.h" | 8 #include "third_party/ppapi/c/pp_var.h" |
9 #include "webkit/glue/plugins/pepper_resource_tracker.h" | |
10 | 9 |
11 namespace pepper { | 10 namespace pepper { |
12 | 11 |
13 namespace { | 12 namespace { |
14 | 13 |
15 bool IsURLResponseInfo(PP_Resource resource) { | 14 bool IsURLResponseInfo(PP_Resource resource) { |
16 return !!ResourceTracker::Get()->GetAsURLResponseInfo(resource).get(); | 15 return !!Resource::GetAs<URLResponseInfo>(resource).get(); |
17 } | 16 } |
18 | 17 |
19 PP_Var GetProperty(PP_Resource response_id, | 18 PP_Var GetProperty(PP_Resource response_id, |
20 PP_URLResponseProperty property) { | 19 PP_URLResponseProperty property) { |
21 scoped_refptr<URLResponseInfo> response( | 20 scoped_refptr<URLResponseInfo> response( |
22 ResourceTracker::Get()->GetAsURLResponseInfo(response_id)); | 21 Resource::GetAs<URLResponseInfo>(response_id)); |
23 if (!response.get()) | 22 if (!response.get()) |
24 return PP_MakeVoid(); | 23 return PP_MakeVoid(); |
25 | 24 |
26 return response->GetProperty(property); | 25 return response->GetProperty(property); |
27 } | 26 } |
28 | 27 |
29 PP_Resource GetBody(PP_Resource response_id) { | 28 PP_Resource GetBody(PP_Resource response_id) { |
30 NOTIMPLEMENTED(); // TODO(darin): Implement me! | 29 NOTIMPLEMENTED(); // TODO(darin): Implement me! |
31 return 0; | 30 return 0; |
32 } | 31 } |
(...skipping 17 matching lines...) Expand all Loading... |
50 const PPB_URLResponseInfo* URLResponseInfo::GetInterface() { | 49 const PPB_URLResponseInfo* URLResponseInfo::GetInterface() { |
51 return &ppb_urlresponseinfo; | 50 return &ppb_urlresponseinfo; |
52 } | 51 } |
53 | 52 |
54 PP_Var URLResponseInfo::GetProperty(PP_URLResponseProperty property) { | 53 PP_Var URLResponseInfo::GetProperty(PP_URLResponseProperty property) { |
55 NOTIMPLEMENTED(); // TODO(darin): Implement me! | 54 NOTIMPLEMENTED(); // TODO(darin): Implement me! |
56 return PP_MakeVoid(); | 55 return PP_MakeVoid(); |
57 } | 56 } |
58 | 57 |
59 } // namespace pepper | 58 } // namespace pepper |
OLD | NEW |