Diff
Modified: branches/safari-537-branch/Source/WebCore/ChangeLog (152246 => 152247)
--- branches/safari-537-branch/Source/WebCore/ChangeLog 2013-07-01 20:38:23 UTC (rev 152246)
+++ branches/safari-537-branch/Source/WebCore/ChangeLog 2013-07-01 20:39:59 UTC (rev 152247)
@@ -1,5 +1,22 @@
2013-07-01 Lucas Forschler <[email protected]>
+ Merge r152196
+
+ 2013-06-28 Alexey Proskuryakov <[email protected]>
+
+ [Mac] Crash when loading is stopped from -didReceiveResponse
+ https://bugs.webkit.org/show_bug.cgi?id=118209
+ <rdar://problem/14259249>
+
+ Reviewed by Brady Eidson.
+
+ Test: TestWebKitAPI/Tests/mac/StopLoadingFromDidReceiveResponse.mm.
+
+ * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::didReceiveResponse):
+ Added yet another check for reachedTerminalState().
+
+2013-07-01 Lucas Forschler <[email protected]>
+
Merge r152194
2013-06-28 Beth Dakin <[email protected]>
Modified: branches/safari-537-branch/Source/WebCore/loader/SubresourceLoader.cpp (152246 => 152247)
--- branches/safari-537-branch/Source/WebCore/loader/SubresourceLoader.cpp 2013-07-01 20:38:23 UTC (rev 152246)
+++ branches/safari-537-branch/Source/WebCore/loader/SubresourceLoader.cpp 2013-07-01 20:39:59 UTC (rev 152247)
@@ -188,7 +188,10 @@
m_resource->responseReceived(response);
if (reachedTerminalState())
return;
+
ResourceLoader::didReceiveResponse(response);
+ if (reachedTerminalState())
+ return;
// FIXME: Main resources have a different set of rules for multipart than images do.
// Hopefully we can merge those 2 paths.
Modified: branches/safari-537-branch/Tools/ChangeLog (152246 => 152247)
--- branches/safari-537-branch/Tools/ChangeLog 2013-07-01 20:38:23 UTC (rev 152246)
+++ branches/safari-537-branch/Tools/ChangeLog 2013-07-01 20:39:59 UTC (rev 152247)
@@ -1,3 +1,21 @@
+2013-07-01 Lucas Forschler <[email protected]>
+
+ Merge r152196
+
+ 2013-06-28 Alexey Proskuryakov <[email protected]>
+
+ [Mac] Crash when loading is stopped from -didReceiveResponse
+ https://bugs.webkit.org/show_bug.cgi?id=118209
+ <rdar://problem/14259249>
+
+ Reviewed by Brady Eidson.
+
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+ * TestWebKitAPI/Tests/mac/StopLoadingFromDidReceiveResponse.html: Added.
+ * TestWebKitAPI/Tests/mac/StopLoadingFromDidReceiveResponse.mm: Added.
+ (-[StopLoadingFromDidReceiveResponse webView:resource:didReceiveResponse:fromDataSource:]):
+ (TestWebKitAPI::TEST):
+
2013-06-28 Lucas Forschler <[email protected]>
Merge r152188
Modified: branches/safari-537-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (152246 => 152247)
--- branches/safari-537-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj 2013-07-01 20:38:23 UTC (rev 152246)
+++ branches/safari-537-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj 2013-07-01 20:39:59 UTC (rev 152247)
@@ -207,6 +207,8 @@
CD5497B415857F0C00B5BC30 /* MediaTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD5497B315857F0C00B5BC30 /* MediaTime.cpp */; };
E1220DA0155B25480013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = E1220D9F155B25480013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.mm */; };
E1220DCA155B28AA0013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = E1220DC9155B287D0013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.html */; };
+ E194E1BB177E5145009C4D4E /* StopLoadingFromDidReceiveResponse.mm in Sources */ = {isa = PBXBuildFile; fileRef = E194E1BA177E5145009C4D4E /* StopLoadingFromDidReceiveResponse.mm */; };
+ E194E1BD177E53C7009C4D4E /* StopLoadingFromDidReceiveResponse.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = E194E1BC177E534A009C4D4E /* StopLoadingFromDidReceiveResponse.html */; };
E490296814E2E3A4002BEDD1 /* TypingStyleCrash.mm in Sources */ = {isa = PBXBuildFile; fileRef = E490296714E2E3A4002BEDD1 /* TypingStyleCrash.mm */; };
F660AA0D15A5F061003A1243 /* GetInjectedBundleInitializationUserDataCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F660AA0C15A5F061003A1243 /* GetInjectedBundleInitializationUserDataCallback.cpp */; };
F660AA1115A5F631003A1243 /* GetInjectedBundleInitializationUserDataCallback_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F660AA0F15A5F624003A1243 /* GetInjectedBundleInitializationUserDataCallback_Bundle.cpp */; };
@@ -287,6 +289,7 @@
BCAA485614A0444C0088FAC4 /* simple-tall.html in Copy Resources */,
BC909784125571CF00083756 /* simple.html in Copy Resources */,
C01A23F21266156700C9ED55 /* spacebar-scrolling.html in Copy Resources */,
+ E194E1BD177E53C7009C4D4E /* StopLoadingFromDidReceiveResponse.html in Copy Resources */,
C540F784152E5A9A00A40C8C /* verboseMarkup.html in Copy Resources */,
A5E2027515B21F6E00C13E14 /* WindowlessWebViewWithMedia.html in Copy Resources */,
);
@@ -516,6 +519,8 @@
CD5497B315857F0C00B5BC30 /* MediaTime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MediaTime.cpp; path = WTF/MediaTime.cpp; sourceTree = "<group>"; };
E1220D9F155B25480013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MemoryCacheDisableWithinResourceLoadDelegate.mm; sourceTree = "<group>"; };
E1220DC9155B287D0013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = MemoryCacheDisableWithinResourceLoadDelegate.html; sourceTree = "<group>"; };
+ E194E1BA177E5145009C4D4E /* StopLoadingFromDidReceiveResponse.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = StopLoadingFromDidReceiveResponse.mm; sourceTree = "<group>"; };
+ E194E1BC177E534A009C4D4E /* StopLoadingFromDidReceiveResponse.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = StopLoadingFromDidReceiveResponse.html; sourceTree = "<group>"; };
E490296714E2E3A4002BEDD1 /* TypingStyleCrash.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TypingStyleCrash.mm; sourceTree = "<group>"; };
F3FC3EE213678B7300126A65 /* libgtest.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libgtest.a; sourceTree = BUILT_PRODUCTS_DIR; };
F660AA0C15A5F061003A1243 /* GetInjectedBundleInitializationUserDataCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetInjectedBundleInitializationUserDataCallback.cpp; sourceTree = "<group>"; };
@@ -891,6 +896,7 @@
37E38C33169B7D010084C28C /* WebViewDidRemoveFrameFromHierarchy.mm */,
1A7BFC0A171A0BDB00BC5F64 /* WillSendSubmitEvent.mm */,
A5E2027215B2181900C13E14 /* WindowlessWebViewWithMedia.mm */,
+ E194E1BA177E5145009C4D4E /* StopLoadingFromDidReceiveResponse.mm */,
);
path = mac;
sourceTree = "<group>";
@@ -915,6 +921,7 @@
290A9BB81735F42300D71BBC /* OpenNewWindow.html */,
A57A34F116AF69E200C2501F /* PageVisibilityStateWithWindowChanges.html */,
52B8CF9415868CF000281053 /* SetDocumentURI.html */,
+ E194E1BC177E534A009C4D4E /* StopLoadingFromDidReceiveResponse.html */,
C540F783152E5A7800A40C8C /* verboseMarkup.html */,
A5E2027015B2180600C13E14 /* WindowlessWebViewWithMedia.html */,
);
@@ -1148,6 +1155,7 @@
51FCF79A1534AC6D00104491 /* ShouldGoToBackForwardListItem.cpp in Sources */,
C540F776152E4DA000A40C8C /* SimplifyMarkup.mm in Sources */,
C02B77F2126612140026BF0F /* SpacebarScrolling.cpp in Sources */,
+ E194E1BB177E5145009C4D4E /* StopLoadingFromDidReceiveResponse.mm in Sources */,
81B50193140F232300D9EB58 /* StringBuilder.cpp in Sources */,
3799AD3A14120A43005EB0C6 /* StringByEvaluatingJavaScriptFromString.mm in Sources */,
93ABA80916DDAB91002DB2FA /* StringHasher.cpp in Sources */,
Copied: branches/safari-537-branch/Tools/TestWebKitAPI/Tests/mac/StopLoadingFromDidReceiveResponse.html (from rev 152196, trunk/Tools/TestWebKitAPI/Tests/mac/StopLoadingFromDidReceiveResponse.html) (0 => 152247)
--- branches/safari-537-branch/Tools/TestWebKitAPI/Tests/mac/StopLoadingFromDidReceiveResponse.html (rev 0)
+++ branches/safari-537-branch/Tools/TestWebKitAPI/Tests/mac/StopLoadingFromDidReceiveResponse.html 2013-07-01 20:39:59 UTC (rev 152247)
@@ -0,0 +1 @@
+<script src=""
Copied: branches/safari-537-branch/Tools/TestWebKitAPI/Tests/mac/StopLoadingFromDidReceiveResponse.mm (from rev 152196, trunk/Tools/TestWebKitAPI/Tests/mac/StopLoadingFromDidReceiveResponse.mm) (0 => 152247)
--- branches/safari-537-branch/Tools/TestWebKitAPI/Tests/mac/StopLoadingFromDidReceiveResponse.mm (rev 0)
+++ branches/safari-537-branch/Tools/TestWebKitAPI/Tests/mac/StopLoadingFromDidReceiveResponse.mm 2013-07-01 20:39:59 UTC (rev 152247)
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "PlatformUtilities.h"
+#import <WebKit/WebCache.h>
+#import <wtf/RetainPtr.h>
+
+@interface StopLoadingFromDidReceiveResponse : NSObject {
+}
+@end
+
+static bool didFinishLoad;
+
+@implementation StopLoadingFromDidReceiveResponse
+
+- (void)webView:(WebView *)sender resource:(id)identifier didReceiveResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)dataSource
+{
+ static BOOL mainResourceReceived;
+ if (!mainResourceReceived) {
+ mainResourceReceived = YES;
+ return;
+ }
+
+ [sender stopLoading:identifier];
+
+ didFinishLoad = YES;
+}
+
+@end
+
+namespace TestWebKitAPI {
+
+TEST(WebKit1, StopLoadingFromDidReceiveResponse)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+
+ RetainPtr<StopLoadingFromDidReceiveResponse> resourceLoadDelegate = adoptNS([[StopLoadingFromDidReceiveResponse alloc] init]);
+ webView.get().resourceLoadDelegate = resourceLoadDelegate.get();
+
+ [[webView.get() mainFrame] loadRequest:[NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"StopLoadingFromDidReceiveResponse" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]];
+
+ Util::run(&didFinishLoad);
+
+ [pool drain];
+ // If we finished without crashing, the test passed.
+}
+
+} // namespace TestWebKitAPI