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

Side by Side Diff: webkit/quota/quota_manager.cc

Issue 12163003: Add FilePath to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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
« no previous file with comments | « webkit/quota/quota_manager.h ('k') | webkit/quota/quota_manager_unittest.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 #include "webkit/quota/quota_manager.h" 5 #include "webkit/quota/quota_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <deque> 8 #include <deque>
9 #include <functional> 9 #include <functional>
10 #include <set> 10 #include <set>
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 } 144 }
145 145
146 bool UpdateModifiedTimeOnDBThread(const GURL& origin, 146 bool UpdateModifiedTimeOnDBThread(const GURL& origin,
147 StorageType type, 147 StorageType type,
148 base::Time modified_time, 148 base::Time modified_time,
149 QuotaDatabase* database) { 149 QuotaDatabase* database) {
150 DCHECK(database); 150 DCHECK(database);
151 return database->SetOriginLastModifiedTime(origin, type, modified_time); 151 return database->SetOriginLastModifiedTime(origin, type, modified_time);
152 } 152 }
153 153
154 int64 CallSystemGetAmountOfFreeDiskSpace(const FilePath& profile_path) { 154 int64 CallSystemGetAmountOfFreeDiskSpace(const base::FilePath& profile_path) {
155 // Ensure the profile path exists. 155 // Ensure the profile path exists.
156 if(!file_util::CreateDirectory(profile_path)) { 156 if(!file_util::CreateDirectory(profile_path)) {
157 LOG(WARNING) << "Create directory failed for path" << profile_path.value(); 157 LOG(WARNING) << "Create directory failed for path" << profile_path.value();
158 return 0; 158 return 0;
159 } 159 }
160 return base::SysInfo::AmountOfFreeDiskSpace(profile_path); 160 return base::SysInfo::AmountOfFreeDiskSpace(profile_path);
161 } 161 }
162 162
163 } // anonymous namespace 163 } // anonymous namespace
164 164
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 entries_.push_back(entry); 869 entries_.push_back(entry);
870 return true; 870 return true;
871 } 871 }
872 872
873 OriginInfoTableEntries entries_; 873 OriginInfoTableEntries entries_;
874 }; 874 };
875 875
876 // QuotaManager --------------------------------------------------------------- 876 // QuotaManager ---------------------------------------------------------------
877 877
878 QuotaManager::QuotaManager(bool is_incognito, 878 QuotaManager::QuotaManager(bool is_incognito,
879 const FilePath& profile_path, 879 const base::FilePath& profile_path,
880 base::SingleThreadTaskRunner* io_thread, 880 base::SingleThreadTaskRunner* io_thread,
881 base::SequencedTaskRunner* db_thread, 881 base::SequencedTaskRunner* db_thread,
882 SpecialStoragePolicy* special_storage_policy) 882 SpecialStoragePolicy* special_storage_policy)
883 : is_incognito_(is_incognito), 883 : is_incognito_(is_incognito),
884 profile_path_(profile_path), 884 profile_path_(profile_path),
885 proxy_(new QuotaManagerProxy( 885 proxy_(new QuotaManagerProxy(
886 ALLOW_THIS_IN_INITIALIZER_LIST(this), io_thread)), 886 ALLOW_THIS_IN_INITIALIZER_LIST(this), io_thread)),
887 db_disabled_(false), 887 db_disabled_(false),
888 eviction_disabled_(false), 888 eviction_disabled_(false),
889 io_thread_(io_thread), 889 io_thread_(io_thread),
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
1176 } 1176 }
1177 1177
1178 void QuotaManager::LazyInitialize() { 1178 void QuotaManager::LazyInitialize() {
1179 DCHECK(io_thread_->BelongsToCurrentThread()); 1179 DCHECK(io_thread_->BelongsToCurrentThread());
1180 if (database_.get()) { 1180 if (database_.get()) {
1181 // Initialization seems to be done already. 1181 // Initialization seems to be done already.
1182 return; 1182 return;
1183 } 1183 }
1184 1184
1185 // Use an empty path to open an in-memory only databse for incognito. 1185 // Use an empty path to open an in-memory only databse for incognito.
1186 database_.reset(new QuotaDatabase(is_incognito_ ? FilePath() : 1186 database_.reset(new QuotaDatabase(is_incognito_ ? base::FilePath() :
1187 profile_path_.AppendASCII(kDatabaseName))); 1187 profile_path_.AppendASCII(kDatabaseName)));
1188 1188
1189 temporary_usage_tracker_.reset( 1189 temporary_usage_tracker_.reset(
1190 new UsageTracker(clients_, kStorageTypeTemporary, 1190 new UsageTracker(clients_, kStorageTypeTemporary,
1191 special_storage_policy_)); 1191 special_storage_policy_));
1192 persistent_usage_tracker_.reset( 1192 persistent_usage_tracker_.reset(
1193 new UsageTracker(clients_, kStorageTypePersistent, 1193 new UsageTracker(clients_, kStorageTypePersistent,
1194 special_storage_policy_)); 1194 special_storage_policy_));
1195 syncable_usage_tracker_.reset( 1195 syncable_usage_tracker_.reset(
1196 new UsageTracker(clients_, kStorageTypeSyncable, 1196 new UsageTracker(clients_, kStorageTypeSyncable,
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
1708 1708
1709 QuotaManagerProxy::QuotaManagerProxy( 1709 QuotaManagerProxy::QuotaManagerProxy(
1710 QuotaManager* manager, base::SingleThreadTaskRunner* io_thread) 1710 QuotaManager* manager, base::SingleThreadTaskRunner* io_thread)
1711 : manager_(manager), io_thread_(io_thread) { 1711 : manager_(manager), io_thread_(io_thread) {
1712 } 1712 }
1713 1713
1714 QuotaManagerProxy::~QuotaManagerProxy() { 1714 QuotaManagerProxy::~QuotaManagerProxy() {
1715 } 1715 }
1716 1716
1717 } // namespace quota 1717 } // namespace quota
OLDNEW
« no previous file with comments | « webkit/quota/quota_manager.h ('k') | webkit/quota/quota_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698