Bug 115898 - Begin making SecurityOrigin immutable
Summary: Begin making SecurityOrigin immutable
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Anders Carlsson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-10 04:43 PDT by Anders Carlsson
Modified: 2013-05-10 05:23 PDT (History)
3 users (show)

See Also:


Attachments
Patch (9.64 KB, patch)
2013-05-10 04:47 PDT, Anders Carlsson
kling: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anders Carlsson 2013-05-10 04:43:21 PDT
Begin making SecurityOrigin immutable
Comment 1 Anders Carlsson 2013-05-10 04:47:09 PDT
Created attachment 201334 [details]
Patch
Comment 2 Andreas Kling 2013-05-10 04:56:33 PDT
Comment on attachment 201334 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=201334&action=review

r=me with some fixing!

> Source/WebCore/page/SecurityOrigin.cpp:219
> +    return adoptRef(new SecurityOrigin(m_protocol, m_host, domain, m_filePath, m_port, m_isUnique, m_universalAccess, m_domainWasSetInDOM, m_canLoadLocalResources, m_storageBlockingPolicy, m_enforceFilePathSeparation, m_needsDatabaseIdentifierQuirkForFiles));

You're just passing m_domainWasSetInDOM again here, that argument should be true.

> Source/WebCore/page/SecurityOrigin.h:80
> -    void setDomainFromDOM(const String& newDomain);
> +    PassRefPtr<SecurityOrigin> securityOriginWithDomainSetFromDOM(const String& newDomain) const;

I'd call this securityOriginWithDomainSetFromDOM().

> Source/WebCore/page/SecurityOrigin.h:140
> -    void grantUniversalAccess();
> +    PassRefPtr<SecurityOrigin> securityOriginWithUniversalAccessGranted() const;

I'd call this copyWithUniversalAccessGranted().
Comment 3 Andreas Kling 2013-05-10 04:57:12 PDT
(In reply to comment #2)
> (From update of attachment 201334 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=201334&action=review
> 
> > Source/WebCore/page/SecurityOrigin.h:80
> > -    void setDomainFromDOM(const String& newDomain);
> > +    PassRefPtr<SecurityOrigin> securityOriginWithDomainSetFromDOM(const String& newDomain) const;
> 
> I'd call this securityOriginWithDomainSetFromDOM().

I'd call this copyWithDomainSetFromDOM().
Comment 4 Andreas Kling 2013-05-10 04:57:19 PDT
(In reply to comment #2)
> (From update of attachment 201334 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=201334&action=review
> 
> > Source/WebCore/page/SecurityOrigin.h:80
> > -    void setDomainFromDOM(const String& newDomain);
> > +    PassRefPtr<SecurityOrigin> securityOriginWithDomainSetFromDOM(const String& newDomain) const;
> 
> I'd call this securityOriginWithDomainSetFromDOM().

I'd call this copyWithDomainSetFromDOM().
Comment 5 Anders Carlsson 2013-05-10 04:58:38 PDT
Committed r149866: <http://trac.webkit.org/changeset/149866>
Comment 6 Anders Carlsson 2013-05-10 05:22:15 PDT
Reverted r149866 for reason:

Broke

Committed r149869: <http://trac.webkit.org/changeset/149869>
Comment 7 Anders Carlsson 2013-05-10 05:23:41 PDT
This won’t work since we rely on subframes having their origins linked to their parent frames.