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

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

Issue 10381122: Add flag to specify if explicitly requested download is from web. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporated comments. Created 8 years, 7 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
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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 // to do a re-POST without user consent, and currently don't have a good 88 // to do a re-POST without user consent, and currently don't have a good
89 // plan on how to display the UI for that. 89 // plan on how to display the UI for that.
90 DCHECK(url_params.prefer_cache_); 90 DCHECK(url_params.prefer_cache_);
91 request->set_method("POST"); 91 request->set_method("POST");
92 scoped_refptr<net::UploadData> upload_data = new net::UploadData(); 92 scoped_refptr<net::UploadData> upload_data = new net::UploadData();
93 upload_data->set_identifier(url_params.post_id_); 93 upload_data->set_identifier(url_params.post_id_);
94 request->set_upload(upload_data); 94 request->set_upload(upload_data);
95 } 95 }
96 resource_dispatcher_host->BeginDownload( 96 resource_dispatcher_host->BeginDownload(
97 request.Pass(), 97 request.Pass(),
98 false, // is_content_initiated
benjhayden 2012/05/14 13:51:51 This should be configurable via DownloadUrlParamet
Randy Smith (Not in Mondays) 2012/05/14 15:55:28 Probably, although I don't have strong feelings gi
98 context, 99 context,
99 render_params.render_process_id_, 100 render_params.render_process_id_,
100 render_params.render_view_id_, 101 render_params.render_view_id_,
101 url_params.prefer_cache_, 102 url_params.prefer_cache_,
102 save_info, 103 save_info,
103 callback); 104 callback);
104 } 105 }
105 106
106 class MapValueIteratorAdapter { 107 class MapValueIteratorAdapter {
107 public: 108 public:
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1208 if (it->second->IsComplete() && !it->second->GetOpened()) 1209 if (it->second->IsComplete() && !it->second->GetOpened())
1209 ++num_unopened; 1210 ++num_unopened;
1210 } 1211 }
1211 download_stats::RecordOpensOutstanding(num_unopened); 1212 download_stats::RecordOpensOutstanding(num_unopened);
1212 } 1213 }
1213 1214
1214 void DownloadManagerImpl::SetFileManagerForTesting( 1215 void DownloadManagerImpl::SetFileManagerForTesting(
1215 DownloadFileManager* file_manager) { 1216 DownloadFileManager* file_manager) {
1216 file_manager_ = file_manager; 1217 file_manager_ = file_manager;
1217 } 1218 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698