⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 100182 in webkit


Ignore:
Timestamp:
Nov 14, 2011, 12:58:30 PM (15 years ago)
Author:
abarth@webkit.org
Message:

Remove the concept of an empty SecurityOrigin
https://bugs.webkit.org/show_bug.cgi?id=72287

Reviewed by Eric Seidel.

Source/WebCore:

This concept is fragile and doesn't exist in the specs. Previous
patches have removed most of the code relying upon this function. This
patch removes a couple stragglers.

  • page/DOMWindow.cpp:

(WebCore::DOMWindow::postMessage):

  • This check should really be about unique origins because it doesn't make sense to target postMessages at unique origins, as explained in the comment.
  • page/SecurityOrigin.cpp:
  • page/SecurityOrigin.h:

Source/WebKit/chromium:

I'll rename the API in a subsequent patch.

  • src/WebSecurityOrigin.cpp:

(WebKit::WebSecurityOrigin::isEmpty):

Location:
trunk/Source
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r100181 r100182  
     12011-11-14  Adam Barth  <abarth@webkit.org>
     2
     3        Remove the concept of an empty SecurityOrigin
     4        https://bugs.webkit.org/show_bug.cgi?id=72287
     5
     6        Reviewed by Eric Seidel.
     7
     8        This concept is fragile and doesn't exist in the specs.  Previous
     9        patches have removed most of the code relying upon this function.  This
     10        patch removes a couple stragglers.
     11
     12        * page/DOMWindow.cpp:
     13        (WebCore::DOMWindow::postMessage):
     14            - This check should really be about unique origins because it
     15              doesn't make sense to target postMessages at unique origins, as
     16              explained in the comment.
     17        * page/SecurityOrigin.cpp:
     18        * page/SecurityOrigin.h:
     19
    1202011-11-14  Adam Barth  <abarth@webkit.org>
    221
  • trunk/Source/WebCore/page/DOMWindow.cpp

    r98388 r100182  
    879879    if (targetOrigin != "*") {
    880880        target = SecurityOrigin::createFromString(targetOrigin);
    881         if (target->isEmpty()) {
     881        // It doesn't make sense target a postMessage at a unique origin
     882        // because there's no way to represent a unique origin in a string.
     883        if (target->isUnique()) {
    882884            ec = SYNTAX_ERR;
    883885            return;
  • trunk/Source/WebCore/page/SecurityOrigin.cpp

    r100100 r100182  
    133133    , m_enforceFilePathSeparation(other->m_enforceFilePathSeparation)
    134134{
    135 }
    136 
    137 bool SecurityOrigin::isEmpty() const
    138 {
    139     ASSERT(!m_protocol.isEmpty() || m_isUnique);
    140     return m_protocol.isEmpty();
    141135}
    142136
  • trunk/Source/WebCore/page/SecurityOrigin.h

    r100100 r100182  
    135135    bool isUnique() const { return m_isUnique; }
    136136
    137     // The empty SecurityOrigin is a unique security orign (in the sense of
    138     // isUnique above) that was created for a "blank" document, such about
    139     // about:blank. Empty origins differ from unique origins in that they can
    140     // sometimes be replaced by non-empty origins, for example when an
    141     // about:blank iframe inherits its security origin from its parent frame.
    142     bool isEmpty() const;
    143 
    144137    // Marks a file:// origin as being in a domain defined by its path.
    145138    void enforceFilePathSeparation();
  • trunk/Source/WebKit/chromium/ChangeLog

    r100180 r100182  
     12011-11-14  Adam Barth  <abarth@webkit.org>
     2
     3        Remove the concept of an empty SecurityOrigin
     4        https://bugs.webkit.org/show_bug.cgi?id=72287
     5
     6        Reviewed by Eric Seidel.
     7
     8        I'll rename the API in a subsequent patch.
     9
     10        * src/WebSecurityOrigin.cpp:
     11        (WebKit::WebSecurityOrigin::isEmpty):
     12
    1132011-11-14  Vincent Scheib  <scheib@chromium.org>
    214
  • trunk/Source/WebKit/chromium/src/WebSecurityOrigin.cpp

    r99239 r100182  
    9191}
    9292
     93// FIXME: Rename this API to isUnique.
    9394bool WebSecurityOrigin::isEmpty() const
    9495{
    9596    ASSERT(m_private);
    96     return m_private->isEmpty();
     97    return m_private->isUnique();
    9798}
    9899
Note: See TracChangeset for help on using the changeset viewer.