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

Side by Side Diff: third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp

Issue 2029163002: Worklets - Change inheritance heirarchy of WorkletGlobalScope (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix build 2 Created 4 years, 6 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 unified diff | Download patch
OLDNEW
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
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"
53 #include "core/workers/WorkletGlobalScope.h"
55 #include "modules/indexeddb/IDBKey.h" 54 #include "modules/indexeddb/IDBKey.h"
56 #include "modules/indexeddb/IDBKeyPath.h" 55 #include "modules/indexeddb/IDBKeyPath.h"
57 #include "modules/indexeddb/IDBKeyRange.h" 56 #include "modules/indexeddb/IDBKeyRange.h"
58 #include "modules/indexeddb/IDBTracing.h" 57 #include "modules/indexeddb/IDBTracing.h"
59 #include "modules/indexeddb/IDBValue.h" 58 #include "modules/indexeddb/IDBValue.h"
60 #include "modules/worklet/WorkletGlobalScope.h"
61 #include "platform/RuntimeEnabledFeatures.h" 59 #include "platform/RuntimeEnabledFeatures.h"
62 #include "platform/SharedBuffer.h" 60 #include "platform/SharedBuffer.h"
63 #include "wtf/MathExtras.h" 61 #include "wtf/MathExtras.h"
64 #include "wtf/Vector.h" 62 #include "wtf/Vector.h"
65 63
66 namespace blink { 64 namespace blink {
67 65
68 static v8::Local<v8::Value> deserializeIDBValueData(v8::Isolate*, const IDBValue *); 66 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*); 67 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>>*); 68 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
519 IDBKey* expectedKey = createIDBKeyFromValueAndKeyPath(isolate, scriptValue.v 8Value(), value->keyPath(), exceptionState, allowExperimentalTypes); 517 IDBKey* expectedKey = createIDBKeyFromValueAndKeyPath(isolate, scriptValue.v 8Value(), value->keyPath(), exceptionState, allowExperimentalTypes);
520 ASSERT(!exceptionState.hadException()); 518 ASSERT(!exceptionState.hadException());
521 if (expectedKey && expectedKey->isEqual(value->primaryKey())) 519 if (expectedKey && expectedKey->isEqual(value->primaryKey()))
522 return; 520 return;
523 521
524 bool injected = injectV8KeyIntoV8Value(isolate, keyValue.v8Value(), scriptVa lue.v8Value(), value->keyPath()); 522 bool injected = injectV8KeyIntoV8Value(isolate, keyValue.v8Value(), scriptVa lue.v8Value(), value->keyPath());
525 ASSERT_UNUSED(injected, injected); 523 ASSERT_UNUSED(injected, injected);
526 } 524 }
527 #endif 525 #endif
528 526
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 { 527 namespace {
542 InstallOriginTrialsFunction s_originalInstallOriginTrialsFunction = nullptr; 528 InstallOriginTrialsFunction s_originalInstallOriginTrialsFunction = nullptr;
543 } 529 }
544 530
545 void installOriginTrialsForModules(ScriptState* scriptState) 531 void installOriginTrialsForModules(ScriptState* scriptState)
546 { 532 {
547 // TODO(iclelland): Generate all of this logic at compile-time, based on the 533 // TODO(iclelland): Generate all of this logic at compile-time, based on the
548 // configuration of origin trial enabled attibutes and interfaces in IDL 534 // configuration of origin trial enabled attibutes and interfaces in IDL
549 // files. (crbug.com/615060) 535 // files. (crbug.com/615060)
550 (*s_originalInstallOriginTrialsFunction)(scriptState); 536 (*s_originalInstallOriginTrialsFunction)(scriptState);
(...skipping 23 matching lines...) Expand all
574 } 560 }
575 originTrialContext->setFeatureBindingsInstalled("DurableStorage"); 561 originTrialContext->setFeatureBindingsInstalled("DurableStorage");
576 } 562 }
577 } 563 }
578 564
579 void registerInstallOriginTrialsForModules() 565 void registerInstallOriginTrialsForModules()
580 { 566 {
581 s_originalInstallOriginTrialsFunction = setInstallOriginTrialsFunction(&inst allOriginTrialsForModules); 567 s_originalInstallOriginTrialsFunction = setInstallOriginTrialsFunction(&inst allOriginTrialsForModules);
582 } 568 }
583 } // namespace blink 569 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698