| 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) 2009, 2011 Google Inc. All Rights Reserved. | 3 * Copyright (C) 2009, 2011 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 | 84 |
| 85 virtual bool isCleanupTask() const { return true; } | 85 virtual bool isCleanupTask() const { return true; } |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 WorkerContext::WorkerContext(const KURL& url, const String& userAgent, PassOwnPt
r<GroupSettings> settings, WorkerThread* thread, PassRefPtr<SecurityOrigin> topO
rigin) | 88 WorkerContext::WorkerContext(const KURL& url, const String& userAgent, PassOwnPt
r<GroupSettings> settings, WorkerThread* thread, PassRefPtr<SecurityOrigin> topO
rigin) |
| 89 : m_url(url) | 89 : m_url(url) |
| 90 , m_userAgent(userAgent) | 90 , m_userAgent(userAgent) |
| 91 , m_groupSettings(settings) | 91 , m_groupSettings(settings) |
| 92 , m_script(adoptPtr(new WorkerScriptController(this))) | 92 , m_script(adoptPtr(new WorkerScriptController(this))) |
| 93 , m_thread(thread) | 93 , m_thread(thread) |
| 94 #if ENABLE(INSPECTOR) | |
| 95 , m_workerInspectorController(adoptPtr(new WorkerInspectorController(this))) | 94 , m_workerInspectorController(adoptPtr(new WorkerInspectorController(this))) |
| 96 #endif | |
| 97 , m_closing(false) | 95 , m_closing(false) |
| 98 , m_eventQueue(WorkerEventQueue::create(this)) | 96 , m_eventQueue(WorkerEventQueue::create(this)) |
| 99 , m_topOrigin(topOrigin) | 97 , m_topOrigin(topOrigin) |
| 100 { | 98 { |
| 101 setSecurityOrigin(SecurityOrigin::create(url)); | 99 setSecurityOrigin(SecurityOrigin::create(url)); |
| 102 } | 100 } |
| 103 | 101 |
| 104 WorkerContext::~WorkerContext() | 102 WorkerContext::~WorkerContext() |
| 105 { | 103 { |
| 106 ASSERT(currentThread() == thread()->threadID()); | 104 ASSERT(currentThread() == thread()->threadID()); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 int WorkerContext::setTimeout(PassOwnPtr<ScheduledAction> action, int timeout) | 202 int WorkerContext::setTimeout(PassOwnPtr<ScheduledAction> action, int timeout) |
| 205 { | 203 { |
| 206 return DOMTimer::install(scriptExecutionContext(), action, timeout, true); | 204 return DOMTimer::install(scriptExecutionContext(), action, timeout, true); |
| 207 } | 205 } |
| 208 | 206 |
| 209 void WorkerContext::clearTimeout(int timeoutId) | 207 void WorkerContext::clearTimeout(int timeoutId) |
| 210 { | 208 { |
| 211 DOMTimer::removeById(scriptExecutionContext(), timeoutId); | 209 DOMTimer::removeById(scriptExecutionContext(), timeoutId); |
| 212 } | 210 } |
| 213 | 211 |
| 214 #if ENABLE(INSPECTOR) | |
| 215 void WorkerContext::clearInspector() | 212 void WorkerContext::clearInspector() |
| 216 { | 213 { |
| 217 m_workerInspectorController.clear(); | 214 m_workerInspectorController.clear(); |
| 218 } | 215 } |
| 219 #endif | |
| 220 | 216 |
| 221 int WorkerContext::setInterval(PassOwnPtr<ScheduledAction> action, int timeout) | 217 int WorkerContext::setInterval(PassOwnPtr<ScheduledAction> action, int timeout) |
| 222 { | 218 { |
| 223 return DOMTimer::install(scriptExecutionContext(), action, timeout, false); | 219 return DOMTimer::install(scriptExecutionContext(), action, timeout, false); |
| 224 } | 220 } |
| 225 | 221 |
| 226 void WorkerContext::clearInterval(int timeoutId) | 222 void WorkerContext::clearInterval(int timeoutId) |
| 227 { | 223 { |
| 228 DOMTimer::removeById(scriptExecutionContext(), timeoutId); | 224 DOMTimer::removeById(scriptExecutionContext(), timeoutId); |
| 229 } | 225 } |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 } | 372 } |
| 377 | 373 |
| 378 WorkerEventQueue* WorkerContext::eventQueue() const | 374 WorkerEventQueue* WorkerContext::eventQueue() const |
| 379 { | 375 { |
| 380 return m_eventQueue.get(); | 376 return m_eventQueue.get(); |
| 381 } | 377 } |
| 382 | 378 |
| 383 } // namespace WebCore | 379 } // namespace WebCore |
| 384 | 380 |
| 385 #endif // ENABLE(WORKERS) | 381 #endif // ENABLE(WORKERS) |
| OLD | NEW |