browser: fix reloadignoringcache api
authorRobo <hop2deep@gmail.com>
Fri, 13 Nov 2015 20:55:23 +0000 (02:25 +0530)
committerRobo <hop2deep@gmail.com>
Fri, 13 Nov 2015 20:55:23 +0000 (02:25 +0530)
atom/browser/api/atom_api_web_contents.cc
atom/browser/api/lib/navigation-controller.coffee

index 601a4ba..1c3334e 100644 (file)
@@ -658,10 +658,6 @@ void WebContents::Stop() {
   web_contents()->Stop();
 }
 
-void WebContents::ReloadIgnoringCache() {
-  web_contents()->GetController().ReloadIgnoringCache(false);
-}
-
 void WebContents::GoBack() {
   atom::AtomBrowserClient::SuppressRendererProcessRestartForOnce();
   web_contents()->GetController().GoBack();
@@ -1009,7 +1005,6 @@ mate::ObjectTemplateBuilder WebContents::GetObjectTemplateBuilder(
         .SetMethod("isLoading", &WebContents::IsLoading)
         .SetMethod("isWaitingForResponse", &WebContents::IsWaitingForResponse)
         .SetMethod("_stop", &WebContents::Stop)
-        .SetMethod("_reloadIgnoringCache", &WebContents::ReloadIgnoringCache)
         .SetMethod("_goBack", &WebContents::GoBack)
         .SetMethod("_goForward", &WebContents::GoForward)
         .SetMethod("_goToOffset", &WebContents::GoToOffset)
index 7d276e5..d0c539a 100644 (file)
@@ -62,8 +62,8 @@ class NavigationController
     @webContents._loadURL @getURL(), {}
 
   reloadIgnoringCache: ->
-    @webContents._reloadIgnoringCache()  # Rely on WebContents to clear cache.
-    @reload()
+    @pendingIndex = @currentIndex
+    @webContents._loadURL @getURL(), {extraHeaders: "pragma: no-cache\n"}
 
   canGoBack: ->
     @getActiveIndex() > 0