| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome_frame/chrome_frame_automation.h" | 5 #include "chrome_frame/chrome_frame_automation.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1298 automation_server_->SendAsAsync(msg, unload_context, this); | 1298 automation_server_->SendAsAsync(msg, unload_context, this); |
| 1299 HANDLE done = unload_call_finished.handle(); | 1299 HANDLE done = unload_call_finished.handle(); |
| 1300 WaitWithMessageLoop(&done, 1, kUnloadEventTimeout); | 1300 WaitWithMessageLoop(&done, 1, kUnloadEventTimeout); |
| 1301 } | 1301 } |
| 1302 } | 1302 } |
| 1303 | 1303 |
| 1304 ////////////////////////////////////////////////////////////////////////// | 1304 ////////////////////////////////////////////////////////////////////////// |
| 1305 // PluginUrlRequestDelegate implementation. | 1305 // PluginUrlRequestDelegate implementation. |
| 1306 // Forward network related responses to Chrome. | 1306 // Forward network related responses to Chrome. |
| 1307 | 1307 |
| 1308 void ChromeFrameAutomationClient::OnResponseStarted(int request_id, | 1308 void ChromeFrameAutomationClient::OnResponseStarted( |
| 1309 const char* mime_type, const char* headers, int size, | 1309 int request_id, const char* mime_type, const char* headers, int size, |
| 1310 base::Time last_modified, const std::string& redirect_url, | 1310 base::Time last_modified, const std::string& redirect_url, |
| 1311 int redirect_status, const net::HostPortPair& socket_address) { | 1311 int redirect_status, const net::HostPortPair& socket_address, |
| 1312 uint64 upload_size) { |
| 1312 AutomationURLResponse response; | 1313 AutomationURLResponse response; |
| 1313 response.mime_type = mime_type; | 1314 response.mime_type = mime_type; |
| 1314 if (headers) | 1315 if (headers) |
| 1315 response.headers = headers; | 1316 response.headers = headers; |
| 1316 response.content_length = size; | 1317 response.content_length = size; |
| 1317 response.last_modified = last_modified; | 1318 response.last_modified = last_modified; |
| 1318 response.redirect_url = redirect_url; | 1319 response.redirect_url = redirect_url; |
| 1319 response.redirect_status = redirect_status; | 1320 response.redirect_status = redirect_status; |
| 1320 response.socket_address = socket_address; | 1321 response.socket_address = socket_address; |
| 1322 response.upload_size = upload_size; |
| 1321 | 1323 |
| 1322 automation_server_->Send(new AutomationMsg_RequestStarted( | 1324 automation_server_->Send(new AutomationMsg_RequestStarted( |
| 1323 tab_->handle(), request_id, response)); | 1325 tab_->handle(), request_id, response)); |
| 1324 } | 1326 } |
| 1325 | 1327 |
| 1326 void ChromeFrameAutomationClient::OnReadComplete(int request_id, | 1328 void ChromeFrameAutomationClient::OnReadComplete(int request_id, |
| 1327 const std::string& data) { | 1329 const std::string& data) { |
| 1328 automation_server_->Send(new AutomationMsg_RequestData( | 1330 automation_server_->Send(new AutomationMsg_RequestData( |
| 1329 tab_->handle(), request_id, data)); | 1331 tab_->handle(), request_id, data)); |
| 1330 } | 1332 } |
| 1331 | 1333 |
| 1332 void ChromeFrameAutomationClient::OnResponseEnd( | 1334 void ChromeFrameAutomationClient::OnResponseEnd( |
| 1333 int request_id, | 1335 int request_id, |
| 1334 const net::URLRequestStatus& status) { | 1336 const net::URLRequestStatus& status) { |
| 1335 automation_server_->Send(new AutomationMsg_RequestEnd( | 1337 automation_server_->Send(new AutomationMsg_RequestEnd( |
| 1336 tab_->handle(), request_id, status)); | 1338 tab_->handle(), request_id, status)); |
| 1337 } | 1339 } |
| 1338 | 1340 |
| 1339 void ChromeFrameAutomationClient::OnCookiesRetrieved(bool success, | 1341 void ChromeFrameAutomationClient::OnCookiesRetrieved(bool success, |
| 1340 const GURL& url, const std::string& cookie_string, int cookie_id) { | 1342 const GURL& url, const std::string& cookie_string, int cookie_id) { |
| 1341 automation_server_->Send(new AutomationMsg_GetCookiesHostResponse( | 1343 automation_server_->Send(new AutomationMsg_GetCookiesHostResponse( |
| 1342 tab_->handle(), success, url, cookie_string, cookie_id)); | 1344 tab_->handle(), success, url, cookie_string, cookie_id)); |
| 1343 } | 1345 } |
| OLD | NEW |