| 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 "ppapi/proxy/ppb_url_response_info_proxy.h" | 5 #include "ppapi/proxy/ppb_url_response_info_proxy.h" |
| 6 | 6 |
| 7 #include "ppapi/c/ppb_url_response_info.h" | 7 #include "ppapi/c/ppb_url_response_info.h" |
| 8 #include "ppapi/proxy/plugin_dispatcher.h" | 8 #include "ppapi/proxy/plugin_dispatcher.h" |
| 9 #include "ppapi/proxy/plugin_resource.h" | 9 #include "ppapi/proxy/plugin_resource.h" |
| 10 #include "ppapi/proxy/ppapi_messages.h" | 10 #include "ppapi/proxy/ppapi_messages.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 } | 78 } |
| 79 | 79 |
| 80 const void* PPB_URLResponseInfo_Proxy::GetSourceInterface() const { | 80 const void* PPB_URLResponseInfo_Proxy::GetSourceInterface() const { |
| 81 return &ppb_urlresponseinfo; | 81 return &ppb_urlresponseinfo; |
| 82 } | 82 } |
| 83 | 83 |
| 84 InterfaceID PPB_URLResponseInfo_Proxy::GetInterfaceId() const { | 84 InterfaceID PPB_URLResponseInfo_Proxy::GetInterfaceId() const { |
| 85 return INTERFACE_ID_PPB_URL_RESPONSE_INFO; | 85 return INTERFACE_ID_PPB_URL_RESPONSE_INFO; |
| 86 } | 86 } |
| 87 | 87 |
| 88 void PPB_URLResponseInfo_Proxy::OnMessageReceived(const IPC::Message& msg) { | 88 bool PPB_URLResponseInfo_Proxy::OnMessageReceived(const IPC::Message& msg) { |
| 89 bool handled = true; |
| 89 IPC_BEGIN_MESSAGE_MAP(PPB_URLResponseInfo_Proxy, msg) | 90 IPC_BEGIN_MESSAGE_MAP(PPB_URLResponseInfo_Proxy, msg) |
| 90 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLResponseInfo_GetProperty, | 91 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLResponseInfo_GetProperty, |
| 91 OnMsgGetProperty) | 92 OnMsgGetProperty) |
| 92 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLResponseInfo_GetBodyAsFileRef, | 93 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLResponseInfo_GetBodyAsFileRef, |
| 93 OnMsgGetBodyAsFileRef) | 94 OnMsgGetBodyAsFileRef) |
| 95 IPC_MESSAGE_UNHANDLED(handled = false) |
| 94 IPC_END_MESSAGE_MAP() | 96 IPC_END_MESSAGE_MAP() |
| 95 // TODO(brettw): handle bad messages. | 97 // TODO(brettw): handle bad messages. |
| 98 return handled; |
| 96 } | 99 } |
| 97 | 100 |
| 98 void PPB_URLResponseInfo_Proxy::OnMsgGetProperty( | 101 void PPB_URLResponseInfo_Proxy::OnMsgGetProperty( |
| 99 PP_Resource response, | 102 PP_Resource response, |
| 100 int32_t property, | 103 int32_t property, |
| 101 SerializedVarReturnValue result) { | 104 SerializedVarReturnValue result) { |
| 102 result.Return(dispatcher(), ppb_url_response_info_target()->GetProperty( | 105 result.Return(dispatcher(), ppb_url_response_info_target()->GetProperty( |
| 103 response, static_cast<PP_URLResponseProperty>(property))); | 106 response, static_cast<PP_URLResponseProperty>(property))); |
| 104 } | 107 } |
| 105 | 108 |
| 106 void PPB_URLResponseInfo_Proxy::OnMsgGetBodyAsFileRef( | 109 void PPB_URLResponseInfo_Proxy::OnMsgGetBodyAsFileRef( |
| 107 PP_Resource response, | 110 PP_Resource response, |
| 108 PP_Resource* file_ref_result) { | 111 PP_Resource* file_ref_result) { |
| 109 *file_ref_result = ppb_url_response_info_target()->GetBodyAsFileRef(response); | 112 *file_ref_result = ppb_url_response_info_target()->GetBodyAsFileRef(response); |
| 110 } | 113 } |
| 111 | 114 |
| 112 } // namespace proxy | 115 } // namespace proxy |
| 113 } // namespace pp | 116 } // namespace pp |
| OLD | NEW |