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 virtual void trace(Visitor*); | 69 virtual void trace(Visitor*); |
70 | 70 |
71 // Delegating to ExecutionContextClient | 71 // Delegating to ExecutionContextClient |
72 bool isDocument() const { return m_client && m_client->isDocument(); } | 72 bool isDocument() const { return m_client && m_client->isDocument(); } |
73 bool isWorkerGlobalScope() const { return m_client && m_client->isWorkerGlob
alScope(); } | 73 bool isWorkerGlobalScope() const { return m_client && m_client->isWorkerGlob
alScope(); } |
74 bool isJSExecutionForbidden() { return m_client && m_client->isJSExecutionFo
rbidden(); } | 74 bool isJSExecutionForbidden() { return m_client && m_client->isJSExecutionFo
rbidden(); } |
75 SecurityOrigin* securityOrigin() const; | 75 SecurityOrigin* securityOrigin() const; |
76 ContentSecurityPolicy* contentSecurityPolicy() const; | 76 ContentSecurityPolicy* contentSecurityPolicy() const; |
77 const KURL& url() const; | 77 const KURL& url() const; |
78 KURL completeURL(const String& url) const; | 78 KURL completeURL(const String& url) const; |
79 void disableEval(const String& errorMessage); | 79 void disableEval(const String& errorMessage); |
80 DOMWindow* executingWindow() const; | 80 LocalDOMWindow* executingWindow() const; |
81 String userAgent(const KURL&) const; | 81 String userAgent(const KURL&) const; |
82 void postTask(PassOwnPtr<ExecutionContextTask>); | 82 void postTask(PassOwnPtr<ExecutionContextTask>); |
83 void postTask(const Closure&); | 83 void postTask(const Closure&); |
84 double timerAlignmentInterval() const; | 84 double timerAlignmentInterval() const; |
85 | 85 |
86 virtual void reportBlockedScriptExecutionToInspector(const String& directive
Text) = 0; | 86 virtual void reportBlockedScriptExecutionToInspector(const String& directive
Text) = 0; |
87 | 87 |
88 virtual SecurityContext& securityContext() = 0; | 88 virtual SecurityContext& securityContext() = 0; |
89 KURL contextURL() const { return virtualURL(); } | 89 KURL contextURL() const { return virtualURL(); } |
90 KURL contextCompleteURL(const String& url) const { return virtualCompleteURL
(url); } | 90 KURL contextCompleteURL(const String& url) const { return virtualCompleteURL
(url); } |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 177 |
178 // 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 |
179 // 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, |
180 // m_lifecycleNotifer should be placed *after* such members. | 180 // m_lifecycleNotifer should be placed *after* such members. |
181 OwnPtr<ContextLifecycleNotifier> m_lifecycleNotifier; | 181 OwnPtr<ContextLifecycleNotifier> m_lifecycleNotifier; |
182 }; | 182 }; |
183 | 183 |
184 } // namespace WebCore | 184 } // namespace WebCore |
185 | 185 |
186 #endif // ExecutionContext_h | 186 #endif // ExecutionContext_h |
OLD | NEW |