Title: [166613] trunk/Source/WebKit2
Revision
166613
Author
ander...@apple.com
Date
2014-04-01 14:35:54 -0700 (Tue, 01 Apr 2014)

Log Message

Demote WKBackForwardListDidChangeNotification to SPI
https://bugs.webkit.org/show_bug.cgi?id=131059

Reviewed by Dan Bernstein.

* UIProcess/API/Cocoa/WKBackForwardList.h:
* UIProcess/API/Cocoa/WKBackForwardList.mm:
* UIProcess/API/Cocoa/WKBackForwardListInternal.h:
* UIProcess/API/Cocoa/WKBackForwardListPrivate.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardListInternal.h.
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::LoaderClient::didChangeBackForwardList):
* WebKit2.xcodeproj/project.pbxproj:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (166612 => 166613)


--- trunk/Source/WebKit2/ChangeLog	2014-04-01 21:29:48 UTC (rev 166612)
+++ trunk/Source/WebKit2/ChangeLog	2014-04-01 21:35:54 UTC (rev 166613)
@@ -1,3 +1,18 @@
+2014-04-01  Anders Carlsson  <ander...@apple.com>
+
+        Demote WKBackForwardListDidChangeNotification to SPI
+        https://bugs.webkit.org/show_bug.cgi?id=131059
+
+        Reviewed by Dan Bernstein.
+
+        * UIProcess/API/Cocoa/WKBackForwardList.h:
+        * UIProcess/API/Cocoa/WKBackForwardList.mm:
+        * UIProcess/API/Cocoa/WKBackForwardListInternal.h:
+        * UIProcess/API/Cocoa/WKBackForwardListPrivate.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardListInternal.h.
+        * UIProcess/Cocoa/NavigationState.mm:
+        (WebKit::NavigationState::LoaderClient::didChangeBackForwardList):
+        * WebKit2.xcodeproj/project.pbxproj:
+
 2014-04-01  Andy Estes  <aes...@apple.com>
 
         [Cocoa] Add SPI to determine if a WKWebView is displaying a PDF

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardList.h (166612 => 166613)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardList.h	2014-04-01 21:29:48 UTC (rev 166612)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardList.h	2014-04-01 21:35:54 UTC (rev 166613)
@@ -29,26 +29,7 @@
 
 #import <WebKit2/WKBackForwardListItem.h>
 
-/*! Posted when a back-forward list changes. The notification object is the WKBackForwardList
-        that changed. The <code>userInfo</code> dictionary may contain the
-        @link WKBackForwardListAddedItemKey @/link and @link WKBackForwardListRemovedItemsKey @/link
-        keys.
-*/
-WK_EXTERN NSString * const WKBackForwardListDidChangeNotification;
 
-/*! A key in the <code>userInfo</code> dictionary of a
-        @link WKBackForwardListDidChangeNotification @/link, whose value is the
-        @link WKBackForwardListItem @/link that was appended to the list.
-*/
-WK_EXTERN NSString * const WKBackForwardListAddedItemKey;
-
-
-/*! A key in the <code>userInfo</code> dictionary of a
-        @link WKBackForwardListDidChangeNotification @/link, whose value is an NSArray of
-        @link WKBackForwardListItem@/link instances that were removed from the list.
-*/
-WK_EXTERN NSString * const WKBackForwardListRemovedItemsKey;
-
 WK_API_CLASS
 @interface WKBackForwardList : NSObject
 

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardList.mm (166612 => 166613)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardList.mm	2014-04-01 21:29:48 UTC (rev 166612)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardList.mm	2014-04-01 21:35:54 UTC (rev 166613)
@@ -31,10 +31,12 @@
 #import "WKBackForwardListItemInternal.h"
 #import "WKNSArray.h"
 
-NSString * const WKBackForwardListDidChangeNotification = @"WKBackForwardListDidChangeNotification";
-NSString * const WKBackForwardListAddedItemKey = @"WKBackForwardListAddedItemKey";
-NSString * const WKBackForwardListRemovedItemsKey = @"WKBackForwardListRemovedItemsKey";
+// FIXME: Remove this when nobody depends on it.
+WK_EXTERN NSString * const WKBackForwardListDidChangeNotification;
+NSString * const WKBackForwardListDidChangeNotification = @"_WKBackForwardListDidChangeNotification";
 
+NSString * const _WKBackForwardListDidChangeNotification = @"_WKBackForwardListDidChangeNotification";
+
 using namespace WebKit;
 
 @implementation WKBackForwardList {

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardListInternal.h (166612 => 166613)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardListInternal.h	2014-04-01 21:29:48 UTC (rev 166612)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardListInternal.h	2014-04-01 21:35:54 UTC (rev 166613)
@@ -23,7 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import "WKBackForwardList.h"
+#import "WKBackForwardListPrivate.h"
 
 #if WK_API_ENABLED
 

Copied: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardListPrivate.h (from rev 166612, trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardListInternal.h) (0 => 166613)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardListPrivate.h	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardListPrivate.h	2014-04-01 21:35:54 UTC (rev 166613)
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2014 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 <WebKit2/WKBackForwardList.h>
+
+#if WK_API_ENABLED
+
+WK_EXTERN NSString * const _WKBackForwardListDidChangeNotification;
+
+#endif

Modified: trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm (166612 => 166613)


--- trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm	2014-04-01 21:29:48 UTC (rev 166612)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm	2014-04-01 21:35:54 UTC (rev 166613)
@@ -517,22 +517,7 @@
 
 void NavigationState::LoaderClient::didChangeBackForwardList(WebKit::WebPageProxy*, WebKit::WebBackForwardListItem* addedItem, Vector<RefPtr<WebKit::WebBackForwardListItem>> removedItems)
 {
-    auto userInfo = adoptNS([[NSMutableDictionary alloc] init]);
-
-    if (addedItem)
-        [userInfo setObject:wrapper(*addedItem) forKey:WKBackForwardListAddedItemKey];
-
-    if (!removedItems.isEmpty()) {
-        Vector<id> removed;
-        removed.reserveInitialCapacity(removedItems.size());
-
-        for (const auto& removedItem : removedItems)
-            removed.uncheckedAppend(wrapper(*removedItem));
-
-        [userInfo setObject:adoptNS([[NSArray alloc] initWithObjects:removed.data() count:removed.size()]).get() forKey:WKBackForwardListRemovedItemsKey];
-    }
-
-    [[NSNotificationCenter defaultCenter] postNotificationName:WKBackForwardListDidChangeNotification object:wrapper(m_navigationState.m_webView->_page->backForwardList()) userInfo:userInfo.get()];
+    [[NSNotificationCenter defaultCenter] postNotificationName:_WKBackForwardListDidChangeNotification object:wrapper(m_navigationState.m_webView->_page->backForwardList())];
 }
 
 void NavigationState::willChangeIsLoading()

Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (166612 => 166613)


--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2014-04-01 21:29:48 UTC (rev 166612)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2014-04-01 21:35:54 UTC (rev 166613)
@@ -251,6 +251,7 @@
 		1A6FBD2911E69BC200DB1371 /* NetscapePlugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6FBD2711E69BC200DB1371 /* NetscapePlugin.cpp */; };
 		1A7865B916CAC71500ACE83A /* PluginProcessConnectionManagerMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A7865B716CAC71500ACE83A /* PluginProcessConnectionManagerMessageReceiver.cpp */; };
 		1A7865BA16CAC71500ACE83A /* PluginProcessConnectionManagerMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A7865B816CAC71500ACE83A /* PluginProcessConnectionManagerMessages.h */; };
+		1A79D9F218EB5EF100914CC5 /* WKBackForwardListPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A79D9F118EB5EF100914CC5 /* WKBackForwardListPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1A7C6CDA1378950800B9C04D /* EnvironmentVariables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A7C6CD81378950800B9C04D /* EnvironmentVariables.cpp */; };
 		1A7C6CDB1378950800B9C04D /* EnvironmentVariables.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A7C6CD91378950800B9C04D /* EnvironmentVariables.h */; };
 		1A7E376D18E3CA57003D0FFF /* _WKScriptWorld.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A7E376B18E3CA57003D0FFF /* _WKScriptWorld.mm */; };
@@ -2015,6 +2016,7 @@
 		1A7865B616CAC6FD00ACE83A /* PluginProcessConnectionManager.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = PluginProcessConnectionManager.messages.in; sourceTree = "<group>"; };
 		1A7865B716CAC71500ACE83A /* PluginProcessConnectionManagerMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginProcessConnectionManagerMessageReceiver.cpp; sourceTree = "<group>"; };
 		1A7865B816CAC71500ACE83A /* PluginProcessConnectionManagerMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginProcessConnectionManagerMessages.h; sourceTree = "<group>"; };
+		1A79D9F118EB5EF100914CC5 /* WKBackForwardListPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBackForwardListPrivate.h; sourceTree = "<group>"; };
 		1A7C6CD81378950800B9C04D /* EnvironmentVariables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EnvironmentVariables.cpp; sourceTree = "<group>"; };
 		1A7C6CD91378950800B9C04D /* EnvironmentVariables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EnvironmentVariables.h; sourceTree = "<group>"; };
 		1A7E376B18E3CA57003D0FFF /* _WKScriptWorld.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKScriptWorld.mm; sourceTree = "<group>"; };
@@ -3788,6 +3790,7 @@
 				37C4C08B1814AC5C003688B9 /* WKBackForwardList.h */,
 				37C4C08A1814AC5C003688B9 /* WKBackForwardList.mm */,
 				37C4C08E1814AF3A003688B9 /* WKBackForwardListInternal.h */,
+				1A79D9F118EB5EF100914CC5 /* WKBackForwardListPrivate.h */,
 				37C4C08518149C5B003688B9 /* WKBackForwardListItem.h */,
 				37C4C08418149C5B003688B9 /* WKBackForwardListItem.mm */,
 				37C4C08818149F23003688B9 /* WKBackForwardListItemInternal.h */,
@@ -6702,6 +6705,7 @@
 				C0CE72AD1247E78D00BC0EC4 /* HandleMessage.h in Headers */,
 				512C06891638F67E00ABB911 /* HostRecord.h in Headers */,
 				37F90DE31376560E0051CF68 /* HTTPCookieAcceptPolicy.h in Headers */,
+				1A79D9F218EB5EF100914CC5 /* WKBackForwardListPrivate.h in Headers */,
 				BCCF6B2512C93E7A008F9C35 /* ImageOptions.h in Headers */,
 				1A1E093418861D3800D2DC49 /* WebProgressTrackerClient.h in Headers */,
 				BC64697011DBE603006455B0 /* APIArray.h in Headers */,
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to