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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 FilePath exe_path = ChildProcessHost::GetChildPath(gpu_launcher.empty()); | 514 FilePath exe_path = ChildProcessHost::GetChildPath(gpu_launcher.empty()); |
515 if (exe_path.empty()) | 515 if (exe_path.empty()) |
516 return false; | 516 return false; |
517 | 517 |
518 CommandLine* cmd_line = new CommandLine(exe_path); | 518 CommandLine* cmd_line = new CommandLine(exe_path); |
519 cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kGpuProcess); | 519 cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kGpuProcess); |
520 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id()); | 520 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id()); |
521 | 521 |
522 // Propagate relevant command line switches. | 522 // Propagate relevant command line switches. |
523 static const char* const kSwitchNames[] = { | 523 static const char* const kSwitchNames[] = { |
| 524 switches::kDisableBreakpad, |
524 switches::kDisableGLMultisampling, | 525 switches::kDisableGLMultisampling, |
525 switches::kDisableGpuSandbox, | 526 switches::kDisableGpuSandbox, |
526 switches::kDisableGpuVsync, | 527 switches::kDisableGpuVsync, |
527 switches::kDisableGpuWatchdog, | 528 switches::kDisableGpuWatchdog, |
528 switches::kDisableLogging, | 529 switches::kDisableLogging, |
529 switches::kEnableGPUServiceLogging, | 530 switches::kEnableGPUServiceLogging, |
530 switches::kEnableLogging, | 531 switches::kEnableLogging, |
531 #if defined(OS_MACOSX) | 532 #if defined(OS_MACOSX) |
532 switches::kEnableSandboxLogging, | 533 switches::kEnableSandboxLogging, |
533 #endif | 534 #endif |
534 switches::kGpuNoContextLost, | 535 switches::kGpuNoContextLost, |
535 switches::kGpuStartupDialog, | 536 switches::kGpuStartupDialog, |
536 switches::kLoggingLevel, | 537 switches::kLoggingLevel, |
537 switches::kNoSandbox, | 538 switches::kNoSandbox, |
538 switches::kUseGL, | 539 switches::kUseGL, |
539 }; | 540 }; |
540 cmd_line->CopySwitchesFrom(browser_command_line, kSwitchNames, | 541 cmd_line->CopySwitchesFrom(browser_command_line, kSwitchNames, |
541 arraysize(kSwitchNames)); | 542 arraysize(kSwitchNames)); |
542 | 543 |
| 544 // If --ignore-gpu-blacklist is passed in, don't send in crash reports |
| 545 // because GPU is expected to be unreliable. |
| 546 if (browser_command_line.HasSwitch(switches::kIgnoreGpuBlacklist) && |
| 547 !cmd_line->HasSwitch(switches::kDisableBreakpad)) |
| 548 cmd_line->AppendSwitch(switches::kDisableBreakpad); |
| 549 |
543 GpuFeatureFlags flags = GpuDataManager::GetInstance()->GetGpuFeatureFlags(); | 550 GpuFeatureFlags flags = GpuDataManager::GetInstance()->GetGpuFeatureFlags(); |
544 if (flags.flags() & GpuFeatureFlags::kGpuFeatureMultisampling) | 551 if (flags.flags() & GpuFeatureFlags::kGpuFeatureMultisampling) |
545 cmd_line->AppendSwitch(switches::kDisableGLMultisampling); | 552 cmd_line->AppendSwitch(switches::kDisableGLMultisampling); |
546 | 553 |
547 // If specified, prepend a launcher program to the command line. | 554 // If specified, prepend a launcher program to the command line. |
548 if (!gpu_launcher.empty()) | 555 if (!gpu_launcher.empty()) |
549 cmd_line->PrependWrapper(gpu_launcher); | 556 cmd_line->PrependWrapper(gpu_launcher); |
550 | 557 |
551 Launch( | 558 Launch( |
552 #if defined(OS_WIN) | 559 #if defined(OS_WIN) |
(...skipping 29 matching lines...) Expand all Loading... |
582 scoped_ptr<EstablishChannelCallback> wrapped_callback(callback); | 589 scoped_ptr<EstablishChannelCallback> wrapped_callback(callback); |
583 wrapped_callback->Run(channel_handle, renderer_process_for_gpu, gpu_info); | 590 wrapped_callback->Run(channel_handle, renderer_process_for_gpu, gpu_info); |
584 } | 591 } |
585 | 592 |
586 void GpuProcessHost::CreateCommandBufferError( | 593 void GpuProcessHost::CreateCommandBufferError( |
587 CreateCommandBufferCallback* callback, int32 route_id) { | 594 CreateCommandBufferCallback* callback, int32 route_id) { |
588 scoped_ptr<GpuProcessHost::CreateCommandBufferCallback> | 595 scoped_ptr<GpuProcessHost::CreateCommandBufferCallback> |
589 wrapped_callback(callback); | 596 wrapped_callback(callback); |
590 callback->Run(route_id); | 597 callback->Run(route_id); |
591 } | 598 } |
OLD | NEW |