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

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

Issue 1004043002: Re-land: base: Implement browser process support for discardable memory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: set allocator instance for blink tests 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"
44 #include "content/public/browser/browser_main_parts.h" 45 #include "content/public/browser/browser_main_parts.h"
45 #include "content/public/browser/browser_shutdown.h" 46 #include "content/public/browser/browser_shutdown.h"
46 #include "content/public/browser/content_browser_client.h" 47 #include "content/public/browser/content_browser_client.h"
47 #include "content/public/browser/render_process_host.h" 48 #include "content/public/browser/render_process_host.h"
48 #include "content/public/browser/tracing_controller.h" 49 #include "content/public/browser/tracing_controller.h"
49 #include "content/public/common/content_switches.h" 50 #include "content/public/common/content_switches.h"
50 #include "content/public/common/main_function_params.h" 51 #include "content/public/common/main_function_params.h"
51 #include "content/public/common/result_codes.h" 52 #include "content/public/common/result_codes.h"
52 #include "crypto/nss_util.h" 53 #include "crypto/nss_util.h"
53 #include "device/battery/battery_status_service.h" 54 #include "device/battery/battery_status_service.h"
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 if (parsed_command_line_.HasSwitch(switches::kEnableNativeGpuMemoryBuffers)) { 454 if (parsed_command_line_.HasSwitch(switches::kEnableNativeGpuMemoryBuffers)) {
454 BrowserGpuChannelHostFactory::EnableGpuMemoryBufferFactoryUsage( 455 BrowserGpuChannelHostFactory::EnableGpuMemoryBufferFactoryUsage(
455 gfx::GpuMemoryBuffer::MAP); 456 gfx::GpuMemoryBuffer::MAP);
456 } 457 }
457 458
458 #if defined(USE_OZONE) 459 #if defined(USE_OZONE)
459 BrowserGpuChannelHostFactory::EnableGpuMemoryBufferFactoryUsage( 460 BrowserGpuChannelHostFactory::EnableGpuMemoryBufferFactoryUsage(
460 gfx::GpuMemoryBuffer::SCANOUT); 461 gfx::GpuMemoryBuffer::SCANOUT);
461 #endif 462 #endif
462 463
464 base::DiscardableMemoryShmemAllocator::SetInstance(
465 HostDiscardableSharedMemoryManager::current());
466
463 if (parts_) 467 if (parts_)
464 parts_->PostEarlyInitialization(); 468 parts_->PostEarlyInitialization();
465 } 469 }
466 470
467 void BrowserMainLoop::MainMessageLoopStart() { 471 void BrowserMainLoop::MainMessageLoopStart() {
468 TRACE_EVENT0("startup", "BrowserMainLoop::MainMessageLoopStart"); 472 TRACE_EVENT0("startup", "BrowserMainLoop::MainMessageLoopStart");
469 if (parts_) { 473 if (parts_) {
470 TRACE_EVENT0("startup", 474 TRACE_EVENT0("startup",
471 "BrowserMainLoop::MainMessageLoopStart:PreMainMessageLoopStart"); 475 "BrowserMainLoop::MainMessageLoopStart:PreMainMessageLoopStart");
472 parts_->PreMainMessageLoopStart(); 476 parts_->PreMainMessageLoopStart();
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
1270 1274
1271 void BrowserMainLoop::EndStartupTracing() { 1275 void BrowserMainLoop::EndStartupTracing() {
1272 is_tracing_startup_ = false; 1276 is_tracing_startup_ = false;
1273 TracingController::GetInstance()->DisableRecording( 1277 TracingController::GetInstance()->DisableRecording(
1274 TracingController::CreateFileSink( 1278 TracingController::CreateFileSink(
1275 startup_trace_file_, 1279 startup_trace_file_,
1276 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); 1280 base::Bind(OnStoppedStartupTracing, startup_trace_file_)));
1277 } 1281 }
1278 1282
1279 } // namespace content 1283 } // 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