| Index: third_party/WebKit/Source/core/dom/Document.cpp
|
| diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
|
| index 36d6b6656c5ea5fc1a12cce7202bc3338bc9d923..5981f207c4e5c3d9d4a8874626fcbe37886cdf20 100644
|
| --- a/third_party/WebKit/Source/core/dom/Document.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/Document.cpp
|
| @@ -353,15 +353,6 @@ static bool acceptsEditingFocus(const Element& element)
|
| return element.document().frame() && element.rootEditableElement();
|
| }
|
|
|
| -static bool isOriginPotentiallyTrustworthy(SecurityOrigin* origin, String* errorMessage)
|
| -{
|
| - if (origin->isPotentiallyTrustworthy())
|
| - return true;
|
| - if (errorMessage)
|
| - *errorMessage = origin->isPotentiallyTrustworthyErrorMessage();
|
| - return false;
|
| -}
|
| -
|
| uint64_t Document::s_globalTreeVersion = 0;
|
|
|
| static bool s_threadedParsingEnabledForTesting = true;
|
| @@ -3385,21 +3376,16 @@ bool Document::isSecureContextImpl(String* errorMessage, const SecureContextChec
|
| //
|
| // In all cases, a frame must be potentially trustworthy in addition to
|
| // having an exception listed in order for the exception to be granted.
|
| - if (!isOriginPotentiallyTrustworthy(getSecurityOrigin(), errorMessage))
|
| + if (!getSecurityOrigin()->isPotentiallyTrustworthy(errorMessage))
|
| return false;
|
|
|
| if (SchemeRegistry::schemeShouldBypassSecureContextCheck(getSecurityOrigin()->protocol()))
|
| return true;
|
|
|
| if (privilegeContextCheck == StandardSecureContextCheck) {
|
| - if (!m_frame)
|
| - return true;
|
| - Frame* parent = m_frame->tree().parent();
|
| - while (parent) {
|
| - if (!isOriginPotentiallyTrustworthy(parent->securityContext()->getSecurityOrigin(), errorMessage))
|
| - return false;
|
| - parent = parent->tree().parent();
|
| - }
|
| + Frame* parent = m_frame ? m_frame->tree().parent() : nullptr;
|
| + if (parent)
|
| + return parent->canHaveSecureChild(errorMessage);
|
| }
|
| return true;
|
| }
|
|
|