| 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 "net/url_request/url_fetcher_core.h" | 5 #include "net/url_request/url_fetcher_core.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/sequenced_task_runner.h" | 10 #include "base/sequenced_task_runner.h" |
| (...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 // run after the URLFetcher was already stopped. | 500 // run after the URLFetcher was already stopped. |
| 501 return; | 501 return; |
| 502 } | 502 } |
| 503 | 503 |
| 504 DCHECK(request_context_getter_.get()); | 504 DCHECK(request_context_getter_.get()); |
| 505 DCHECK(!request_.get()); | 505 DCHECK(!request_.get()); |
| 506 | 506 |
| 507 g_registry.Get().AddURLFetcherCore(this); | 507 g_registry.Get().AddURLFetcherCore(this); |
| 508 current_response_bytes_ = 0; | 508 current_response_bytes_ = 0; |
| 509 request_ = request_context_getter_->GetURLRequestContext()->CreateRequest( | 509 request_ = request_context_getter_->GetURLRequestContext()->CreateRequest( |
| 510 original_url_, DEFAULT_PRIORITY, this, NULL); | 510 original_url_, DEFAULT_PRIORITY, this); |
| 511 request_->set_stack_trace(stack_trace_); | 511 request_->set_stack_trace(stack_trace_); |
| 512 int flags = request_->load_flags() | load_flags_; | 512 int flags = request_->load_flags() | load_flags_; |
| 513 if (!g_interception_enabled) | 513 if (!g_interception_enabled) |
| 514 flags = flags | LOAD_DISABLE_INTERCEPT; | 514 flags = flags | LOAD_DISABLE_INTERCEPT; |
| 515 | 515 |
| 516 if (is_chunked_upload_) | 516 if (is_chunked_upload_) |
| 517 request_->EnableChunkedUpload(); | 517 request_->EnableChunkedUpload(); |
| 518 request_->SetLoadFlags(flags); | 518 request_->SetLoadFlags(flags); |
| 519 request_->SetReferrer(referrer_); | 519 request_->SetReferrer(referrer_); |
| 520 request_->set_referrer_policy(referrer_policy_); | 520 request_->set_referrer_policy(referrer_policy_); |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 890 } | 890 } |
| 891 | 891 |
| 892 void URLFetcherCore::InformDelegateDownloadProgressInDelegateThread( | 892 void URLFetcherCore::InformDelegateDownloadProgressInDelegateThread( |
| 893 int64 current, int64 total) { | 893 int64 current, int64 total) { |
| 894 DCHECK(delegate_task_runner_->BelongsToCurrentThread()); | 894 DCHECK(delegate_task_runner_->BelongsToCurrentThread()); |
| 895 if (delegate_) | 895 if (delegate_) |
| 896 delegate_->OnURLFetchDownloadProgress(fetcher_, current, total); | 896 delegate_->OnURLFetchDownloadProgress(fetcher_, current, total); |
| 897 } | 897 } |
| 898 | 898 |
| 899 } // namespace net | 899 } // namespace net |
| OLD | NEW |