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

Side by Side Diff: webkit/fileapi/file_system_quota_client_unittest.cc

Issue 7312023: Refactoring: Change all -FileUtils non-Singleton and to own underlying FileUtils. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Reflected the comments. Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/memory/scoped_callback_factory.h" 7 #include "base/memory/scoped_callback_factory.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/message_loop_proxy.h" 9 #include "base/message_loop_proxy.h"
10 #include "base/platform_file.h" 10 #include "base/platform_file.h"
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 const std::string& origin_url, 210 const std::string& origin_url,
211 quota::StorageType type) { 211 quota::StorageType type) {
212 int64 file_paths_cost = 0; 212 int64 file_paths_cost = 0;
213 for (int i = 0; i < num_files; i++) { 213 for (int i = 0; i < num_files; i++) {
214 if (files[i].type == type && 214 if (files[i].type == type &&
215 GURL(files[i].origin_url) == GURL(origin_url)) { 215 GURL(files[i].origin_url) == GURL(origin_url)) {
216 FilePath path = FilePath().AppendASCII(files[i].name); 216 FilePath path = FilePath().AppendASCII(files[i].name);
217 if (!path.empty()) { 217 if (!path.empty()) {
218 // TODO(dmikurube): Use QuotaFileUtil in the actual -FileUtil stack. 218 // TODO(dmikurube): Use QuotaFileUtil in the actual -FileUtil stack.
219 file_paths_cost += 219 file_paths_cost +=
220 QuotaFileUtil::GetInstance()->ComputeFilePathCost(path); 220 QuotaFileUtil::CreateDefault()->ComputeFilePathCost(path);
221 } 221 }
222 } 222 }
223 } 223 }
224 return file_paths_cost; 224 return file_paths_cost;
225 } 225 }
226 226
227 void DeleteOriginData(FileSystemQuotaClient* quota_client, 227 void DeleteOriginData(FileSystemQuotaClient* quota_client,
228 const std::string& origin, 228 const std::string& origin,
229 quota::StorageType type) { 229 quota::StorageType type) {
230 deletion_status_ = quota::kQuotaStatusUnknown; 230 deletion_status_ = quota::kQuotaStatusUnknown;
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 GetOriginUsage(quota_client.get(), 588 GetOriginUsage(quota_client.get(),
589 "https://bar.com/", 589 "https://bar.com/",
590 kPersistent)); 590 kPersistent));
591 EXPECT_EQ(64 + file_paths_cost_temporary_bar_https, 591 EXPECT_EQ(64 + file_paths_cost_temporary_bar_https,
592 GetOriginUsage(quota_client.get(), 592 GetOriginUsage(quota_client.get(),
593 "https://bar.com/", 593 "https://bar.com/",
594 kTemporary)); 594 kTemporary));
595 } 595 }
596 596
597 } // namespace fileapi 597 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_operation_write_unittest.cc ('k') | webkit/fileapi/file_system_quota_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698