| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/gpu_process_host.h" | 5 #include "chrome/browser/gpu_process_host.h" |
| 6 | 6 |
| 7 #include "app/app_switches.h" | 7 #include "app/app_switches.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 // Tasks used by this file | 47 // Tasks used by this file |
| 48 class RouteOnUIThreadTask : public Task { | 48 class RouteOnUIThreadTask : public Task { |
| 49 public: | 49 public: |
| 50 explicit RouteOnUIThreadTask(const IPC::Message& msg) : msg_(msg) { | 50 explicit RouteOnUIThreadTask(const IPC::Message& msg) : msg_(msg) { |
| 51 } | 51 } |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 void Run() { | 54 void Run() { |
| 55 GpuProcessHostUIShim::Get()->OnMessageReceived(msg_); | 55 GpuProcessHostUIShim::GetInstance()->OnMessageReceived(msg_); |
| 56 } | 56 } |
| 57 IPC::Message msg_; | 57 IPC::Message msg_; |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 // Global GpuProcessHost instance. | 60 // Global GpuProcessHost instance. |
| 61 // We can not use Singleton<GpuProcessHost> because that gets | 61 // We can not use Singleton<GpuProcessHost> because that gets |
| 62 // terminated on the wrong thread (main thread). We need the | 62 // terminated on the wrong thread (main thread). We need the |
| 63 // GpuProcessHost to be terminated on the same thread on which it is | 63 // GpuProcessHost to be terminated on the same thread on which it is |
| 64 // initialized, the IO thread. | 64 // initialized, the IO thread. |
| 65 static GpuProcessHost* sole_instance_ = NULL; | 65 static GpuProcessHost* sole_instance_ = NULL; |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); | 567 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); |
| 568 if (browser_command_line.HasSwitch(switches::kIgnoreGpuBlacklist) || | 568 if (browser_command_line.HasSwitch(switches::kIgnoreGpuBlacklist) || |
| 569 blacklist->LoadGpuBlacklist(gpu_blacklist_json.as_string(), true)) { | 569 blacklist->LoadGpuBlacklist(gpu_blacklist_json.as_string(), true)) { |
| 570 gpu_blacklist_.reset(blacklist); | 570 gpu_blacklist_.reset(blacklist); |
| 571 return true; | 571 return true; |
| 572 } | 572 } |
| 573 delete blacklist; | 573 delete blacklist; |
| 574 return false; | 574 return false; |
| 575 } | 575 } |
| 576 | 576 |
| OLD | NEW |