Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(303)

Side by Side Diff: net/url_request/url_fetcher_core.cc

Issue 10873056: Added URLRequestContext::CreateRequest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed android bug Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/test/spawner_communicator.cc ('k') | net/url_request/url_request.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/file_util_proxy.h" 8 #include "base/file_util_proxy.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 // Since StartURLRequest() is posted as a *delayed* task, it may 656 // Since StartURLRequest() is posted as a *delayed* task, it may
657 // run after the URLFetcher was already stopped. 657 // run after the URLFetcher was already stopped.
658 return; 658 return;
659 } 659 }
660 660
661 DCHECK(request_context_getter_); 661 DCHECK(request_context_getter_);
662 DCHECK(!request_.get()); 662 DCHECK(!request_.get());
663 663
664 g_registry.Get().AddURLFetcherCore(this); 664 g_registry.Get().AddURLFetcherCore(this);
665 current_response_bytes_ = 0; 665 current_response_bytes_ = 0;
666 request_.reset(new URLRequest( 666 request_.reset(request_context_getter_->GetURLRequestContext()->CreateRequest(
667 original_url_, 667 original_url_, this));
668 this,
669 request_context_getter_->GetURLRequestContext()));
670 request_->set_stack_trace(stack_trace_); 668 request_->set_stack_trace(stack_trace_);
671 int flags = request_->load_flags() | load_flags_; 669 int flags = request_->load_flags() | load_flags_;
672 if (!g_interception_enabled) 670 if (!g_interception_enabled)
673 flags = flags | LOAD_DISABLE_INTERCEPT; 671 flags = flags | LOAD_DISABLE_INTERCEPT;
674 672
675 if (is_chunked_upload_) 673 if (is_chunked_upload_)
676 request_->EnableChunkedUpload(); 674 request_->EnableChunkedUpload();
677 request_->set_load_flags(flags); 675 request_->set_load_flags(flags);
678 request_->set_referrer(referrer_); 676 request_->set_referrer(referrer_);
679 request_->set_first_party_for_cookies(first_party_for_cookies_.is_empty() ? 677 request_->set_first_party_for_cookies(first_party_for_cookies_.is_empty() ?
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
998 } 996 }
999 997
1000 void URLFetcherCore::InformDelegateDownloadDataInDelegateThread( 998 void URLFetcherCore::InformDelegateDownloadDataInDelegateThread(
1001 scoped_ptr<std::string> download_data) { 999 scoped_ptr<std::string> download_data) {
1002 DCHECK(delegate_task_runner_->BelongsToCurrentThread()); 1000 DCHECK(delegate_task_runner_->BelongsToCurrentThread());
1003 if (delegate_) 1001 if (delegate_)
1004 delegate_->OnURLFetchDownloadData(fetcher_, download_data.Pass()); 1002 delegate_->OnURLFetchDownloadData(fetcher_, download_data.Pass());
1005 } 1003 }
1006 1004
1007 } // namespace net 1005 } // namespace net
OLDNEW
« no previous file with comments | « net/test/spawner_communicator.cc ('k') | net/url_request/url_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698