Ignore:
Timestamp:
Mar 28, 2019, 10:50:19 AM (6 years ago)
Author:
Tadeu Zagallo
Message:

In-memory code cache should not share bytecode across domains
https://bugs.webkit.org/show_bug.cgi?id=196321

Reviewed by Geoffrey Garen.

Use the SourceProvider's URL to make sure that the hosts match for the
two SourceCodeKeys in operator==.

  • parser/SourceCodeKey.h:

(JSC::SourceCodeKey::host const):
(JSC::SourceCodeKey::operator== const):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/parser/SourceCodeKey.h

    r240511 r243609  
    111111    StringView string() const { return m_sourceCode.view(); }
    112112
     113    StringView host() const { return m_sourceCode.provider().url().host(); }
     114
    113115    bool operator==(const SourceCodeKey& other) const
    114116    {
     
    118120            && m_functionConstructorParametersEndPosition == other.m_functionConstructorParametersEndPosition
    119121            && m_name == other.m_name
     122            && host() == other.host()
    120123            && string() == other.string();
    121124    }
Note: See TracChangeset for help on using the changeset viewer.