Allow override BrowserMainParts::InitProxyResolverV8.

This commit is contained in:
Cheng Zhao 2014-07-03 09:18:24 +00:00
parent 8f3546ed30
commit 02f52f7e20
2 changed files with 17 additions and 9 deletions

View file

@ -86,11 +86,7 @@ int BrowserMainParts::PreCreateThreads() {
views::CreateDesktopScreen()); views::CreateDesktopScreen());
#endif #endif
#if defined(OS_WIN) InitProxyResolverV8();
net::ProxyResolverV8::CreateIsolate();
#else
net::ProxyResolverV8::RememberDefaultIsolate();
#endif
return 0; return 0;
} }
@ -98,4 +94,12 @@ BrowserContext* BrowserMainParts::CreateBrowserContext() {
return new BrowserContext; return new BrowserContext;
} }
void BrowserMainParts::InitProxyResolverV8() {
#if defined(OS_WIN)
net::ProxyResolverV8::CreateIsolate();
#else
net::ProxyResolverV8::RememberDefaultIsolate();
#endif
}
} // namespace brightray } // namespace brightray

View file

@ -28,10 +28,7 @@ class BrowserMainParts : public content::BrowserMainParts {
BrowserContext* browser_context() { return browser_context_.get(); } BrowserContext* browser_context() { return browser_context_.get(); }
protected: protected:
// Subclasses should override this to provide their own BrowserContxt // content::BrowserMainParts:
// implementation. The caller takes ownership of the returned object.
virtual BrowserContext* CreateBrowserContext();
virtual void PreEarlyInitialization() OVERRIDE; virtual void PreEarlyInitialization() OVERRIDE;
virtual void ToolkitInitialized() OVERRIDE; virtual void ToolkitInitialized() OVERRIDE;
virtual void PreMainMessageLoopStart() OVERRIDE; virtual void PreMainMessageLoopStart() OVERRIDE;
@ -39,6 +36,13 @@ class BrowserMainParts : public content::BrowserMainParts {
virtual void PostMainMessageLoopRun() OVERRIDE; virtual void PostMainMessageLoopRun() OVERRIDE;
virtual int PreCreateThreads() OVERRIDE; virtual int PreCreateThreads() OVERRIDE;
// Subclasses should override this to provide their own BrowserContxt
// implementation. The caller takes ownership of the returned object.
virtual BrowserContext* CreateBrowserContext();
// Override this to change how ProxyResolverV8 is initialized.
virtual void InitProxyResolverV8();
private: private:
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
void IncreaseFileDescriptorLimit(); void IncreaseFileDescriptorLimit();