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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 current_response_bytes_ = 0; | 506 current_response_bytes_ = 0; |
507 request_ = request_context_getter_->GetURLRequestContext()->CreateRequest( | 507 request_ = request_context_getter_->GetURLRequestContext()->CreateRequest( |
508 original_url_, DEFAULT_PRIORITY, this); | 508 original_url_, DEFAULT_PRIORITY, this); |
509 request_->set_stack_trace(stack_trace_); | 509 request_->set_stack_trace(stack_trace_); |
510 int flags = request_->load_flags() | load_flags_; | 510 int flags = request_->load_flags() | load_flags_; |
511 if (!g_interception_enabled) | 511 if (!g_interception_enabled) |
512 flags = flags | LOAD_DISABLE_INTERCEPT; | 512 flags = flags | LOAD_DISABLE_INTERCEPT; |
513 | 513 |
514 if (is_chunked_upload_) | 514 if (is_chunked_upload_) |
515 request_->EnableChunkedUpload(); | 515 request_->EnableChunkedUpload(); |
516 request_->set_load_flags(flags); | 516 request_->SetLoadFlags(flags); |
517 request_->SetReferrer(referrer_); | 517 request_->SetReferrer(referrer_); |
518 request_->set_first_party_for_cookies(first_party_for_cookies_.is_empty() ? | 518 request_->set_first_party_for_cookies(first_party_for_cookies_.is_empty() ? |
519 original_url_ : first_party_for_cookies_); | 519 original_url_ : first_party_for_cookies_); |
520 if (url_request_data_key_ && !url_request_create_data_callback_.is_null()) { | 520 if (url_request_data_key_ && !url_request_create_data_callback_.is_null()) { |
521 request_->SetUserData(url_request_data_key_, | 521 request_->SetUserData(url_request_data_key_, |
522 url_request_create_data_callback_.Run()); | 522 url_request_create_data_callback_.Run()); |
523 } | 523 } |
524 | 524 |
525 switch (request_type_) { | 525 switch (request_type_) { |
526 case URLFetcher::GET: | 526 case URLFetcher::GET: |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
887 } | 887 } |
888 | 888 |
889 void URLFetcherCore::InformDelegateDownloadProgressInDelegateThread( | 889 void URLFetcherCore::InformDelegateDownloadProgressInDelegateThread( |
890 int64 current, int64 total) { | 890 int64 current, int64 total) { |
891 DCHECK(delegate_task_runner_->BelongsToCurrentThread()); | 891 DCHECK(delegate_task_runner_->BelongsToCurrentThread()); |
892 if (delegate_) | 892 if (delegate_) |
893 delegate_->OnURLFetchDownloadProgress(fetcher_, current, total); | 893 delegate_->OnURLFetchDownloadProgress(fetcher_, current, total); |
894 } | 894 } |
895 | 895 |
896 } // namespace net | 896 } // namespace net |
OLD | NEW |