OLD | NEW |
---|---|
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/public/browser/browser_main_runner.h" | 5 #include "content/public/browser/browser_main_runner.h" |
6 | 6 |
7 #include "base/allocator/allocator_shim.h" | 7 #include "base/allocator/allocator_shim.h" |
8 #include "base/base_switches.h" | 8 #include "base/base_switches.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/leak_annotations.h" | 10 #include "base/debug/leak_annotations.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
77 ole_initializer_.reset(new ui::ScopedOleInitializer); | 77 ole_initializer_.reset(new ui::ScopedOleInitializer); |
78 #endif // OS_WIN | 78 #endif // OS_WIN |
79 | 79 |
80 main_loop_.reset(new BrowserMainLoop(parameters)); | 80 main_loop_.reset(new BrowserMainLoop(parameters)); |
81 | 81 |
82 main_loop_->Init(); | 82 main_loop_->Init(); |
83 | 83 |
84 main_loop_->EarlyInitialization(); | 84 main_loop_->EarlyInitialization(); |
85 | 85 |
86 // Must happen before we try to use a message loop or display any UI. | 86 // Must happen before we try to use a message loop or display any UI. |
87 main_loop_->InitializeToolkit(); | 87 if (!main_loop_->InitializeToolkit()) |
88 return 0; | |
Daniel Erat
2014/04/24 22:39:27
this method is super-undocumented. is this used as
sadrul
2014/04/24 22:57:14
Yep, looks like it.
Daniel Erat
2014/04/24 23:21:08
there aren't any conventions, as far as i'm aware.
sadrul
2014/04/25 02:34:48
Done.
| |
88 | 89 |
89 main_loop_->MainMessageLoopStart(); | 90 main_loop_->MainMessageLoopStart(); |
90 | 91 |
91 // WARNING: If we get a WM_ENDSESSION, objects created on the stack here | 92 // WARNING: If we get a WM_ENDSESSION, objects created on the stack here |
92 // are NOT deleted. If you need something to run during WM_ENDSESSION add it | 93 // are NOT deleted. If you need something to run during WM_ENDSESSION add it |
93 // to browser_shutdown::Shutdown or BrowserProcess::EndSession. | 94 // to browser_shutdown::Shutdown or BrowserProcess::EndSession. |
94 | 95 |
95 #if defined(OS_WIN) && !defined(NO_TCMALLOC) | 96 #if defined(OS_WIN) && !defined(NO_TCMALLOC) |
96 // When linking shared libraries, NO_TCMALLOC is defined, and dynamic | 97 // When linking shared libraries, NO_TCMALLOC is defined, and dynamic |
97 // allocator selection is not supported. | 98 // allocator selection is not supported. |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
172 | 173 |
173 DISALLOW_COPY_AND_ASSIGN(BrowserMainRunnerImpl); | 174 DISALLOW_COPY_AND_ASSIGN(BrowserMainRunnerImpl); |
174 }; | 175 }; |
175 | 176 |
176 // static | 177 // static |
177 BrowserMainRunner* BrowserMainRunner::Create() { | 178 BrowserMainRunner* BrowserMainRunner::Create() { |
178 return new BrowserMainRunnerImpl(); | 179 return new BrowserMainRunnerImpl(); |
179 } | 180 } |
180 | 181 |
181 } // namespace content | 182 } // namespace content |
OLD | NEW |