Chromium Code Reviews| Index: Source/core/wawwa/RemotePlayer.h |
| diff --git a/Source/core/workers/DedicatedWorkerThread.cpp b/Source/core/wawwa/RemotePlayer.h |
| similarity index 52% |
| copy from Source/core/workers/DedicatedWorkerThread.cpp |
| copy to Source/core/wawwa/RemotePlayer.h |
| index 1e253243e7b6043703bebf7f5d7c75b85d0c9ddd..83aa7550b3b9d55041117102d11b7945ac7f4d19 100644 |
| --- a/Source/core/workers/DedicatedWorkerThread.cpp |
| +++ b/Source/core/wawwa/RemotePlayer.h |
| @@ -1,5 +1,5 @@ |
| /* |
| - * Copyright (C) 2009 Google Inc. All rights reserved. |
| + * Copyright (C) 2014 Google Inc. All rights reserved. |
| * |
| * Redistribution and use in source and binary forms, with or without |
| * modification, are permitted provided that the following conditions are |
| @@ -28,42 +28,56 @@ |
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| */ |
| -#include "config.h" |
| - |
| -#include "core/workers/DedicatedWorkerThread.h" |
| +#ifndef RemotePlayer_h |
| +#define RemotePlayer_h |
| +#include "bindings/core/v8/Dictionary.h" |
| +#include "core/animation/AnimationEffect.h" |
| +#include "core/animation/AnimationTestHelper.h" |
| +#include "core/animation/TimingInput.h" |
| +#include "core/css/parser/BisonCSSParser.h" |
| +#include "core/css/resolver/CSSToStyleMap.h" |
| +#include "core/dom/CrossThreadTask.h" |
| +#include "core/dom/Document.h" |
| +#include "core/wawwa/ProxyKeyframe.h" |
| #include "core/workers/DedicatedWorkerGlobalScope.h" |
| +#include "core/workers/DedicatedWorkerThread.h" |
| +#include "core/workers/Worker.h" |
| #include "core/workers/WorkerObjectProxy.h" |
| -#include "core/workers/WorkerThreadStartupData.h" |
| +#include "wtf/text/WTFString.h" |
| namespace blink { |
| -PassRefPtr<DedicatedWorkerThread> DedicatedWorkerThread::create(WorkerLoaderProxy& workerLoaderProxy, WorkerObjectProxy& workerObjectProxy, double timeOrigin, PassOwnPtrWillBeRawPtr<WorkerThreadStartupData> startupData) |
| -{ |
| - return adoptRef(new DedicatedWorkerThread(workerLoaderProxy, workerObjectProxy, timeOrigin, startupData)); |
| -} |
| +class Dictionary; |
| +class ExceptionState; |
| -DedicatedWorkerThread::DedicatedWorkerThread(WorkerLoaderProxy& workerLoaderProxy, WorkerObjectProxy& workerObjectProxy, double timeOrigin, PassOwnPtrWillBeRawPtr<WorkerThreadStartupData> startupData) |
| - : WorkerThread(workerLoaderProxy, workerObjectProxy, startupData) |
| - , m_workerObjectProxy(workerObjectProxy) |
| - , m_timeOrigin(timeOrigin) |
| -{ |
| -} |
| +class RemotePlayer FINAL : public RefCountedWillBeRefCountedGarbageCollected<RemotePlayer> { |
| -DedicatedWorkerThread::~DedicatedWorkerThread() |
| -{ |
| -} |
| +public: |
| + RemotePlayer(String inputID, PassRefPtr<DedicatedWorkerGlobalScope>, const Vector<ProxyKeyframe> keyframes, const Timing timingInputDictionary); |
| + static PassRefPtrWillBeRawPtr<RemotePlayer> create(String inputID, PassRefPtr<DedicatedWorkerGlobalScope>, const Vector<ProxyKeyframe> keyframes, const Timing timingInputDictionary); |
| + void pause(ExceptionState&); |
| + void play(ExceptionState&); |
| + void cancel(ExceptionState&); |
| + void finish(ExceptionState&); |
| + void reverse(ExceptionState&); |
| + void setStartTime(double val) |
|
dstockwell
2014/08/29 01:05:44
Trivial functions like this a better written on a
nainar1
2014/08/29 06:01:40
Acknowledged.
|
| + { |
| + startTime = val; |
| + } |
| + double getStartTime() |
| + { |
| + return startTime; |
| + } |
| + RefPtr<DedicatedWorkerGlobalScope> m_workerGlobalScope; |
| -PassRefPtrWillBeRawPtr<WorkerGlobalScope> DedicatedWorkerThread::createWorkerGlobalScope(PassOwnPtrWillBeRawPtr<WorkerThreadStartupData> startupData) |
| -{ |
| - return DedicatedWorkerGlobalScope::create(this, startupData, m_timeOrigin); |
| -} |
| - |
| -void DedicatedWorkerThread::runEventLoop() |
| -{ |
| - // Notify the parent object of our current active state before calling the superclass to run the event loop. |
| - m_workerObjectProxy.reportPendingActivity(workerGlobalScope()->hasPendingActivity()); |
| - WorkerThread::runEventLoop(); |
| -} |
| +private: |
| + String m_id; |
| + double startTime; |
| + Vector<ProxyKeyframe> m_keyframes; |
| + Timing m_timingInputDictionary; |
| +}; |
| } // namespace blink |
| + |
| +#endif |