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

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

Issue 1182453004: Write new Starts/EndsWith and convert FilePath functions to StringPiece. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string_util
Patch Set: default back Created 5 years, 6 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
« base/strings/string_util.h ('K') | « base/win/win_util.cc ('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 #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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 294
295 // Indicates whether user get disk error. 295 // Indicates whether user get disk error.
296 bool disk_error_occurred_; 296 bool disk_error_occurred_;
297 297
298 // Type about saving page as only-html or complete-html. 298 // Type about saving page as only-html or complete-html.
299 SavePageType save_type_; 299 SavePageType save_type_;
300 300
301 // Number of all need to be saved resources. 301 // Number of all need to be saved resources.
302 size_t all_save_items_count_; 302 size_t all_save_items_count_;
303 303
304 typedef std::set<base::FilePath::StringType, 304 using FileNameSet =
305 bool (*)(const base::FilePath::StringType&, 305 std::set<base::FilePath::StringType,
306 const base::FilePath::StringType&)> FileNameSet; 306 bool (*)(base::FilePath::StringPieceType,
307 base::FilePath::StringPieceType)>;
307 // This set is used to eliminate duplicated file names in saving directory. 308 // This set is used to eliminate duplicated file names in saving directory.
308 FileNameSet file_name_set_; 309 FileNameSet file_name_set_;
309 310
310 typedef base::hash_map<base::FilePath::StringType, uint32> FileNameCountMap; 311 typedef base::hash_map<base::FilePath::StringType, uint32> FileNameCountMap;
311 // This map is used to track serial number for specified filename. 312 // This map is used to track serial number for specified filename.
312 FileNameCountMap file_name_count_map_; 313 FileNameCountMap file_name_count_map_;
313 314
314 // Indicates current waiting state when SavePackage try to get something 315 // Indicates current waiting state when SavePackage try to get something
315 // from outside. 316 // from outside.
316 WaitState wait_state_; 317 WaitState wait_state_;
(...skipping 13 matching lines...) Expand all
330 friend class SavePackageTest; 331 friend class SavePackageTest;
331 FRIEND_TEST_ALL_PREFIXES(SavePackageTest, TestSuggestedSaveNames); 332 FRIEND_TEST_ALL_PREFIXES(SavePackageTest, TestSuggestedSaveNames);
332 FRIEND_TEST_ALL_PREFIXES(SavePackageTest, TestLongSafePureFilename); 333 FRIEND_TEST_ALL_PREFIXES(SavePackageTest, TestLongSafePureFilename);
333 334
334 DISALLOW_COPY_AND_ASSIGN(SavePackage); 335 DISALLOW_COPY_AND_ASSIGN(SavePackage);
335 }; 336 };
336 337
337 } // namespace content 338 } // namespace content
338 339
339 #endif // CONTENT_BROWSER_DOWNLOAD_SAVE_PACKAGE_H_ 340 #endif // CONTENT_BROWSER_DOWNLOAD_SAVE_PACKAGE_H_
OLDNEW
« base/strings/string_util.h ('K') | « base/win/win_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698