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

Side by Side Diff: webkit/browser/fileapi/file_system_usage_cache.cc

Issue 492873002: Collapse fileapi, webkit_blob, webkit_database, quota, and webkit_common namespaces into single sto… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix chromeos build Created 6 years, 4 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
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/browser/fileapi/file_system_usage_cache.h" 5 #include "webkit/browser/fileapi/file_system_usage_cache.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
11 #include "base/file_util.h" 11 #include "base/file_util.h"
12 #include "base/files/file_path.h" 12 #include "base/files/file_path.h"
13 #include "base/pickle.h" 13 #include "base/pickle.h"
14 #include "base/stl_util.h" 14 #include "base/stl_util.h"
15 #include "webkit/browser/fileapi/timed_task_helper.h" 15 #include "webkit/browser/fileapi/timed_task_helper.h"
16 16
17 namespace fileapi { 17 namespace storage {
18 18
19 namespace { 19 namespace {
20 const int64 kCloseDelaySeconds = 5; 20 const int64 kCloseDelaySeconds = 5;
21 const size_t kMaxHandleCacheSize = 2; 21 const size_t kMaxHandleCacheSize = 2;
22 } // namespace 22 } // namespace
23 23
24 FileSystemUsageCache::FileSystemUsageCache( 24 FileSystemUsageCache::FileSystemUsageCache(
25 base::SequencedTaskRunner* task_runner) 25 base::SequencedTaskRunner* task_runner)
26 : task_runner_(task_runner), 26 : task_runner_(task_runner),
27 weak_factory_(this) { 27 weak_factory_(this) {
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 bool FileSystemUsageCache::CalledOnValidThread() { 297 bool FileSystemUsageCache::CalledOnValidThread() {
298 return !task_runner_.get() || task_runner_->RunsTasksOnCurrentThread(); 298 return !task_runner_.get() || task_runner_->RunsTasksOnCurrentThread();
299 } 299 }
300 300
301 bool FileSystemUsageCache::HasCacheFileHandle(const base::FilePath& file_path) { 301 bool FileSystemUsageCache::HasCacheFileHandle(const base::FilePath& file_path) {
302 DCHECK(CalledOnValidThread()); 302 DCHECK(CalledOnValidThread());
303 DCHECK_LE(cache_files_.size(), kMaxHandleCacheSize); 303 DCHECK_LE(cache_files_.size(), kMaxHandleCacheSize);
304 return ContainsKey(cache_files_, file_path); 304 return ContainsKey(cache_files_, file_path);
305 } 305 }
306 306
307 } // namespace fileapi 307 } // namespace storage
OLDNEW
« no previous file with comments | « webkit/browser/fileapi/file_system_usage_cache.h ('k') | webkit/browser/fileapi/file_writer_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698