Changeset 224984 in webkit


Ignore:
Timestamp:
Nov 17, 2017 1:38:11 PM (6 years ago)
Author:
achristensen@apple.com
Message:

Clean up URL.h
https://bugs.webkit.org/show_bug.cgi?id=179710

Reviewed by Brady Eidson.

No change in behavior.

  • Modules/fetch/FetchRequest.cpp:

(WebCore::FetchRequest::urlString const):

  • Modules/fetch/FetchResponse.cpp:

(WebCore::FetchResponse::url const):

  • platform/URL.cpp:

(WebCore::URL::serialize const): Deleted.

  • platform/URL.h:
  • platform/mac/URLMac.mm:

(WebCore::URL::createCFURL const):

Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r224982 r224984  
     12017-11-17  Alex Christensen  <achristensen@webkit.org>
     2
     3        Clean up URL.h
     4        https://bugs.webkit.org/show_bug.cgi?id=179710
     5
     6        Reviewed by Brady Eidson.
     7
     8        No change in behavior.
     9
     10        * Modules/fetch/FetchRequest.cpp:
     11        (WebCore::FetchRequest::urlString const):
     12        * Modules/fetch/FetchResponse.cpp:
     13        (WebCore::FetchResponse::url const):
     14        * platform/URL.cpp:
     15        (WebCore::URL::serialize const): Deleted.
     16        * platform/URL.h:
     17        * platform/mac/URLMac.mm:
     18        (WebCore::URL::createCFURL const):
     19
    1202017-11-17  Alex Christensen  <achristensen@webkit.org>
    221
  • trunk/Source/WebCore/Modules/fetch/FetchRequest.cpp

    r222819 r224984  
    264264{
    265265    if (m_requestURL.isNull())
    266         m_requestURL = m_request.url().serialize();
     266        m_requestURL = m_request.url();
    267267    return m_requestURL;
    268268}
  • trunk/Source/WebCore/Modules/fetch/FetchResponse.cpp

    r224645 r224984  
    187187const String& FetchResponse::url() const
    188188{
    189     if (m_responseURL.isNull())
    190         m_responseURL = m_response.url().serialize(true);
     189    if (m_responseURL.isNull()) {
     190        URL url = m_response.url();
     191        url.removeFragmentIdentifier();
     192        m_responseURL = url.string();
     193    }
    191194    return m_responseURL;
    192195}
  • trunk/Source/WebCore/platform/URL.cpp

    r224973 r224984  
    685685        return string;
    686686    return decodeEscapeSequences<URLEscapeSequence>(string, encoding);
    687 }
    688 
    689 String URL::serialize(bool omitFragment) const
    690 {
    691     if (omitFragment)
    692         return m_string.left(m_queryEnd);
    693     return m_string;
    694687}
    695688
  • trunk/Source/WebCore/platform/URL.h

    r224387 r224984  
    208208    template <class Decoder> static std::optional<URL> decode(Decoder&);
    209209
    210     String serialize(bool omitFragment = false) const;
    211 
    212210private:
    213211    friend class URLParser;
     
    216214    void init(const URL&, const String&, const TextEncoding&);
    217215    void copyToBuffer(Vector<char, 512>& buffer) const;
    218 
    219     // Parses the given URL. The originalString parameter allows for an
    220     // optimization: When the source is the same as the fixed-up string,
    221     // it will use the passed-in string instead of allocating a new one.
    222     void parse(const String&);
    223     void parse(const char* url, const String* originalString = 0);
    224216
    225217    bool hasPath() const;
     
    465457namespace WTF {
    466458
    467     // URLHash is the default hash for String
    468     template<typename T> struct DefaultHash;
    469     template<> struct DefaultHash<WebCore::URL> {
    470         typedef WebCore::URLHash Hash;
    471     };
     459// URLHash is the default hash for String
     460template<typename T> struct DefaultHash;
     461template<> struct DefaultHash<WebCore::URL> {
     462    typedef WebCore::URLHash Hash;
     463};
    472464
    473465} // namespace WTF
  • trunk/Source/WebCore/platform/mac/URLMac.mm

    r212508 r224984  
    5858{
    5959    if (isNull())
    60         return 0;
     60        return nullptr;
    6161
    6262    if (isEmpty()) {
     
    7575}
    7676
    77 
    78 
    7977}
Note: See TracChangeset for help on using the changeset viewer.