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 "chrome/browser/extensions/state_store.h" | 5 #include "chrome/browser/extensions/state_store.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/common/extensions/extension.h" | |
11 #include "content/public/browser/notification_service.h" | 10 #include "content/public/browser/notification_service.h" |
12 #include "content/public/browser/notification_types.h" | 11 #include "content/public/browser/notification_types.h" |
| 12 #include "extensions/common/extension.h" |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 // Delay, in seconds, before we should open the State Store database. We | 16 // Delay, in seconds, before we should open the State Store database. We |
17 // defer it to avoid slowing down startup. See http://crbug.com/161848 | 17 // defer it to avoid slowing down startup. See http://crbug.com/161848 |
18 const int kInitDelaySeconds = 1; | 18 const int kInitDelaySeconds = 1; |
19 | 19 |
20 std::string GetFullKey(const std::string& extension_id, | 20 std::string GetFullKey(const std::string& extension_id, |
21 const std::string& key) { | 21 const std::string& key) { |
22 return extension_id + "." + key; | 22 return extension_id + "." + key; |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 void StateStore::RemoveKeysForExtension(const std::string& extension_id) { | 162 void StateStore::RemoveKeysForExtension(const std::string& extension_id) { |
163 for (std::set<std::string>::iterator key = registered_keys_.begin(); | 163 for (std::set<std::string>::iterator key = registered_keys_.begin(); |
164 key != registered_keys_.end(); ++key) { | 164 key != registered_keys_.end(); ++key) { |
165 task_queue_->InvokeWhenReady( | 165 task_queue_->InvokeWhenReady( |
166 base::Bind(&ValueStoreFrontend::Remove, base::Unretained(&store_), | 166 base::Bind(&ValueStoreFrontend::Remove, base::Unretained(&store_), |
167 GetFullKey(extension_id, *key))); | 167 GetFullKey(extension_id, *key))); |
168 } | 168 } |
169 } | 169 } |
170 | 170 |
171 } // namespace extensions | 171 } // namespace extensions |
OLD | NEW |