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

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: added comments. Created 5 years 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> {
kinuko 2016/01/05 04:58:32 Now that the class name is less obvious we should
+ 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;
+ RawPtrWillBeMember<ScriptWrappable> m_scriptWrappable;
+ v8::Isolate* m_isolate;
kinuko 2016/01/05 04:58:32 Could we have a comment for this too? Something l
ikilpatrick 2016/01/07 22:47:34 Done.
+
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