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

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

Issue 10197007: Change webkit/{fileapi,quota} code to use TaskRunner. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test fix Created 8 years, 8 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/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 <set> 9 #include <set>
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/callback.h" 12 #include "base/callback.h"
13 #include "base/command_line.h" 13 #include "base/command_line.h"
14 #include "base/file_path.h" 14 #include "base/file_path.h"
15 #include "base/message_loop_proxy.h" 15 #include "base/sequenced_task_runner.h"
16 #include "base/single_thread_task_runner.h"
16 #include "base/metrics/histogram.h" 17 #include "base/metrics/histogram.h"
17 #include "base/string_number_conversions.h" 18 #include "base/string_number_conversions.h"
18 #include "base/sys_info.h" 19 #include "base/sys_info.h"
19 #include "base/time.h" 20 #include "base/time.h"
20 #include "net/base/net_util.h" 21 #include "net/base/net_util.h"
21 #include "webkit/quota/quota_database.h" 22 #include "webkit/quota/quota_database.h"
22 #include "webkit/quota/quota_temporary_storage_evictor.h" 23 #include "webkit/quota/quota_temporary_storage_evictor.h"
23 #include "webkit/quota/quota_types.h" 24 #include "webkit/quota/quota_types.h"
24 #include "webkit/quota/usage_tracker.h" 25 #include "webkit/quota/usage_tracker.h"
25 26
(...skipping 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after
1111 } 1112 }
1112 1113
1113 Callback callback_; 1114 Callback callback_;
1114 TableEntries entries_; 1115 TableEntries entries_;
1115 }; 1116 };
1116 1117
1117 // QuotaManager --------------------------------------------------------------- 1118 // QuotaManager ---------------------------------------------------------------
1118 1119
1119 QuotaManager::QuotaManager(bool is_incognito, 1120 QuotaManager::QuotaManager(bool is_incognito,
1120 const FilePath& profile_path, 1121 const FilePath& profile_path,
1121 base::MessageLoopProxy* io_thread, 1122 base::SingleThreadTaskRunner* io_thread,
1122 base::MessageLoopProxy* db_thread, 1123 base::SequencedTaskRunner* db_thread,
1123 SpecialStoragePolicy* special_storage_policy) 1124 SpecialStoragePolicy* special_storage_policy)
1124 : is_incognito_(is_incognito), 1125 : is_incognito_(is_incognito),
1125 profile_path_(profile_path), 1126 profile_path_(profile_path),
1126 proxy_(new QuotaManagerProxy( 1127 proxy_(new QuotaManagerProxy(
1127 ALLOW_THIS_IN_INITIALIZER_LIST(this), io_thread)), 1128 ALLOW_THIS_IN_INITIALIZER_LIST(this), io_thread)),
1128 db_disabled_(false), 1129 db_disabled_(false),
1129 eviction_disabled_(false), 1130 eviction_disabled_(false),
1130 io_thread_(io_thread), 1131 io_thread_(io_thread),
1131 db_thread_(db_thread), 1132 db_thread_(db_thread),
1132 temporary_quota_initialized_(false), 1133 temporary_quota_initialized_(false),
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
1753 if (manager_) 1754 if (manager_)
1754 manager_->NotifyOriginNoLongerInUse(origin); 1755 manager_->NotifyOriginNoLongerInUse(origin);
1755 } 1756 }
1756 1757
1757 QuotaManager* QuotaManagerProxy::quota_manager() const { 1758 QuotaManager* QuotaManagerProxy::quota_manager() const {
1758 DCHECK(!io_thread_ || io_thread_->BelongsToCurrentThread()); 1759 DCHECK(!io_thread_ || io_thread_->BelongsToCurrentThread());
1759 return manager_; 1760 return manager_;
1760 } 1761 }
1761 1762
1762 QuotaManagerProxy::QuotaManagerProxy( 1763 QuotaManagerProxy::QuotaManagerProxy(
1763 QuotaManager* manager, base::MessageLoopProxy* io_thread) 1764 QuotaManager* manager, base::SingleThreadTaskRunner* io_thread)
1764 : manager_(manager), io_thread_(io_thread) { 1765 : manager_(manager), io_thread_(io_thread) {
1765 } 1766 }
1766 1767
1767 QuotaManagerProxy::~QuotaManagerProxy() { 1768 QuotaManagerProxy::~QuotaManagerProxy() {
1768 } 1769 }
1769 1770
1770 } // namespace quota 1771 } // namespace quota
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698