| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "chrome/browser/automation/automation_resource_message_filter.h" | 10 #include "chrome/browser/automation/automation_resource_message_filter.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 URLRequestAutomationJob::~URLRequestAutomationJob() { | 74 URLRequestAutomationJob::~URLRequestAutomationJob() { |
| 75 DVLOG(1) << "URLRequestAutomationJob delete. Count: " << --instance_count_; | 75 DVLOG(1) << "URLRequestAutomationJob delete. Count: " << --instance_count_; |
| 76 Cleanup(); | 76 Cleanup(); |
| 77 } | 77 } |
| 78 | 78 |
| 79 bool URLRequestAutomationJob::EnsureProtocolFactoryRegistered() { | 79 bool URLRequestAutomationJob::EnsureProtocolFactoryRegistered() { |
| 80 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 80 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 81 | 81 |
| 82 if (!is_protocol_factory_registered_) { | 82 if (!is_protocol_factory_registered_) { |
| 83 old_http_factory_ = | 83 old_http_factory_ = |
| 84 net::URLRequest::RegisterProtocolFactory( | 84 net::URLRequest::Deprecated::RegisterProtocolFactory( |
| 85 "http", &URLRequestAutomationJob::Factory); | 85 "http", &URLRequestAutomationJob::Factory); |
| 86 old_https_factory_ = | 86 old_https_factory_ = |
| 87 net::URLRequest::RegisterProtocolFactory( | 87 net::URLRequest::Deprecated::RegisterProtocolFactory( |
| 88 "https", &URLRequestAutomationJob::Factory); | 88 "https", &URLRequestAutomationJob::Factory); |
| 89 is_protocol_factory_registered_ = true; | 89 is_protocol_factory_registered_ = true; |
| 90 } | 90 } |
| 91 | 91 |
| 92 return true; | 92 return true; |
| 93 } | 93 } |
| 94 | 94 |
| 95 net::URLRequestJob* URLRequestAutomationJob::Factory( | 95 net::URLRequestJob* URLRequestAutomationJob::Factory( |
| 96 net::URLRequest* request, | 96 net::URLRequest* request, |
| 97 const std::string& scheme) { | 97 const std::string& scheme) { |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 if (!is_done()) { | 482 if (!is_done()) { |
| 483 NotifyDone(request_status_); | 483 NotifyDone(request_status_); |
| 484 } | 484 } |
| 485 // Reset any pending reads. | 485 // Reset any pending reads. |
| 486 if (pending_buf_) { | 486 if (pending_buf_) { |
| 487 pending_buf_ = NULL; | 487 pending_buf_ = NULL; |
| 488 pending_buf_size_ = 0; | 488 pending_buf_size_ = 0; |
| 489 NotifyReadComplete(0); | 489 NotifyReadComplete(0); |
| 490 } | 490 } |
| 491 } | 491 } |
| OLD | NEW |