diff options
Diffstat (limited to 'Source/WebCore/bindings/v8/ScriptState.cpp')
-rw-r--r-- | Source/WebCore/bindings/v8/ScriptState.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/Source/WebCore/bindings/v8/ScriptState.cpp b/Source/WebCore/bindings/v8/ScriptState.cpp index fac1d26..600a92a 100644 --- a/Source/WebCore/bindings/v8/ScriptState.cpp +++ b/Source/WebCore/bindings/v8/ScriptState.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 Google Inc. All rights reserved. + * Copyright (C) 2009, 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -37,6 +37,10 @@ #include "ScriptController.h" #include "V8HiddenPropertyName.h" +#include "WorkerContext.h" +#include "WorkerContextExecutionProxy.h" +#include "WorkerScriptController.h" + #include <v8.h> #include <wtf/Assertions.h> @@ -111,4 +115,17 @@ ScriptState* scriptStateFromPage(DOMWrapperWorld*, Page* page) return mainWorldScriptState(page->mainFrame()); } +#if ENABLE(WORKERS) +ScriptState* scriptStateFromWorkerContext(WorkerContext* workerContext) +{ + WorkerContextExecutionProxy* proxy = workerContext->script()->proxy(); + if (!proxy) + return 0; + + v8::HandleScope handleScope; + v8::Local<v8::Context> context = proxy->context(); + return ScriptState::forContext(context); +} +#endif + } |