<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>21826</bug_id>
          
          <creation_ts>2008-10-23 01:53:11 -0700</creation_ts>
          <short_desc>Add accessor for SecurityOrigin::m_domainWasSetInDOM</short_desc>
          <delta_ts>2008-10-23 10:20:51 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Adam Barth">abarth</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>sam</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>96305</commentid>
    <comment_count>0</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2008-10-23 01:53:11 -0700</bug_when>
    <thetext>It will help Chromium unfork SecurityOrigin.cpp if we add an accessor for SecurityOrigin::m_domainWasSetInDOM.  If this flag is false, Chromium can do a same-origin check in one pointer comparison by atomizing the toString() of the SecurityOrigin (with some other caveats).

Currently they have YASOTSF (Yet Another SecurityOrigin toString Function) called SecurityOrigin::securityToken that knows about m_domainWasSetInDOM.  Adding an accessor for m_domainWasSetInDOM seems better than adding this function to our tree.

Now, if only I can get rid of the YASOTSF called SecurityOrigin::databaseIdentifier, my plans for grand unification of the SecurityOrigin toString methods will be complete!

Patch forthcoming.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96309</commentid>
    <comment_count>1</comment_count>
      <attachid>24594</attachid>
    <who name="Adam Barth">abarth</who>
    <bug_when>2008-10-23 03:02:25 -0700</bug_when>
    <thetext>Created attachment 24594
le patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96328</commentid>
    <comment_count>2</comment_count>
      <attachid>24594</attachid>
    <who name="Sam Weinig">sam</who>
    <bug_when>2008-10-23 06:46:50 -0700</bug_when>
    <thetext>Comment on attachment 24594
le patch

+ * Copyright (C) 2007-2008 Apple Inc. All rights reserved.
We like to use comma delineated years.

         void setDomainFromDOM(const String&amp; newDomain);
 
+        bool domainWasSetInDOM() const { return m_domainWasSetInDOM; }
These should be paragraphed together.

I am a little unclear about why this is necessary, the SecurityOrigin it self should be sufficient for a fast compare.  Perhaps we can remove this later.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96344</commentid>
    <comment_count>3</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2008-10-23 10:20:51 -0700</bug_when>
    <thetext>Fixed in http://trac.webkit.org/changeset/37814

&gt; I am a little unclear about why this is necessary, the SecurityOrigin it self
&gt; should be sufficient for a fast compare.  Perhaps we can remove this later.

Yeah, maybe there is a better long term solution here.  I think the fast path for comparing SecurityOrigins in V8 gets inlined into the JITed code and they want to avoid the function call overhead.  (I might be wrong about this, V8 is pretty mysterious to me.)  It&apos;s similar to how JavaScriptCore doesn&apos;t bother calling SecurityOrigin::canAccess if a frame is accessing itself (the most common case) but taken to a little further extreme.

</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>24594</attachid>
            <date>2008-10-23 03:02:25 -0700</date>
            <delta_ts>2008-10-23 06:46:50 -0700</delta_ts>
            <desc>le patch</desc>
            <filename>was-set-in-dom.patch</filename>
            <type>text/plain</type>
            <size>2052</size>
            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aXRob3V0CiAgKiBtb2RpZmljYXRpb24sIGFyZSBwZXJt
aXR0ZWQgcHJvdmlkZWQgdGhhdCB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbnMKQEAgLTU1LDYgKzU1
LDcgQEAgbmFtZXNwYWNlIFdlYkNvcmUgewogICAgICAgICAvLyBkb21haW4uICBUaGUgY2FsbGVy
IGlzIHJlc3BvbnNpYmxlIGZvciB2YWxpZGF0aW5nIG5ld0RvbWFpbi4KICAgICAgICAgdm9pZCBz
ZXREb21haW5Gcm9tRE9NKGNvbnN0IFN0cmluZyYgbmV3RG9tYWluKTsKIAorICAgICAgICBib29s
IGRvbWFpbldhc1NldEluRE9NKCkgY29uc3QgeyByZXR1cm4gbV9kb21haW5XYXNTZXRJbkRPTTsg
fQogICAgICAgICBTdHJpbmcgcHJvdG9jb2woKSBjb25zdCB7IHJldHVybiBtX3Byb3RvY29sOyB9
CiAgICAgICAgIFN0cmluZyBob3N0KCkgY29uc3QgeyByZXR1cm4gbV9ob3N0OyB9CiAgICAgICAg
IFN0cmluZyBkb21haW4oKSBjb25zdCB7IHJldHVybiBtX2RvbWFpbjsgfQotLSAKMS42LjAuMQoK
</data>
<flag name="review"
          id="11219"
          type_id="1"
          status="+"
          setter="sam"
    />
          </attachment>
      

    </bug>

</bugzilla>