Reviewed by Adele.
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Dec 2007 23:42:32 +0000 (23:42 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Dec 2007 23:42:32 +0000 (23:42 +0000)
        - fix http://bugs.webkit.org/show_bug.cgi?id=16442
          navigation policy delegate gets called twice for each load

        * loader/MainResourceLoader.cpp:
        (WebCore::MainResourceLoader::willSendRequest): Removed call to checkNavigationPolicy.
        That's handled by FrameLoader.

        * loader/MainResourceLoader.h: Removed callContinueAfterNavigationPolicy
        and continueAfterNavigationPolicy.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28726 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/loader/MainResourceLoader.cpp
WebCore/loader/MainResourceLoader.h

index 2151f7f9d10bc1e5faa90ad5c34ff7886b8c4f2c..81f80d2e0ad64e50579a9b48fd7b87e9afc8e996 100644 (file)
@@ -1,3 +1,17 @@
+2007-12-14  Darin Adler  <darin@apple.com>
+
+        Reviewed by Adele.
+
+        - fix http://bugs.webkit.org/show_bug.cgi?id=16442
+          navigation policy delegate gets called twice for each load
+
+        * loader/MainResourceLoader.cpp:
+        (WebCore::MainResourceLoader::willSendRequest): Removed call to checkNavigationPolicy.
+        That's handled by FrameLoader.
+
+        * loader/MainResourceLoader.h: Removed callContinueAfterNavigationPolicy
+        and continueAfterNavigationPolicy.
+
 2007-12-14  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Brady.
index 6de846cf4a6db43e2d89088f5728a38f09bb96e9..12478ab4ed3b0bd01c76479119dd3624adf68b84 100644 (file)
@@ -106,18 +106,6 @@ void MainResourceLoader::stopLoadingForPolicyChange()
     cancel(interruptionForPolicyChangeError());
 }
 
-void MainResourceLoader::callContinueAfterNavigationPolicy(void* argument, const ResourceRequest& request, PassRefPtr<FormState>, bool shouldContinue)
-{
-    static_cast<MainResourceLoader*>(argument)->continueAfterNavigationPolicy(request, shouldContinue);
-}
-
-void MainResourceLoader::continueAfterNavigationPolicy(const ResourceRequest& request, bool shouldContinue)
-{
-    if (!shouldContinue)
-        stopLoadingForPolicyChange();
-    deref(); // balances ref in willSendRequest
-}
-
 bool MainResourceLoader::isPostOrRedirectAfterPost(const ResourceRequest& newRequest, const ResourceResponse& redirectResponse)
 {
     if (newRequest.httpMethod() == "POST")
@@ -168,9 +156,6 @@ void MainResourceLoader::willSendRequest(ResourceRequest& newRequest, const Reso
     
     // Don't set this on the first request. It is set when the main load was started.
     m_documentLoader->setRequest(newRequest);
-    
-    ref(); // balanced by deref in continueAfterNavigationPolicy
-    frameLoader()->checkNavigationPolicy(newRequest, callContinueAfterNavigationPolicy, this);
 }
 
 static bool shouldLoadAsEmptyDocument(const KURL& url)
index 94a4170deebc2f6b8048df228086998623c09463..d81367aad5dd3a8730800ede8a86f0e76cfdda06 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005, 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2005, 2006, 2007 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -74,9 +74,6 @@ namespace WebCore {
         void stopLoadingForPolicyChange();
         bool isPostOrRedirectAfterPost(const ResourceRequest& newRequest, const ResourceResponse& redirectResponse);
 
-        static void callContinueAfterNavigationPolicy(void*, const ResourceRequest&, PassRefPtr<FormState>, bool shouldContinue);
-        void continueAfterNavigationPolicy(const ResourceRequest&, bool shouldContinue);
-
         static void callContinueAfterContentPolicy(void*, PolicyAction);
         void continueAfterContentPolicy(PolicyAction);
         void continueAfterContentPolicy(PolicyAction, const ResourceResponse&);