| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MediaRecorder_h | 5 #ifndef MediaRecorder_h |
| 6 #define MediaRecorder_h | 6 #define MediaRecorder_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ActiveScriptWrappable.h" |
| 8 #include "core/dom/ActiveDOMObject.h" | 9 #include "core/dom/ActiveDOMObject.h" |
| 9 #include "core/events/EventTarget.h" | 10 #include "core/events/EventTarget.h" |
| 10 #include "modules/EventTargetModules.h" | 11 #include "modules/EventTargetModules.h" |
| 11 #include "modules/ModulesExport.h" | 12 #include "modules/ModulesExport.h" |
| 12 #include "modules/mediarecorder/MediaRecorderOptions.h" | 13 #include "modules/mediarecorder/MediaRecorderOptions.h" |
| 13 #include "modules/mediastream/MediaStream.h" | 14 #include "modules/mediastream/MediaStream.h" |
| 14 #include "platform/AsyncMethodRunner.h" | 15 #include "platform/AsyncMethodRunner.h" |
| 15 #include "public/platform/WebMediaRecorderHandler.h" | 16 #include "public/platform/WebMediaRecorderHandler.h" |
| 16 #include "public/platform/WebMediaRecorderHandlerClient.h" | 17 #include "public/platform/WebMediaRecorderHandlerClient.h" |
| 17 | 18 |
| 18 namespace blink { | 19 namespace blink { |
| 19 | 20 |
| 20 class Blob; | 21 class Blob; |
| 21 class BlobData; | 22 class BlobData; |
| 22 class ExceptionState; | 23 class ExceptionState; |
| 23 | 24 |
| 24 class MODULES_EXPORT MediaRecorder final | 25 class MODULES_EXPORT MediaRecorder final |
| 25 : public RefCountedGarbageCollectedEventTargetWithInlineData<MediaRecorder> | 26 : public RefCountedGarbageCollectedEventTargetWithInlineData<MediaRecorder> |
| 26 , public WebMediaRecorderHandlerClient | 27 , public WebMediaRecorderHandlerClient |
| 28 , public ActiveScriptWrappable |
| 27 , public ActiveDOMObject { | 29 , public ActiveDOMObject { |
| 28 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(MediaRecorder); | 30 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(MediaRecorder); |
| 29 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaRecorder); | 31 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaRecorder); |
| 30 DEFINE_WRAPPERTYPEINFO(); | 32 DEFINE_WRAPPERTYPEINFO(); |
| 31 public: | 33 public: |
| 32 enum class State { | 34 enum class State { |
| 33 Inactive = 0, | 35 Inactive = 0, |
| 34 Recording, | 36 Recording, |
| 35 Paused | 37 Paused |
| 36 }; | 38 }; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 65 static bool isTypeSupported(const String& type); | 67 static bool isTypeSupported(const String& type); |
| 66 | 68 |
| 67 // EventTarget | 69 // EventTarget |
| 68 const AtomicString& interfaceName() const override; | 70 const AtomicString& interfaceName() const override; |
| 69 ExecutionContext* getExecutionContext() const override; | 71 ExecutionContext* getExecutionContext() const override; |
| 70 | 72 |
| 71 // ActiveDOMObject | 73 // ActiveDOMObject |
| 72 void suspend() override; | 74 void suspend() override; |
| 73 void resume() override; | 75 void resume() override; |
| 74 void stop() override; | 76 void stop() override; |
| 75 bool hasPendingActivity() const override { return !m_stopped; } | 77 |
| 78 // ActiveScriptWrappable |
| 79 bool hasPendingActivity() const final { return !m_stopped; } |
| 76 | 80 |
| 77 // WebMediaRecorderHandlerClient | 81 // WebMediaRecorderHandlerClient |
| 78 void writeData(const char* data, size_t length, bool lastInSlice) override; | 82 void writeData(const char* data, size_t length, bool lastInSlice) override; |
| 79 void onError(const WebString& message) override; | 83 void onError(const WebString& message) override; |
| 80 | 84 |
| 81 DECLARE_VIRTUAL_TRACE(); | 85 DECLARE_VIRTUAL_TRACE(); |
| 82 | 86 |
| 83 private: | 87 private: |
| 84 MediaRecorder(ExecutionContext*, MediaStream*, const MediaRecorderOptions&,
ExceptionState&); | 88 MediaRecorder(ExecutionContext*, MediaStream*, const MediaRecorderOptions&,
ExceptionState&); |
| 85 | 89 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 103 | 107 |
| 104 OwnPtr<WebMediaRecorderHandler> m_recorderHandler; | 108 OwnPtr<WebMediaRecorderHandler> m_recorderHandler; |
| 105 | 109 |
| 106 Member<AsyncMethodRunner<MediaRecorder>> m_dispatchScheduledEventRunner; | 110 Member<AsyncMethodRunner<MediaRecorder>> m_dispatchScheduledEventRunner; |
| 107 WillBeHeapVector<RefPtrWillBeMember<Event>> m_scheduledEvents; | 111 WillBeHeapVector<RefPtrWillBeMember<Event>> m_scheduledEvents; |
| 108 }; | 112 }; |
| 109 | 113 |
| 110 } // namespace blink | 114 } // namespace blink |
| 111 | 115 |
| 112 #endif // MediaRecorder_h | 116 #endif // MediaRecorder_h |
| OLD | NEW |