Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(677)

Side by Side Diff: content/browser/browser_main_loop.cc

Issue 699073004: content: Add command line flag for native GPU memory buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gpu-memory-buffer-impl-unittests
Patch Set: fix unit test failures on macosx Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser_main_loop.h" 5 #include "content/browser/browser_main_loop.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.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/logging.h" 10 #include "base/logging.h"
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 if (parsed_command_line_.HasSwitch(switches::kRendererProcessLimit)) { 423 if (parsed_command_line_.HasSwitch(switches::kRendererProcessLimit)) {
424 std::string limit_string = parsed_command_line_.GetSwitchValueASCII( 424 std::string limit_string = parsed_command_line_.GetSwitchValueASCII(
425 switches::kRendererProcessLimit); 425 switches::kRendererProcessLimit);
426 size_t process_limit; 426 size_t process_limit;
427 if (base::StringToSizeT(limit_string, &process_limit)) { 427 if (base::StringToSizeT(limit_string, &process_limit)) {
428 RenderProcessHost::SetMaxRendererProcessCount(process_limit); 428 RenderProcessHost::SetMaxRendererProcessCount(process_limit);
429 } 429 }
430 } 430 }
431 #endif // !defined(OS_IOS) 431 #endif // !defined(OS_IOS)
432 432
433 if (parsed_command_line_.HasSwitch(switches::kEnableNativeGpuMemoryBuffers)) {
434 BrowserGpuChannelHostFactory::EnableGpuMemoryBufferFactoryUsage(
435 gfx::GpuMemoryBuffer::MAP);
436 }
437
438 #if defined(USE_OZONE)
439 BrowserGpuChannelHostFactory::EnableGpuMemoryBufferFactoryUsage(
440 gfx::GpuMemoryBuffer::SCANOUT);
441 #endif
442
433 if (parts_) 443 if (parts_)
434 parts_->PostEarlyInitialization(); 444 parts_->PostEarlyInitialization();
435 } 445 }
436 446
437 void BrowserMainLoop::MainMessageLoopStart() { 447 void BrowserMainLoop::MainMessageLoopStart() {
438 TRACE_EVENT0("startup", "BrowserMainLoop::MainMessageLoopStart"); 448 TRACE_EVENT0("startup", "BrowserMainLoop::MainMessageLoopStart");
439 if (parts_) { 449 if (parts_) {
440 TRACE_EVENT0("startup", 450 TRACE_EVENT0("startup",
441 "BrowserMainLoop::MainMessageLoopStart:PreMainMessageLoopStart"); 451 "BrowserMainLoop::MainMessageLoopStart:PreMainMessageLoopStart");
442 parts_->PreMainMessageLoopStart(); 452 parts_->PreMainMessageLoopStart();
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
1193 1203
1194 void BrowserMainLoop::EndStartupTracing() { 1204 void BrowserMainLoop::EndStartupTracing() {
1195 is_tracing_startup_ = false; 1205 is_tracing_startup_ = false;
1196 TracingController::GetInstance()->DisableRecording( 1206 TracingController::GetInstance()->DisableRecording(
1197 TracingController::CreateFileSink( 1207 TracingController::CreateFileSink(
1198 startup_trace_file_, 1208 startup_trace_file_,
1199 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); 1209 base::Bind(OnStoppedStartupTracing, startup_trace_file_)));
1200 } 1210 }
1201 1211
1202 } // namespace content 1212 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698