OLD | NEW |
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 "chrome/browser/web_resource/gpu_blacklist_updater.h" | 5 #include "chrome/browser/web_resource/gpu_blacklist_updater.h" |
6 | 6 |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/prefs/pref_service.h" | 9 #include "chrome/browser/prefs/pref_service.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/profiles/profile_manager.h" | 11 #include "chrome/browser/profiles/profile_manager.h" |
12 #include "chrome/common/notification_type.h" | |
13 #include "chrome/common/pref_names.h" | 12 #include "chrome/common/pref_names.h" |
14 #include "content/browser/browser_thread.h" | 13 #include "content/browser/browser_thread.h" |
| 14 #include "content/common/notification_type.h" |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 // Delay on first fetch so we don't interfere with startup. | 18 // Delay on first fetch so we don't interfere with startup. |
19 static const int kStartGpuBlacklistFetchDelay = 6000; | 19 static const int kStartGpuBlacklistFetchDelay = 6000; |
20 | 20 |
21 // Delay between calls to update the gpu blacklist (48 hours). | 21 // Delay between calls to update the gpu blacklist (48 hours). |
22 static const int kCacheUpdateDelay = 48 * 60 * 60 * 1000; | 22 static const int kCacheUpdateDelay = 48 * 60 * 60 * 1000; |
23 | 23 |
24 } // namespace | 24 } // namespace |
(...skipping 16 matching lines...) Expand all Loading... |
41 | 41 |
42 void GpuBlacklistUpdater::Unpack(const DictionaryValue& parsed_json) { | 42 void GpuBlacklistUpdater::Unpack(const DictionaryValue& parsed_json) { |
43 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 43 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
44 DictionaryValue* gpu_blacklist_cache = | 44 DictionaryValue* gpu_blacklist_cache = |
45 prefs_->GetMutableDictionary(prefs::kGpuBlacklist); | 45 prefs_->GetMutableDictionary(prefs::kGpuBlacklist); |
46 DCHECK(gpu_blacklist_cache); | 46 DCHECK(gpu_blacklist_cache); |
47 gpu_blacklist_cache->Clear(); | 47 gpu_blacklist_cache->Clear(); |
48 gpu_blacklist_cache->MergeDictionary(&parsed_json); | 48 gpu_blacklist_cache->MergeDictionary(&parsed_json); |
49 } | 49 } |
50 | 50 |
OLD | NEW |