| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * Copyright (C) 2012 Google Inc. All Rights Reserved. | 3 * Copyright (C) 2012 Google Inc. All Rights Reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "public/platform/WebTraceLocation.h" | 42 #include "public/platform/WebTraceLocation.h" |
| 43 | 43 |
| 44 namespace blink { | 44 namespace blink { |
| 45 | 45 |
| 46 class ConsoleMessage; | 46 class ConsoleMessage; |
| 47 class CoreProbeSink; | 47 class CoreProbeSink; |
| 48 class DOMTimerCoordinator; | 48 class DOMTimerCoordinator; |
| 49 class ErrorEvent; | 49 class ErrorEvent; |
| 50 class EventQueue; | 50 class EventQueue; |
| 51 class EventTarget; | 51 class EventTarget; |
| 52 class ExecutionContextTask; | |
| 53 class LocalDOMWindow; | 52 class LocalDOMWindow; |
| 54 class SuspendableObject; | 53 class SuspendableObject; |
| 55 class PublicURLManager; | 54 class PublicURLManager; |
| 56 class SecurityOrigin; | 55 class SecurityOrigin; |
| 57 class ScriptState; | 56 class ScriptState; |
| 58 enum class TaskType : unsigned; | 57 enum class TaskType : unsigned; |
| 59 | 58 |
| 60 enum ReasonForCallingCanExecuteScripts { | 59 enum ReasonForCallingCanExecuteScripts { |
| 61 kAboutToExecuteScript, | 60 kAboutToExecuteScript, |
| 62 kNotAboutToExecuteScript | 61 kNotAboutToExecuteScript |
| (...skipping 25 matching lines...) Expand all Loading... |
| 88 | 87 |
| 89 virtual bool IsContextThread() const { return true; } | 88 virtual bool IsContextThread() const { return true; } |
| 90 | 89 |
| 91 SecurityOrigin* GetSecurityOrigin(); | 90 SecurityOrigin* GetSecurityOrigin(); |
| 92 ContentSecurityPolicy* GetContentSecurityPolicy(); | 91 ContentSecurityPolicy* GetContentSecurityPolicy(); |
| 93 const KURL& Url() const; | 92 const KURL& Url() const; |
| 94 KURL CompleteURL(const String& url) const; | 93 KURL CompleteURL(const String& url) const; |
| 95 virtual void DisableEval(const String& error_message) = 0; | 94 virtual void DisableEval(const String& error_message) = 0; |
| 96 virtual LocalDOMWindow* ExecutingWindow() const { return nullptr; } | 95 virtual LocalDOMWindow* ExecutingWindow() const { return nullptr; } |
| 97 virtual String UserAgent() const = 0; | 96 virtual String UserAgent() const = 0; |
| 98 // Executes the task on context's thread asynchronously. | |
| 99 virtual void PostTask( | |
| 100 TaskType, | |
| 101 const WebTraceLocation&, | |
| 102 std::unique_ptr<ExecutionContextTask>, | |
| 103 const String& task_name_for_instrumentation = g_empty_string) = 0; | |
| 104 | 97 |
| 105 // Gets the DOMTimerCoordinator which maintains the "active timer | 98 // Gets the DOMTimerCoordinator which maintains the "active timer |
| 106 // list" of tasks created by setTimeout and setInterval. The | 99 // list" of tasks created by setTimeout and setInterval. The |
| 107 // DOMTimerCoordinator is owned by the ExecutionContext and should | 100 // DOMTimerCoordinator is owned by the ExecutionContext and should |
| 108 // not be used after the ExecutionContext is destroyed. | 101 // not be used after the ExecutionContext is destroyed. |
| 109 virtual DOMTimerCoordinator* Timers() = 0; | 102 virtual DOMTimerCoordinator* Timers() = 0; |
| 110 | 103 |
| 111 virtual SecurityContext& GetSecurityContext() = 0; | 104 virtual SecurityContext& GetSecurityContext() = 0; |
| 112 KURL ContextURL() const { return VirtualURL(); } | 105 KURL ContextURL() const { return VirtualURL(); } |
| 113 KURL ContextCompleteURL(const String& url) const { | 106 KURL ContextCompleteURL(const String& url) const { |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 // |allowWindowInteraction()| and |consumeWindowInteraction()| in order to | 202 // |allowWindowInteraction()| and |consumeWindowInteraction()| in order to |
| 210 // increment and decrement the counter. | 203 // increment and decrement the counter. |
| 211 int window_interaction_tokens_; | 204 int window_interaction_tokens_; |
| 212 | 205 |
| 213 ReferrerPolicy referrer_policy_; | 206 ReferrerPolicy referrer_policy_; |
| 214 }; | 207 }; |
| 215 | 208 |
| 216 } // namespace blink | 209 } // namespace blink |
| 217 | 210 |
| 218 #endif // ExecutionContext_h | 211 #endif // ExecutionContext_h |
| OLD | NEW |