| Index: chrome/browser/gpu_process_host.cc
|
| ===================================================================
|
| --- chrome/browser/gpu_process_host.cc (revision 68066)
|
| +++ chrome/browser/gpu_process_host.cc (working copy)
|
| @@ -5,20 +5,25 @@
|
| #include "chrome/browser/gpu_process_host.h"
|
|
|
| #include "app/app_switches.h"
|
| +#include "app/resource_bundle.h"
|
| #include "base/command_line.h"
|
| #include "base/metrics/histogram.h"
|
| +#include "base/string_piece.h"
|
| #include "base/thread.h"
|
| #include "chrome/browser/browser_process.h"
|
| #include "chrome/browser/browser_thread.h"
|
| +#include "chrome/browser/gpu_blacklist.h"
|
| #include "chrome/browser/gpu_process_host_ui_shim.h"
|
| #include "chrome/browser/renderer_host/render_view_host.h"
|
| #include "chrome/browser/renderer_host/render_widget_host_view.h"
|
| #include "chrome/browser/renderer_host/resource_message_filter.h"
|
| #include "chrome/browser/tab_contents/render_view_host_delegate_helper.h"
|
| #include "chrome/common/chrome_switches.h"
|
| +#include "chrome/common/gpu_feature_flags.h"
|
| #include "chrome/common/gpu_info.h"
|
| #include "chrome/common/gpu_messages.h"
|
| #include "chrome/common/render_messages.h"
|
| +#include "grit/browser_resources.h"
|
| #include "ipc/ipc_channel_handle.h"
|
| #include "ipc/ipc_switches.h"
|
| #include "media/base/media_switches.h"
|
| @@ -97,6 +102,9 @@
|
| }
|
|
|
| bool GpuProcessHost::Init() {
|
| + if (!LoadGpuBlacklist())
|
| + return false;
|
| +
|
| if (!CreateChannel())
|
| return false;
|
|
|
| @@ -140,7 +148,8 @@
|
| if (Send(new GpuMsg_EstablishChannel(renderer_id))) {
|
| sent_requests_.push(ChannelRequest(filter));
|
| } else {
|
| - SendEstablishChannelReply(IPC::ChannelHandle(), GPUInfo(), filter);
|
| + SendEstablishChannelReply(IPC::ChannelHandle(), GPUInfo(),
|
| + GpuFeatureFlags(), filter);
|
| }
|
| }
|
|
|
| @@ -199,8 +208,11 @@
|
| void GpuProcessHost::OnChannelEstablished(
|
| const IPC::ChannelHandle& channel_handle,
|
| const GPUInfo& gpu_info) {
|
| + GpuFeatureFlags gpu_feature_flags = gpu_blacklist_->DetermineGpuFeatureFlags(
|
| + GpuBlacklist::kOsAny, NULL, gpu_info);
|
| const ChannelRequest& request = sent_requests_.front();
|
| - SendEstablishChannelReply(channel_handle, gpu_info, request.filter);
|
| + SendEstablishChannelReply(
|
| + channel_handle, gpu_info, gpu_feature_flags, request.filter);
|
| sent_requests_.pop();
|
| }
|
|
|
| @@ -440,9 +452,10 @@
|
| void GpuProcessHost::SendEstablishChannelReply(
|
| const IPC::ChannelHandle& channel,
|
| const GPUInfo& gpu_info,
|
| + const GpuFeatureFlags& gpu_feature_flags,
|
| ResourceMessageFilter* filter) {
|
| ViewMsg_GpuChannelEstablished* message =
|
| - new ViewMsg_GpuChannelEstablished(channel, gpu_info);
|
| + new ViewMsg_GpuChannelEstablished(channel, gpu_info, gpu_feature_flags);
|
| // If the renderer process is performing synchronous initialization,
|
| // it needs to handle this message before receiving the reply for
|
| // the synchronous ViewHostMsg_SynchronizeGpu message.
|
| @@ -537,3 +550,20 @@
|
| return true;
|
| }
|
|
|
| +bool GpuProcessHost::LoadGpuBlacklist() {
|
| + if (gpu_blacklist_.get() != NULL)
|
| + return true;
|
| + static const base::StringPiece gpu_blacklist_json(
|
| + ResourceBundle::GetSharedInstance().GetRawDataResource(
|
| + IDR_GPU_BLACKLIST));
|
| + GpuBlacklist* blacklist = new GpuBlacklist();
|
| + const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
|
| + if (browser_command_line.HasSwitch(switches::kIgnoreGpuBlacklist) ||
|
| + blacklist->LoadGpuBlacklist(gpu_blacklist_json.as_string(), true)) {
|
| + gpu_blacklist_.reset(blacklist);
|
| + return true;
|
| + }
|
| + delete blacklist;
|
| + return false;
|
| +}
|
| +
|
|
|