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());
#endif
#if defined(OS_WIN)
net::ProxyResolverV8::CreateIsolate();
#else
net::ProxyResolverV8::RememberDefaultIsolate();
#endif
InitProxyResolverV8();
return 0;
}
@ -98,4 +94,12 @@ BrowserContext* BrowserMainParts::CreateBrowserContext() {
return new BrowserContext;
}
void BrowserMainParts::InitProxyResolverV8() {
#if defined(OS_WIN)
net::ProxyResolverV8::CreateIsolate();
#else
net::ProxyResolverV8::RememberDefaultIsolate();
#endif
}
} // namespace brightray

View file

@ -28,10 +28,7 @@ class BrowserMainParts : public content::BrowserMainParts {
BrowserContext* browser_context() { return browser_context_.get(); }
protected:
// Subclasses should override this to provide their own BrowserContxt
// implementation. The caller takes ownership of the returned object.
virtual BrowserContext* CreateBrowserContext();
// content::BrowserMainParts:
virtual void PreEarlyInitialization() OVERRIDE;
virtual void ToolkitInitialized() OVERRIDE;
virtual void PreMainMessageLoopStart() OVERRIDE;
@ -39,6 +36,13 @@ class BrowserMainParts : public content::BrowserMainParts {
virtual void PostMainMessageLoopRun() 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:
#if defined(OS_MACOSX)
void IncreaseFileDescriptorLimit();