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