| 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 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 #include "bindings/core/v8/SerializedScriptValue.h" | 28 #include "bindings/core/v8/SerializedScriptValue.h" |
| 29 #include "bindings/core/v8/SerializedScriptValueFactory.h" | 29 #include "bindings/core/v8/SerializedScriptValueFactory.h" |
| 30 #include "bindings/core/v8/V8ArrayBuffer.h" | 30 #include "bindings/core/v8/V8ArrayBuffer.h" |
| 31 #include "bindings/core/v8/V8ArrayBufferView.h" | 31 #include "bindings/core/v8/V8ArrayBufferView.h" |
| 32 #include "bindings/core/v8/V8Binding.h" | 32 #include "bindings/core/v8/V8Binding.h" |
| 33 #include "bindings/core/v8/V8Blob.h" | 33 #include "bindings/core/v8/V8Blob.h" |
| 34 #include "bindings/core/v8/V8DOMStringList.h" | 34 #include "bindings/core/v8/V8DOMStringList.h" |
| 35 #include "bindings/core/v8/V8File.h" | 35 #include "bindings/core/v8/V8File.h" |
| 36 #include "bindings/core/v8/V8Uint8Array.h" | 36 #include "bindings/core/v8/V8Uint8Array.h" |
| 37 #include "bindings/core/v8/WorkerOrWorkletScriptController.h" | |
| 38 #include "bindings/modules/v8/ToV8ForModules.h" | 37 #include "bindings/modules/v8/ToV8ForModules.h" |
| 39 #include "bindings/modules/v8/V8DedicatedWorkerGlobalScopePartial.h" | 38 #include "bindings/modules/v8/V8DedicatedWorkerGlobalScopePartial.h" |
| 40 #include "bindings/modules/v8/V8IDBCursor.h" | 39 #include "bindings/modules/v8/V8IDBCursor.h" |
| 41 #include "bindings/modules/v8/V8IDBCursorWithValue.h" | 40 #include "bindings/modules/v8/V8IDBCursorWithValue.h" |
| 42 #include "bindings/modules/v8/V8IDBDatabase.h" | 41 #include "bindings/modules/v8/V8IDBDatabase.h" |
| 43 #include "bindings/modules/v8/V8IDBIndex.h" | 42 #include "bindings/modules/v8/V8IDBIndex.h" |
| 44 #include "bindings/modules/v8/V8IDBKeyRange.h" | 43 #include "bindings/modules/v8/V8IDBKeyRange.h" |
| 45 #include "bindings/modules/v8/V8IDBObjectStore.h" | 44 #include "bindings/modules/v8/V8IDBObjectStore.h" |
| 46 #include "bindings/modules/v8/V8NavigatorPartial.h" | 45 #include "bindings/modules/v8/V8NavigatorPartial.h" |
| 47 #include "bindings/modules/v8/V8ServiceWorkerGlobalScope.h" | 46 #include "bindings/modules/v8/V8ServiceWorkerGlobalScope.h" |
| 48 #include "bindings/modules/v8/V8SharedWorkerGlobalScopePartial.h" | 47 #include "bindings/modules/v8/V8SharedWorkerGlobalScopePartial.h" |
| 49 #include "bindings/modules/v8/V8WindowPartial.h" | 48 #include "bindings/modules/v8/V8WindowPartial.h" |
| 50 #include "bindings/modules/v8/V8WorkletGlobalScope.h" | |
| 51 #include "core/dom/DOMArrayBuffer.h" | 49 #include "core/dom/DOMArrayBuffer.h" |
| 52 #include "core/dom/DOMArrayBufferView.h" | 50 #include "core/dom/DOMArrayBufferView.h" |
| 53 #include "core/dom/ExecutionContext.h" | 51 #include "core/dom/ExecutionContext.h" |
| 54 #include "core/origin_trials/OriginTrialContext.h" | 52 #include "core/origin_trials/OriginTrialContext.h" |
| 55 #include "modules/indexeddb/IDBKey.h" | 53 #include "modules/indexeddb/IDBKey.h" |
| 56 #include "modules/indexeddb/IDBKeyPath.h" | 54 #include "modules/indexeddb/IDBKeyPath.h" |
| 57 #include "modules/indexeddb/IDBKeyRange.h" | 55 #include "modules/indexeddb/IDBKeyRange.h" |
| 58 #include "modules/indexeddb/IDBTracing.h" | 56 #include "modules/indexeddb/IDBTracing.h" |
| 59 #include "modules/indexeddb/IDBValue.h" | 57 #include "modules/indexeddb/IDBValue.h" |
| 60 #include "modules/worklet/WorkletGlobalScope.h" | |
| 61 #include "platform/RuntimeEnabledFeatures.h" | 58 #include "platform/RuntimeEnabledFeatures.h" |
| 62 #include "platform/SharedBuffer.h" | 59 #include "platform/SharedBuffer.h" |
| 63 #include "wtf/MathExtras.h" | 60 #include "wtf/MathExtras.h" |
| 64 #include "wtf/Vector.h" | 61 #include "wtf/Vector.h" |
| 65 | 62 |
| 66 namespace blink { | 63 namespace blink { |
| 67 | 64 |
| 68 static v8::Local<v8::Value> deserializeIDBValueData(v8::Isolate*, const IDBValue
*); | 65 static v8::Local<v8::Value> deserializeIDBValueData(v8::Isolate*, const IDBValue
*); |
| 69 static v8::Local<v8::Value> deserializeIDBValue(v8::Isolate*, v8::Local<v8::Obje
ct> creationContext, const IDBValue*); | 66 static v8::Local<v8::Value> deserializeIDBValue(v8::Isolate*, v8::Local<v8::Obje
ct> creationContext, const IDBValue*); |
| 70 static v8::Local<v8::Value> deserializeIDBValueArray(v8::Isolate*, v8::Local<v8:
:Object> creationContext, const Vector<RefPtr<IDBValue>>*); | 67 static v8::Local<v8::Value> deserializeIDBValueArray(v8::Isolate*, v8::Local<v8:
:Object> creationContext, const Vector<RefPtr<IDBValue>>*); |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 IDBKey* expectedKey = createIDBKeyFromValueAndKeyPath(isolate, scriptValue.v
8Value(), value->keyPath(), exceptionState, allowExperimentalTypes); | 516 IDBKey* expectedKey = createIDBKeyFromValueAndKeyPath(isolate, scriptValue.v
8Value(), value->keyPath(), exceptionState, allowExperimentalTypes); |
| 520 ASSERT(!exceptionState.hadException()); | 517 ASSERT(!exceptionState.hadException()); |
| 521 if (expectedKey && expectedKey->isEqual(value->primaryKey())) | 518 if (expectedKey && expectedKey->isEqual(value->primaryKey())) |
| 522 return; | 519 return; |
| 523 | 520 |
| 524 bool injected = injectV8KeyIntoV8Value(isolate, keyValue.v8Value(), scriptVa
lue.v8Value(), value->keyPath()); | 521 bool injected = injectV8KeyIntoV8Value(isolate, keyValue.v8Value(), scriptVa
lue.v8Value(), value->keyPath()); |
| 525 ASSERT_UNUSED(injected, injected); | 522 ASSERT_UNUSED(injected, injected); |
| 526 } | 523 } |
| 527 #endif | 524 #endif |
| 528 | 525 |
| 529 ExecutionContext* toExecutionContextForModules(v8::Local<v8::Context> context) | |
| 530 { | |
| 531 if (context.IsEmpty()) | |
| 532 return nullptr; | |
| 533 v8::Local<v8::Object> global = context->Global(); | |
| 534 v8::Local<v8::Object> workletWrapper = V8WorkletGlobalScope::findInstanceInP
rototypeChain(global, context->GetIsolate()); | |
| 535 if (!workletWrapper.IsEmpty()) | |
| 536 return V8WorkletGlobalScope::toImpl(workletWrapper); | |
| 537 // FIXME: Is this line of code reachable? | |
| 538 return nullptr; | |
| 539 } | |
| 540 | |
| 541 namespace { | 526 namespace { |
| 542 InstallOriginTrialsFunction s_originalInstallOriginTrialsFunction = nullptr; | 527 InstallOriginTrialsFunction s_originalInstallOriginTrialsFunction = nullptr; |
| 543 } | 528 } |
| 544 | 529 |
| 545 void installOriginTrialsForModules(ScriptState* scriptState) | 530 void installOriginTrialsForModules(ScriptState* scriptState) |
| 546 { | 531 { |
| 547 // TODO(iclelland): Generate all of this logic at compile-time, based on the | 532 // TODO(iclelland): Generate all of this logic at compile-time, based on the |
| 548 // configuration of origin trial enabled attibutes and interfaces in IDL | 533 // configuration of origin trial enabled attibutes and interfaces in IDL |
| 549 // files. (crbug.com/615060) | 534 // files. (crbug.com/615060) |
| 550 (*s_originalInstallOriginTrialsFunction)(scriptState); | 535 (*s_originalInstallOriginTrialsFunction)(scriptState); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 574 } | 559 } |
| 575 originTrialContext->setFeatureBindingsInstalled("DurableStorage"); | 560 originTrialContext->setFeatureBindingsInstalled("DurableStorage"); |
| 576 } | 561 } |
| 577 } | 562 } |
| 578 | 563 |
| 579 void registerInstallOriginTrialsForModules() | 564 void registerInstallOriginTrialsForModules() |
| 580 { | 565 { |
| 581 s_originalInstallOriginTrialsFunction = setInstallOriginTrialsFunction(&inst
allOriginTrialsForModules); | 566 s_originalInstallOriginTrialsFunction = setInstallOriginTrialsFunction(&inst
allOriginTrialsForModules); |
| 582 } | 567 } |
| 583 } // namespace blink | 568 } // namespace blink |
| OLD | NEW |