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/logging.h" | 7 #include "base/logging.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 chrome::VersionInfo version_info; | 32 chrome::VersionInfo version_info; |
33 return version_info.is_valid() ? version_info.Version() : "0"; | 33 return version_info.is_valid() ? version_info.Version() : "0"; |
34 } | 34 } |
35 | 35 |
36 } // namespace anonymous | 36 } // namespace anonymous |
37 | 37 |
38 const char* GpuBlacklistUpdater::kDefaultGpuBlacklistURL = | 38 const char* GpuBlacklistUpdater::kDefaultGpuBlacklistURL = |
39 "https://dl.google.com/dl/edgedl/chrome/gpu/software_rendering_list.json"; | 39 "https://dl.google.com/dl/edgedl/chrome/gpu/software_rendering_list.json"; |
40 | 40 |
41 GpuBlacklistUpdater::GpuBlacklistUpdater() | 41 GpuBlacklistUpdater::GpuBlacklistUpdater() |
42 : WebResourceService(ProfileManager::GetDefaultProfile(), | 42 : WebResourceService(g_browser_process->local_state(), |
43 g_browser_process->local_state(), | |
44 GpuBlacklistUpdater::kDefaultGpuBlacklistURL, | 43 GpuBlacklistUpdater::kDefaultGpuBlacklistURL, |
45 false, // don't append locale to URL | 44 false, // don't append locale to URL |
46 NotificationType::NOTIFICATION_TYPE_COUNT, | 45 NotificationType::NOTIFICATION_TYPE_COUNT, |
47 prefs::kGpuBlacklistUpdate, | 46 prefs::kGpuBlacklistUpdate, |
48 kStartGpuBlacklistFetchDelay, | 47 kStartGpuBlacklistFetchDelay, |
49 kCacheUpdateDelay) { | 48 kCacheUpdateDelay) { |
50 prefs_->RegisterDictionaryPref(prefs::kGpuBlacklist); | 49 prefs_->RegisterDictionaryPref(prefs::kGpuBlacklist); |
51 InitializeGpuBlacklist(); | 50 InitializeGpuBlacklist(); |
52 } | 51 } |
53 | 52 |
(...skipping 29 matching lines...) Expand all Loading... |
83 const DictionaryValue& gpu_blacklist_cache, bool preliminary) { | 82 const DictionaryValue& gpu_blacklist_cache, bool preliminary) { |
84 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 83 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
85 | 84 |
86 scoped_ptr<GpuBlacklist> gpu_blacklist( | 85 scoped_ptr<GpuBlacklist> gpu_blacklist( |
87 new GpuBlacklist(GetChromeVersionString())); | 86 new GpuBlacklist(GetChromeVersionString())); |
88 if (gpu_blacklist->LoadGpuBlacklist(gpu_blacklist_cache, true)) { | 87 if (gpu_blacklist->LoadGpuBlacklist(gpu_blacklist_cache, true)) { |
89 GpuDataManager::GetInstance()->UpdateGpuBlacklist( | 88 GpuDataManager::GetInstance()->UpdateGpuBlacklist( |
90 gpu_blacklist.release(), preliminary); | 89 gpu_blacklist.release(), preliminary); |
91 } | 90 } |
92 } | 91 } |
OLD | NEW |