| OLD | NEW | 
|---|
| 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  Loading... | 
| 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::GetDefault()->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  Loading... | 
| 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 | 
| OLD | NEW | 
|---|