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