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

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

Issue 2160533002: Add use counters for Secure Context checks and sandboxed origins. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Wrong flag. Created 4 years, 5 months 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d269191de65902e37e43757d974330cba09bec18..83398ef180fe0a4ea112fba4762b4179c3394896 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -5873,15 +5873,35 @@ v8::Local<v8::Object> Document::associateWithWrapper(v8::Isolate* isolate, const
bool Document::isSecureContext(String& errorMessage, const SecureContextCheck privilegeContextCheck) const
{
- if (isSecureContextImpl(privilegeContextCheck))
+ bool isSecure = isSecureContextImpl(privilegeContextCheck);
+ if (getSandboxFlags() != SandboxNone) {
+ UseCounter::count(*this, isSecure
+ ? UseCounter::SecureContextCheckForSandboxedOriginPassed
+ : UseCounter::SecureContextCheckForSandboxedOriginFailed);
+ }
+ UseCounter::count(*this, isSecure
+ ? UseCounter::SecureContextCheckPassed
+ : UseCounter::SecureContextCheckFailed);
+
+ if (isSecure)
return true;
+
errorMessage = SecurityOrigin::isPotentiallyTrustworthyErrorMessage();
return false;
}
bool Document::isSecureContext(const SecureContextCheck privilegeContextCheck) const
{
- return isSecureContextImpl(privilegeContextCheck);
+ bool isSecure = isSecureContextImpl(privilegeContextCheck);
+ if (getSandboxFlags() != SandboxNone) {
+ UseCounter::count(*this, isSecure
+ ? UseCounter::SecureContextCheckForSandboxedOriginPassed
+ : UseCounter::SecureContextCheckForSandboxedOriginFailed);
+ }
+ UseCounter::count(*this, isSecure
+ ? UseCounter::SecureContextCheckPassed
+ : UseCounter::SecureContextCheckFailed);
+ return isSecure;
}
void Document::enforceInsecureRequestPolicy(WebInsecureRequestPolicy policy)
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698