OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "webkit/glue/plugins/pepper_url_response_info.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "third_party/ppapi/c/pp_var.h" |
| 9 #include "webkit/glue/plugins/pepper_resource_tracker.h" |
| 10 |
| 11 namespace pepper { |
| 12 |
| 13 namespace { |
| 14 |
| 15 bool IsURLResponseInfo(PP_Resource resource) { |
| 16 return !!ResourceTracker::Get()->GetAsURLResponseInfo(resource).get(); |
| 17 } |
| 18 |
| 19 PP_Var GetProperty(PP_Resource response_id, |
| 20 PP_URLResponseProperty property) { |
| 21 scoped_refptr<URLResponseInfo> response( |
| 22 ResourceTracker::Get()->GetAsURLResponseInfo(response_id)); |
| 23 if (!response.get()) |
| 24 return PP_MakeVoid(); |
| 25 |
| 26 return response->GetProperty(property); |
| 27 } |
| 28 |
| 29 PP_Resource GetBody(PP_Resource response_id) { |
| 30 NOTIMPLEMENTED(); // TODO(darin): Implement me! |
| 31 return 0; |
| 32 } |
| 33 |
| 34 const PPB_URLResponseInfo ppb_urlresponseinfo = { |
| 35 &IsURLResponseInfo, |
| 36 &GetProperty, |
| 37 &GetBody |
| 38 }; |
| 39 |
| 40 } // namespace |
| 41 |
| 42 URLResponseInfo::URLResponseInfo(PluginModule* module) |
| 43 : Resource(module) { |
| 44 } |
| 45 |
| 46 URLResponseInfo::~URLResponseInfo() { |
| 47 } |
| 48 |
| 49 // static |
| 50 const PPB_URLResponseInfo* URLResponseInfo::GetInterface() { |
| 51 return &ppb_urlresponseinfo; |
| 52 } |
| 53 |
| 54 PP_Var URLResponseInfo::GetProperty(PP_URLResponseProperty property) { |
| 55 NOTIMPLEMENTED(); // TODO(darin): Implement me! |
| 56 return PP_MakeVoid(); |
| 57 } |
| 58 |
| 59 } // namespace pepper |
OLD | NEW |