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

Unified Diff: third_party/WebKit/Source/core/testing/v8/WebCoreTestSupport.cpp

Issue 2130883002: [OriginTrials] Allow origin trials to be installed without an instance object. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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
Index: third_party/WebKit/Source/core/testing/v8/WebCoreTestSupport.cpp
diff --git a/third_party/WebKit/Source/core/testing/v8/WebCoreTestSupport.cpp b/third_party/WebKit/Source/core/testing/v8/WebCoreTestSupport.cpp
index 1421e186c04a8b70f51eeb376de4360b680f7b5e..b1e85dfea8c7116da91adf1b9913152fb5d7395c 100644
--- a/third_party/WebKit/Source/core/testing/v8/WebCoreTestSupport.cpp
+++ b/third_party/WebKit/Source/core/testing/v8/WebCoreTestSupport.cpp
@@ -99,15 +99,14 @@ void installOriginTrialsForTests(ScriptState* scriptState)
v8::Local<v8::Object> global = context->Global();
v8::Isolate* isolate = scriptState->isolate();
- v8::Local<v8::String> internalsName = v8::String::NewFromOneByte(isolate, reinterpret_cast<const uint8_t*>("internals"), v8::NewStringType::kNormal).ToLocalChecked();
- v8::Local<v8::Value> v8Internals = global->Get(context, internalsName).ToLocalChecked();
- if (v8Internals->IsObject()) {
- v8::Local<v8::Object> internals = v8Internals->ToObject();
- if (!originTrialContext->featureBindingsInstalled("Frobulate") && originTrialContext->isFeatureEnabled("Frobulate", nullptr)) {
+ if (!originTrialContext->featureBindingsInstalled("Frobulate") && originTrialContext->isFeatureEnabled("Frobulate", nullptr)) {
+ v8::Local<v8::String> internalsName = v8::String::NewFromOneByte(isolate, reinterpret_cast<const uint8_t*>("internals"), v8::NewStringType::kNormal).ToLocalChecked();
+ v8::Local<v8::Value> v8Internals = global->Get(context, internalsName).ToLocalChecked();
+ if (v8Internals->IsObject()) {
if (executionContext->isDocument())
- V8Internals::installOriginTrialsSampleAPI(scriptState, internals);
+ V8Internals::installOriginTrialsSampleAPI(scriptState);
else if (executionContext->isWorkerGlobalScope())
- V8WorkerInternals::installOriginTrialsSampleAPI(scriptState, internals);
+ V8WorkerInternals::installOriginTrialsSampleAPI(scriptState);
originTrialContext->setFeatureBindingsInstalled("Frobulate");
}
}

Powered by Google App Engine
This is Rietveld 408576698