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

Side by Side Diff: content/child/quota_dispatcher.cc

Issue 2496653002: Part 2 of base::IDMap refactor to eliminate IDMapOwnPointer/IDMapExternalPointer modes (Closed)
Patch Set: typedefs => using statements, update comments in base/id_map.h Created 4 years 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
OLDNEW
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 "content/child/quota_dispatcher.h" 5 #include "content/child/quota_dispatcher.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 } // namespace 63 } // namespace
64 64
65 QuotaDispatcher::QuotaDispatcher(ThreadSafeSender* thread_safe_sender, 65 QuotaDispatcher::QuotaDispatcher(ThreadSafeSender* thread_safe_sender,
66 QuotaMessageFilter* quota_message_filter) 66 QuotaMessageFilter* quota_message_filter)
67 : thread_safe_sender_(thread_safe_sender), 67 : thread_safe_sender_(thread_safe_sender),
68 quota_message_filter_(quota_message_filter) { 68 quota_message_filter_(quota_message_filter) {
69 g_quota_dispatcher_tls.Pointer()->Set(this); 69 g_quota_dispatcher_tls.Pointer()->Set(this);
70 } 70 }
71 71
72 QuotaDispatcher::~QuotaDispatcher() { 72 QuotaDispatcher::~QuotaDispatcher() {
73 IDMap<Callback, IDMapOwnPointer>::iterator iter(&pending_quota_callbacks_); 73 IDMap<std::unique_ptr<Callback>>::iterator iter(&pending_quota_callbacks_);
74 while (!iter.IsAtEnd()) { 74 while (!iter.IsAtEnd()) {
75 iter.GetCurrentValue()->DidFail(storage::kQuotaErrorAbort); 75 iter.GetCurrentValue()->DidFail(storage::kQuotaErrorAbort);
76 iter.Advance(); 76 iter.Advance();
77 } 77 }
78 78
79 g_quota_dispatcher_tls.Pointer()->Set(NULL); 79 g_quota_dispatcher_tls.Pointer()->Set(NULL);
80 } 80 }
81 81
82 QuotaDispatcher* QuotaDispatcher::ThreadSpecificInstance( 82 QuotaDispatcher* QuotaDispatcher::ThreadSpecificInstance(
83 ThreadSafeSender* thread_safe_sender, 83 ThreadSafeSender* thread_safe_sender,
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 "mismatching enums: kStorageTypePersistent"); 183 "mismatching enums: kStorageTypePersistent");
184 184
185 static_assert(int(blink::WebStorageQuotaErrorNotSupported) == 185 static_assert(int(blink::WebStorageQuotaErrorNotSupported) ==
186 int(storage::kQuotaErrorNotSupported), 186 int(storage::kQuotaErrorNotSupported),
187 "mismatching enums: kQuotaErrorNotSupported"); 187 "mismatching enums: kQuotaErrorNotSupported");
188 static_assert(int(blink::WebStorageQuotaErrorAbort) == 188 static_assert(int(blink::WebStorageQuotaErrorAbort) ==
189 int(storage::kQuotaErrorAbort), 189 int(storage::kQuotaErrorAbort),
190 "mismatching enums: kQuotaErrorAbort"); 190 "mismatching enums: kQuotaErrorAbort");
191 191
192 } // namespace content 192 } // namespace content
OLDNEW
« no previous file with comments | « content/child/quota_dispatcher.h ('k') | content/child/service_worker/service_worker_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698