Title: [228413] trunk/Source/WebCore
Revision
228413
Author
[email protected]
Date
2018-02-12 18:26:17 -0800 (Mon, 12 Feb 2018)

Log Message

Unify UserAgent into WebCore/platform.
https://bugs.webkit.org/show_bug.cgi?id=182716

Reviewed by Michael Catanzaro.

No change in functionality.

* SourcesCocoa.txt:
* SourcesIOS.txt:
* SourcesMac.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/cocoa/UserAgent.h: Removed.
* platform/UserAgent.h:
* platform/cocoa/UserAgentCocoa.mm: Renamed from Source/WebCore/page/cocoa/UserAgent.mm.
* platform/ios/UserAgentIOS.mm: Renamed from Source/WebCore/page/ios/UserAgentIOS.mm.
* platform/mac/UserAgentMac.mm: Renamed from Source/WebCore/page/mac/UserAgentMac.mm.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (228412 => 228413)


--- trunk/Source/WebCore/ChangeLog	2018-02-13 01:28:27 UTC (rev 228412)
+++ trunk/Source/WebCore/ChangeLog	2018-02-13 02:26:17 UTC (rev 228413)
@@ -1,3 +1,22 @@
+2018-02-12  Ross Kirsling  <[email protected]>
+
+        Unify UserAgent into WebCore/platform.
+        https://bugs.webkit.org/show_bug.cgi?id=182716
+
+        Reviewed by Michael Catanzaro.
+
+        No change in functionality.
+
+        * SourcesCocoa.txt:
+        * SourcesIOS.txt:
+        * SourcesMac.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * page/cocoa/UserAgent.h: Removed.
+        * platform/UserAgent.h:
+        * platform/cocoa/UserAgentCocoa.mm: Renamed from Source/WebCore/page/cocoa/UserAgent.mm.
+        * platform/ios/UserAgentIOS.mm: Renamed from Source/WebCore/page/ios/UserAgentIOS.mm.
+        * platform/mac/UserAgentMac.mm: Renamed from Source/WebCore/page/mac/UserAgentMac.mm.
+
 2018-02-12  Antoine Quint  <[email protected]>
 
         [Web Animations] Support the copy constructors for KeyframeEffectReadOnly and KeyframeEffect

Modified: trunk/Source/WebCore/SourcesCocoa.txt (228412 => 228413)


--- trunk/Source/WebCore/SourcesCocoa.txt	2018-02-13 01:28:27 UTC (rev 228412)
+++ trunk/Source/WebCore/SourcesCocoa.txt	2018-02-13 02:26:17 UTC (rev 228413)
@@ -98,7 +98,6 @@
 page/cocoa/ResourceUsageOverlayCocoa.mm
 page/cocoa/ResourceUsageThreadCocoa.mm
 page/cocoa/SettingsBaseCocoa.mm
-page/cocoa/UserAgent.mm
 
 page/mac/ChromeMac.mm
 page/mac/DragControllerMac.mm
@@ -158,6 +157,7 @@
 platform/cocoa/SystemVersion.mm
 platform/cocoa/TelephoneNumberDetectorCocoa.cpp
 platform/cocoa/ThemeCocoa.mm
+platform/cocoa/UserAgentCocoa.mm
 platform/cocoa/VideoFullscreenModelVideoElement.mm
 platform/cocoa/VideoToolboxSoftLink.cpp
 platform/cocoa/WebCoreNSErrorExtras.mm

Modified: trunk/Source/WebCore/SourcesIOS.txt (228412 => 228413)


--- trunk/Source/WebCore/SourcesIOS.txt	2018-02-13 01:28:27 UTC (rev 228412)
+++ trunk/Source/WebCore/SourcesIOS.txt	2018-02-13 02:26:17 UTC (rev 228413)
@@ -58,7 +58,6 @@
 
 page/ios/EventHandlerIOS.mm
 page/ios/FrameIOS.mm
-page/ios/UserAgentIOS.mm
 page/ios/WebEventRegion.mm
 
 page/scrolling/ios/ScrollingCoordinatorIOS.mm
@@ -91,6 +90,7 @@
 platform/ios/ScrollbarThemeIOS.mm
 platform/ios/ScrollViewIOS.mm
 platform/ios/ThemeIOS.mm @no-unify
+platform/ios/UserAgentIOS.mm
 platform/ios/ValidationBubbleIOS.mm @no-unify
 platform/ios/VideoFullscreenInterfaceAVKit.mm @no-unify
 platform/ios/wak/WAKScrollView.mm

Modified: trunk/Source/WebCore/SourcesMac.txt (228412 => 228413)


--- trunk/Source/WebCore/SourcesMac.txt	2018-02-13 01:28:27 UTC (rev 228412)
+++ trunk/Source/WebCore/SourcesMac.txt	2018-02-13 02:26:17 UTC (rev 228413)
@@ -42,7 +42,6 @@
 page/mac/EventHandlerMac.mm
 page/mac/ServicesOverlayController.mm
 page/mac/TextIndicatorWindow.mm
-page/mac/UserAgentMac.mm
 page/mac/WheelEventDeltaFilterMac.mm
 
 page/scrolling/mac/ScrollingCoordinatorMac.mm
@@ -97,6 +96,7 @@
 platform/mac/ThemeMac.mm
 platform/mac/ThreadCheck.mm @no-unify
 platform/mac/UserActivityMac.mm
+platform/mac/UserAgentMac.mm
 platform/mac/ValidationBubbleMac.mm
 platform/mac/WebCoreFullScreenPlaceholderView.mm
 platform/mac/WebCoreFullScreenWarningView.mm

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (228412 => 228413)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2018-02-13 01:28:27 UTC (rev 228412)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2018-02-13 02:26:17 UTC (rev 228413)
@@ -644,7 +644,6 @@
 		24F54EAD101FE914000AE741 /* ApplicationCacheHost.h in Headers */ = {isa = PBXBuildFile; fileRef = 24F54EAB101FE914000AE741 /* ApplicationCacheHost.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		2542F4DB1166C25A00E89A86 /* UserGestureIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = 2542F4D91166C25A00E89A86 /* UserGestureIndicator.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		262391361A648CEE007251A3 /* ContentExtensionsDebugging.h in Headers */ = {isa = PBXBuildFile; fileRef = 262391351A648CEE007251A3 /* ContentExtensionsDebugging.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		26255F0318878E110006E1FD /* UserAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 26255F0118878E110006E1FD /* UserAgent.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		262EC41A1D078FB900BA78FC /* EventTrackingRegions.h in Headers */ = {isa = PBXBuildFile; fileRef = 262EC4191D078F3D00BA78FC /* EventTrackingRegions.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		265541391489811C000DFC5D /* KeyEventCodesIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 265541371489811C000DFC5D /* KeyEventCodesIOS.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		26601EBF14B3B9AD0012C0FE /* PlatformEventFactoryIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 26601EBD14B3B9AD0012C0FE /* PlatformEventFactoryIOS.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -2873,6 +2872,7 @@
 		A31C4E4D16E02AA6002F7957 /* OESTextureHalfFloat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A31C4E4C16E02AA6002F7957 /* OESTextureHalfFloat.cpp */; };
 		A31C4E4F16E02AB4002F7957 /* OESTextureHalfFloat.h in Headers */ = {isa = PBXBuildFile; fileRef = A31C4E4E16E02AB4002F7957 /* OESTextureHalfFloat.h */; };
 		A31C4E5416E02B40002F7957 /* JSOESTextureHalfFloat.h in Headers */ = {isa = PBXBuildFile; fileRef = A31C4E5316E02B40002F7957 /* JSOESTextureHalfFloat.h */; };
+		A3AF9D8620326861006CAD06 /* UserAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A3AF9D8220325324006CAD06 /* UserAgent.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		A3BB59F41457A40D00AC56FE /* DocumentEventQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = A3BB59F21457A40D00AC56FE /* DocumentEventQueue.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		A3E2643114748991005A8588 /* WorkerEventQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = A3E2642F14748991005A8588 /* WorkerEventQueue.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		A409C985116D0DDD007197BD /* AccessibilityProgressIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = A409C983116D0DDD007197BD /* AccessibilityProgressIndicator.h */; };
@@ -6181,9 +6181,6 @@
 		2542F4D81166C25A00E89A86 /* UserGestureIndicator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserGestureIndicator.cpp; sourceTree = "<group>"; };
 		2542F4D91166C25A00E89A86 /* UserGestureIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserGestureIndicator.h; sourceTree = "<group>"; };
 		262391351A648CEE007251A3 /* ContentExtensionsDebugging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContentExtensionsDebugging.h; sourceTree = "<group>"; };
-		26255EFF18878DFF0006E1FD /* UserAgentIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UserAgentIOS.mm; sourceTree = "<group>"; };
-		26255F0118878E110006E1FD /* UserAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserAgent.h; sourceTree = "<group>"; };
-		26255F0218878E110006E1FD /* UserAgentMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UserAgentMac.mm; sourceTree = "<group>"; };
 		262EC4191D078F3D00BA78FC /* EventTrackingRegions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventTrackingRegions.h; sourceTree = "<group>"; };
 		262EC41C1D110B1F00BA78FC /* EventTrackingRegions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventTrackingRegions.cpp; sourceTree = "<group>"; };
 		265541371489811C000DFC5D /* KeyEventCodesIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyEventCodesIOS.h; sourceTree = "<group>"; };
@@ -8472,7 +8469,6 @@
 		5D21A80113ECE5DF00BB7064 /* WebVTTParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVTTParser.h; sourceTree = "<group>"; };
 		5D5975B119635F1100D00878 /* SystemVersion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SystemVersion.h; sourceTree = "<group>"; };
 		5D5975B219635F1100D00878 /* SystemVersion.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SystemVersion.mm; sourceTree = "<group>"; };
-		5D5975B61963637B00D00878 /* UserAgent.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UserAgent.mm; sourceTree = "<group>"; };
 		5D925B650F64D4DD00B847F0 /* ScrollAlignment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollAlignment.cpp; sourceTree = "<group>"; };
 		5D925B660F64D4DD00B847F0 /* ScrollAlignment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollAlignment.h; sourceTree = "<group>"; };
 		5DA5E0FA102B953800088CF9 /* JSWebSocket.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebSocket.cpp; sourceTree = "<group>"; };
@@ -10877,6 +10873,10 @@
 		A31C4E5016E02AC5002F7957 /* OESTextureHalfFloat.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = OESTextureHalfFloat.idl; sourceTree = "<group>"; };
 		A31C4E5116E02B08002F7957 /* JSOESTextureHalfFloat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSOESTextureHalfFloat.cpp; sourceTree = "<group>"; };
 		A31C4E5316E02B40002F7957 /* JSOESTextureHalfFloat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSOESTextureHalfFloat.h; sourceTree = "<group>"; };
+		A3AF9D81203252EE006CAD06 /* UserAgentCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UserAgentCocoa.mm; sourceTree = "<group>"; };
+		A3AF9D8220325324006CAD06 /* UserAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserAgent.h; sourceTree = "<group>"; };
+		A3AF9D8320325691006CAD06 /* UserAgentIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UserAgentIOS.mm; sourceTree = "<group>"; };
+		A3AF9D84203256A3006CAD06 /* UserAgentMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UserAgentMac.mm; sourceTree = "<group>"; };
 		A3BB59F11457A40D00AC56FE /* DocumentEventQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentEventQueue.cpp; sourceTree = "<group>"; };
 		A3BB59F21457A40D00AC56FE /* DocumentEventQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentEventQueue.h; sourceTree = "<group>"; };
 		A3D42A841F33BA3600A64B62 /* LayoutUnit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutUnit.cpp; sourceTree = "<group>"; };
@@ -15478,7 +15478,6 @@
 			children = (
 				FE6938B51045D67E008EABB6 /* EventHandlerIOS.mm */,
 				FED13D3B0CEA936A00D89466 /* FrameIOS.mm */,
-				26255EFF18878DFF0006E1FD /* UserAgentIOS.mm */,
 				225A16B30D5C11E900090295 /* WebEventRegion.h */,
 				225A16B40D5C11E900090295 /* WebEventRegion.mm */,
 			);
@@ -18341,8 +18340,6 @@
 				ADFE2B541BD5F41200DAB457 /* ResourceUsageOverlayCocoa.mm */,
 				A5071E881C56D4FA009951BE /* ResourceUsageThreadCocoa.mm */,
 				A182D5B61BE722620087A7CC /* SettingsBaseCocoa.mm */,
-				26255F0118878E110006E1FD /* UserAgent.h */,
-				5D5975B61963637B00D00878 /* UserAgent.mm */,
 			);
 			path = cocoa;
 			sourceTree = "<group>";
@@ -18670,6 +18667,7 @@
 				51DF6D7F0B92A18E00C2DC85 /* ThreadCheck.mm */,
 				6593923909AE435C002C531F /* URLMac.mm */,
 				868160D3187669E70021E79D /* UserActivityMac.mm */,
+				A3AF9D84203256A3006CAD06 /* UserAgentMac.mm */,
 				83C45B8B1DC2B663008871BA /* ValidationBubbleMac.mm */,
 				52B0D4C11C57FF910077CE53 /* VideoFullscreenInterfaceMac.h */,
 				52131E5A1C4F15610033F802 /* VideoFullscreenInterfaceMac.mm */,
@@ -19811,7 +19809,6 @@
 				2D93AEE219DF5641002A86C3 /* ServicesOverlayController.mm */,
 				2D4F96F31A1ECC240098BF88 /* TextIndicatorWindow.h */,
 				2D4F96F41A1ECC240098BF88 /* TextIndicatorWindow.mm */,
-				26255F0218878E110006E1FD /* UserAgentMac.mm */,
 				F587854C02DE375901EA4122 /* WebCoreFrameView.h */,
 				2E9B5D8E1B66A94E008C6A24 /* WheelEventDeltaFilterMac.h */,
 				2EEEE55B1B66A047008E2CBC /* WheelEventDeltaFilterMac.mm */,
@@ -20917,6 +20914,7 @@
 				44C9919E0F3D210E00586670 /* ThemeIOS.mm */,
 				1F72BF08187FD4270009BCB3 /* TileControllerMemoryHandlerIOS.cpp */,
 				1F72BF09187FD4270009BCB3 /* TileControllerMemoryHandlerIOS.h */,
+				A3AF9D8320325691006CAD06 /* UserAgentIOS.mm */,
 				837B7D1F1DC3F54C00D051FC /* ValidationBubbleIOS.mm */,
 				3FBC4AF2189881560046EE38 /* VideoFullscreenInterfaceAVKit.h */,
 				3FBC4AF1189881560046EE38 /* VideoFullscreenInterfaceAVKit.mm */,
@@ -21055,6 +21053,7 @@
 				7CC564B918BAC720001B9652 /* TelephoneNumberDetectorCocoa.cpp */,
 				310D71941B335C9D009C7B73 /* ThemeCocoa.h */,
 				310D71931B335C9D009C7B73 /* ThemeCocoa.mm */,
+				A3AF9D81203252EE006CAD06 /* UserAgentCocoa.mm */,
 				52B0D4BF1C57FD660077CE53 /* VideoFullscreenChangeObserver.h */,
 				52D5A1A41C57488900DE34A3 /* VideoFullscreenModel.h */,
 				52D5A1A51C57488900DE34A3 /* VideoFullscreenModelVideoElement.h */,
@@ -23988,6 +23987,7 @@
 				5C6E65401D5CEDC900F7862E /* URLParser.h */,
 				868160D1187669C40021E79D /* UserActivity.cpp */,
 				868160D2187669C40021E79D /* UserActivity.h */,
+				A3AF9D8220325324006CAD06 /* UserAgent.h */,
 				71C916071D1483A300ACA47D /* UserInterfaceLayoutDirection.h */,
 				83C45B8D1DC2B67C008871BA /* ValidationBubble.h */,
 				515F79511CFCA3C700CCED93 /* WebCoreCrossThreadCopier.cpp */,
@@ -30072,7 +30072,7 @@
 				93D437A21D57B3FE00AB85EA /* URLUtils.h in Headers */,
 				A72763BF16689BFB002FCACB /* UserActionElementSet.h in Headers */,
 				868160D618766A130021E79D /* UserActivity.h in Headers */,
-				26255F0318878E110006E1FD /* UserAgent.h in Headers */,
+				A3AF9D8620326861006CAD06 /* UserAgent.h in Headers */,
 				CDAB6D3117C9259500C60B34 /* UserAgentScripts.h in Headers */,
 				656581B209D14EE6000E61D7 /* UserAgentStyleSheets.h in Headers */,
 				1AE79D43188DB61F002239C2 /* UserContentController.h in Headers */,

Deleted: trunk/Source/WebCore/page/cocoa/UserAgent.h (228412 => 228413)


--- trunk/Source/WebCore/page/cocoa/UserAgent.h	2018-02-13 01:28:27 UTC (rev 228412)
+++ trunk/Source/WebCore/page/cocoa/UserAgent.h	2018-02-13 02:26:17 UTC (rev 228413)
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2014-2017 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.
- */
-
-#ifndef UserAgent_h
-#define UserAgent_h
-
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-WEBCORE_EXPORT String standardUserAgentWithApplicationName(const String& applicationName);
-
-String systemMarketingVersionForUserAgentString();
-String userAgentBundleVersion();
-
-}
-
-#endif // UserAgent_h

Deleted: trunk/Source/WebCore/page/cocoa/UserAgent.mm (228412 => 228413)


--- trunk/Source/WebCore/page/cocoa/UserAgent.mm	2018-02-13 01:28:27 UTC (rev 228412)
+++ trunk/Source/WebCore/page/cocoa/UserAgent.mm	2018-02-13 02:26:17 UTC (rev 228413)
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2014-2017 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 "UserAgent.h"
-
-#import "SystemVersion.h"
-
-namespace WebCore {
-
-String systemMarketingVersionForUserAgentString()
-{
-    // Use underscores instead of dots because when we first added the Mac OS X version to the user agent string
-    // we were concerned about old DHTML libraries interpreting "4." as Netscape 4. That's no longer a concern for us
-    // but we're sticking with the underscores for compatibility with the format used by older versions of Safari.
-    return [systemMarketingVersion() stringByReplacingOccurrencesOfString:@"." withString:@"_"];
-}
-
-String userAgentBundleVersion()
-{
-    return ASCIILiteral("605.1.15");
-}
-
-} // namespace WebCore

Deleted: trunk/Source/WebCore/page/ios/UserAgentIOS.mm (228412 => 228413)


--- trunk/Source/WebCore/page/ios/UserAgentIOS.mm	2018-02-13 01:28:27 UTC (rev 228412)
+++ trunk/Source/WebCore/page/ios/UserAgentIOS.mm	2018-02-13 02:26:17 UTC (rev 228413)
@@ -1,98 +0,0 @@
-/*
- * Copyright (C) 2014-2017 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 "UserAgent.h"
-
-#import "Device.h"
-#import "SystemVersion.h"
-#import <pal/spi/ios/MobileGestaltSPI.h>
-#import <pal/spi/ios/UIKitSPI.h>
-#import <wtf/RetainPtr.h>
-#import <wtf/SoftLinking.h>
-
-SOFT_LINK_FRAMEWORK(UIKit);
-SOFT_LINK_CLASS(UIKit, UIApplication);
-
-namespace WebCore {
-
-static inline bool isClassic()
-{
-    return [[getUIApplicationClass() sharedApplication] _isClassic];
-}
-
-static inline bool isClassicPad()
-{
-    return [getUIApplicationClass() _classicMode] == UIApplicationSceneClassicModeOriginalPad;
-}
-
-static inline bool isClassicPhone()
-{
-    return isClassic() && [getUIApplicationClass() _classicMode] != UIApplicationSceneClassicModeOriginalPad;
-}
-
-static inline NSString *osNameForUserAgent()
-{
-    if (deviceHasIPadCapability() && !isClassicPhone())
-        return @"OS";
-    return @"iPhone OS";
-}
-
-static inline NSString *deviceNameForUserAgent()
-{
-    if (isClassic()) {
-        if (isClassicPad())
-            return @"iPad";
-        return @"iPhone";
-    }
-
-    auto name = retainPtr((NSString *)deviceName());
-#if PLATFORM(IOS_SIMULATOR)
-    NSUInteger location = [name rangeOfString:@" Simulator" options:NSBackwardsSearch].location;
-    if (location != NSNotFound && location > 0)
-        return [name substringToIndex:location];
-#endif
-    return name.autorelease();
-}
-
-String standardUserAgentWithApplicationName(const String& applicationName)
-{
-    // Check to see if there is a user agent override for all WebKit clients.
-    CFPropertyListRef override = CFPreferencesCopyAppValue(CFSTR("UserAgent"), CFSTR("com.apple.WebFoundation"));
-    if (override) {
-        if (CFGetTypeID(override) == CFStringGetTypeID())
-            return static_cast<NSString *>(CFBridgingRelease(override));
-        CFRelease(override);
-    }
-
-    // FIXME: We should implement this with String and/or StringBuilder instead.
-    NSString *webKitVersion = userAgentBundleVersion();
-    NSString *osMarketingVersionString = systemMarketingVersionForUserAgentString();
-    if (applicationName.isEmpty())
-        return [NSString stringWithFormat:@"Mozilla/5.0 (%@; CPU %@ %@ like Mac OS X) AppleWebKit/%@ (KHTML, like Gecko)", deviceNameForUserAgent(), osNameForUserAgent(), osMarketingVersionString, webKitVersion];
-    return [NSString stringWithFormat:@"Mozilla/5.0 (%@; CPU %@ %@ like Mac OS X) AppleWebKit/%@ (KHTML, like Gecko) %@", deviceNameForUserAgent(), osNameForUserAgent(), osMarketingVersionString, webKitVersion, static_cast<NSString *>(applicationName)];
-}
-
-} // namespace WebCore.

Deleted: trunk/Source/WebCore/page/mac/UserAgentMac.mm (228412 => 228413)


--- trunk/Source/WebCore/page/mac/UserAgentMac.mm	2018-02-13 01:28:27 UTC (rev 228412)
+++ trunk/Source/WebCore/page/mac/UserAgentMac.mm	2018-02-13 02:26:17 UTC (rev 228413)
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2014-2017 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 "UserAgent.h"
-
-#import "SystemVersion.h"
-
-namespace WebCore {
-
-#if defined(__ppc__) || defined(__ppc64__)
-#define PROCESSOR "PPC"
-#elif defined(__i386__) || defined(__x86_64__)
-#define PROCESSOR "Intel"
-#else
-#error Unknown architecture
-#endif
-
-String standardUserAgentWithApplicationName(const String& applicationName)
-{
-    String osVersion = systemMarketingVersionForUserAgentString();
-    String webKitVersionString = userAgentBundleVersion();
-
-    if (applicationName.isEmpty())
-        return makeString("Mozilla/5.0 (Macintosh; " PROCESSOR " Mac OS X ", osVersion, ") AppleWebKit/", webKitVersionString, " (KHTML, like Gecko)");
-    return makeString("Mozilla/5.0 (Macintosh; " PROCESSOR " Mac OS X ", osVersion, ") AppleWebKit/", webKitVersionString, " (KHTML, like Gecko) ", applicationName);
-}
-
-} // namespace WebCore

Modified: trunk/Source/WebCore/platform/UserAgent.h (228412 => 228413)


--- trunk/Source/WebCore/platform/UserAgent.h	2018-02-13 01:28:27 UTC (rev 228412)
+++ trunk/Source/WebCore/platform/UserAgent.h	2018-02-13 02:26:17 UTC (rev 228413)
@@ -26,19 +26,20 @@
 
 #pragma once
 
-#if PLATFORM(COCOA)
-// FIXME: Remove Source/WebCore/page/cocoa/UserAgent.h
-#include_next "UserAgent.h"
-#else
-
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
+
+#if PLATFORM(COCOA)
+WEBCORE_EXPORT String standardUserAgentWithApplicationName(const String& applicationName);
+
+String systemMarketingVersionForUserAgentString();
+String userAgentBundleVersion();
+#else
 class URL;
 
 WEBCORE_EXPORT String standardUserAgent(const String& applicationName = emptyString(), const String& applicationVersion = emptyString());
 WEBCORE_EXPORT String standardUserAgentForURL(const URL&);
+#endif
 
 }
-
-#endif

Copied: trunk/Source/WebCore/platform/cocoa/UserAgentCocoa.mm (from rev 228412, trunk/Source/WebCore/page/cocoa/UserAgent.mm) (0 => 228413)


--- trunk/Source/WebCore/platform/cocoa/UserAgentCocoa.mm	                        (rev 0)
+++ trunk/Source/WebCore/platform/cocoa/UserAgentCocoa.mm	2018-02-13 02:26:17 UTC (rev 228413)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2014-2017 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 "UserAgent.h"
+
+#import "SystemVersion.h"
+
+namespace WebCore {
+
+String systemMarketingVersionForUserAgentString()
+{
+    // Use underscores instead of dots because when we first added the Mac OS X version to the user agent string
+    // we were concerned about old DHTML libraries interpreting "4." as Netscape 4. That's no longer a concern for us
+    // but we're sticking with the underscores for compatibility with the format used by older versions of Safari.
+    return [systemMarketingVersion() stringByReplacingOccurrencesOfString:@"." withString:@"_"];
+}
+
+String userAgentBundleVersion()
+{
+    return ASCIILiteral("605.1.15");
+}
+
+} // namespace WebCore

Copied: trunk/Source/WebCore/platform/ios/UserAgentIOS.mm (from rev 228412, trunk/Source/WebCore/page/ios/UserAgentIOS.mm) (0 => 228413)


--- trunk/Source/WebCore/platform/ios/UserAgentIOS.mm	                        (rev 0)
+++ trunk/Source/WebCore/platform/ios/UserAgentIOS.mm	2018-02-13 02:26:17 UTC (rev 228413)
@@ -0,0 +1,98 @@
+/*
+ * Copyright (C) 2014-2017 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 "UserAgent.h"
+
+#import "Device.h"
+#import "SystemVersion.h"
+#import <pal/spi/ios/MobileGestaltSPI.h>
+#import <pal/spi/ios/UIKitSPI.h>
+#import <wtf/RetainPtr.h>
+#import <wtf/SoftLinking.h>
+
+SOFT_LINK_FRAMEWORK(UIKit);
+SOFT_LINK_CLASS(UIKit, UIApplication);
+
+namespace WebCore {
+
+static inline bool isClassic()
+{
+    return [[getUIApplicationClass() sharedApplication] _isClassic];
+}
+
+static inline bool isClassicPad()
+{
+    return [getUIApplicationClass() _classicMode] == UIApplicationSceneClassicModeOriginalPad;
+}
+
+static inline bool isClassicPhone()
+{
+    return isClassic() && [getUIApplicationClass() _classicMode] != UIApplicationSceneClassicModeOriginalPad;
+}
+
+static inline NSString *osNameForUserAgent()
+{
+    if (deviceHasIPadCapability() && !isClassicPhone())
+        return @"OS";
+    return @"iPhone OS";
+}
+
+static inline NSString *deviceNameForUserAgent()
+{
+    if (isClassic()) {
+        if (isClassicPad())
+            return @"iPad";
+        return @"iPhone";
+    }
+
+    auto name = retainPtr((NSString *)deviceName());
+#if PLATFORM(IOS_SIMULATOR)
+    NSUInteger location = [name rangeOfString:@" Simulator" options:NSBackwardsSearch].location;
+    if (location != NSNotFound && location > 0)
+        return [name substringToIndex:location];
+#endif
+    return name.autorelease();
+}
+
+String standardUserAgentWithApplicationName(const String& applicationName)
+{
+    // Check to see if there is a user agent override for all WebKit clients.
+    CFPropertyListRef override = CFPreferencesCopyAppValue(CFSTR("UserAgent"), CFSTR("com.apple.WebFoundation"));
+    if (override) {
+        if (CFGetTypeID(override) == CFStringGetTypeID())
+            return static_cast<NSString *>(CFBridgingRelease(override));
+        CFRelease(override);
+    }
+
+    // FIXME: We should implement this with String and/or StringBuilder instead.
+    NSString *webKitVersion = userAgentBundleVersion();
+    NSString *osMarketingVersionString = systemMarketingVersionForUserAgentString();
+    if (applicationName.isEmpty())
+        return [NSString stringWithFormat:@"Mozilla/5.0 (%@; CPU %@ %@ like Mac OS X) AppleWebKit/%@ (KHTML, like Gecko)", deviceNameForUserAgent(), osNameForUserAgent(), osMarketingVersionString, webKitVersion];
+    return [NSString stringWithFormat:@"Mozilla/5.0 (%@; CPU %@ %@ like Mac OS X) AppleWebKit/%@ (KHTML, like Gecko) %@", deviceNameForUserAgent(), osNameForUserAgent(), osMarketingVersionString, webKitVersion, static_cast<NSString *>(applicationName)];
+}
+
+} // namespace WebCore.

Copied: trunk/Source/WebCore/platform/mac/UserAgentMac.mm (from rev 228412, trunk/Source/WebCore/page/mac/UserAgentMac.mm) (0 => 228413)


--- trunk/Source/WebCore/platform/mac/UserAgentMac.mm	                        (rev 0)
+++ trunk/Source/WebCore/platform/mac/UserAgentMac.mm	2018-02-13 02:26:17 UTC (rev 228413)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2014-2017 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 "UserAgent.h"
+
+#import "SystemVersion.h"
+
+namespace WebCore {
+
+#if defined(__ppc__) || defined(__ppc64__)
+#define PROCESSOR "PPC"
+#elif defined(__i386__) || defined(__x86_64__)
+#define PROCESSOR "Intel"
+#else
+#error Unknown architecture
+#endif
+
+String standardUserAgentWithApplicationName(const String& applicationName)
+{
+    String osVersion = systemMarketingVersionForUserAgentString();
+    String webKitVersionString = userAgentBundleVersion();
+
+    if (applicationName.isEmpty())
+        return makeString("Mozilla/5.0 (Macintosh; " PROCESSOR " Mac OS X ", osVersion, ") AppleWebKit/", webKitVersionString, " (KHTML, like Gecko)");
+    return makeString("Mozilla/5.0 (Macintosh; " PROCESSOR " Mac OS X ", osVersion, ") AppleWebKit/", webKitVersionString, " (KHTML, like Gecko) ", applicationName);
+}
+
+} // namespace WebCore
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to