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

Side by Side Diff: extensions/browser/state_store.cc

Issue 2036863002: Remove use of deprecated MessageLoop methods in extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « extensions/browser/serial_extension_host_queue.cc ('k') | extensions/renderer/api_test_base.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/state_store.h" 5 #include "extensions/browser/state_store.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/message_loop/message_loop.h" 12 #include "base/location.h"
13 #include "base/single_thread_task_runner.h"
14 #include "base/threading/thread_task_runner_handle.h"
13 #include "content/public/browser/browser_context.h" 15 #include "content/public/browser/browser_context.h"
14 #include "content/public/browser/notification_service.h" 16 #include "content/public/browser/notification_service.h"
15 #include "content/public/browser/notification_types.h" 17 #include "content/public/browser/notification_types.h"
16 #include "extensions/browser/extension_registry.h" 18 #include "extensions/browser/extension_registry.h"
17 #include "extensions/browser/value_store/value_store_factory.h" 19 #include "extensions/browser/value_store/value_store_factory.h"
18 #include "extensions/common/extension.h" 20 #include "extensions/common/extension.h"
19 21
20 namespace { 22 namespace {
21 23
22 // Delay, in seconds, before we should open the State Store database. We 24 // Delay, in seconds, before we should open the State Store database. We
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 // TODO(cmumford): The store now always lazily initializes upon first access. 162 // TODO(cmumford): The store now always lazily initializes upon first access.
161 // A follow-on CL will remove this deferred initialization implementation 163 // A follow-on CL will remove this deferred initialization implementation
162 // which is now vestigial. 164 // which is now vestigial.
163 task_queue_->SetReady(); 165 task_queue_->SetReady();
164 } 166 }
165 167
166 void StateStore::InitAfterDelay() { 168 void StateStore::InitAfterDelay() {
167 if (IsInitialized()) 169 if (IsInitialized())
168 return; 170 return;
169 171
170 base::MessageLoop::current()->PostDelayedTask( 172 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
171 FROM_HERE, 173 FROM_HERE, base::Bind(&StateStore::Init, AsWeakPtr()),
172 base::Bind(&StateStore::Init, AsWeakPtr()),
173 base::TimeDelta::FromSeconds(kInitDelaySeconds)); 174 base::TimeDelta::FromSeconds(kInitDelaySeconds));
174 } 175 }
175 176
176 void StateStore::RemoveKeysForExtension(const std::string& extension_id) { 177 void StateStore::RemoveKeysForExtension(const std::string& extension_id) {
177 for (std::set<std::string>::iterator key = registered_keys_.begin(); 178 for (std::set<std::string>::iterator key = registered_keys_.begin();
178 key != registered_keys_.end(); 179 key != registered_keys_.end();
179 ++key) { 180 ++key) {
180 task_queue_->InvokeWhenReady(base::Bind(&ValueStoreFrontend::Remove, 181 task_queue_->InvokeWhenReady(base::Bind(&ValueStoreFrontend::Remove,
181 base::Unretained(store_.get()), 182 base::Unretained(store_.get()),
182 GetFullKey(extension_id, *key))); 183 GetFullKey(extension_id, *key)));
183 } 184 }
184 } 185 }
185 186
186 } // namespace extensions 187 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/serial_extension_host_queue.cc ('k') | extensions/renderer/api_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698