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 "net/url_request/url_request.h" | 5 #include "net/url_request/url_request.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/metrics/stats_counters.h" | 9 #include "base/metrics/stats_counters.h" |
10 #include "base/singleton.h" | 10 #include "base/singleton.h" |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 void URLRequest::ResponseStarted() { | 479 void URLRequest::ResponseStarted() { |
480 scoped_refptr<net::NetLog::EventParameters> params; | 480 scoped_refptr<net::NetLog::EventParameters> params; |
481 if (!status_.is_success()) | 481 if (!status_.is_success()) |
482 params = new net::NetLogIntegerParameter("net_error", status_.os_error()); | 482 params = new net::NetLogIntegerParameter("net_error", status_.os_error()); |
483 net_log_.EndEvent(net::NetLog::TYPE_URL_REQUEST_START_JOB, params); | 483 net_log_.EndEvent(net::NetLog::TYPE_URL_REQUEST_START_JOB, params); |
484 | 484 |
485 URLRequestJob* job = | 485 URLRequestJob* job = |
486 URLRequestJobManager::GetInstance()->MaybeInterceptResponse(this); | 486 URLRequestJobManager::GetInstance()->MaybeInterceptResponse(this); |
487 if (job) { | 487 if (job) { |
488 RestartWithJob(job); | 488 RestartWithJob(job); |
489 } else if (delegate_) { | 489 } else { |
490 delegate_->OnResponseStarted(this); | 490 if (context_ && context_->network_delegate()) |
| 491 context_->network_delegate()->OnResponseStarted(this); |
| 492 if (delegate_) |
| 493 delegate_->OnResponseStarted(this); |
491 } | 494 } |
492 } | 495 } |
493 | 496 |
494 void URLRequest::FollowDeferredRedirect() { | 497 void URLRequest::FollowDeferredRedirect() { |
495 CHECK(job_); | 498 CHECK(job_); |
496 CHECK(status_.is_success()); | 499 CHECK(status_.is_success()); |
497 | 500 |
498 job_->FollowDeferredRedirect(); | 501 job_->FollowDeferredRedirect(); |
499 } | 502 } |
500 | 503 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 if (found != user_data_.end()) | 639 if (found != user_data_.end()) |
637 return found->second.get(); | 640 return found->second.get(); |
638 return NULL; | 641 return NULL; |
639 } | 642 } |
640 | 643 |
641 void URLRequest::SetUserData(const void* key, UserData* data) { | 644 void URLRequest::SetUserData(const void* key, UserData* data) { |
642 user_data_[key] = linked_ptr<UserData>(data); | 645 user_data_[key] = linked_ptr<UserData>(data); |
643 } | 646 } |
644 | 647 |
645 } // namespace net | 648 } // namespace net |
OLD | NEW |