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

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

Issue 1373573002: ABANDONED: OOPIFs: Moving stitching of local paths from renderer to browser process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@page-serialization-recursive-begone
Patch Set: Self-review. Created 5 years, 2 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/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"
11 #include "content/browser/download/save_package.h" 11 #include "content/browser/download/save_package.h"
12 #include "content/browser/frame_host/frame_tree_node.h"
12 13
13 namespace content { 14 namespace content {
14 15
15 // Constructor for SaveItem when creating each saving job. 16 // Constructor for SaveItem when creating each saving job.
16 SaveItem::SaveItem(const GURL& url, 17 SaveItem::SaveItem(const GURL& url,
17 const Referrer& referrer,
18 SavePackage* package, 18 SavePackage* package,
19 SaveFileCreateInfo::SaveFileSource save_source) 19 SaveFileCreateInfo::SaveFileSource save_source)
20 : save_id_(-1), 20 : save_id_(-1),
21 url_(url), 21 frame_tree_node_id_(FrameTreeNode::kFrameTreeNodeInvalidID),
22 referrer_(referrer), 22 url_(url),
23 total_bytes_(0), 23 referrer_(),
24 received_bytes_(0), 24 total_bytes_(0),
25 state_(WAIT_START), 25 received_bytes_(0),
26 has_final_name_(false), 26 state_(WAIT_START),
27 is_success_(false), 27 has_final_name_(false),
28 save_source_(save_source), 28 is_success_(false),
29 package_(package) { 29 save_source_(save_source),
30 package_(package) {
30 DCHECK(package); 31 DCHECK(package);
31 } 32 }
32 33
33 SaveItem::~SaveItem() { 34 SaveItem::~SaveItem() {
34 } 35 }
35 36
36 // Set start state for save item. 37 // Set start state for save item.
37 void SaveItem::Start() { 38 void SaveItem::Start() {
38 DCHECK(state_ == WAIT_START); 39 DCHECK(state_ == WAIT_START);
39 state_ = IN_PROGRESS; 40 state_ = IN_PROGRESS;
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 DCHECK_EQ(-1, save_id_); 125 DCHECK_EQ(-1, save_id_);
125 save_id_ = save_id; 126 save_id_ = save_id;
126 } 127 }
127 128
128 void SaveItem::SetTotalBytes(int64 total_bytes) { 129 void SaveItem::SetTotalBytes(int64 total_bytes) {
129 DCHECK_EQ(0, total_bytes_); 130 DCHECK_EQ(0, total_bytes_);
130 total_bytes_ = total_bytes; 131 total_bytes_ = total_bytes;
131 } 132 }
132 133
133 } // namespace content 134 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698