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

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

Issue 1009413002: Revert "base: Implement browser process support for discardable memory." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
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/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 23 matching lines...) Expand all
34 #include "content/browser/loader/resource_dispatcher_host_impl.h" 34 #include "content/browser/loader/resource_dispatcher_host_impl.h"
35 #include "content/browser/media/media_internals.h" 35 #include "content/browser/media/media_internals.h"
36 #include "content/browser/net/browser_online_state_observer.h" 36 #include "content/browser/net/browser_online_state_observer.h"
37 #include "content/browser/renderer_host/media/media_stream_manager.h" 37 #include "content/browser/renderer_host/media/media_stream_manager.h"
38 #include "content/browser/speech/speech_recognition_manager_impl.h" 38 #include "content/browser/speech/speech_recognition_manager_impl.h"
39 #include "content/browser/startup_task_runner.h" 39 #include "content/browser/startup_task_runner.h"
40 #include "content/browser/time_zone_monitor.h" 40 #include "content/browser/time_zone_monitor.h"
41 #include "content/browser/webui/content_web_ui_controller_factory.h" 41 #include "content/browser/webui/content_web_ui_controller_factory.h"
42 #include "content/browser/webui/url_data_manager.h" 42 #include "content/browser/webui/url_data_manager.h"
43 #include "content/common/content_switches_internal.h" 43 #include "content/common/content_switches_internal.h"
44 #include "content/common/host_discardable_shared_memory_manager.h"
45 #include "content/public/browser/browser_main_parts.h" 44 #include "content/public/browser/browser_main_parts.h"
46 #include "content/public/browser/browser_shutdown.h" 45 #include "content/public/browser/browser_shutdown.h"
47 #include "content/public/browser/content_browser_client.h" 46 #include "content/public/browser/content_browser_client.h"
48 #include "content/public/browser/render_process_host.h" 47 #include "content/public/browser/render_process_host.h"
49 #include "content/public/browser/tracing_controller.h" 48 #include "content/public/browser/tracing_controller.h"
50 #include "content/public/common/content_switches.h" 49 #include "content/public/common/content_switches.h"
51 #include "content/public/common/main_function_params.h" 50 #include "content/public/common/main_function_params.h"
52 #include "content/public/common/result_codes.h" 51 #include "content/public/common/result_codes.h"
53 #include "crypto/nss_util.h" 52 #include "crypto/nss_util.h"
54 #include "device/battery/battery_status_service.h" 53 #include "device/battery/battery_status_service.h"
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 if (parsed_command_line_.HasSwitch(switches::kEnableNativeGpuMemoryBuffers)) { 453 if (parsed_command_line_.HasSwitch(switches::kEnableNativeGpuMemoryBuffers)) {
455 BrowserGpuChannelHostFactory::EnableGpuMemoryBufferFactoryUsage( 454 BrowserGpuChannelHostFactory::EnableGpuMemoryBufferFactoryUsage(
456 gfx::GpuMemoryBuffer::MAP); 455 gfx::GpuMemoryBuffer::MAP);
457 } 456 }
458 457
459 #if defined(USE_OZONE) 458 #if defined(USE_OZONE)
460 BrowserGpuChannelHostFactory::EnableGpuMemoryBufferFactoryUsage( 459 BrowserGpuChannelHostFactory::EnableGpuMemoryBufferFactoryUsage(
461 gfx::GpuMemoryBuffer::SCANOUT); 460 gfx::GpuMemoryBuffer::SCANOUT);
462 #endif 461 #endif
463 462
464 base::DiscardableMemoryShmemAllocator::SetInstance(
465 HostDiscardableSharedMemoryManager::current());
466
467 if (parts_) 463 if (parts_)
468 parts_->PostEarlyInitialization(); 464 parts_->PostEarlyInitialization();
469 } 465 }
470 466
471 void BrowserMainLoop::MainMessageLoopStart() { 467 void BrowserMainLoop::MainMessageLoopStart() {
472 TRACE_EVENT0("startup", "BrowserMainLoop::MainMessageLoopStart"); 468 TRACE_EVENT0("startup", "BrowserMainLoop::MainMessageLoopStart");
473 if (parts_) { 469 if (parts_) {
474 TRACE_EVENT0("startup", 470 TRACE_EVENT0("startup",
475 "BrowserMainLoop::MainMessageLoopStart:PreMainMessageLoopStart"); 471 "BrowserMainLoop::MainMessageLoopStart:PreMainMessageLoopStart");
476 parts_->PreMainMessageLoopStart(); 472 parts_->PreMainMessageLoopStart();
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
1274 1270
1275 void BrowserMainLoop::EndStartupTracing() { 1271 void BrowserMainLoop::EndStartupTracing() {
1276 is_tracing_startup_ = false; 1272 is_tracing_startup_ = false;
1277 TracingController::GetInstance()->DisableRecording( 1273 TracingController::GetInstance()->DisableRecording(
1278 TracingController::CreateFileSink( 1274 TracingController::CreateFileSink(
1279 startup_trace_file_, 1275 startup_trace_file_,
1280 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); 1276 base::Bind(OnStoppedStartupTracing, startup_trace_file_)));
1281 } 1277 }
1282 1278
1283 } // namespace content 1279 } // namespace content
OLDNEW
« no previous file with comments | « chrome/test/base/chrome_unit_test_suite.cc ('k') | content/common/host_discardable_shared_memory_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698