| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 #include "bindings/modules/v8/V8IDBCursor.h" | 39 #include "bindings/modules/v8/V8IDBCursor.h" |
| 40 #include "bindings/modules/v8/V8IDBCursorWithValue.h" | 40 #include "bindings/modules/v8/V8IDBCursorWithValue.h" |
| 41 #include "bindings/modules/v8/V8IDBDatabase.h" | 41 #include "bindings/modules/v8/V8IDBDatabase.h" |
| 42 #include "bindings/modules/v8/V8IDBIndex.h" | 42 #include "bindings/modules/v8/V8IDBIndex.h" |
| 43 #include "bindings/modules/v8/V8IDBKeyRange.h" | 43 #include "bindings/modules/v8/V8IDBKeyRange.h" |
| 44 #include "bindings/modules/v8/V8IDBObjectStore.h" | 44 #include "bindings/modules/v8/V8IDBObjectStore.h" |
| 45 #include "bindings/modules/v8/V8NavigatorPartial.h" | 45 #include "bindings/modules/v8/V8NavigatorPartial.h" |
| 46 #include "bindings/modules/v8/V8ServiceWorkerGlobalScope.h" | 46 #include "bindings/modules/v8/V8ServiceWorkerGlobalScope.h" |
| 47 #include "bindings/modules/v8/V8SharedWorkerGlobalScopePartial.h" | 47 #include "bindings/modules/v8/V8SharedWorkerGlobalScopePartial.h" |
| 48 #include "bindings/modules/v8/V8WindowPartial.h" | 48 #include "bindings/modules/v8/V8WindowPartial.h" |
| 49 #include "bindings/modules/v8/V8WorkerNavigatorPartial.h" |
| 49 #include "core/dom/DOMArrayBuffer.h" | 50 #include "core/dom/DOMArrayBuffer.h" |
| 50 #include "core/dom/DOMArrayBufferView.h" | 51 #include "core/dom/DOMArrayBufferView.h" |
| 51 #include "core/dom/ExecutionContext.h" | 52 #include "core/dom/ExecutionContext.h" |
| 52 #include "core/origin_trials/OriginTrialContext.h" | 53 #include "core/origin_trials/OriginTrialContext.h" |
| 53 #include "modules/indexeddb/IDBKey.h" | 54 #include "modules/indexeddb/IDBKey.h" |
| 54 #include "modules/indexeddb/IDBKeyPath.h" | 55 #include "modules/indexeddb/IDBKeyPath.h" |
| 55 #include "modules/indexeddb/IDBKeyRange.h" | 56 #include "modules/indexeddb/IDBKeyRange.h" |
| 56 #include "modules/indexeddb/IDBTracing.h" | 57 #include "modules/indexeddb/IDBTracing.h" |
| 57 #include "modules/indexeddb/IDBValue.h" | 58 #include "modules/indexeddb/IDBValue.h" |
| 58 #include "platform/RuntimeEnabledFeatures.h" | 59 #include "platform/RuntimeEnabledFeatures.h" |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 ExecutionContext* executionContext = toExecutionContext(context); | 539 ExecutionContext* executionContext = toExecutionContext(context); |
| 539 OriginTrialContext* originTrialContext = OriginTrialContext::from(executionC
ontext, OriginTrialContext::DontCreateIfNotExists); | 540 OriginTrialContext* originTrialContext = OriginTrialContext::from(executionC
ontext, OriginTrialContext::DontCreateIfNotExists); |
| 540 if (!originTrialContext) | 541 if (!originTrialContext) |
| 541 return; | 542 return; |
| 542 | 543 |
| 543 ScriptState::Scope scope(scriptState); | 544 ScriptState::Scope scope(scriptState); |
| 544 v8::Local<v8::Object> global = context->Global(); | 545 v8::Local<v8::Object> global = context->Global(); |
| 545 v8::Isolate* isolate = scriptState->isolate(); | 546 v8::Isolate* isolate = scriptState->isolate(); |
| 546 | 547 |
| 547 if (!originTrialContext->featureBindingsInstalled("DurableStorage") && (Runt
imeEnabledFeatures::durableStorageEnabled() || originTrialContext->isFeatureEnab
led("DurableStorage", nullptr))) { | 548 if (!originTrialContext->featureBindingsInstalled("DurableStorage") && (Runt
imeEnabledFeatures::durableStorageEnabled() || originTrialContext->isFeatureEnab
led("DurableStorage", nullptr))) { |
| 549 v8::Local<v8::String> navigatorName = v8::String::NewFromOneByte(isolate
, reinterpret_cast<const uint8_t*>("navigator"), v8::NewStringType::kNormal).ToL
ocalChecked(); |
| 548 if (executionContext->isDocument()) { | 550 if (executionContext->isDocument()) { |
| 549 v8::Local<v8::String> navigatorName = v8::String::NewFromOneByte(iso
late, reinterpret_cast<const uint8_t*>("navigator"), v8::NewStringType::kNormal)
.ToLocalChecked(); | |
| 550 v8::Local<v8::Object> navigator = global->Get(context, navigatorName
).ToLocalChecked()->ToObject(); | 551 v8::Local<v8::Object> navigator = global->Get(context, navigatorName
).ToLocalChecked()->ToObject(); |
| 551 V8WindowPartial::installDurableStorage(scriptState, global); | 552 V8WindowPartial::installDurableStorage(scriptState, global); |
| 552 V8NavigatorPartial::installDurableStorage(scriptState, navigator); | 553 V8NavigatorPartial::installDurableStorage(scriptState, navigator); |
| 553 } else if (executionContext->isSharedWorkerGlobalScope()) { | 554 } else if (executionContext->isSharedWorkerGlobalScope()) { |
| 555 v8::Local<v8::Object> navigator = global->Get(context, navigatorName
).ToLocalChecked()->ToObject(); |
| 554 V8SharedWorkerGlobalScopePartial::installDurableStorage(scriptState,
global); | 556 V8SharedWorkerGlobalScopePartial::installDurableStorage(scriptState,
global); |
| 557 V8WorkerNavigatorPartial::installDurableStorage(scriptState, navigat
or); |
| 555 } else if (executionContext->isDedicatedWorkerGlobalScope()) { | 558 } else if (executionContext->isDedicatedWorkerGlobalScope()) { |
| 559 v8::Local<v8::Object> navigator = global->Get(context, navigatorName
).ToLocalChecked()->ToObject(); |
| 556 V8DedicatedWorkerGlobalScopePartial::installDurableStorage(scriptSta
te, global); | 560 V8DedicatedWorkerGlobalScopePartial::installDurableStorage(scriptSta
te, global); |
| 561 V8WorkerNavigatorPartial::installDurableStorage(scriptState, navigat
or); |
| 557 } else if (executionContext->isServiceWorkerGlobalScope()) { | 562 } else if (executionContext->isServiceWorkerGlobalScope()) { |
| 563 v8::Local<v8::Object> navigator = global->Get(context, navigatorName
).ToLocalChecked()->ToObject(); |
| 558 V8ServiceWorkerGlobalScope::installDurableStorage(scriptState, globa
l); | 564 V8ServiceWorkerGlobalScope::installDurableStorage(scriptState, globa
l); |
| 565 V8WorkerNavigatorPartial::installDurableStorage(scriptState, navigat
or); |
| 559 } | 566 } |
| 560 originTrialContext->setFeatureBindingsInstalled("DurableStorage"); | 567 originTrialContext->setFeatureBindingsInstalled("DurableStorage"); |
| 561 } | 568 } |
| 562 } | 569 } |
| 563 | 570 |
| 564 void registerInstallOriginTrialsForModules() | 571 void registerInstallOriginTrialsForModules() |
| 565 { | 572 { |
| 566 s_originalInstallOriginTrialsFunction = setInstallOriginTrialsFunction(&inst
allOriginTrialsForModules); | 573 s_originalInstallOriginTrialsFunction = setInstallOriginTrialsFunction(&inst
allOriginTrialsForModules); |
| 567 } | 574 } |
| 568 } // namespace blink | 575 } // namespace blink |
| OLD | NEW |