| 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 25 matching lines...) Expand all Loading... |
| 36 #include "core/frame/LocalDOMWindow.h" | 36 #include "core/frame/LocalDOMWindow.h" |
| 37 #include "core/frame/UseCounter.h" | 37 #include "core/frame/UseCounter.h" |
| 38 #include "core/workers/WorkerGlobalScopeProxy.h" | 38 #include "core/workers/WorkerGlobalScopeProxy.h" |
| 39 #include "core/workers/WorkerGlobalScopeProxyProvider.h" | 39 #include "core/workers/WorkerGlobalScopeProxyProvider.h" |
| 40 #include "core/workers/WorkerScriptLoader.h" | 40 #include "core/workers/WorkerScriptLoader.h" |
| 41 #include "core/workers/WorkerThread.h" | 41 #include "core/workers/WorkerThread.h" |
| 42 #include "wtf/MainThread.h" | 42 #include "wtf/MainThread.h" |
| 43 | 43 |
| 44 namespace blink { | 44 namespace blink { |
| 45 | 45 |
| 46 inline Worker::Worker(ExecutionContext* context) | 46 Worker::Worker(ExecutionContext* context) |
| 47 : AbstractWorker(context) | 47 : AbstractWorker(context) |
| 48 , m_contextProxy(nullptr) | 48 , m_contextProxy(nullptr) |
| 49 { | 49 { |
| 50 } | 50 } |
| 51 | 51 |
| 52 PassRefPtrWillBeRawPtr<Worker> Worker::create(ExecutionContext* context, const S
tring& url, ExceptionState& exceptionState) | 52 PassRefPtrWillBeRawPtr<Worker> Worker::create(ExecutionContext* context, const S
tring& url, ExceptionState& exceptionState) |
| 53 { | 53 { |
| 54 ASSERT(isMainThread()); | 54 ASSERT(isMainThread()); |
| 55 Document* document = toDocument(context); | 55 Document* document = toDocument(context); |
| 56 UseCounter::count(context, UseCounter::WorkerStart); | 56 UseCounter::count(context, UseCounter::WorkerStart); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 InspectorInstrumentation::scriptImported(executionContext(), m_scriptLoa
der->identifier(), m_scriptLoader->script()); | 134 InspectorInstrumentation::scriptImported(executionContext(), m_scriptLoa
der->identifier(), m_scriptLoader->script()); |
| 135 } | 135 } |
| 136 m_scriptLoader = nullptr; | 136 m_scriptLoader = nullptr; |
| 137 } | 137 } |
| 138 | 138 |
| 139 void Worker::trace(Visitor* visitor) | 139 void Worker::trace(Visitor* visitor) |
| 140 { | 140 { |
| 141 AbstractWorker::trace(visitor); | 141 AbstractWorker::trace(visitor); |
| 142 } | 142 } |
| 143 | 143 |
| 144 void Worker::initScriptLoader(ExecutionContext* context, const KURL& scriptURL) |
| 145 { |
| 146 m_scriptLoader = WorkerScriptLoader::create(); |
| 147 m_scriptLoader->loadAsynchronously(*context, scriptURL, DenyCrossOriginReque
sts, this); |
| 148 } |
| 149 |
| 150 void Worker::setContextProxy(WorkerGlobalScopeProxy* proxy) |
| 151 { |
| 152 m_contextProxy = proxy; |
| 153 } |
| 154 |
| 144 } // namespace blink | 155 } // namespace blink |
| OLD | NEW |