Changeset 260724 in webkit
- Timestamp:
- Apr 26, 2020 7:53:33 AM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 1 added
- 1 deleted
- 13 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r260723 r260724 1 2020-04-26 Darin Adler <darin@apple.com> 2 3 Remove unnecessary inlining and templates for URL decomposition DOM functions 4 https://bugs.webkit.org/show_bug.cgi?id=211025 5 6 Reviewed by Alex Christensen. 7 8 * Headers.cmake: Renamed URLUtils.h to URLDecomposition.h. 9 * Modules/cache/DOMCacheStorage.cpp: Updated include and using namespace. 10 * Sources.txt: Added URLDecomposition.cpp. 11 * WebCore.xcodeproj/project.pbxproj: Added URLDecomposition.cpp and 12 renamed URLUtils.h to URLDecomposition.h. 13 14 * html/DOMURL.h: Removed the WEBCORE_EXPORT on this class. Added final. 15 Derive from URLDecomposition instead of URLUtils. Changed return type of 16 href to const&. Moved toJSON here from URLUtils. Added overrides of the 17 fullURL and setFullURL functions for URLDecomposition. 18 19 * html/DOMURL.idl: Removed ImplementationLacksVTable. 20 21 * html/HTMLAnchorElement.cpp: 22 (WebCore::HTMLAnchorElement::HTMLAnchorElement): Moved initialization of 23 boolean data members to the class definition. 24 25 * html/HTMLAnchorElement.h: Derive from URLDecomposition instead of 26 URLUtils. Added overrides of the fullURL and setFullURL functions for 27 URLDecomposition. Initialize data members here in the class definition. 28 29 * html/HTMLMediaElement.cpp: Removed unnecessary include of DOMURL.h. 30 31 * html/URLDecomposition.cpp: Added. Contains most of the code from 32 the URLUtils class template, which no longer needs to be in a header. 33 34 * html/URLDecomposition.h: Renamed URLUtils.h to this. It's now an 35 abstract base class rather than a class template using the curiously 36 recurring template pattern. 37 38 * html/URLSearchParams.h: Forward-declare DOMURL rather than including 39 the DOMURL.h header. 40 41 * html/URLUtils.h: Removed. Renamed to URLDecompostion.h. 42 43 * page/DOMWindow.cpp: Removed unneeded include of DOMURL.h. 44 * testing/Internals.cpp: Added include of DOMURL.h. 45 1 46 2020-04-26 Cathie Chen <cathiechen@igalia.com> 2 47 -
trunk/Source/WebCore/Headers.cmake
r260504 r260724 651 651 html/TimeRanges.h 652 652 html/TypeAhead.h 653 html/URLDecomposition.h 653 654 html/URLRegistry.h 654 html/URLUtils.h655 655 html/ValidityState.h 656 656 html/VoidCallback.h -
trunk/Source/WebCore/Modules/cache/DOMCacheStorage.cpp
r255136 r260724 33 33 #include "JSFetchResponse.h" 34 34 #include "ScriptExecutionContext.h" 35 #include "SecurityOrigin.h" 35 36 36 37 namespace WebCore { 37 using namespace WebCore::DOMCacheEngine;38 38 39 39 DOMCacheStorage::DOMCacheStorage(ScriptExecutionContext& context, Ref<CacheStorageConnection>&& connection) -
trunk/Source/WebCore/Sources.txt
r260504 r260724 1277 1277 html/TimeRanges.cpp 1278 1278 html/TypeAhead.cpp 1279 html/URLDecomposition.cpp 1279 1280 html/URLInputType.cpp 1280 1281 html/URLSearchParams.cpp -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r260718 r260724 2714 2714 93D4379F1D57B15300AB85EA /* JSExecState.h in Headers */ = {isa = PBXBuildFile; fileRef = 8F934D831189F1EE00508D5D /* JSExecState.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2715 2715 93D437A01D57B19A00AB85EA /* CustomElementReactionQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B56C9A81C89312800C456DF /* CustomElementReactionQueue.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2716 93D437A21D57B3FE00AB85EA /* URL Utils.h in Headers */ = {isa = PBXBuildFile; fileRef = 656B9DCA189DE10000BB842C /* URLUtils.h */; settings = {ATTRIBUTES = (Private, ); }; };2716 93D437A21D57B3FE00AB85EA /* URLDecomposition.h in Headers */ = {isa = PBXBuildFile; fileRef = 656B9DCA189DE10000BB842C /* URLDecomposition.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2717 2717 93D437A31D57B7E200AB85EA /* JSMediaListCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = AD726FE716D9F204003A4E6D /* JSMediaListCustom.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2718 2718 93D9D53C0DA27E180077216C /* RangeBoundaryPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D9D53B0DA27E180077216C /* RangeBoundaryPoint.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 9257 9257 656581EA09D1508D000E61D7 /* XLinkNames.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = XLinkNames.cpp; path = DerivedSources/WebCore/XLinkNames.cpp; sourceTree = BUILT_PRODUCTS_DIR; }; 9258 9258 656581EB09D1508D000E61D7 /* XLinkNames.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = XLinkNames.h; path = DerivedSources/WebCore/XLinkNames.h; sourceTree = BUILT_PRODUCTS_DIR; }; 9259 656B9DCA189DE10000BB842C /* URL Utils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = URLUtils.h; sourceTree = "<group>"; };9259 656B9DCA189DE10000BB842C /* URLDecomposition.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = URLDecomposition.h; sourceTree = "<group>"; }; 9260 9260 656D371A0ADBA5DE00A4554D /* LoaderNSURLExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = LoaderNSURLExtras.h; sourceTree = "<group>"; }; 9261 9261 656D371B0ADBA5DE00A4554D /* LoaderNSURLExtras.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = LoaderNSURLExtras.mm; sourceTree = "<group>"; }; … … 10942 10942 93E2A304123E9DC0009FE12A /* HTMLParserIdioms.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLParserIdioms.cpp; sourceTree = "<group>"; }; 10943 10943 93E2A305123E9DC0009FE12A /* HTMLParserIdioms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLParserIdioms.h; sourceTree = "<group>"; }; 10944 93E5B25424536B1E005C52D0 /* URLDecomposition.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = URLDecomposition.cpp; sourceTree = "<group>"; }; 10944 10945 93EB355E09E37FD600F43799 /* MouseEventWithHitTestResults.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MouseEventWithHitTestResults.cpp; sourceTree = "<group>"; }; 10945 10946 93EEC1E509C2877700C515D1 /* Attr.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Attr.idl; sourceTree = "<group>"; }; … … 22520 22521 C375D7FB16639519006184AB /* TypeAhead.cpp */, 22521 22522 C375D7FC16639519006184AB /* TypeAhead.h */, 22523 93E5B25424536B1E005C52D0 /* URLDecomposition.cpp */, 22524 656B9DCA189DE10000BB842C /* URLDecomposition.h */, 22522 22525 F55B3DA91251F12D003EF269 /* URLInputType.cpp */, 22523 22526 F55B3DAA1251F12D003EF269 /* URLInputType.h */, … … 22526 22529 5C5381B11D87D45700E2EBE6 /* URLSearchParams.h */, 22527 22530 5C5381AF1D8793E000E2EBE6 /* URLSearchParams.idl */, 22528 656B9DCA189DE10000BB842C /* URLUtils.h */,22529 22531 F5A154251279534D00D0B0C0 /* ValidationMessage.cpp */, 22530 22532 F5A154261279534D00D0B0C0 /* ValidationMessage.h */, … … 33354 33356 D086FE9809D53AAB005BC74D /* UnlinkCommand.h in Headers */, 33355 33357 FD1762E0176686D900D836A8 /* UpSampler.h in Headers */, 33358 93D437A21D57B3FE00AB85EA /* URLDecomposition.h in Headers */, 33356 33359 267726051A5DF6F2003C24DD /* URLFilterParser.h in Headers */, 33357 33360 F55B3DDE1251F12D003EF269 /* URLInputType.h in Headers */, 33358 33361 7CC289DF1AA0FE5D009A9CE3 /* URLRegistry.h in Headers */, 33359 93D437A21D57B3FE00AB85EA /* URLUtils.h in Headers */,33360 33362 A72763BF16689BFB002FCACB /* UserActionElementSet.h in Headers */, 33361 33363 868160D618766A130021E79D /* UserActivity.h in Headers */, -
trunk/Source/WebCore/html/DOMURL.h
r238771 r260724 28 28 29 29 #include "ExceptionOr.h" 30 #include "URLDecomposition.h" 30 31 #include <wtf/URL.h> 31 #include "URLUtils.h"32 32 33 33 namespace WebCore { … … 38 38 class URLSearchParams; 39 39 40 class WEBCORE_EXPORT DOMURL : public RefCounted<DOMURL>, public URLUtils<DOMURL>{40 class DOMURL final : public RefCounted<DOMURL>, public URLDecomposition { 41 41 public: 42 42 static ExceptionOr<Ref<DOMURL>> create(const String& url, const String& base); … … 45 45 ~DOMURL(); 46 46 47 URLhref() const { return m_url; }48 ExceptionOr<void> setHref(const String& url);47 const URL& href() const { return m_url; } 48 ExceptionOr<void> setHref(const String&); 49 49 void setQuery(const String&); 50 50 51 51 URLSearchParams& searchParams(); 52 53 const String& toJSON() const { return m_url.string(); } 52 54 53 55 static String createObjectURL(ScriptExecutionContext&, Blob&); … … 59 61 DOMURL(URL&& completeURL, URL&& baseURL); 60 62 63 URL fullURL() const final { return m_url; } 64 void setFullURL(const URL& fullURL) final { setHref(fullURL.string()); } 65 61 66 URL m_baseURL; 62 67 URL m_url; -
trunk/Source/WebCore/html/DOMURL.idl
r222429 r260724 33 33 ExportMacro=WEBCORE_EXPORT, 34 34 Exposed=(Window,Worker), 35 ImplementationLacksVTable,36 35 InterfaceName=URL, 37 36 JSGenerateToJSObject, -
trunk/Source/WebCore/html/HTMLAnchorElement.cpp
r260707 r260724 66 66 HTMLAnchorElement::HTMLAnchorElement(const QualifiedName& tagName, Document& document) 67 67 : HTMLElement(tagName, document) 68 , m_hasRootEditableElementForSelectionOnMouseDown(false)69 , m_wasShiftKeyDownOnMouseDown(false)70 68 { 71 69 } -
trunk/Source/WebCore/html/HTMLAnchorElement.h
r259687 r260724 27 27 #include "HTMLNames.h" 28 28 #include "SharedStringHash.h" 29 #include "URL Utils.h"29 #include "URLDecomposition.h" 30 30 #include <wtf/OptionSet.h> 31 31 … … 42 42 }; 43 43 44 class HTMLAnchorElement : public HTMLElement, public URL Utils<HTMLAnchorElement>{44 class HTMLAnchorElement : public HTMLElement, public URLDecomposition { 45 45 WTF_MAKE_ISO_ALLOCATED(HTMLAnchorElement); 46 46 public: … … 117 117 void clearRootEditableElementForSelectionOnMouseDown(); 118 118 119 bool m_hasRootEditableElementForSelectionOnMouseDown; 120 bool m_wasShiftKeyDownOnMouseDown; 119 URL fullURL() const final { return href(); } 120 void setFullURL(const URL& fullURL) final { setHref(fullURL.string()); } 121 122 bool m_hasRootEditableElementForSelectionOnMouseDown { false }; 123 bool m_wasShiftKeyDownOnMouseDown { false }; 121 124 OptionSet<Relation> m_linkRelations; 122 125 -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r260709 r260724 150 150 151 151 #if ENABLE(MEDIA_STREAM) 152 #include "DOMURL.h"153 152 #include "MediaStream.h" 154 153 #endif -
trunk/Source/WebCore/html/URLDecomposition.h
r260723 r260724 1 1 /* 2 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2012 Motorola Mobility Inc. 2 * Copyright (C) 2014-2020 Apple Inc. All rights reserved. 4 3 * 5 4 * Redistribution and use in source and binary forms, with or without … … 27 26 #pragma once 28 27 29 #include "ExceptionOr.h" 30 #include <wtf/URL.h> 31 #include "URLUtils.h" 28 #include <wtf/Forward.h> 32 29 33 30 namespace WebCore { 34 31 35 class Blob; 36 class ScriptExecutionContext; 37 class URLRegistrable; 38 class URLSearchParams; 32 class URLDecomposition { 33 public: 34 String origin() const; 39 35 40 class WEBCORE_EXPORT DOMURL : public RefCounted<DOMURL>, public URLUtils<DOMURL> { 41 public: 42 static ExceptionOr<Ref<DOMURL>> create(const String& url, const String& base); 43 static ExceptionOr<Ref<DOMURL>> create(const String& url, const DOMURL& base); 44 static ExceptionOr<Ref<DOMURL>> create(const String& url); 45 ~DOMURL(); 36 WEBCORE_EXPORT String protocol() const; 37 void setProtocol(StringView); 46 38 47 URL href() const { return m_url; } 48 ExceptionOr<void> setHref(const String& url); 49 void setQuery(const String&); 39 String username() const; 40 void setUsername(StringView); 50 41 51 URLSearchParams& searchParams(); 42 String password() const; 43 void setPassword(StringView); 52 44 53 static String createObjectURL(ScriptExecutionContext&, Blob&);54 static void revokeObjectURL(ScriptExecutionContext&, const String&);45 WEBCORE_EXPORT String host() const; 46 void setHost(StringView); 55 47 56 static String createPublicURL(ScriptExecutionContext&, URLRegistrable&); 48 WEBCORE_EXPORT String hostname() const; 49 void setHostname(StringView); 50 51 WEBCORE_EXPORT String port() const; 52 void setPort(StringView); 53 54 WEBCORE_EXPORT String pathname() const; 55 void setPathname(StringView); 56 57 WEBCORE_EXPORT String search() const; 58 void setSearch(const String&); 59 60 WEBCORE_EXPORT String hash() const; 61 void setHash(StringView); 62 63 protected: 64 virtual ~URLDecomposition() = default; 57 65 58 66 private: 59 DOMURL(URL&& completeURL, URL&& baseURL); 60 61 URL m_baseURL; 62 URL m_url; 63 RefPtr<URLSearchParams> m_searchParams; 67 virtual URL fullURL() const = 0; 68 virtual void setFullURL(const URL&) = 0; 64 69 }; 65 70 -
trunk/Source/WebCore/html/URLSearchParams.h
r239427 r260724 25 25 #pragma once 26 26 27 #include "DOMURL.h"28 27 #include <wtf/Variant.h> 29 28 #include <wtf/Vector.h> … … 31 30 32 31 namespace WebCore { 32 33 class DOMURL; 33 34 34 35 class URLSearchParams : public RefCounted<URLSearchParams> { -
trunk/Source/WebCore/page/DOMWindow.cpp
r260709 r260724 46 46 #include "DOMTimer.h" 47 47 #include "DOMTokenList.h" 48 #include "DOMURL.h"49 48 #include "DeviceMotionController.h" 50 49 #include "DeviceMotionData.h" -
trunk/Source/WebCore/testing/Internals.cpp
r260699 r260724 59 59 #include "DOMRectList.h" 60 60 #include "DOMStringList.h" 61 #include "DOMURL.h" 61 62 #include "DOMWindow.h" 62 63 #include "DeprecatedGlobalSettings.h"
Note: See TracChangeset
for help on using the changeset viewer.