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

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

Issue 2187353004: Resource requests from Save-Page-As should go through CanRequestURL checks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 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
« no previous file with comments | « content/browser/download/save_item.h ('k') | content/browser/download/save_package.cc » ('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 "content/browser/download/save_item.h" 5 #include "content/browser/download/save_item.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "content/browser/download/save_file.h" 9 #include "content/browser/download/save_file.h"
10 #include "content/browser/download/save_file_manager.h" 10 #include "content/browser/download/save_file_manager.h"
(...skipping 10 matching lines...) Expand all
21 return SaveItemId::FromUnsafeValue(g_next_save_item_id++); 21 return SaveItemId::FromUnsafeValue(g_next_save_item_id++);
22 } 22 }
23 23
24 } // namespace 24 } // namespace
25 25
26 // Constructor for SaveItem when creating each saving job. 26 // Constructor for SaveItem when creating each saving job.
27 SaveItem::SaveItem(const GURL& url, 27 SaveItem::SaveItem(const GURL& url,
28 const Referrer& referrer, 28 const Referrer& referrer,
29 SavePackage* package, 29 SavePackage* package,
30 SaveFileCreateInfo::SaveFileSource save_source, 30 SaveFileCreateInfo::SaveFileSource save_source,
31 int frame_tree_node_id) 31 int frame_tree_node_id,
32 int container_frame_tree_node_id)
32 : save_item_id_(GetNextSaveItemId()), 33 : save_item_id_(GetNextSaveItemId()),
33 url_(url), 34 url_(url),
34 referrer_(referrer), 35 referrer_(referrer),
35 frame_tree_node_id_(frame_tree_node_id), 36 frame_tree_node_id_(frame_tree_node_id),
37 container_frame_tree_node_id_(container_frame_tree_node_id),
36 total_bytes_(0), 38 total_bytes_(0),
37 received_bytes_(0), 39 received_bytes_(0),
38 state_(WAIT_START), 40 state_(WAIT_START),
39 is_success_(false), 41 is_success_(false),
40 save_source_(save_source), 42 save_source_(save_source),
41 package_(package) { 43 package_(package) {
42 DCHECK(package); 44 DCHECK(package);
43 } 45 }
44 46
45 SaveItem::~SaveItem() {} 47 SaveItem::~SaveItem() {}
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 DCHECK(!full_path.empty() && !has_final_name()); 98 DCHECK(!full_path.empty() && !has_final_name());
97 full_path_ = full_path; 99 full_path_ = full_path;
98 } 100 }
99 101
100 void SaveItem::SetTotalBytes(int64_t total_bytes) { 102 void SaveItem::SetTotalBytes(int64_t total_bytes) {
101 DCHECK_EQ(0, total_bytes_); 103 DCHECK_EQ(0, total_bytes_);
102 total_bytes_ = total_bytes; 104 total_bytes_ = total_bytes;
103 } 105 }
104 106
105 } // namespace content 107 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/save_item.h ('k') | content/browser/download/save_package.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698