| 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| 11 #include "chrome/browser/prefs/pref_service.h" | 11 #include "chrome/browser/prefs/pref_service.h" |
| 12 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 12 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/profiles/profile_manager.h" | 14 #include "chrome/browser/profiles/profile_manager.h" |
| 15 #include "chrome/common/chrome_notification_types.h" | 15 #include "chrome/common/chrome_notification_types.h" |
| 16 #include "chrome/common/chrome_version_info.h" | 16 #include "chrome/common/chrome_version_info.h" |
| 17 #include "chrome/common/pref_names.h" | 17 #include "chrome/common/pref_names.h" |
| 18 #include "content/browser/gpu/gpu_blacklist.h" | 18 #include "content/browser/gpu/gpu_blacklist.h" |
| 19 #include "content/browser/gpu/gpu_data_manager.h" | 19 #include "content/browser/gpu/gpu_data_manager.h" |
| 20 #include "content/public/browser/browser_thread.h" | 20 #include "content/public/browser/browser_thread.h" |
| 21 #include "content/public/common/content_switches.h" | 21 #include "content/public/common/content_switches.h" |
| 22 #include "grit/browser_resources.h" | 22 #include "grit/browser_resources.h" |
| 23 #include "ui/base/resource/resource_bundle.h" | 23 #include "ui/base/resource/resource_bundle.h" |
| 24 #include "ui/gfx/gl/gl_implementation.h" | 24 #include "ui/gfx/gl/gl_implementation.h" |
| 25 #include "ui/gfx/gl/gl_switches.h" | 25 #include "ui/gfx/gl/gl_switches.h" |
| 26 | 26 |
| 27 using content::BrowserThread; |
| 28 |
| 27 namespace { | 29 namespace { |
| 28 | 30 |
| 29 // Delay on first fetch so we don't interfere with startup. | 31 // Delay on first fetch so we don't interfere with startup. |
| 30 static const int kStartGpuBlacklistFetchDelay = 6000; | 32 static const int kStartGpuBlacklistFetchDelay = 6000; |
| 31 | 33 |
| 32 // Delay between calls to update the gpu blacklist (48 hours). | 34 // Delay between calls to update the gpu blacklist (48 hours). |
| 33 static const int kCacheUpdateDelay = 48 * 60 * 60 * 1000; | 35 static const int kCacheUpdateDelay = 48 * 60 * 60 * 1000; |
| 34 | 36 |
| 35 std::string GetChromeVersionString() { | 37 std::string GetChromeVersionString() { |
| 36 static std::string cr_version; | 38 static std::string cr_version; |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 148 |
| 147 scoped_ptr<GpuBlacklist> gpu_blacklist( | 149 scoped_ptr<GpuBlacklist> gpu_blacklist( |
| 148 new GpuBlacklist(GetChromeVersionString())); | 150 new GpuBlacklist(GetChromeVersionString())); |
| 149 bool success = gpu_blacklist->LoadGpuBlacklist( | 151 bool success = gpu_blacklist->LoadGpuBlacklist( |
| 150 gpu_blacklist_cache, GpuBlacklist::kCurrentOsOnly); | 152 gpu_blacklist_cache, GpuBlacklist::kCurrentOsOnly); |
| 151 if (success) { | 153 if (success) { |
| 152 GpuDataManager::GetInstance()->UpdateGpuBlacklist( | 154 GpuDataManager::GetInstance()->UpdateGpuBlacklist( |
| 153 gpu_blacklist.release(), preliminary); | 155 gpu_blacklist.release(), preliminary); |
| 154 } | 156 } |
| 155 } | 157 } |
| OLD | NEW |