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_request_info_proxy.h" | 5 #include "ppapi/proxy/ppb_url_request_info_proxy.h" |
6 | 6 |
7 #include "ppapi/c/ppb_url_request_info.h" | 7 #include "ppapi/c/ppb_url_request_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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 } | 104 } |
105 | 105 |
106 const void* PPB_URLRequestInfo_Proxy::GetSourceInterface() const { | 106 const void* PPB_URLRequestInfo_Proxy::GetSourceInterface() const { |
107 return &ppb_urlrequestinfo; | 107 return &ppb_urlrequestinfo; |
108 } | 108 } |
109 | 109 |
110 InterfaceID PPB_URLRequestInfo_Proxy::GetInterfaceId() const { | 110 InterfaceID PPB_URLRequestInfo_Proxy::GetInterfaceId() const { |
111 return INTERFACE_ID_PPB_URL_REQUEST_INFO; | 111 return INTERFACE_ID_PPB_URL_REQUEST_INFO; |
112 } | 112 } |
113 | 113 |
114 void PPB_URLRequestInfo_Proxy::OnMessageReceived(const IPC::Message& msg) { | 114 bool PPB_URLRequestInfo_Proxy::OnMessageReceived(const IPC::Message& msg) { |
| 115 bool handled = true; |
115 IPC_BEGIN_MESSAGE_MAP(PPB_URLRequestInfo_Proxy, msg) | 116 IPC_BEGIN_MESSAGE_MAP(PPB_URLRequestInfo_Proxy, msg) |
116 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLRequestInfo_Create, OnMsgCreate) | 117 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLRequestInfo_Create, OnMsgCreate) |
117 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLRequestInfo_SetProperty, | 118 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLRequestInfo_SetProperty, |
118 OnMsgSetProperty) | 119 OnMsgSetProperty) |
119 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLRequestInfo_AppendDataToBody, | 120 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLRequestInfo_AppendDataToBody, |
120 OnMsgAppendDataToBody) | 121 OnMsgAppendDataToBody) |
121 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLRequestInfo_AppendFileToBody, | 122 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLRequestInfo_AppendFileToBody, |
122 OnMsgAppendFileToBody) | 123 OnMsgAppendFileToBody) |
| 124 IPC_MESSAGE_UNHANDLED(handled = false) |
123 IPC_END_MESSAGE_MAP() | 125 IPC_END_MESSAGE_MAP() |
124 // TODO(brettw): handle bad messages. | 126 // TODO(brettw): handle bad messages. |
| 127 return handled; |
125 } | 128 } |
126 | 129 |
127 void PPB_URLRequestInfo_Proxy::OnMsgCreate( | 130 void PPB_URLRequestInfo_Proxy::OnMsgCreate( |
128 PP_Module module, | 131 PP_Module module, |
129 PP_Resource* result) { | 132 PP_Resource* result) { |
130 *result = ppb_url_request_info_target()->Create(module); | 133 *result = ppb_url_request_info_target()->Create(module); |
131 } | 134 } |
132 | 135 |
133 void PPB_URLRequestInfo_Proxy::OnMsgSetProperty( | 136 void PPB_URLRequestInfo_Proxy::OnMsgSetProperty( |
134 PP_Resource request, | 137 PP_Resource request, |
(...skipping 17 matching lines...) Expand all Loading... |
152 int64_t start_offset, | 155 int64_t start_offset, |
153 int64_t number_of_bytes, | 156 int64_t number_of_bytes, |
154 double expected_last_modified_time) { | 157 double expected_last_modified_time) { |
155 ppb_url_request_info_target()->AppendFileToBody( | 158 ppb_url_request_info_target()->AppendFileToBody( |
156 request, file_ref, start_offset, number_of_bytes, | 159 request, file_ref, start_offset, number_of_bytes, |
157 expected_last_modified_time); | 160 expected_last_modified_time); |
158 } | 161 } |
159 | 162 |
160 } // namespace proxy | 163 } // namespace proxy |
161 } // namespace pp | 164 } // namespace pp |
OLD | NEW |