OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
75 const KURL& url() const { return m_url; } | 75 const KURL& url() const { return m_url; } |
76 KURL completeURL(const String&) const; | 76 KURL completeURL(const String&) const; |
77 | 77 |
78 virtual String userAgent(const KURL&) const OVERRIDE FINAL; | 78 virtual String userAgent(const KURL&) const OVERRIDE FINAL; |
79 virtual void disableEval(const String& errorMessage) OVERRIDE FINAL; | 79 virtual void disableEval(const String& errorMessage) OVERRIDE FINAL; |
80 | 80 |
81 WorkerScriptController* script() { return m_script.get(); } | 81 WorkerScriptController* script() { return m_script.get(); } |
82 void clearScript() { m_script.clear(); } | 82 void clearScript() { m_script.clear(); } |
83 void clearInspector(); | 83 void clearInspector(); |
84 | 84 |
85 void willStopActiveDOMObjects(); | 85 // FIXME: We can remove this interface when we remove openDatabaseSync. |
86 class TerminationObserver { | |
87 public: | |
88 virtual ~TerminationObserver() { } | |
89 // The function is called in the main thread. | |
haraken
2014/04/23 09:17:36
Given that this is not always called from the main
tkent
2014/04/23 09:24:53
Updated the comment.
| |
90 virtual void wasRequestedToTerminate() = 0; | |
91 }; | |
92 void registerTerminationObserver(TerminationObserver*); | |
93 void unregisterTerminationObserver(TerminationObserver*); | |
94 void wasRequestedToTerminate(); | |
95 | |
86 void dispose(); | 96 void dispose(); |
87 | 97 |
88 WorkerThread* thread() const { return m_thread; } | 98 WorkerThread* thread() const { return m_thread; } |
89 | 99 |
90 virtual void postTask(PassOwnPtr<ExecutionContextTask>) OVERRIDE FINAL; // Executes the task on context's thread asynchronously. | 100 virtual void postTask(PassOwnPtr<ExecutionContextTask>) OVERRIDE FINAL; // Executes the task on context's thread asynchronously. |
91 | 101 |
92 // WorkerGlobalScope | 102 // WorkerGlobalScope |
93 WorkerGlobalScope* self() { return this; } | 103 WorkerGlobalScope* self() { return this; } |
94 WorkerConsole* console(); | 104 WorkerConsole* console(); |
95 WorkerLocation* location() const; | 105 WorkerLocation* location() const; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
161 WorkerThread* m_thread; | 171 WorkerThread* m_thread; |
162 | 172 |
163 OwnPtr<WorkerInspectorController> m_workerInspectorController; | 173 OwnPtr<WorkerInspectorController> m_workerInspectorController; |
164 bool m_closing; | 174 bool m_closing; |
165 | 175 |
166 OwnPtr<WorkerEventQueue> m_eventQueue; | 176 OwnPtr<WorkerEventQueue> m_eventQueue; |
167 | 177 |
168 OwnPtrWillBeMember<WorkerClients> m_workerClients; | 178 OwnPtrWillBeMember<WorkerClients> m_workerClients; |
169 | 179 |
170 double m_timeOrigin; | 180 double m_timeOrigin; |
181 TerminationObserver* m_terminationObserver; | |
171 }; | 182 }; |
172 | 183 |
173 DEFINE_TYPE_CASTS(WorkerGlobalScope, ExecutionContext, context, context->isWorke rGlobalScope(), context.isWorkerGlobalScope()); | 184 DEFINE_TYPE_CASTS(WorkerGlobalScope, ExecutionContext, context, context->isWorke rGlobalScope(), context.isWorkerGlobalScope()); |
174 | 185 |
175 } // namespace WebCore | 186 } // namespace WebCore |
176 | 187 |
177 #endif // WorkerGlobalScope_h | 188 #endif // WorkerGlobalScope_h |
OLD | NEW |