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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 class ScriptState; | 59 class ScriptState; |
60 class PublicURLManager; | 60 class PublicURLManager; |
61 class SecurityOrigin; | 61 class SecurityOrigin; |
62 class ScriptCallStack; | 62 class ScriptCallStack; |
63 | 63 |
64 class ExecutionContext | 64 class ExecutionContext |
65 : public WillBeGarbageCollectedMixin | 65 : public WillBeGarbageCollectedMixin |
66 , public LifecycleContext<ExecutionContext> | 66 , public LifecycleContext<ExecutionContext> |
67 , public Supplementable<ExecutionContext> { | 67 , public Supplementable<ExecutionContext> { |
68 public: | 68 public: |
69 ExecutionContext(); | |
70 virtual ~ExecutionContext(); | |
71 virtual void trace(Visitor*); | 69 virtual void trace(Visitor*); |
72 | 70 |
73 // Delegating to ExecutionContextClient | 71 // Delegating to ExecutionContextClient |
74 bool isDocument() const { return m_client && m_client->isDocument(); } | 72 bool isDocument() const { return m_client && m_client->isDocument(); } |
75 bool isWorkerGlobalScope() const { return m_client && m_client->isWorkerGlob
alScope(); } | 73 bool isWorkerGlobalScope() const { return m_client && m_client->isWorkerGlob
alScope(); } |
76 bool isJSExecutionForbidden() { return m_client && m_client->isJSExecutionFo
rbidden(); } | 74 bool isJSExecutionForbidden() { return m_client && m_client->isJSExecutionFo
rbidden(); } |
77 SecurityOrigin* securityOrigin() const; | 75 SecurityOrigin* securityOrigin() const; |
78 ContentSecurityPolicy* contentSecurityPolicy() const; | 76 ContentSecurityPolicy* contentSecurityPolicy() const; |
79 const KURL& url() const; | 77 const KURL& url() const; |
80 KURL completeURL(const String& url) const; | 78 KURL completeURL(const String& url) const; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 127 |
130 SandboxFlags sandboxFlags() const { return m_sandboxFlags; } | 128 SandboxFlags sandboxFlags() const { return m_sandboxFlags; } |
131 bool isSandboxed(SandboxFlags mask) const { return m_sandboxFlags & mask; } | 129 bool isSandboxed(SandboxFlags mask) const { return m_sandboxFlags & mask; } |
132 void enforceSandboxFlags(SandboxFlags mask); | 130 void enforceSandboxFlags(SandboxFlags mask); |
133 | 131 |
134 PassOwnPtr<LifecycleNotifier<ExecutionContext> > createLifecycleNotifier(); | 132 PassOwnPtr<LifecycleNotifier<ExecutionContext> > createLifecycleNotifier(); |
135 | 133 |
136 virtual EventQueue* eventQueue() const = 0; | 134 virtual EventQueue* eventQueue() const = 0; |
137 | 135 |
138 protected: | 136 protected: |
| 137 ExecutionContext(); |
| 138 virtual ~ExecutionContext(); |
| 139 |
139 void setClient(ExecutionContextClient* client) { m_client = client; } | 140 void setClient(ExecutionContextClient* client) { m_client = client; } |
140 | 141 |
141 virtual const KURL& virtualURL() const = 0; | 142 virtual const KURL& virtualURL() const = 0; |
142 virtual KURL virtualCompleteURL(const String&) const = 0; | 143 virtual KURL virtualCompleteURL(const String&) const = 0; |
143 | 144 |
144 ContextLifecycleNotifier& lifecycleNotifier(); | 145 ContextLifecycleNotifier& lifecycleNotifier(); |
145 | 146 |
146 private: | 147 private: |
147 friend class DOMTimer; // For installNewTimeout() and removeTimeoutByID() be
low. | 148 friend class DOMTimer; // For installNewTimeout() and removeTimeoutByID() be
low. |
148 | 149 |
(...skipping 27 matching lines...) Expand all Loading... |
176 | 177 |
177 // The location of this member is important; to make sure contextDestroyed()
notification on | 178 // The location of this member is important; to make sure contextDestroyed()
notification on |
178 // ExecutionContext's members (notably m_timeouts) is called before they are
destructed, | 179 // ExecutionContext's members (notably m_timeouts) is called before they are
destructed, |
179 // m_lifecycleNotifer should be placed *after* such members. | 180 // m_lifecycleNotifer should be placed *after* such members. |
180 OwnPtr<ContextLifecycleNotifier> m_lifecycleNotifier; | 181 OwnPtr<ContextLifecycleNotifier> m_lifecycleNotifier; |
181 }; | 182 }; |
182 | 183 |
183 } // namespace WebCore | 184 } // namespace WebCore |
184 | 185 |
185 #endif // ExecutionContext_h | 186 #endif // ExecutionContext_h |
OLD | NEW |