| 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 "content/browser/gpu/gpu_process_host.h" |    5 #include "content/browser/gpu/gpu_process_host.h" | 
|    6  |    6  | 
|    7 #include "base/base_switches.h" |    7 #include "base/base_switches.h" | 
|    8 #include "base/command_line.h" |    8 #include "base/command_line.h" | 
|    9 #include "base/debug/trace_event.h" |    9 #include "base/debug/trace_event.h" | 
|   10 #include "base/memory/ref_counted.h" |   10 #include "base/memory/ref_counted.h" | 
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  512     SendOutstandingReplies(); |  512     SendOutstandingReplies(); | 
|  513     gpu_enabled_ = false; |  513     gpu_enabled_ = false; | 
|  514     return false; |  514     return false; | 
|  515   } |  515   } | 
|  516  |  516  | 
|  517   const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); |  517   const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); | 
|  518  |  518  | 
|  519   CommandLine::StringType gpu_launcher = |  519   CommandLine::StringType gpu_launcher = | 
|  520       browser_command_line.GetSwitchValueNative(switches::kGpuLauncher); |  520       browser_command_line.GetSwitchValueNative(switches::kGpuLauncher); | 
|  521  |  521  | 
|  522   FilePath exe_path = ChildProcessHost::GetChildPath(gpu_launcher.empty()); |  522 #if defined(OS_LINUX) | 
 |  523   int child_flags = gpu_launcher.empty() ? ChildProcessHost::CHILD_ALLOW_SELF : | 
 |  524                                            ChildProcessHost::CHILD_NORMAL; | 
 |  525 #else | 
 |  526   int child_flags = ChildProcessHost::CHILD_NORMAL; | 
 |  527 #endif | 
 |  528  | 
 |  529   FilePath exe_path = ChildProcessHost::GetChildPath(child_flags); | 
|  523   if (exe_path.empty()) |  530   if (exe_path.empty()) | 
|  524     return false; |  531     return false; | 
|  525  |  532  | 
|  526   CommandLine* cmd_line = new CommandLine(exe_path); |  533   CommandLine* cmd_line = new CommandLine(exe_path); | 
|  527   cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kGpuProcess); |  534   cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kGpuProcess); | 
|  528   cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id()); |  535   cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id()); | 
|  529  |  536  | 
|  530   // Propagate relevant command line switches. |  537   // Propagate relevant command line switches. | 
|  531   static const char* const kSwitchNames[] = { |  538   static const char* const kSwitchNames[] = { | 
|  532     switches::kDisableBreakpad, |  539     switches::kDisableBreakpad, | 
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  597   scoped_ptr<EstablishChannelCallback> wrapped_callback(callback); |  604   scoped_ptr<EstablishChannelCallback> wrapped_callback(callback); | 
|  598   wrapped_callback->Run(channel_handle, renderer_process_for_gpu, gpu_info); |  605   wrapped_callback->Run(channel_handle, renderer_process_for_gpu, gpu_info); | 
|  599 } |  606 } | 
|  600  |  607  | 
|  601 void GpuProcessHost::CreateCommandBufferError( |  608 void GpuProcessHost::CreateCommandBufferError( | 
|  602     CreateCommandBufferCallback* callback, int32 route_id) { |  609     CreateCommandBufferCallback* callback, int32 route_id) { | 
|  603   scoped_ptr<GpuProcessHost::CreateCommandBufferCallback> |  610   scoped_ptr<GpuProcessHost::CreateCommandBufferCallback> | 
|  604     wrapped_callback(callback); |  611     wrapped_callback(callback); | 
|  605   callback->Run(route_id); |  612   callback->Run(route_id); | 
|  606 } |  613 } | 
| OLD | NEW |