| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2010 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008, 2010 Apple Inc. All Rights Reserved. |
| 3 * Copyright (C) 2009 Google Inc. All Rights Reserved. | 3 * Copyright (C) 2009 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 30 matching lines...) Expand all Loading... |
| 41 #include "core/page/Frame.h" | 41 #include "core/page/Frame.h" |
| 42 #include "core/page/UseCounter.h" | 42 #include "core/page/UseCounter.h" |
| 43 #include "core/workers/WorkerContextProxy.h" | 43 #include "core/workers/WorkerContextProxy.h" |
| 44 #include "core/workers/WorkerScriptLoader.h" | 44 #include "core/workers/WorkerScriptLoader.h" |
| 45 #include "core/workers/WorkerThread.h" | 45 #include "core/workers/WorkerThread.h" |
| 46 #include "wtf/MainThread.h" | 46 #include "wtf/MainThread.h" |
| 47 | 47 |
| 48 namespace WebCore { | 48 namespace WebCore { |
| 49 | 49 |
| 50 inline Worker::Worker(ScriptExecutionContext* context) | 50 inline Worker::Worker(ScriptExecutionContext* context) |
| 51 : AbstractWorker(context) | 51 : ActiveDOMObject(context) |
| 52 , m_contextProxy(WorkerContextProxy::create(this)) | 52 , m_contextProxy(WorkerContextProxy::create(this)) |
| 53 { | 53 { |
| 54 ScriptWrappable::init(this); | 54 ScriptWrappable::init(this); |
| 55 } | 55 } |
| 56 | 56 |
| 57 PassRefPtr<Worker> Worker::create(ScriptExecutionContext* context, const String&
url, ExceptionCode& ec) | 57 PassRefPtr<Worker> Worker::create(ScriptExecutionContext* context, const String&
url, ExceptionCode& ec) |
| 58 { | 58 { |
| 59 ASSERT(isMainThread()); | 59 ASSERT(isMainThread()); |
| 60 UseCounter::count(static_cast<Document*>(context)->domWindow(), UseCounter::
WorkerStart); | 60 UseCounter::count(static_cast<Document*>(context)->domWindow(), UseCounter::
WorkerStart); |
| 61 | 61 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 if (InspectorInstrumentation::shouldPauseDedicatedWorkerOnStart(scriptEx
ecutionContext())) | 132 if (InspectorInstrumentation::shouldPauseDedicatedWorkerOnStart(scriptEx
ecutionContext())) |
| 133 startMode = PauseWorkerContextOnStart; | 133 startMode = PauseWorkerContextOnStart; |
| 134 m_contextProxy->startWorkerContext(m_scriptLoader->url(), scriptExecutio
nContext()->userAgent(m_scriptLoader->url()), m_scriptLoader->script(), startMod
e); | 134 m_contextProxy->startWorkerContext(m_scriptLoader->url(), scriptExecutio
nContext()->userAgent(m_scriptLoader->url()), m_scriptLoader->script(), startMod
e); |
| 135 InspectorInstrumentation::scriptImported(scriptExecutionContext(), m_scr
iptLoader->identifier(), m_scriptLoader->script()); | 135 InspectorInstrumentation::scriptImported(scriptExecutionContext(), m_scr
iptLoader->identifier(), m_scriptLoader->script()); |
| 136 } | 136 } |
| 137 m_scriptLoader = nullptr; | 137 m_scriptLoader = nullptr; |
| 138 | 138 |
| 139 unsetPendingActivity(this); | 139 unsetPendingActivity(this); |
| 140 } | 140 } |
| 141 | 141 |
| 142 void Worker::contextDestroyed() |
| 143 { |
| 144 ActiveDOMObject::contextDestroyed(); |
| 145 } |
| 146 |
| 142 } // namespace WebCore | 147 } // namespace WebCore |
| OLD | NEW |