| Index: chrome/browser/gpu_process_host.cc
 | 
| ===================================================================
 | 
| --- chrome/browser/gpu_process_host.cc	(revision 68066)
 | 
| +++ chrome/browser/gpu_process_host.cc	(working copy)
 | 
| @@ -5,8 +5,10 @@
 | 
|  #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"
 | 
| @@ -19,6 +21,7 @@
 | 
|  #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 +100,9 @@
 | 
|  }
 | 
|  
 | 
|  bool GpuProcessHost::Init() {
 | 
| +  if (!LoadGpuBlacklist())
 | 
| +    return false;
 | 
| +
 | 
|    if (!CreateChannel())
 | 
|      return false;
 | 
|  
 | 
| @@ -140,7 +146,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 +206,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 +450,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 +548,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())) {
 | 
| +    gpu_blacklist_.reset(blacklist);
 | 
| +    return true;
 | 
| +  }
 | 
| +  delete blacklist;
 | 
| +  return false;
 | 
| +}
 | 
| +
 | 
| 
 |