OLD | NEW |
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/browser/fileapi/obfuscated_file_util.h" | 5 #include "webkit/browser/fileapi/obfuscated_file_util.h" |
6 | 6 |
7 #include <queue> | 7 #include <queue> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1276 void ObfuscatedFileUtil::InvalidateUsageCache( | 1276 void ObfuscatedFileUtil::InvalidateUsageCache( |
1277 FileSystemOperationContext* context, | 1277 FileSystemOperationContext* context, |
1278 const GURL& origin, | 1278 const GURL& origin, |
1279 FileSystemType type) { | 1279 FileSystemType type) { |
1280 context->file_system_context()->GetQuotaUtil(type)-> | 1280 context->file_system_context()->GetQuotaUtil(type)-> |
1281 InvalidateUsageCache(origin, type); | 1281 InvalidateUsageCache(origin, type); |
1282 } | 1282 } |
1283 | 1283 |
1284 void ObfuscatedFileUtil::MarkUsed() { | 1284 void ObfuscatedFileUtil::MarkUsed() { |
1285 if (!timer_) | 1285 if (!timer_) |
1286 timer_.reset(new TimedTaskHelper(file_task_runner_)); | 1286 timer_.reset(new TimedTaskHelper(file_task_runner_.get())); |
1287 | 1287 |
1288 if (timer_->IsRunning()) { | 1288 if (timer_->IsRunning()) { |
1289 timer_->Reset(); | 1289 timer_->Reset(); |
1290 } else { | 1290 } else { |
1291 timer_->Start(FROM_HERE, | 1291 timer_->Start(FROM_HERE, |
1292 base::TimeDelta::FromSeconds(db_flush_delay_seconds_), | 1292 base::TimeDelta::FromSeconds(db_flush_delay_seconds_), |
1293 base::Bind(&ObfuscatedFileUtil::DropDatabases, | 1293 base::Bind(&ObfuscatedFileUtil::DropDatabases, |
1294 base::Unretained(this))); | 1294 base::Unretained(this))); |
1295 } | 1295 } |
1296 } | 1296 } |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1438 // If truncating we need to update the usage. | 1438 // If truncating we need to update the usage. |
1439 if (error == base::PLATFORM_FILE_OK && delta) { | 1439 if (error == base::PLATFORM_FILE_OK && delta) { |
1440 UpdateUsage(context, url, delta); | 1440 UpdateUsage(context, url, delta); |
1441 context->change_observers()->Notify( | 1441 context->change_observers()->Notify( |
1442 &FileChangeObserver::OnModifyFile, MakeTuple(url)); | 1442 &FileChangeObserver::OnModifyFile, MakeTuple(url)); |
1443 } | 1443 } |
1444 return error; | 1444 return error; |
1445 } | 1445 } |
1446 | 1446 |
1447 } // namespace fileapi | 1447 } // namespace fileapi |
OLD | NEW |