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

Side by Side Diff: chrome/browser/chromeos/gdata/gdata_cache_metadata.cc

Issue 10855002: Change the type of file_type parameter to int, as the parameter actually takes or-ed bitmasks, (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix missing comma. Created 8 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
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 "chrome/browser/chromeos/gdata/gdata_cache_metadata.h" 5 #include "chrome/browser/chromeos/gdata/gdata_cache_metadata.h"
6 6
7 #include <leveldb/db.h> 7 #include <leveldb/db.h>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/sequenced_task_runner.h" 10 #include "base/sequenced_task_runner.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 // The resource IDs and file paths of discovered files are collected as a 103 // The resource IDs and file paths of discovered files are collected as a
104 // ResourceIdToFilePathMap, if these are processed properly. 104 // ResourceIdToFilePathMap, if these are processed properly.
105 void ScanCacheDirectory( 105 void ScanCacheDirectory(
106 const std::vector<FilePath>& cache_paths, 106 const std::vector<FilePath>& cache_paths,
107 GDataCache::CacheSubDirectoryType sub_dir_type, 107 GDataCache::CacheSubDirectoryType sub_dir_type,
108 GDataCacheMetadata::CacheMap* cache_map, 108 GDataCacheMetadata::CacheMap* cache_map,
109 ResourceIdToFilePathMap* processed_file_map) { 109 ResourceIdToFilePathMap* processed_file_map) {
110 DCHECK(cache_map); 110 DCHECK(cache_map);
111 DCHECK(processed_file_map); 111 DCHECK(processed_file_map);
112 112
113 file_util::FileEnumerator enumerator( 113 file_util::FileEnumerator enumerator(cache_paths[sub_dir_type],
114 cache_paths[sub_dir_type],
115 false, // not recursive 114 false, // not recursive
116 static_cast<file_util::FileEnumerator::FileType>( 115 file_util::FileEnumerator::FILES |
117 file_util::FileEnumerator::FILES | 116 file_util::FileEnumerator::SHOW_SYM_LINKS,
118 file_util::FileEnumerator::SHOW_SYM_LINKS),
119 util::kWildCard); 117 util::kWildCard);
120 for (FilePath current = enumerator.Next(); !current.empty(); 118 for (FilePath current = enumerator.Next(); !current.empty();
121 current = enumerator.Next()) { 119 current = enumerator.Next()) {
122 // Extract resource_id and md5 from filename. 120 // Extract resource_id and md5 from filename.
123 std::string resource_id; 121 std::string resource_id;
124 std::string md5; 122 std::string md5;
125 std::string extra_extension; 123 std::string extra_extension;
126 util::ParseCacheFilePath(current, &resource_id, &md5, &extra_extension); 124 util::ParseCacheFilePath(current, &resource_id, &md5, &extra_extension);
127 125
128 // Determine cache state. 126 // Determine cache state.
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 return scoped_ptr<GDataCacheMetadata>( 602 return scoped_ptr<GDataCacheMetadata>(
605 new FakeGDataCacheMetadata(blocking_task_runner)); 603 new FakeGDataCacheMetadata(blocking_task_runner));
606 } 604 }
607 605
608 void GDataCacheMetadata::AssertOnSequencedWorkerPool() { 606 void GDataCacheMetadata::AssertOnSequencedWorkerPool() {
609 DCHECK(!blocking_task_runner_ || 607 DCHECK(!blocking_task_runner_ ||
610 blocking_task_runner_->RunsTasksOnCurrentThread()); 608 blocking_task_runner_->RunsTasksOnCurrentThread());
611 } 609 }
612 610
613 } // namespace gdata 611 } // namespace gdata
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_cache.cc ('k') | chrome/browser/chromeos/gdata/gdata_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698