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; } | |
55 virtual bool isJSExecutionForbidden() const = 0; | 52 virtual bool isJSExecutionForbidden() const = 0; |
56 virtual LocalDOMWindow* executingWindow() { return 0; } | 53 virtual LocalDOMWindow* executingWindow() { return 0; } |
57 virtual String userAgent(const KURL&) const = 0; | 54 virtual String userAgent(const KURL&) const = 0; |
58 virtual void disableEval(const String& errorMessage) = 0; | 55 virtual void disableEval(const String& errorMessage) = 0; |
59 virtual SecurityContext& securityContext() = 0; | 56 virtual SecurityContext& securityContext() = 0; |
60 virtual void addMessage(MessageSource, MessageLevel, const String& message,
const String& sourceURL, unsigned lineNumber, ScriptState*) = 0; | 57 virtual void addMessage(MessageSource, MessageLevel, const String& message,
const String& sourceURL, unsigned lineNumber, ScriptState*) = 0; |
61 virtual EventTarget* errorEventTarget() = 0; | 58 virtual EventTarget* errorEventTarget() = 0; |
62 virtual void logExceptionToConsole(const String& errorMessage, const String&
sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawPtr<ScriptCallS
tack>) = 0; | 59 virtual void logExceptionToConsole(const String& errorMessage, const String&
sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawPtr<ScriptCallS
tack>) = 0; |
63 virtual double timerAlignmentInterval() const = 0; | 60 virtual double timerAlignmentInterval() const = 0; |
64 virtual void didUpdateSecurityOrigin() = 0; | 61 virtual void didUpdateSecurityOrigin() = 0; |
65 | 62 |
66 virtual void tasksWereSuspended() { } | 63 virtual void tasksWereSuspended() { } |
67 virtual void tasksWereResumed() { } | 64 virtual void tasksWereResumed() { } |
68 | 65 |
69 void addConsoleMessage(MessageSource source, MessageLevel level, const Strin
g& message, const String& sourceURL, unsigned lineNumber) { addMessage(source, l
evel, message, sourceURL, lineNumber, 0); } | 66 void addConsoleMessage(MessageSource source, MessageLevel level, const Strin
g& message, const String& sourceURL, unsigned lineNumber) { addMessage(source, l
evel, message, sourceURL, lineNumber, 0); } |
70 void addConsoleMessage(MessageSource source, MessageLevel level, const Strin
g& message, ScriptState* state = 0) { addMessage(source, level, message, String(
), 0, state); } | 67 void addConsoleMessage(MessageSource source, MessageLevel level, const Strin
g& message, ScriptState* state = 0) { addMessage(source, level, message, String(
), 0, state); } |
71 | 68 |
72 protected: | 69 protected: |
73 virtual ~ExecutionContextClient() { } | 70 virtual ~ExecutionContextClient() { } |
74 | 71 |
75 }; | 72 }; |
76 | 73 |
77 | 74 |
78 } // namespace | 75 } // namespace |
79 | 76 |
80 #endif | 77 #endif |
OLD | NEW |