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

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

Issue 786423002: Get rid of net::DO_NOT_PROMPT_FOR_LOGIN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: delete flag from iOS code Created 5 years, 11 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
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 void BeginDownload(scoped_ptr<DownloadUrlParameters> params, 51 void BeginDownload(scoped_ptr<DownloadUrlParameters> params,
52 uint32 download_id) { 52 uint32 download_id) {
53 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 53 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
54 // ResourceDispatcherHost{Base} is-not-a URLRequest::Delegate, and 54 // ResourceDispatcherHost{Base} is-not-a URLRequest::Delegate, and
55 // DownloadUrlParameters can-not include resource_dispatcher_host_impl.h, so 55 // DownloadUrlParameters can-not include resource_dispatcher_host_impl.h, so
56 // we must down cast. RDHI is the only subclass of RDH as of 2012 May 4. 56 // we must down cast. RDHI is the only subclass of RDH as of 2012 May 4.
57 scoped_ptr<net::URLRequest> request( 57 scoped_ptr<net::URLRequest> request(
58 params->resource_context()->GetRequestContext()->CreateRequest( 58 params->resource_context()->GetRequestContext()->CreateRequest(
59 params->url(), net::DEFAULT_PRIORITY, NULL, NULL)); 59 params->url(), net::DEFAULT_PRIORITY, NULL, NULL));
60 request->SetLoadFlags(request->load_flags() | params->load_flags());
61 request->set_method(params->method()); 60 request->set_method(params->method());
62 if (!params->post_body().empty()) { 61 if (!params->post_body().empty()) {
63 const std::string& body = params->post_body(); 62 const std::string& body = params->post_body();
64 scoped_ptr<net::UploadElementReader> reader( 63 scoped_ptr<net::UploadElementReader> reader(
65 net::UploadOwnedBytesElementReader::CreateWithString(body)); 64 net::UploadOwnedBytesElementReader::CreateWithString(body));
66 request->set_upload( 65 request->set_upload(
67 net::ElementsUploadDataStream::CreateWithReader(reader.Pass(), 0)); 66 net::ElementsUploadDataStream::CreateWithReader(reader.Pass(), 0));
68 } 67 }
69 if (params->post_id() >= 0) { 68 if (params->post_id() >= 0) {
70 // 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 save_info->file = params->GetFile(); 121 save_info->file = params->GetFile();
123 122
124 ResourceDispatcherHost::Get()->BeginDownload( 123 ResourceDispatcherHost::Get()->BeginDownload(
125 request.Pass(), 124 request.Pass(),
126 params->referrer(), 125 params->referrer(),
127 params->content_initiated(), 126 params->content_initiated(),
128 params->resource_context(), 127 params->resource_context(),
129 params->render_process_host_id(), 128 params->render_process_host_id(),
130 params->render_view_host_routing_id(), 129 params->render_view_host_routing_id(),
131 params->prefer_cache(), 130 params->prefer_cache(),
131 params->do_not_prompt_for_login(),
132 save_info.Pass(), 132 save_info.Pass(),
133 download_id, 133 download_id,
134 params->callback()); 134 params->callback());
135 } 135 }
136 136
137 class MapValueIteratorAdapter { 137 class MapValueIteratorAdapter {
138 public: 138 public:
139 explicit MapValueIteratorAdapter( 139 explicit MapValueIteratorAdapter(
140 base::hash_map<int64, DownloadItem*>::const_iterator iter) 140 base::hash_map<int64, DownloadItem*>::const_iterator iter)
141 : iter_(iter) { 141 : iter_(iter) {
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 if (delegate_) 716 if (delegate_)
717 delegate_->OpenDownload(download); 717 delegate_->OpenDownload(download);
718 } 718 }
719 719
720 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) { 720 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) {
721 if (delegate_) 721 if (delegate_)
722 delegate_->ShowDownloadInShell(download); 722 delegate_->ShowDownloadInShell(download);
723 } 723 }
724 724
725 } // namespace content 725 } // namespace content
OLDNEW
« no previous file with comments | « components/precache/core/precache_fetcher.cc ('k') | content/browser/loader/resource_dispatcher_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698