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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/IsolatedScriptController.h

Issue 1535943005: Initial implementation of bindings and basic classes for worklets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 12 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/bindings/core/v8/IsolatedScriptController.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/WorkerScriptController.h b/third_party/WebKit/Source/bindings/core/v8/IsolatedScriptController.h
similarity index 84%
rename from third_party/WebKit/Source/bindings/core/v8/WorkerScriptController.h
rename to third_party/WebKit/Source/bindings/core/v8/IsolatedScriptController.h
index f4e53bf82656ac384a006d738f59cd331feb4eb4..9c51b7179f85e2925070f1fe057a7fc2db7bcafa 100644
--- a/third_party/WebKit/Source/bindings/core/v8/WorkerScriptController.h
+++ b/third_party/WebKit/Source/bindings/core/v8/IsolatedScriptController.h
@@ -28,8 +28,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WorkerScriptController_h
-#define WorkerScriptController_h
+#ifndef IsolatedScriptController_h
+#define IsolatedScriptController_h
#include "bindings/core/v8/RejectedPromises.h"
#include "bindings/core/v8/ScriptValue.h"
@@ -46,16 +46,17 @@ namespace blink {
class CachedMetadataHandler;
class ErrorEvent;
+class ExecutionContext;
class ExceptionState;
class ScriptSourceCode;
-class WorkerGlobalScope;
+class ScriptWrappable;
-class CORE_EXPORT WorkerScriptController : public NoBaseWillBeGarbageCollectedFinalized<WorkerScriptController> {
- USING_FAST_MALLOC_WILL_BE_REMOVED(WorkerScriptController);
- WTF_MAKE_NONCOPYABLE(WorkerScriptController);
+class CORE_EXPORT IsolatedScriptController : public NoBaseWillBeGarbageCollectedFinalized<IsolatedScriptController> {
haraken 2016/01/05 06:08:06 I'd prefer GlobalScopeScriptController if kinuko-s
kinuko 2016/01/05 10:08:31 I agree that isolated could be confusing while I a
haraken 2016/01/05 12:12:40 WorkerOrWorkletScriptController sounds good. Also
ikilpatrick 2016/01/07 22:47:35 Done.
+ USING_FAST_MALLOC_WILL_BE_REMOVED(IsolatedScriptController);
+ WTF_MAKE_NONCOPYABLE(IsolatedScriptController);
public:
- static PassOwnPtrWillBeRawPtr<WorkerScriptController> create(WorkerGlobalScope*, v8::Isolate*);
- virtual ~WorkerScriptController();
+ static PassOwnPtrWillBeRawPtr<IsolatedScriptController> create(ExecutionContext*, ScriptWrappable*, v8::Isolate*);
+ virtual ~IsolatedScriptController();
void dispose();
bool isExecutionForbidden() const;
@@ -72,7 +73,7 @@ public:
bool initializeContextIfNeeded();
// Async request to terminate future JavaScript execution on the
// worker thread. JavaScript evaluation exits with a
- // non-continuable exception and WorkerScriptController calls
+ // non-continuable exception and IsolatedScriptController calls
// forbidExecution to prevent further JavaScript execution. Use
// forbidExecution()/isExecutionForbidden() to guard against
// reentry into JavaScript.
@@ -95,15 +96,16 @@ public:
bool isContextInitialized() const { return m_scriptState && !!m_scriptState->perContextData(); }
private:
- WorkerScriptController(WorkerGlobalScope*, v8::Isolate*);
+ IsolatedScriptController(ExecutionContext*, ScriptWrappable*, v8::Isolate*);
class ExecutionState;
- v8::Isolate* isolate() const;
-
// Evaluate a script file in the current execution environment.
ScriptValue evaluate(const String& script, const String& fileName, const TextPosition& scriptStartPosition, CachedMetadataHandler*, V8CacheOptions);
- RawPtrWillBeMember<WorkerGlobalScope> m_workerGlobalScope;
+ RawPtrWillBeMember<ExecutionContext> m_executionContext;
haraken 2016/01/05 06:08:06 This is redundant. You can get the ExecutionContex
ikilpatrick 2016/01/07 22:47:35 This is required before initializeContextIfNeeded
+ RawPtrWillBeMember<ScriptWrappable> m_scriptWrappable;
haraken 2016/01/05 06:08:06 I'd rename this to m_globalScope. Also I'd prefer
kinuko 2016/01/05 10:08:31 I'd like to avoid deep inheritance while they shar
haraken 2016/01/05 12:12:40 Or you can add two members: Member<WorkerGlobal
ikilpatrick 2016/01/07 22:47:35 Not sure that adding two members is good in this c
haraken 2016/01/08 04:59:07 Yeah, I think it's better to introduce WorkerOrWor
ikilpatrick 2016/01/11 04:13:19 Added WorkerOrWorkletGlobalScope, @kinuko I've jus
+ v8::Isolate* m_isolate;
haraken 2016/01/05 06:08:06 You can get the Isolate by m_scriptState->isolate(
ikilpatrick 2016/01/07 22:47:35 This is actually needed before m_scriptState exist
+
RefPtr<ScriptState> m_scriptState;
RefPtr<DOMWrapperWorld> m_world;
String m_disableEvalPending;
@@ -124,4 +126,4 @@ private:
} // namespace blink
-#endif // WorkerScriptController_h
+#endif // IsolatedScriptController_h

Powered by Google App Engine
This is Rietveld 408576698