Make BrowserMainParts's overrides available on all platforms.
This commit is contained in:
parent
bc6237375e
commit
d4e81da19a
3 changed files with 23 additions and 5 deletions
|
@ -18,6 +18,21 @@ BrowserMainParts::BrowserMainParts() {
|
|||
BrowserMainParts::~BrowserMainParts() {
|
||||
}
|
||||
|
||||
void BrowserMainParts::PreEarlyInitialization() {
|
||||
#if defined(OS_MACOSX)
|
||||
IncreaseFileDescriptorLimit();
|
||||
#endif
|
||||
}
|
||||
|
||||
void BrowserMainParts::ToolkitInitialized() {
|
||||
}
|
||||
|
||||
void BrowserMainParts::PreMainMessageLoopStart() {
|
||||
#if defined(OS_MACOSX)
|
||||
InitializeMainNib();
|
||||
#endif
|
||||
}
|
||||
|
||||
void BrowserMainParts::PreMainMessageLoopRun() {
|
||||
browser_context_.reset(CreateBrowserContext());
|
||||
browser_context_->Initialize();
|
||||
|
|
|
@ -26,16 +26,19 @@ class BrowserMainParts : public content::BrowserMainParts {
|
|||
// implementation. The caller takes ownership of the returned object.
|
||||
virtual BrowserContext* CreateBrowserContext();
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
virtual void PreEarlyInitialization() OVERRIDE;
|
||||
virtual void ToolkitInitialized() OVERRIDE;
|
||||
virtual void PreMainMessageLoopStart() OVERRIDE;
|
||||
#endif
|
||||
|
||||
virtual void PreMainMessageLoopRun() OVERRIDE;
|
||||
virtual void PostMainMessageLoopRun() OVERRIDE;
|
||||
virtual int PreCreateThreads() OVERRIDE;
|
||||
|
||||
private:
|
||||
#if defined(OS_MACOSX)
|
||||
void IncreaseFileDescriptorLimit();
|
||||
void InitializeMainNib();
|
||||
#endif
|
||||
|
||||
scoped_ptr<BrowserContext> browser_context_;
|
||||
scoped_ptr<WebUIControllerFactory> web_ui_controller_factory_;
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ void SetFileDescriptorLimit(rlim_t max_descriptors) {
|
|||
|
||||
} // namespace
|
||||
|
||||
void BrowserMainParts::PreEarlyInitialization() {
|
||||
void BrowserMainParts::IncreaseFileDescriptorLimit() {
|
||||
// We use quite a few file descriptors for our IPC, and the default limit on the Mac is low (256),
|
||||
// so bump it up.
|
||||
// See http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/chrome_browser_main_posix.cc?revision=244734#l295
|
||||
|
@ -36,7 +36,7 @@ void BrowserMainParts::PreEarlyInitialization() {
|
|||
}
|
||||
|
||||
// Replicates NSApplicationMain, but doesn't start a run loop.
|
||||
void BrowserMainParts::PreMainMessageLoopStart() {
|
||||
void BrowserMainParts::InitializeMainNib() {
|
||||
auto infoDictionary = base::mac::OuterBundle().infoDictionary;
|
||||
|
||||
auto principalClass = NSClassFromString([infoDictionary objectForKey:@"NSPrincipalClass"]);
|
||||
|
|
Loading…
Reference in a new issue