Deprecate the BrowserWindow.restart.
Now BrowserWindow.reload would just do the same thing.
This commit is contained in:
parent
19698fc739
commit
a85db2d780
4 changed files with 8 additions and 8 deletions
|
@ -99,11 +99,14 @@ void WebContents::Stop() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebContents::Reload() {
|
void WebContents::Reload() {
|
||||||
web_contents()->GetController().Reload(false);
|
// Navigating to a URL would always restart the renderer process, we want this
|
||||||
|
// because normal reloading will break our node integration.
|
||||||
|
// This is done by AtomBrowserClient::ShouldSwapProcessesForNavigation.
|
||||||
|
LoadURL(GetURL());
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebContents::ReloadIgnoringCache() {
|
void WebContents::ReloadIgnoringCache() {
|
||||||
web_contents()->GetController().ReloadIgnoringCache(false);
|
Reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WebContents::CanGoBack() const {
|
bool WebContents::CanGoBack() const {
|
||||||
|
|
|
@ -81,7 +81,7 @@ BrowserWindow::loadUrl = -> @webContents.loadUrl.apply @webContents, arguments
|
||||||
BrowserWindow::send = -> @webContents.send.apply @webContents, arguments
|
BrowserWindow::send = -> @webContents.send.apply @webContents, arguments
|
||||||
|
|
||||||
# Be compatible with old API.
|
# Be compatible with old API.
|
||||||
BrowserWindow::restart = -> @webContents.restart()
|
BrowserWindow::restart = -> @webContents.reload()
|
||||||
BrowserWindow::getUrl = -> @webContents.getUrl()
|
BrowserWindow::getUrl = -> @webContents.getUrl()
|
||||||
BrowserWindow::reload = -> @webContents.reload()
|
BrowserWindow::reload = -> @webContents.reload()
|
||||||
BrowserWindow::reloadIgnoringCache = -> @webContents.reloadIgnoringCache()
|
BrowserWindow::reloadIgnoringCache = -> @webContents.reloadIgnoringCache()
|
||||||
|
|
|
@ -11,10 +11,6 @@ module.exports.wrap = (webContents) ->
|
||||||
webContents.send = (args...) ->
|
webContents.send = (args...) ->
|
||||||
@_send 'ATOM_INTERNAL_MESSAGE', [args...]
|
@_send 'ATOM_INTERNAL_MESSAGE', [args...]
|
||||||
|
|
||||||
# WebContents::restart()
|
|
||||||
# Restart the renderer process.
|
|
||||||
webContents.restart = -> @loadUrl @getUrl()
|
|
||||||
|
|
||||||
# The processId and routingId and identify a webContents.
|
# The processId and routingId and identify a webContents.
|
||||||
webContents.getId = -> "#{@getProcessId()}-#{@getRoutingId()}"
|
webContents.getId = -> "#{@getProcessId()}-#{@getRoutingId()}"
|
||||||
webContents.equal = (other) -> @getId() is other.getId()
|
webContents.equal = (other) -> @getId() is other.getId()
|
||||||
|
|
|
@ -83,7 +83,8 @@ bool AtomBrowserClient::ShouldSwapProcessesForNavigation(
|
||||||
if (site_instance->HasProcess())
|
if (site_instance->HasProcess())
|
||||||
dying_render_process_ = site_instance->GetProcess();
|
dying_render_process_ = site_instance->GetProcess();
|
||||||
|
|
||||||
// Restart renderer process for all navigations.
|
// Restart renderer process for all navigations, this relies on a patch to
|
||||||
|
// Chromium: http://git.io/_PaNyg.
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue