Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1205)

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2567173002: Clean up Document::isSecureContext (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 ad7cb1132be820ad1e54480636220d97401532d4..94e8b30b071aeec794c99fcb8497b06902f50f6d 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -6375,21 +6375,11 @@ void Document::platformColorsChanged() {
bool Document::isSecureContext(
String& errorMessage,
const SecureContextCheck privilegeContextCheck) const {
- bool isSecure = isSecureContextImpl(privilegeContextCheck);
- if (getSandboxFlags() != SandboxNone) {
- UseCounter::count(
- *this, isSecure
- ? UseCounter::SecureContextCheckForSandboxedOriginPassed
- : UseCounter::SecureContextCheckForSandboxedOriginFailed);
+ if (!isSecureContext(privilegeContextCheck)) {
+ errorMessage = SecurityOrigin::isPotentiallyTrustworthyErrorMessage();
+ return false;
}
- UseCounter::count(*this, isSecure ? UseCounter::SecureContextCheckPassed
- : UseCounter::SecureContextCheckFailed);
-
- if (isSecure)
- return true;
-
- errorMessage = SecurityOrigin::isPotentiallyTrustworthyErrorMessage();
- return false;
+ return true;
}
bool Document::isSecureContext(
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | third_party/WebKit/Source/modules/device_orientation/DeviceMotionController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698