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

Unified Diff: content/browser/download/save_item.h

Issue 233723002: Workarounding fix for save complete page problems. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/download/download_manager_impl.cc ('k') | content/browser/download/save_item.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/save_item.h
diff --git a/content/browser/download/save_item.h b/content/browser/download/save_item.h
index d7cbb4f0329ccb29fed9ba970690ec8c1faff064..142f630b0650ea71dbd7230f201086a82c31d328 100644
--- a/content/browser/download/save_item.h
+++ b/content/browser/download/save_item.h
@@ -54,8 +54,17 @@ class SaveItem {
void SetTotalBytes(int64 total_bytes);
+ // Set last data received.
+ // This is in fact a "substate" of IN_PROGRESS, should be set only after
+ // after receiving the last portion of data from the renderer.
+ // This is only used as a workaround for the flawed architecture of save
+ // page functionality, which doesn't allow to save more than one serializable
+ // resource per url.
+ void SetLastDataReceived();
+
// Accessors.
SaveState state() const { return state_; }
+ bool last_data_received() const { return last_data_received_; }
const base::FilePath& full_path() const { return full_path_; }
const base::FilePath& file_name() const { return file_name_; }
const GURL& url() const { return url_; }
@@ -102,6 +111,9 @@ class SaveItem {
// Flag indicates whether SaveItem has error while in saving process.
bool is_success_;
+ // Becomes true after receiving the last portion of data from the renderer.
+ bool last_data_received_;
+
SaveFileCreateInfo::SaveFileSource save_source_;
// Our owning object.
« no previous file with comments | « content/browser/download/download_manager_impl.cc ('k') | content/browser/download/save_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698