| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #ifndef ExecutionContextClient_h | 27 #ifndef ExecutionContextClient_h |
| 28 #define ExecutionContextClient_h | 28 #define ExecutionContextClient_h |
| 29 | 29 |
| 30 #include "core/frame/ConsoleTypes.h" | 30 #include "core/frame/ConsoleTypes.h" |
| 31 #include "core/inspector/ConsoleMessage.h" |
| 31 #include "platform/LifecycleNotifier.h" | 32 #include "platform/LifecycleNotifier.h" |
| 32 #include "platform/heap/Handle.h" | 33 #include "platform/heap/Handle.h" |
| 33 #include "platform/weborigin/KURL.h" | 34 #include "platform/weborigin/KURL.h" |
| 34 #include "wtf/Forward.h" | 35 #include "wtf/Forward.h" |
| 35 | 36 |
| 36 namespace blink { | 37 namespace blink { |
| 37 | 38 |
| 38 class EventTarget; | 39 class EventTarget; |
| 39 class ExecutionContextTask; | 40 class ExecutionContextTask; |
| 40 class KURL; | 41 class KURL; |
| 41 class LocalDOMWindow; | 42 class LocalDOMWindow; |
| 42 class ScriptCallStack; | 43 class ScriptCallStack; |
| 43 class ScriptState; | 44 class ScriptState; |
| 44 class SecurityContext; | 45 class SecurityContext; |
| 45 | 46 |
| 46 class ExecutionContextClient { | 47 class ExecutionContextClient { |
| 47 public: | 48 public: |
| 48 virtual void postTask(PassOwnPtr<ExecutionContextTask>) = 0; // Executes the
task on context's thread asynchronously. | 49 virtual void postTask(PassOwnPtr<ExecutionContextTask>) = 0; // Executes the
task on context's thread asynchronously. |
| 49 | 50 |
| 50 virtual bool isDocument() const { return false; } | 51 virtual bool isDocument() const { return false; } |
| 51 virtual bool isWorkerGlobalScope() const { return false; } | 52 virtual bool isWorkerGlobalScope() const { return false; } |
| 52 virtual bool isJSExecutionForbidden() const = 0; | 53 virtual bool isJSExecutionForbidden() const = 0; |
| 53 virtual LocalDOMWindow* executingWindow() { return 0; } | 54 virtual LocalDOMWindow* executingWindow() { return 0; } |
| 54 virtual String userAgent(const KURL&) const = 0; | 55 virtual String userAgent(const KURL&) const = 0; |
| 55 virtual void disableEval(const String& errorMessage) = 0; | 56 virtual void disableEval(const String& errorMessage) = 0; |
| 56 virtual SecurityContext& securityContext() = 0; | 57 virtual SecurityContext& securityContext() = 0; |
| 57 virtual void addMessage(MessageSource, MessageLevel, const String& message,
const String& sourceURL, unsigned lineNumber, ScriptState*) = 0; | 58 virtual void addMessage(PassRefPtr<ConsoleMessage>) = 0; |
| 58 virtual EventTarget* errorEventTarget() = 0; | 59 virtual EventTarget* errorEventTarget() = 0; |
| 59 virtual void logExceptionToConsole(const String& errorMessage, const String&
sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawPtr<ScriptCallS
tack>) = 0; | 60 virtual void logExceptionToConsole(const String& errorMessage, const String&
sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawPtr<ScriptCallS
tack>) = 0; |
| 60 virtual double timerAlignmentInterval() const = 0; | 61 virtual double timerAlignmentInterval() const = 0; |
| 61 virtual void didUpdateSecurityOrigin() = 0; | 62 virtual void didUpdateSecurityOrigin() = 0; |
| 62 | 63 |
| 63 virtual void tasksWereSuspended() { } | 64 virtual void tasksWereSuspended() { } |
| 64 virtual void tasksWereResumed() { } | 65 virtual void tasksWereResumed() { } |
| 65 | 66 |
| 66 void addConsoleMessage(MessageSource source, MessageLevel level, const Strin
g& message, const String& sourceURL, unsigned lineNumber) { addMessage(source, l
evel, message, sourceURL, lineNumber, 0); } | 67 void addConsoleMessage(PassRefPtr<ConsoleMessage> consoleMessage) { addMessa
ge(consoleMessage); } |
| 67 void addConsoleMessage(MessageSource source, MessageLevel level, const Strin
g& message, ScriptState* state = 0) { addMessage(source, level, message, String(
), 0, state); } | |
| 68 | 68 |
| 69 protected: | 69 protected: |
| 70 virtual ~ExecutionContextClient() { } | 70 virtual ~ExecutionContextClient() { } |
| 71 | 71 |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 | 74 |
| 75 } // namespace | 75 } // namespace |
| 76 | 76 |
| 77 #endif | 77 #endif |
| OLD | NEW |