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/browser/automation/url_request_automation_job.h" | 5 #include "chrome/browser/automation/url_request_automation_job.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 if (info) { | 450 if (info) { |
451 resource_type = info->GetResourceType(); | 451 resource_type = info->GetResourceType(); |
452 } | 452 } |
453 | 453 |
454 // Ask automation to start this request. | 454 // Ask automation to start this request. |
455 AutomationURLRequest automation_request; | 455 AutomationURLRequest automation_request; |
456 automation_request.url = request_->url().spec(); | 456 automation_request.url = request_->url().spec(); |
457 automation_request.method = request_->method(); | 457 automation_request.method = request_->method(); |
458 automation_request.referrer = referrer.spec(); | 458 automation_request.referrer = referrer.spec(); |
459 automation_request.extra_request_headers = new_request_headers.ToString(); | 459 automation_request.extra_request_headers = new_request_headers.ToString(); |
460 automation_request.upload_data =request_->get_upload(); | 460 automation_request.upload_data = request_->get_upload_mutable(); |
461 automation_request.resource_type = resource_type; | 461 automation_request.resource_type = resource_type; |
462 automation_request.load_flags = request_->load_flags(); | 462 automation_request.load_flags = request_->load_flags(); |
463 | 463 |
464 DCHECK(message_filter_); | 464 DCHECK(message_filter_); |
465 message_filter_->Send(new AutomationMsg_RequestStart( | 465 message_filter_->Send(new AutomationMsg_RequestStart( |
466 tab_, id_, automation_request)); | 466 tab_, id_, automation_request)); |
467 } | 467 } |
468 | 468 |
469 void URLRequestAutomationJob::DisconnectFromMessageFilter() { | 469 void URLRequestAutomationJob::DisconnectFromMessageFilter() { |
470 if (message_filter_) { | 470 if (message_filter_) { |
(...skipping 16 matching lines...) Expand all Loading... |
487 if (!is_done()) { | 487 if (!is_done()) { |
488 NotifyDone(request_status_); | 488 NotifyDone(request_status_); |
489 } | 489 } |
490 // Reset any pending reads. | 490 // Reset any pending reads. |
491 if (pending_buf_) { | 491 if (pending_buf_) { |
492 pending_buf_ = NULL; | 492 pending_buf_ = NULL; |
493 pending_buf_size_ = 0; | 493 pending_buf_size_ = 0; |
494 NotifyReadComplete(0); | 494 NotifyReadComplete(0); |
495 } | 495 } |
496 } | 496 } |
OLD | NEW |