| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 virtual void performTask(ExecutionContext *context) | 66 virtual void performTask(ExecutionContext *context) |
| 67 { | 67 { |
| 68 WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context); | 68 WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context); |
| 69 // Notify parent that this context is closed. Parent is responsible for
calling WorkerThread::stop(). | 69 // Notify parent that this context is closed. Parent is responsible for
calling WorkerThread::stop(). |
| 70 workerGlobalScope->thread()->workerReportingProxy().workerGlobalScopeClo
sed(); | 70 workerGlobalScope->thread()->workerReportingProxy().workerGlobalScopeClo
sed(); |
| 71 } | 71 } |
| 72 | 72 |
| 73 virtual bool isCleanupTask() const { return true; } | 73 virtual bool isCleanupTask() const { return true; } |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 WorkerGlobalScope::WorkerGlobalScope(const KURL& url, const String& userAgent, W
orkerThread* thread, double timeOrigin, PassOwnPtr<WorkerClients> workerClients) | 76 WorkerGlobalScope::WorkerGlobalScope(const KURL& url, const String& userAgent, W
orkerThread* thread, double timeOrigin, const WorkerSettings& settings, PassOwnP
tr<WorkerClients> workerClients) |
| 77 : m_url(url) | 77 : m_url(url) |
| 78 , m_userAgent(userAgent) | 78 , m_userAgent(userAgent) |
| 79 , m_script(adoptPtr(new WorkerScriptController(*this))) | 79 , m_script(adoptPtr(new WorkerScriptController(*this))) |
| 80 , m_thread(thread) | 80 , m_thread(thread) |
| 81 , m_workerInspectorController(adoptPtr(new WorkerInspectorController(this))) | 81 , m_workerInspectorController(adoptPtr(new WorkerInspectorController(this))) |
| 82 , m_closing(false) | 82 , m_closing(false) |
| 83 , m_eventQueue(WorkerEventQueue::create(this)) | 83 , m_eventQueue(WorkerEventQueue::create(this)) |
| 84 , m_workerClients(workerClients) | 84 , m_workerClients(workerClients) |
| 85 , m_timeOrigin(timeOrigin) | 85 , m_timeOrigin(timeOrigin) |
| 86 , m_workerSettings(WorkerSettings::create()) |
| 86 { | 87 { |
| 87 ScriptWrappable::init(this); | 88 ScriptWrappable::init(this); |
| 88 setClient(this); | 89 setClient(this); |
| 89 setSecurityOrigin(SecurityOrigin::create(url)); | 90 setSecurityOrigin(SecurityOrigin::create(url)); |
| 91 m_workerSettings->setMemoryInfoEnabled(settings.memoryInfoEnabled()); |
| 90 m_workerClients->reattachThread(); | 92 m_workerClients->reattachThread(); |
| 91 } | 93 } |
| 92 | 94 |
| 93 WorkerGlobalScope::~WorkerGlobalScope() | 95 WorkerGlobalScope::~WorkerGlobalScope() |
| 94 { | 96 { |
| 95 ASSERT(thread()->isCurrentThread()); | 97 ASSERT(thread()->isCurrentThread()); |
| 96 | 98 |
| 97 // Make sure we have no observers. | 99 // Make sure we have no observers. |
| 98 notifyObserversOfStop(); | 100 notifyObserversOfStop(); |
| 99 | 101 |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 { | 326 { |
| 325 return script()->idleNotification(); | 327 return script()->idleNotification(); |
| 326 } | 328 } |
| 327 | 329 |
| 328 WorkerEventQueue* WorkerGlobalScope::eventQueue() const | 330 WorkerEventQueue* WorkerGlobalScope::eventQueue() const |
| 329 { | 331 { |
| 330 return m_eventQueue.get(); | 332 return m_eventQueue.get(); |
| 331 } | 333 } |
| 332 | 334 |
| 333 } // namespace WebCore | 335 } // namespace WebCore |
| OLD | NEW |