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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 class ScriptCallStack; | 42 class ScriptCallStack; |
43 class ScriptState; | 43 class ScriptState; |
44 class SecurityContext; | 44 class SecurityContext; |
45 | 45 |
46 class ExecutionContextClient { | 46 class ExecutionContextClient { |
47 public: | 47 public: |
48 virtual void postTask(PassOwnPtr<ExecutionContextTask>) = 0; // Executes the
task on context's thread asynchronously. | 48 virtual void postTask(PassOwnPtr<ExecutionContextTask>) = 0; // Executes the
task on context's thread asynchronously. |
49 | 49 |
50 virtual bool isDocument() const { return false; } | 50 virtual bool isDocument() const { return false; } |
51 virtual bool isWorkerGlobalScope() const { return false; } | 51 virtual bool isWorkerGlobalScope() const { return false; } |
| 52 virtual bool isDedicatedWorkerGlobalScope() const { return false; } |
| 53 virtual bool isSharedWorkerGlobalScope() const { return false; } |
| 54 virtual bool isServiceWorkerGlobalScope() const { return false; } |
52 virtual bool isJSExecutionForbidden() const = 0; | 55 virtual bool isJSExecutionForbidden() const = 0; |
53 virtual LocalDOMWindow* executingWindow() { return 0; } | 56 virtual LocalDOMWindow* executingWindow() { return 0; } |
54 virtual String userAgent(const KURL&) const = 0; | 57 virtual String userAgent(const KURL&) const = 0; |
55 virtual void disableEval(const String& errorMessage) = 0; | 58 virtual void disableEval(const String& errorMessage) = 0; |
56 virtual SecurityContext& securityContext() = 0; | 59 virtual SecurityContext& securityContext() = 0; |
57 virtual void addMessage(MessageSource, MessageLevel, const String& message,
const String& sourceURL, unsigned lineNumber, ScriptState*) = 0; | 60 virtual void addMessage(MessageSource, MessageLevel, const String& message,
const String& sourceURL, unsigned lineNumber, ScriptState*) = 0; |
58 virtual EventTarget* errorEventTarget() = 0; | 61 virtual EventTarget* errorEventTarget() = 0; |
59 virtual void logExceptionToConsole(const String& errorMessage, const String&
sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawPtr<ScriptCallS
tack>) = 0; | 62 virtual void logExceptionToConsole(const String& errorMessage, const String&
sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawPtr<ScriptCallS
tack>) = 0; |
60 virtual double timerAlignmentInterval() const = 0; | 63 virtual double timerAlignmentInterval() const = 0; |
61 virtual void didUpdateSecurityOrigin() = 0; | 64 virtual void didUpdateSecurityOrigin() = 0; |
62 | 65 |
63 virtual void tasksWereSuspended() { } | 66 virtual void tasksWereSuspended() { } |
64 virtual void tasksWereResumed() { } | 67 virtual void tasksWereResumed() { } |
65 | 68 |
66 void addConsoleMessage(MessageSource source, MessageLevel level, const Strin
g& message, const String& sourceURL, unsigned lineNumber) { addMessage(source, l
evel, message, sourceURL, lineNumber, 0); } | 69 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(MessageSource source, MessageLevel level, const Strin
g& message, ScriptState* state = 0) { addMessage(source, level, message, String(
), 0, state); } | 70 void addConsoleMessage(MessageSource source, MessageLevel level, const Strin
g& message, ScriptState* state = 0) { addMessage(source, level, message, String(
), 0, state); } |
68 | 71 |
69 protected: | 72 protected: |
70 virtual ~ExecutionContextClient() { } | 73 virtual ~ExecutionContextClient() { } |
71 | 74 |
72 }; | 75 }; |
73 | 76 |
74 | 77 |
75 } // namespace | 78 } // namespace |
76 | 79 |
77 #endif | 80 #endif |
OLD | NEW |