Chromium Code Reviews| Index: Source/core/html/track/DataCue.h |
| diff --git a/Source/modules/performance/SharedWorkerPerformance.h b/Source/core/html/track/DataCue.h |
| similarity index 57% |
| copy from Source/modules/performance/SharedWorkerPerformance.h |
| copy to Source/core/html/track/DataCue.h |
| index 0fcf977550b9b81accfd084957438e39be8c3931..5b0d1b51b93250cc925328f4da32ad0776ce9d7b 100644 |
| --- a/Source/modules/performance/SharedWorkerPerformance.h |
| +++ b/Source/core/html/track/DataCue.h |
| @@ -1,5 +1,5 @@ |
| /* |
| - * Copyright (c) 2014, Opera Software ASA. All rights reserved. |
| + * Copyright (c) 2014, CableLabs Inc. All rights reserved. |
|
acolwell GONE FROM CHROMIUM
2014/04/04 23:25:27
nit: New files should have the Chromium header men
|
| * |
| * Redistribution and use in source and binary forms, with or without |
| * modification, are permitted provided that the following conditions |
| @@ -27,34 +27,49 @@ |
| * OF THE POSSIBILITY OF SUCH DAMAGE. |
| */ |
| -#ifndef SharedWorkerPerformance_h |
| -#define SharedWorkerPerformance_h |
| +#ifndef DataCue_h |
| +#define DataCue_h |
| -#include "heap/Handle.h" |
| -#include "platform/Supplementable.h" |
| +#include "bindings/v8/ScriptWrappable.h" |
| +#include "core/html/track/TextTrackCue.h" |
| +#include "wtf/ArrayBuffer.h" |
| namespace WebCore { |
| class ExecutionContext; |
| -class SharedWorker; |
| -class SharedWorkerPerformance FINAL : public NoBaseWillBeGarbageCollected<SharedWorkerPerformance>, public WillBeHeapSupplement<SharedWorker> { |
| - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SharedWorkerPerformance); |
| +class DataCue FINAL : public TextTrackCue, public ScriptWrappable { |
| public: |
| - static SharedWorkerPerformance& from(SharedWorker&); |
| + static PassRefPtr<DataCue> create(ExecutionContext* context, double start, double end, ArrayBuffer* data, ExceptionState& exceptionState) |
| + { |
| + return adoptRef(new DataCue(context, start, end, data, exceptionState)); |
|
sof
2014/04/04 19:11:31
Argument validation could with benefit be put here
Brendan Long
2014/04/04 19:37:51
The check is already done in setData() (which is u
|
| + } |
| - static double workerStart(ExecutionContext*, SharedWorker&); |
| - double getWorkerStart(ExecutionContext*, SharedWorker&) const; |
| + virtual ~DataCue(); |
| - void trace(Visitor*) { } |
| + PassRefPtr<ArrayBuffer> data() const; |
| + void setData(ArrayBuffer*, ExceptionState&); |
| + String text(bool& isNull) const; |
| -private: |
| - explicit SharedWorkerPerformance(); |
| - static const char* supplementName(); |
| + virtual CueType cueType() const OVERRIDE { return Data; } |
| + |
| + virtual ExecutionContext* executionContext() const OVERRIDE; |
| + |
| +#ifndef NDEBUG |
| + virtual String toString() const OVERRIDE; |
| +#endif |
| - double m_timeOrigin; |
| +protected: |
| + DataCue(ExecutionContext*, double start, double end, ArrayBuffer*, ExceptionState&); |
| + |
| +private: |
| + ExecutionContext* m_executionContext; |
| + RefPtr<ArrayBuffer> m_data; |
| }; |
| +// DataCue is currently the only TextTrackCue subclass. |
|
acolwell GONE FROM CHROMIUM
2014/04/04 23:25:27
nit: Remove comment since it is a lie. :)
|
| +DEFINE_TYPE_CASTS(DataCue, TextTrackCue, cue, cue->cueType() == TextTrackCue::Data, cue.cueType() == TextTrackCue::Data); |
| + |
| } // namespace WebCore |
| -#endif // SharedWorkerPerformance_h |
| +#endif |