| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(); | 69 ExecutionContext(); |
| 70 virtual ~ExecutionContext(); | 70 virtual ~ExecutionContext(); |
| 71 | 71 |
| 72 // Delegating to ExecutionContextClient | 72 // Delegating to ExecutionContextClient |
| 73 void setClient(ExecutionContextClient* client) { m_client = client; } | |
| 74 bool isDocument() const { return m_client && m_client->isDocument(); } | 73 bool isDocument() const { return m_client && m_client->isDocument(); } |
| 75 bool isWorkerGlobalScope() const { return m_client && m_client->isWorkerGlob
alScope(); } | 74 bool isWorkerGlobalScope() const { return m_client && m_client->isWorkerGlob
alScope(); } |
| 76 bool isJSExecutionForbidden() { return m_client && m_client->isJSExecutionFo
rbidden(); } | 75 bool isJSExecutionForbidden() { return m_client && m_client->isJSExecutionFo
rbidden(); } |
| 77 SecurityOrigin* securityOrigin() const; | 76 SecurityOrigin* securityOrigin() const; |
| 78 ContentSecurityPolicy* contentSecurityPolicy() const; | 77 ContentSecurityPolicy* contentSecurityPolicy() const; |
| 79 const KURL& url() const; | 78 const KURL& url() const; |
| 80 KURL completeURL(const String& url) const; | 79 KURL completeURL(const String& url) const; |
| 81 void disableEval(const String& errorMessage); | 80 void disableEval(const String& errorMessage); |
| 82 DOMWindow* executingWindow() const; | 81 DOMWindow* executingWindow() const; |
| 83 String userAgent(const KURL&) const; | 82 String userAgent(const KURL&) const; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 | 122 |
| 124 SandboxFlags sandboxFlags() const { return m_sandboxFlags; } | 123 SandboxFlags sandboxFlags() const { return m_sandboxFlags; } |
| 125 bool isSandboxed(SandboxFlags mask) const { return m_sandboxFlags & mask; } | 124 bool isSandboxed(SandboxFlags mask) const { return m_sandboxFlags & mask; } |
| 126 void enforceSandboxFlags(SandboxFlags mask); | 125 void enforceSandboxFlags(SandboxFlags mask); |
| 127 | 126 |
| 128 PassOwnPtr<LifecycleNotifier<ExecutionContext> > createLifecycleNotifier(); | 127 PassOwnPtr<LifecycleNotifier<ExecutionContext> > createLifecycleNotifier(); |
| 129 | 128 |
| 130 virtual EventQueue* eventQueue() const = 0; | 129 virtual EventQueue* eventQueue() const = 0; |
| 131 | 130 |
| 132 protected: | 131 protected: |
| 132 void setClient(ExecutionContextClient* client) { m_client = client; } |
| 133 | 133 |
| 134 ContextLifecycleNotifier& lifecycleNotifier(); | 134 ContextLifecycleNotifier& lifecycleNotifier(); |
| 135 | 135 |
| 136 private: | 136 private: |
| 137 friend class DOMTimer; // For installNewTimeout() and removeTimeoutByID() be
low. | 137 friend class DOMTimer; // For installNewTimeout() and removeTimeoutByID() be
low. |
| 138 | 138 |
| 139 bool dispatchErrorEvent(PassRefPtrWillBeRawPtr<ErrorEvent>, AccessControlSta
tus); | 139 bool dispatchErrorEvent(PassRefPtrWillBeRawPtr<ErrorEvent>, AccessControlSta
tus); |
| 140 | 140 |
| 141 #if !ENABLE(OILPAN) | 141 #if !ENABLE(OILPAN) |
| 142 virtual void refExecutionContext() = 0; | 142 virtual void refExecutionContext() = 0; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 166 | 166 |
| 167 // The location of this member is important; to make sure contextDestroyed()
notification on | 167 // The location of this member is important; to make sure contextDestroyed()
notification on |
| 168 // ExecutionContext's members (notably m_timeouts) is called before they are
destructed, | 168 // ExecutionContext's members (notably m_timeouts) is called before they are
destructed, |
| 169 // m_lifecycleNotifer should be placed *after* such members. | 169 // m_lifecycleNotifer should be placed *after* such members. |
| 170 OwnPtr<ContextLifecycleNotifier> m_lifecycleNotifier; | 170 OwnPtr<ContextLifecycleNotifier> m_lifecycleNotifier; |
| 171 }; | 171 }; |
| 172 | 172 |
| 173 } // namespace WebCore | 173 } // namespace WebCore |
| 174 | 174 |
| 175 #endif // ExecutionContext_h | 175 #endif // ExecutionContext_h |
| OLD | NEW |