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

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

Issue 1411253013: ABANDONED CL: Adding a save-page test that uses a custom referrer policy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@referrer-revert-to-default
Patch Set: Reuploading with no dependencies. Created 5 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
« no previous file with comments | « chrome/test/data/save_page/b_with_referrer_policy_origin.htm ('k') | no next file » | 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 "content/browser/download/save_package.h" 5 #include "content/browser/download/save_package.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after
1254 const GURL& url, 1254 const GURL& url,
1255 const Referrer& referrer, 1255 const Referrer& referrer,
1256 SaveFileCreateInfo::SaveFileSource save_source) { 1256 SaveFileCreateInfo::SaveFileSource save_source) {
1257 DCHECK(url.is_valid()); // |url| should be validated by the callers. 1257 DCHECK(url.is_valid()); // |url| should be validated by the callers.
1258 1258
1259 SaveItem* save_item; 1259 SaveItem* save_item;
1260 auto it = url_to_save_item_.find(url); 1260 auto it = url_to_save_item_.find(url);
1261 if (it != url_to_save_item_.end()) { 1261 if (it != url_to_save_item_.end()) {
1262 save_item = it->second; 1262 save_item = it->second;
1263 } else { 1263 } else {
1264 save_item = new SaveItem(url, referrer, this, save_source); 1264 Referrer sanitized_referrer = Referrer::SanitizeForRequest(url, referrer);
1265 save_item = new SaveItem(url, sanitized_referrer, this, save_source);
1265 waiting_item_queue_.push_back(save_item); 1266 waiting_item_queue_.push_back(save_item);
1266 url_to_save_item_[url] = save_item; 1267 url_to_save_item_[url] = save_item;
1267 } 1268 }
1268 1269
1269 frame_tree_node_id_to_contained_save_items_[container_frame_tree_node_id] 1270 frame_tree_node_id_to_contained_save_items_[container_frame_tree_node_id]
1270 .push_back(save_item); 1271 .push_back(save_item);
1271 return save_item; 1272 return save_item;
1272 } 1273 }
1273 1274
1274 void SavePackage::EnqueueSavableResource(int container_frame_tree_node_id, 1275 void SavePackage::EnqueueSavableResource(int container_frame_tree_node_id,
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
1575 1576
1576 void SavePackage::FinalizeDownloadEntry() { 1577 void SavePackage::FinalizeDownloadEntry() {
1577 DCHECK(download_); 1578 DCHECK(download_);
1578 DCHECK(download_manager_); 1579 DCHECK(download_manager_);
1579 1580
1580 download_manager_->OnSavePackageSuccessfullyFinished(download_); 1581 download_manager_->OnSavePackageSuccessfullyFinished(download_);
1581 StopObservation(); 1582 StopObservation();
1582 } 1583 }
1583 1584
1584 } // namespace content 1585 } // namespace content
OLDNEW
« no previous file with comments | « chrome/test/data/save_page/b_with_referrer_policy_origin.htm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698