| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 #include "wtf/OwnPtr.h" | 44 #include "wtf/OwnPtr.h" |
| 45 #include "wtf/PassOwnPtr.h" | 45 #include "wtf/PassOwnPtr.h" |
| 46 | 46 |
| 47 namespace WTF { | 47 namespace WTF { |
| 48 class OrdinalNumber; | 48 class OrdinalNumber; |
| 49 } | 49 } |
| 50 | 50 |
| 51 namespace WebCore { | 51 namespace WebCore { |
| 52 | 52 |
| 53 class ContextLifecycleNotifier; | 53 class ContextLifecycleNotifier; |
| 54 class DOMWindow; | 54 class LocalDOMWindow; |
| 55 class EventListener; | 55 class EventListener; |
| 56 class EventQueue; | 56 class EventQueue; |
| 57 class EventTarget; | 57 class EventTarget; |
| 58 class ExecutionContextTask; | 58 class ExecutionContextTask; |
| 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(); | 69 ExecutionContext(); |
| 70 virtual ~ExecutionContext(); | 70 virtual ~ExecutionContext(); |
| 71 virtual void trace(Visitor*); | 71 virtual void trace(Visitor*); |
| 72 | 72 |
| 73 // Delegating to ExecutionContextClient | 73 // Delegating to ExecutionContextClient |
| 74 bool isDocument() const { return m_client && m_client->isDocument(); } | 74 bool isDocument() const { return m_client && m_client->isDocument(); } |
| 75 bool isWorkerGlobalScope() const { return m_client && m_client->isWorkerGlob
alScope(); } | 75 bool isWorkerGlobalScope() const { return m_client && m_client->isWorkerGlob
alScope(); } |
| 76 bool isJSExecutionForbidden() { return m_client && m_client->isJSExecutionFo
rbidden(); } | 76 bool isJSExecutionForbidden() { return m_client && m_client->isJSExecutionFo
rbidden(); } |
| 77 SecurityOrigin* securityOrigin() const; | 77 SecurityOrigin* securityOrigin() const; |
| 78 ContentSecurityPolicy* contentSecurityPolicy() const; | 78 ContentSecurityPolicy* contentSecurityPolicy() const; |
| 79 const KURL& url() const; | 79 const KURL& url() const; |
| 80 KURL completeURL(const String& url) const; | 80 KURL completeURL(const String& url) const; |
| 81 void disableEval(const String& errorMessage); | 81 void disableEval(const String& errorMessage); |
| 82 DOMWindow* executingWindow() const; | 82 LocalDOMWindow* executingWindow() const; |
| 83 String userAgent(const KURL&) const; | 83 String userAgent(const KURL&) const; |
| 84 void postTask(PassOwnPtr<ExecutionContextTask>); | 84 void postTask(PassOwnPtr<ExecutionContextTask>); |
| 85 void postTask(const Closure&); | 85 void postTask(const Closure&); |
| 86 double timerAlignmentInterval() const; | 86 double timerAlignmentInterval() const; |
| 87 | 87 |
| 88 virtual void reportBlockedScriptExecutionToInspector(const String& directive
Text) = 0; | 88 virtual void reportBlockedScriptExecutionToInspector(const String& directive
Text) = 0; |
| 89 | 89 |
| 90 virtual SecurityContext& securityContext() = 0; | 90 virtual SecurityContext& securityContext() = 0; |
| 91 KURL contextURL() const { return virtualURL(); } | 91 KURL contextURL() const { return virtualURL(); } |
| 92 KURL contextCompleteURL(const String& url) const { return virtualCompleteURL
(url); } | 92 KURL contextCompleteURL(const String& url) const { return virtualCompleteURL
(url); } |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 176 |
| 177 // The location of this member is important; to make sure contextDestroyed()
notification on | 177 // 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, | 178 // ExecutionContext's members (notably m_timeouts) is called before they are
destructed, |
| 179 // m_lifecycleNotifer should be placed *after* such members. | 179 // m_lifecycleNotifer should be placed *after* such members. |
| 180 OwnPtr<ContextLifecycleNotifier> m_lifecycleNotifier; | 180 OwnPtr<ContextLifecycleNotifier> m_lifecycleNotifier; |
| 181 }; | 181 }; |
| 182 | 182 |
| 183 } // namespace WebCore | 183 } // namespace WebCore |
| 184 | 184 |
| 185 #endif // ExecutionContext_h | 185 #endif // ExecutionContext_h |
| OLD | NEW |