| 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 "content/browser/indexed_db/indexed_db_context_impl.h" | 5 #include "content/browser/indexed_db/indexed_db_context_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 return 0; | 290 return 0; |
| 291 EnsureDiskUsageCacheInitialized(origin_url); | 291 EnsureDiskUsageCacheInitialized(origin_url); |
| 292 return origin_size_map_[origin_url]; | 292 return origin_size_map_[origin_url]; |
| 293 } | 293 } |
| 294 | 294 |
| 295 base::Time IndexedDBContextImpl::GetOriginLastModified(const GURL& origin_url) { | 295 base::Time IndexedDBContextImpl::GetOriginLastModified(const GURL& origin_url) { |
| 296 DCHECK(TaskRunner()->RunsTasksOnCurrentThread()); | 296 DCHECK(TaskRunner()->RunsTasksOnCurrentThread()); |
| 297 if (data_path_.empty() || !IsInOriginSet(origin_url)) | 297 if (data_path_.empty() || !IsInOriginSet(origin_url)) |
| 298 return base::Time(); | 298 return base::Time(); |
| 299 base::FilePath idb_directory = GetFilePath(origin_url); | 299 base::FilePath idb_directory = GetFilePath(origin_url); |
| 300 base::PlatformFileInfo file_info; | 300 base::File::Info file_info; |
| 301 if (!base::GetFileInfo(idb_directory, &file_info)) | 301 if (!base::GetFileInfo(idb_directory, &file_info)) |
| 302 return base::Time(); | 302 return base::Time(); |
| 303 return file_info.last_modified; | 303 return file_info.last_modified; |
| 304 } | 304 } |
| 305 | 305 |
| 306 void IndexedDBContextImpl::DeleteForOrigin(const GURL& origin_url) { | 306 void IndexedDBContextImpl::DeleteForOrigin(const GURL& origin_url) { |
| 307 DCHECK(TaskRunner()->RunsTasksOnCurrentThread()); | 307 DCHECK(TaskRunner()->RunsTasksOnCurrentThread()); |
| 308 ForceClose(origin_url); | 308 ForceClose(origin_url); |
| 309 if (data_path_.empty() || !IsInOriginSet(origin_url)) | 309 if (data_path_.empty() || !IsInOriginSet(origin_url)) |
| 310 return; | 310 return; |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 origin_set_.reset(); | 582 origin_set_.reset(); |
| 583 origin_size_map_.clear(); | 583 origin_size_map_.clear(); |
| 584 space_available_map_.clear(); | 584 space_available_map_.clear(); |
| 585 } | 585 } |
| 586 | 586 |
| 587 base::TaskRunner* IndexedDBContextImpl::TaskRunner() const { | 587 base::TaskRunner* IndexedDBContextImpl::TaskRunner() const { |
| 588 return task_runner_; | 588 return task_runner_; |
| 589 } | 589 } |
| 590 | 590 |
| 591 } // namespace content | 591 } // namespace content |
| OLD | NEW |