Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a6493b3

Browse files
committed
keep only one renderer running; Fix nwjs#290
1 parent 237ad34 commit a6493b3

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

src/shell_content_browser_client.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,4 +177,14 @@ void ShellContentBrowserClient::OverrideWebkitPrefs(
177177
}
178178
}
179179

180+
bool ShellContentBrowserClient::ShouldTryToUseExistingProcessHost(
181+
BrowserContext* browser_context, const GURL& url) {
182+
return true;
183+
}
184+
185+
bool ShellContentBrowserClient::IsSuitableHost(RenderProcessHost* process_host,
186+
const GURL& site_url) {
187+
return true;
188+
}
189+
180190
} // namespace content

src/shell_content_browser_client.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ class ShellContentBrowserClient : public ContentBrowserClient {
4343
virtual std::string GetDefaultDownloadName() OVERRIDE;
4444
virtual MediaObserver* GetMediaObserver() OVERRIDE;
4545
virtual void BrowserURLHandlerCreated(BrowserURLHandler* handler) OVERRIDE;
46+
virtual bool ShouldTryToUseExistingProcessHost(
47+
BrowserContext* browser_context, const GURL& url) OVERRIDE;
48+
virtual bool IsSuitableHost(RenderProcessHost* process_host,
49+
const GURL& site_url) OVERRIDE;
4650
ShellBrowserContext* browser_context();
4751
ShellBrowserContext* off_the_record_browser_context();
4852
ShellResourceDispatcherHostDelegate* resource_dispatcher_host_delegate() {

0 commit comments

Comments
 (0)