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

Side by Side Diff: content/browser/download/save_package.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 unified diff | Download patch
« no previous file with comments | « content/browser/download/save_item.cc ('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 #ifndef CONTENT_BROWSER_DOWNLOAD_SAVE_PACKAGE_H_ 5 #ifndef CONTENT_BROWSER_DOWNLOAD_SAVE_PACKAGE_H_
6 #define CONTENT_BROWSER_DOWNLOAD_SAVE_PACKAGE_H_ 6 #define CONTENT_BROWSER_DOWNLOAD_SAVE_PACKAGE_H_
7 7
8 #include <queue> 8 #include <queue>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 const SavePackageDownloadCreatedCallback& cb); 205 const SavePackageDownloadCreatedCallback& cb);
206 void OnReceivedSavableResourceLinksForCurrentPage( 206 void OnReceivedSavableResourceLinksForCurrentPage(
207 const std::vector<GURL>& resources_list, 207 const std::vector<GURL>& resources_list,
208 const std::vector<Referrer>& referrers_list, 208 const std::vector<Referrer>& referrers_list,
209 const std::vector<GURL>& frames_list); 209 const std::vector<GURL>& frames_list);
210 210
211 void OnReceivedSerializedHtmlData(const GURL& frame_url, 211 void OnReceivedSerializedHtmlData(const GURL& frame_url,
212 const std::string& data, 212 const std::string& data,
213 int32 status); 213 int32 status);
214 214
215 // This method is a result of a flawed save page architecture,
216 // which doesn't allow to save more than one serializable resource per url.
217 // So if this is about to happen, we must record it and log it.
218 void OnWriteToFinishedFile(bool failed, const SaveItem& item);
219
215 typedef base::hash_map<std::string, SaveItem*> SaveUrlItemMap; 220 typedef base::hash_map<std::string, SaveItem*> SaveUrlItemMap;
216 // in_progress_items_ is map of all saving job in in-progress state. 221 // in_progress_items_ is map of all saving job in in-progress state.
217 SaveUrlItemMap in_progress_items_; 222 SaveUrlItemMap in_progress_items_;
218 // saved_failed_items_ is map of all saving job which are failed. 223 // saved_failed_items_ is map of all saving job which are failed.
219 SaveUrlItemMap saved_failed_items_; 224 SaveUrlItemMap saved_failed_items_;
220 225
221 // The number of in process SaveItems. 226 // The number of in process SaveItems.
222 int in_process_count() const { 227 int in_process_count() const {
223 return static_cast<int>(in_progress_items_.size()); 228 return static_cast<int>(in_progress_items_.size());
224 } 229 }
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 friend class SavePackageTest; 336 friend class SavePackageTest;
332 FRIEND_TEST_ALL_PREFIXES(SavePackageTest, TestSuggestedSaveNames); 337 FRIEND_TEST_ALL_PREFIXES(SavePackageTest, TestSuggestedSaveNames);
333 FRIEND_TEST_ALL_PREFIXES(SavePackageTest, TestLongSafePureFilename); 338 FRIEND_TEST_ALL_PREFIXES(SavePackageTest, TestLongSafePureFilename);
334 339
335 DISALLOW_COPY_AND_ASSIGN(SavePackage); 340 DISALLOW_COPY_AND_ASSIGN(SavePackage);
336 }; 341 };
337 342
338 } // namespace content 343 } // namespace content
339 344
340 #endif // CONTENT_BROWSER_DOWNLOAD_SAVE_PACKAGE_H_ 345 #endif // CONTENT_BROWSER_DOWNLOAD_SAVE_PACKAGE_H_
OLDNEW
« no previous file with comments | « content/browser/download/save_item.cc ('k') | content/browser/download/save_package.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698