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

Side by Side Diff: chrome/browser/chromeos/chrome_browser_main_chromeos.cc

Issue 2527973003: Consolidate code monitoring low memory kills and OOM kills to MemoryKillsMonitor on ChromeOS. (Closed)
Patch Set: move unittest to chromeos only build rule Created 4 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chrome/browser/chromeos/chrome_browser_main_chromeos.h" 5 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 switches::kLoginProfile).value(); 347 switches::kLoginProfile).value();
348 } 348 }
349 349
350 #if defined(GOOGLE_CHROME_BUILD) 350 #if defined(GOOGLE_CHROME_BUILD)
351 const char kChromeOSReleaseTrack[] = "CHROMEOS_RELEASE_TRACK"; 351 const char kChromeOSReleaseTrack[] = "CHROMEOS_RELEASE_TRACK";
352 std::string channel; 352 std::string channel;
353 if (base::SysInfo::GetLsbReleaseValue(kChromeOSReleaseTrack, &channel)) 353 if (base::SysInfo::GetLsbReleaseValue(kChromeOSReleaseTrack, &channel))
354 chrome::SetChannel(channel); 354 chrome::SetChannel(channel);
355 #endif 355 #endif
356 356
357 // Start monitoring OOM kills.
358 memory_kills_monitor_ = base::MakeUnique<memory::MemoryKillsMonitor::Handle>(
359 memory::MemoryKillsMonitor::StartMonitoring());
360
357 ChromeBrowserMainPartsLinux::PreEarlyInitialization(); 361 ChromeBrowserMainPartsLinux::PreEarlyInitialization();
358 } 362 }
359 363
360 void ChromeBrowserMainPartsChromeos::PreMainMessageLoopStart() { 364 void ChromeBrowserMainPartsChromeos::PreMainMessageLoopStart() {
361 // Replace the default NetworkChangeNotifierFactory with ChromeOS specific 365 // Replace the default NetworkChangeNotifierFactory with ChromeOS specific
362 // implementation. This must be done before BrowserMainLoop calls 366 // implementation. This must be done before BrowserMainLoop calls
363 // net::NetworkChangeNotifier::Create() in MainMessageLoopStart(). 367 // net::NetworkChangeNotifier::Create() in MainMessageLoopStart().
364 net::NetworkChangeNotifier::SetFactory( 368 net::NetworkChangeNotifier::SetFactory(
365 new NetworkChangeNotifierFactoryChromeos()); 369 new NetworkChangeNotifierFactoryChromeos());
366 ChromeBrowserMainPartsLinux::PreMainMessageLoopStart(); 370 ChromeBrowserMainPartsLinux::PreMainMessageLoopStart();
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 // Destroy DBus services immediately after threads are stopped. 910 // Destroy DBus services immediately after threads are stopped.
907 dbus_services_.reset(); 911 dbus_services_.reset();
908 912
909 ChromeBrowserMainPartsLinux::PostDestroyThreads(); 913 ChromeBrowserMainPartsLinux::PostDestroyThreads();
910 914
911 // Destroy DeviceSettingsService after g_browser_process. 915 // Destroy DeviceSettingsService after g_browser_process.
912 DeviceSettingsService::Shutdown(); 916 DeviceSettingsService::Shutdown();
913 } 917 }
914 918
915 } // namespace chromeos 919 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/chrome_browser_main_chromeos.h ('k') | chrome/browser/memory/memory_kills_histogram.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698