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

Unified Diff: third_party/WebKit/Source/modules/crypto/SubtleCrypto.cpp

Issue 2639593002: Measure impact of [SecureContext] on WebCrypto. (Closed)
Patch Set: Rebase Created 3 years, 10 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 | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/crypto/SubtleCrypto.cpp
diff --git a/third_party/WebKit/Source/modules/crypto/SubtleCrypto.cpp b/third_party/WebKit/Source/modules/crypto/SubtleCrypto.cpp
index 5c3e3e3c646c425170f9d2f3af1279805a2c5ee4..9d8c75e5deb39fce411ec48c6b6b663ad104e615 100644
--- a/third_party/WebKit/Source/modules/crypto/SubtleCrypto.cpp
+++ b/third_party/WebKit/Source/modules/crypto/SubtleCrypto.cpp
@@ -35,6 +35,7 @@
#include "core/dom/DOMArrayBufferView.h"
#include "core/dom/DOMArrayPiece.h"
#include "core/dom/ExecutionContext.h"
+#include "core/frame/UseCounter.h"
#include "modules/crypto/CryptoHistograms.h"
#include "modules/crypto/CryptoKey.h"
#include "modules/crypto/CryptoResultImpl.h"
@@ -65,6 +66,12 @@ static bool canAccessWebCrypto(ScriptState* scriptState, CryptoResult* result) {
return false;
}
+ if (!scriptState->getExecutionContext()->isSecureContext()) {
+ UseCounter::count(
+ scriptState->getExecutionContext(),
+ UseCounter::SubtleCryptoOnlyStrictSecureContextCheckFailed);
+ }
+
return true;
}
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698