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

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

Issue 1189943002: content: Fix lost context handling when using native GpuMemoryBuffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: retry logic and remove singleton Created 5 years, 6 months 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
« no previous file with comments | « no previous file | content/browser/compositor/buffer_queue_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 if (parsed_command_line_.HasSwitch(switches::kRendererProcessLimit)) { 470 if (parsed_command_line_.HasSwitch(switches::kRendererProcessLimit)) {
471 std::string limit_string = parsed_command_line_.GetSwitchValueASCII( 471 std::string limit_string = parsed_command_line_.GetSwitchValueASCII(
472 switches::kRendererProcessLimit); 472 switches::kRendererProcessLimit);
473 size_t process_limit; 473 size_t process_limit;
474 if (base::StringToSizeT(limit_string, &process_limit)) { 474 if (base::StringToSizeT(limit_string, &process_limit)) {
475 RenderProcessHost::SetMaxRendererProcessCount(process_limit); 475 RenderProcessHost::SetMaxRendererProcessCount(process_limit);
476 } 476 }
477 } 477 }
478 #endif // !defined(OS_IOS) 478 #endif // !defined(OS_IOS)
479 479
480 if (parsed_command_line_.HasSwitch(switches::kEnableNativeGpuMemoryBuffers)) {
481 BrowserGpuChannelHostFactory::EnableGpuMemoryBufferFactoryUsage(
482 gfx::GpuMemoryBuffer::MAP);
483 BrowserGpuChannelHostFactory::EnableGpuMemoryBufferFactoryUsage(
484 gfx::GpuMemoryBuffer::PERSISTENT_MAP);
485 }
486
487 #if defined(USE_OZONE)
488 BrowserGpuChannelHostFactory::EnableGpuMemoryBufferFactoryUsage(
489 gfx::GpuMemoryBuffer::SCANOUT);
490 #endif
491
492 base::DiscardableMemoryAllocator::SetInstance( 480 base::DiscardableMemoryAllocator::SetInstance(
493 HostDiscardableSharedMemoryManager::current()); 481 HostDiscardableSharedMemoryManager::current());
494 482
495 if (parts_) 483 if (parts_)
496 parts_->PostEarlyInitialization(); 484 parts_->PostEarlyInitialization();
497 } 485 }
498 486
499 void BrowserMainLoop::PreMainMessageLoopStart() { 487 void BrowserMainLoop::PreMainMessageLoopStart() {
500 if (parts_) { 488 if (parts_) {
501 TRACE_EVENT0("startup", 489 TRACE_EVENT0("startup",
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
1383 DCHECK(is_tracing_startup_); 1371 DCHECK(is_tracing_startup_);
1384 1372
1385 is_tracing_startup_ = false; 1373 is_tracing_startup_ = false;
1386 TracingController::GetInstance()->DisableRecording( 1374 TracingController::GetInstance()->DisableRecording(
1387 TracingController::CreateFileSink( 1375 TracingController::CreateFileSink(
1388 startup_trace_file_, 1376 startup_trace_file_,
1389 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); 1377 base::Bind(OnStoppedStartupTracing, startup_trace_file_)));
1390 } 1378 }
1391 1379
1392 } // namespace content 1380 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/compositor/buffer_queue_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698