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

Side by Side Diff: content/browser/download/download_manager_impl.cc

Issue 51683002: [Net] Assert that URLRequests with LOAD_IGNORE_LIMITS have MAXIMUM_PRIORITY (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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
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 "content/browser/download/download_manager_impl.h" 5 #include "content/browser/download/download_manager_impl.h"
6 6
7 #include <iterator> 7 #include <iterator>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 void BeginDownload(scoped_ptr<DownloadUrlParameters> params, 50 void BeginDownload(scoped_ptr<DownloadUrlParameters> params,
51 uint32 download_id) { 51 uint32 download_id) {
52 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 52 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
53 // ResourceDispatcherHost{Base} is-not-a URLRequest::Delegate, and 53 // ResourceDispatcherHost{Base} is-not-a URLRequest::Delegate, and
54 // DownloadUrlParameters can-not include resource_dispatcher_host_impl.h, so 54 // DownloadUrlParameters can-not include resource_dispatcher_host_impl.h, so
55 // we must down cast. RDHI is the only subclass of RDH as of 2012 May 4. 55 // we must down cast. RDHI is the only subclass of RDH as of 2012 May 4.
56 scoped_ptr<net::URLRequest> request( 56 scoped_ptr<net::URLRequest> request(
57 params->resource_context()->GetRequestContext()->CreateRequest( 57 params->resource_context()->GetRequestContext()->CreateRequest(
58 params->url(), NULL)); 58 params->url(), NULL));
59 request->set_load_flags(request->load_flags() | params->load_flags()); 59 request->SetLoadFlags(request->load_flags() | params->load_flags());
60 request->set_method(params->method()); 60 request->set_method(params->method());
61 if (!params->post_body().empty()) { 61 if (!params->post_body().empty()) {
62 const std::string& body = params->post_body(); 62 const std::string& body = params->post_body();
63 scoped_ptr<net::UploadElementReader> reader( 63 scoped_ptr<net::UploadElementReader> reader(
64 net::UploadOwnedBytesElementReader::CreateWithString(body)); 64 net::UploadOwnedBytesElementReader::CreateWithString(body));
65 request->set_upload(make_scoped_ptr( 65 request->set_upload(make_scoped_ptr(
66 net::UploadDataStream::CreateWithReader(reader.Pass(), 0))); 66 net::UploadDataStream::CreateWithReader(reader.Pass(), 0)));
67 } 67 }
68 if (params->post_id() >= 0) { 68 if (params->post_id() >= 0) {
69 // The POST in this case does not have an actual body, and only works 69 // The POST in this case does not have an actual body, and only works
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 if (delegate_) 713 if (delegate_)
714 delegate_->OpenDownload(download); 714 delegate_->OpenDownload(download);
715 } 715 }
716 716
717 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) { 717 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) {
718 if (delegate_) 718 if (delegate_)
719 delegate_->ShowDownloadInShell(download); 719 delegate_->ShowDownloadInShell(download);
720 } 720 }
721 721
722 } // namespace content 722 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698