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

Side by Side Diff: chrome/browser/ui/views/athena/chrome_browser_main_extra_parts_athena.cc

Issue 558823002: Fix crash during shutdown (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « chrome/browser/chromeos/chrome_browser_main_chromeos.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/ui/views/athena/chrome_browser_main_extra_parts_athena. h" 5 #include "chrome/browser/ui/views/athena/chrome_browser_main_extra_parts_athena. h"
6 6
7 #include "athena/extensions/public/extensions_delegate.h" 7 #include "athena/extensions/public/extensions_delegate.h"
8 #include "athena/main/public/athena_launcher.h" 8 #include "athena/main/public/athena_launcher.h"
9 #include "base/command_line.h"
9 #include "base/macros.h" 10 #include "base/macros.h"
10 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
11 #include "chrome/browser/chrome_browser_main_extra_parts.h" 12 #include "chrome/browser/chrome_browser_main_extra_parts.h"
13 #include "chrome/browser/lifetime/application_lifetime.h"
12 #include "chrome/browser/profiles/profile.h" 14 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/browser/profiles/profile_manager.h" 15 #include "chrome/browser/profiles/profile_manager.h"
16 #include "chrome/common/chrome_switches.h"
14 #include "content/public/browser/browser_thread.h" 17 #include "content/public/browser/browser_thread.h"
15 18
16 namespace { 19 namespace {
17 20
18 class ChromeBrowserMainExtraPartsAthena : public ChromeBrowserMainExtraParts { 21 class ChromeBrowserMainExtraPartsAthena : public ChromeBrowserMainExtraParts {
19 public: 22 public:
20 ChromeBrowserMainExtraPartsAthena() {} 23 ChromeBrowserMainExtraPartsAthena() {
24 }
25
21 virtual ~ChromeBrowserMainExtraPartsAthena() {} 26 virtual ~ChromeBrowserMainExtraPartsAthena() {}
22 27
28 private:
23 // Overridden from ChromeBrowserMainExtraParts: 29 // Overridden from ChromeBrowserMainExtraParts:
24 virtual void PreProfileInit() OVERRIDE { 30 virtual void PreProfileInit() OVERRIDE {
25 athena::StartAthenaEnv(content::BrowserThread::GetMessageLoopProxyForThread( 31 athena::StartAthenaEnv(content::BrowserThread::GetMessageLoopProxyForThread(
26 content::BrowserThread::FILE)); 32 content::BrowserThread::FILE));
27 } 33 }
28 virtual void PostProfileInit() OVERRIDE { 34 virtual void PostProfileInit() OVERRIDE {
35 if (!CommandLine::ForCurrentProcess()->HasSwitch(
36 switches::kDisableZeroBrowsersOpenForTests)) {
37 chrome::IncrementKeepAliveCount();
38 }
29 Profile* profile = 39 Profile* profile =
30 g_browser_process->profile_manager()->GetActiveUserProfile(); 40 g_browser_process->profile_manager()->GetActiveUserProfile();
31 // TODO(oshima|polukhin): Start OOBE/Login process. 41 // TODO(oshima|polukhin): Start OOBE/Login process.
32 athena::ExtensionsDelegate::CreateExtensionsDelegateForChrome(profile); 42 athena::ExtensionsDelegate::CreateExtensionsDelegateForChrome(profile);
33 athena::StartAthenaSessionWithContext(profile); 43 athena::StartAthenaSessionWithContext(profile);
34 } 44 }
35 virtual void PostMainMessageLoopRun() OVERRIDE { athena::ShutdownAthena(); } 45 virtual void PostMainMessageLoopRun() OVERRIDE { athena::ShutdownAthena(); }
36 46
37 private:
38 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainExtraPartsAthena); 47 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainExtraPartsAthena);
39 }; 48 };
40 49
41 } // namespace 50 } // namespace
42 51
43 ChromeBrowserMainExtraParts* CreateChromeBrowserMainExtraPartsAthena() { 52 ChromeBrowserMainExtraParts* CreateChromeBrowserMainExtraPartsAthena() {
44 return new ChromeBrowserMainExtraPartsAthena(); 53 return new ChromeBrowserMainExtraPartsAthena();
45 } 54 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/chrome_browser_main_chromeos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698