diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/bindings/js/WorkerScriptController.h | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebCore/bindings/js/WorkerScriptController.h')
-rw-r--r-- | Source/WebCore/bindings/js/WorkerScriptController.h | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/Source/WebCore/bindings/js/WorkerScriptController.h b/Source/WebCore/bindings/js/WorkerScriptController.h index 025c37d2c..460455208 100644 --- a/Source/WebCore/bindings/js/WorkerScriptController.h +++ b/Source/WebCore/bindings/js/WorkerScriptController.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008 Apple Inc. All Rights Reserved. + * Copyright (C) 2008, 2015, 2016 Apple Inc. All Rights Reserved. * Copyright (C) 2012 Google Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without @@ -11,10 +11,10 @@ * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR @@ -22,20 +22,15 @@ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * */ -#ifndef WorkerScriptController_h -#define WorkerScriptController_h +#pragma once #include <debugger/Debugger.h> #include <heap/Strong.h> #include <wtf/Forward.h> -#include <wtf/Threading.h> - -namespace Deprecated { -class ScriptValue; -} +#include <wtf/Lock.h> +#include <wtf/NakedPtr.h> namespace JSC { class VM; @@ -45,6 +40,7 @@ namespace WebCore { class JSWorkerGlobalScope; class ScriptSourceCode; + class WorkerConsoleClient; class WorkerGlobalScope; class WorkerScriptController { @@ -60,9 +56,9 @@ namespace WebCore { } void evaluate(const ScriptSourceCode&); - void evaluate(const ScriptSourceCode&, Deprecated::ScriptValue* exception); + void evaluate(const ScriptSourceCode&, NakedPtr<JSC::Exception>& returnedException); - void setException(const Deprecated::ScriptValue&); + void setException(JSC::Exception*); // Async request to terminate a JS run execution. Eventually causes termination // exception raised during JS execution, if the worker thread happens to run JS. @@ -70,7 +66,7 @@ namespace WebCore { // forbidExecution()/isExecutionForbidden() to guard against reentry into JS. // Can be called from any thread. void scheduleExecutionTermination(); - bool isExecutionTerminating() const; + bool isTerminatingExecution() const; // Called on Worker thread when JS exits with termination exception caused by forbidExecution() request, // or by Worker thread termination code to prevent future entry into JS. @@ -79,7 +75,10 @@ namespace WebCore { void disableEval(const String& errorMessage); - JSC::VM* vm() { return m_vm.get(); } + JSC::VM& vm() { return *m_vm; } + + void releaseHeapAccess(); + void acquireHeapAccess(); void attachDebugger(JSC::Debugger*); void detachDebugger(JSC::Debugger*); @@ -95,10 +94,10 @@ namespace WebCore { RefPtr<JSC::VM> m_vm; WorkerGlobalScope* m_workerGlobalScope; JSC::Strong<JSWorkerGlobalScope> m_workerGlobalScopeWrapper; - bool m_executionForbidden; - mutable Mutex m_scheduledTerminationMutex; + std::unique_ptr<WorkerConsoleClient> m_consoleClient; + bool m_executionForbidden { false }; + bool m_isTerminatingExecution { false }; + mutable Lock m_scheduledTerminationMutex; }; } // namespace WebCore - -#endif // WorkerScriptController_h |