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 "webkit/fileapi/obfuscated_file_system_file_util.h" | 5 #include "webkit/fileapi/obfuscated_file_system_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 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1185 return FilePath(); | 1185 return FilePath(); |
1186 } | 1186 } |
1187 | 1187 |
1188 return path; | 1188 return path; |
1189 } | 1189 } |
1190 | 1190 |
1191 void ObfuscatedFileSystemFileUtil::MarkUsed() { | 1191 void ObfuscatedFileSystemFileUtil::MarkUsed() { |
1192 if (timer_.IsRunning()) | 1192 if (timer_.IsRunning()) |
1193 timer_.Reset(); | 1193 timer_.Reset(); |
1194 else | 1194 else |
1195 timer_.Start(FROM_HERE, base::TimeDelta::FromSeconds(kFlushDelaySeconds), | 1195 timer_.Start(base::TimeDelta::FromSeconds(kFlushDelaySeconds), this, |
1196 this, &ObfuscatedFileSystemFileUtil::DropDatabases); | 1196 &ObfuscatedFileSystemFileUtil::DropDatabases); |
1197 } | 1197 } |
1198 | 1198 |
1199 void ObfuscatedFileSystemFileUtil::DropDatabases() { | 1199 void ObfuscatedFileSystemFileUtil::DropDatabases() { |
1200 origin_database_.reset(); | 1200 origin_database_.reset(); |
1201 STLDeleteContainerPairSecondPointers( | 1201 STLDeleteContainerPairSecondPointers( |
1202 directories_.begin(), directories_.end()); | 1202 directories_.begin(), directories_.end()); |
1203 directories_.clear(); | 1203 directories_.clear(); |
1204 } | 1204 } |
1205 | 1205 |
1206 // static | 1206 // static |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1243 return false; | 1243 return false; |
1244 } | 1244 } |
1245 origin_database_.reset( | 1245 origin_database_.reset( |
1246 new FileSystemOriginDatabase( | 1246 new FileSystemOriginDatabase( |
1247 file_system_directory_.AppendASCII(kOriginDatabaseName))); | 1247 file_system_directory_.AppendASCII(kOriginDatabaseName))); |
1248 } | 1248 } |
1249 return true; | 1249 return true; |
1250 } | 1250 } |
1251 | 1251 |
1252 } // namespace fileapi | 1252 } // namespace fileapi |
OLD | NEW |