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
3 // found in the LICENSE file.
5 #include "chrome/browser/browser_process_platform_part_chromeos.h"
7 #include "chrome/browser/chromeos/memory/oom_priority_manager.h"
8 #include "chrome/browser/chromeos/profiles/profile_helper.h"
10 BrowserProcessPlatformPart::BrowserProcessPlatformPart()
11 : created_profile_helper_(false) {
14 BrowserProcessPlatformPart::~BrowserProcessPlatformPart() {
17 void BrowserProcessPlatformPart::StartTearDown() {
18 profile_helper_
.reset();
21 chromeos::OomPriorityManager
*
22 BrowserProcessPlatformPart::oom_priority_manager() {
23 DCHECK(CalledOnValidThread());
24 if (!oom_priority_manager_
.get())
25 oom_priority_manager_
.reset(new chromeos::OomPriorityManager());
26 return oom_priority_manager_
.get();
29 chromeos::ProfileHelper
* BrowserProcessPlatformPart::profile_helper() {
30 DCHECK(CalledOnValidThread());
31 if (!created_profile_helper_
)
32 CreateProfileHelper();
33 return profile_helper_
.get();
36 void BrowserProcessPlatformPart::CreateProfileHelper() {
37 DCHECK(!created_profile_helper_
&& profile_helper_
.get() == NULL
);
38 created_profile_helper_
= true;
39 profile_helper_
.reset(new chromeos::ProfileHelper());