Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: third_party/WebKit/Source/modules/mediasource/SourceBuffer.h

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: First attempt to land. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 22 matching lines...) Expand all
33 33
34 #include "bindings/core/v8/ActiveScriptWrappable.h" 34 #include "bindings/core/v8/ActiveScriptWrappable.h"
35 #include "core/dom/ActiveDOMObject.h" 35 #include "core/dom/ActiveDOMObject.h"
36 #include "core/fileapi/FileReaderLoaderClient.h" 36 #include "core/fileapi/FileReaderLoaderClient.h"
37 #include "modules/EventTargetModules.h" 37 #include "modules/EventTargetModules.h"
38 #include "modules/mediasource/TrackDefaultList.h" 38 #include "modules/mediasource/TrackDefaultList.h"
39 #include "platform/AsyncMethodRunner.h" 39 #include "platform/AsyncMethodRunner.h"
40 #include "platform/weborigin/KURL.h" 40 #include "platform/weborigin/KURL.h"
41 #include "public/platform/WebSourceBufferClient.h" 41 #include "public/platform/WebSourceBufferClient.h"
42 #include "wtf/text/WTFString.h" 42 #include "wtf/text/WTFString.h"
43 #include <memory>
43 44
44 namespace blink { 45 namespace blink {
45 46
46 class AudioTrackList; 47 class AudioTrackList;
47 class DOMArrayBuffer; 48 class DOMArrayBuffer;
48 class DOMArrayBufferView; 49 class DOMArrayBufferView;
49 class ExceptionState; 50 class ExceptionState;
50 class FileReaderLoader; 51 class FileReaderLoader;
51 class GenericEventQueue; 52 class GenericEventQueue;
52 class MediaSource; 53 class MediaSource;
53 class Stream; 54 class Stream;
54 class TimeRanges; 55 class TimeRanges;
55 class VideoTrackList; 56 class VideoTrackList;
56 class WebSourceBuffer; 57 class WebSourceBuffer;
57 58
58 class SourceBuffer final 59 class SourceBuffer final
59 : public EventTargetWithInlineData 60 : public EventTargetWithInlineData
60 , public ActiveScriptWrappable 61 , public ActiveScriptWrappable
61 , public ActiveDOMObject 62 , public ActiveDOMObject
62 , public FileReaderLoaderClient 63 , public FileReaderLoaderClient
63 , public WebSourceBufferClient { 64 , public WebSourceBufferClient {
64 USING_GARBAGE_COLLECTED_MIXIN(SourceBuffer); 65 USING_GARBAGE_COLLECTED_MIXIN(SourceBuffer);
65 DEFINE_WRAPPERTYPEINFO(); 66 DEFINE_WRAPPERTYPEINFO();
66 USING_PRE_FINALIZER(SourceBuffer, dispose); 67 USING_PRE_FINALIZER(SourceBuffer, dispose);
67 public: 68 public:
68 static SourceBuffer* create(PassOwnPtr<WebSourceBuffer>, MediaSource*, Gener icEventQueue*); 69 static SourceBuffer* create(std::unique_ptr<WebSourceBuffer>, MediaSource*, GenericEventQueue*);
69 static const AtomicString& segmentsKeyword(); 70 static const AtomicString& segmentsKeyword();
70 static const AtomicString& sequenceKeyword(); 71 static const AtomicString& sequenceKeyword();
71 72
72 ~SourceBuffer() override; 73 ~SourceBuffer() override;
73 74
74 // SourceBuffer.idl methods 75 // SourceBuffer.idl methods
75 const AtomicString& mode() const { return m_mode; } 76 const AtomicString& mode() const { return m_mode; }
76 void setMode(const AtomicString&, ExceptionState&); 77 void setMode(const AtomicString&, ExceptionState&);
77 bool updating() const { return m_updating; } 78 bool updating() const { return m_updating; }
78 TimeRanges* buffered(ExceptionState&) const; 79 TimeRanges* buffered(ExceptionState&) const;
(...skipping 29 matching lines...) Expand all
108 // EventTarget interface 109 // EventTarget interface
109 ExecutionContext* getExecutionContext() const override; 110 ExecutionContext* getExecutionContext() const override;
110 const AtomicString& interfaceName() const override; 111 const AtomicString& interfaceName() const override;
111 112
112 // WebSourceBufferClient interface 113 // WebSourceBufferClient interface
113 WebVector<WebMediaPlayer::TrackId> initializationSegmentReceived(const WebVe ctor<MediaTrackInfo>&) override; 114 WebVector<WebMediaPlayer::TrackId> initializationSegmentReceived(const WebVe ctor<MediaTrackInfo>&) override;
114 115
115 DECLARE_VIRTUAL_TRACE(); 116 DECLARE_VIRTUAL_TRACE();
116 117
117 private: 118 private:
118 SourceBuffer(PassOwnPtr<WebSourceBuffer>, MediaSource*, GenericEventQueue*); 119 SourceBuffer(std::unique_ptr<WebSourceBuffer>, MediaSource*, GenericEventQue ue*);
119 void dispose(); 120 void dispose();
120 121
121 bool isRemoved() const; 122 bool isRemoved() const;
122 void scheduleEvent(const AtomicString& eventName); 123 void scheduleEvent(const AtomicString& eventName);
123 124
124 bool prepareAppend(size_t newDataSize, ExceptionState&); 125 bool prepareAppend(size_t newDataSize, ExceptionState&);
125 bool evictCodedFrames(size_t newDataSize); 126 bool evictCodedFrames(size_t newDataSize);
126 void appendBufferInternal(const unsigned char*, unsigned, ExceptionState&); 127 void appendBufferInternal(const unsigned char*, unsigned, ExceptionState&);
127 void appendBufferAsyncPart(); 128 void appendBufferAsyncPart();
128 void appendError(bool decodeError); 129 void appendError(bool decodeError);
129 130
130 void removeAsyncPart(); 131 void removeAsyncPart();
131 132
132 void appendStreamInternal(Stream*, ExceptionState&); 133 void appendStreamInternal(Stream*, ExceptionState&);
133 void appendStreamAsyncPart(); 134 void appendStreamAsyncPart();
134 void appendStreamDone(bool success); 135 void appendStreamDone(bool success);
135 void clearAppendStreamState(); 136 void clearAppendStreamState();
136 137
137 void removeMediaTracks(); 138 void removeMediaTracks();
138 139
139 // FileReaderLoaderClient interface 140 // FileReaderLoaderClient interface
140 void didStartLoading() override; 141 void didStartLoading() override;
141 void didReceiveDataForClient(const char* data, unsigned dataLength) override ; 142 void didReceiveDataForClient(const char* data, unsigned dataLength) override ;
142 void didFinishLoading() override; 143 void didFinishLoading() override;
143 void didFail(FileError::ErrorCode) override; 144 void didFail(FileError::ErrorCode) override;
144 145
145 OwnPtr<WebSourceBuffer> m_webSourceBuffer; 146 std::unique_ptr<WebSourceBuffer> m_webSourceBuffer;
146 Member<MediaSource> m_source; 147 Member<MediaSource> m_source;
147 Member<TrackDefaultList> m_trackDefaults; 148 Member<TrackDefaultList> m_trackDefaults;
148 Member<GenericEventQueue> m_asyncEventQueue; 149 Member<GenericEventQueue> m_asyncEventQueue;
149 150
150 AtomicString m_mode; 151 AtomicString m_mode;
151 bool m_updating; 152 bool m_updating;
152 double m_timestampOffset; 153 double m_timestampOffset;
153 Member<AudioTrackList> m_audioTracks; 154 Member<AudioTrackList> m_audioTracks;
154 Member<VideoTrackList> m_videoTracks; 155 Member<VideoTrackList> m_videoTracks;
155 double m_appendWindowStart; 156 double m_appendWindowStart;
156 double m_appendWindowEnd; 157 double m_appendWindowEnd;
157 bool m_firstInitializationSegmentReceived; 158 bool m_firstInitializationSegmentReceived;
158 159
159 Vector<unsigned char> m_pendingAppendData; 160 Vector<unsigned char> m_pendingAppendData;
160 size_t m_pendingAppendDataOffset; 161 size_t m_pendingAppendDataOffset;
161 Member<AsyncMethodRunner<SourceBuffer>> m_appendBufferAsyncPartRunner; 162 Member<AsyncMethodRunner<SourceBuffer>> m_appendBufferAsyncPartRunner;
162 163
163 double m_pendingRemoveStart; 164 double m_pendingRemoveStart;
164 double m_pendingRemoveEnd; 165 double m_pendingRemoveEnd;
165 Member<AsyncMethodRunner<SourceBuffer>> m_removeAsyncPartRunner; 166 Member<AsyncMethodRunner<SourceBuffer>> m_removeAsyncPartRunner;
166 167
167 bool m_streamMaxSizeValid; 168 bool m_streamMaxSizeValid;
168 unsigned long long m_streamMaxSize; 169 unsigned long long m_streamMaxSize;
169 Member<AsyncMethodRunner<SourceBuffer>> m_appendStreamAsyncPartRunner; 170 Member<AsyncMethodRunner<SourceBuffer>> m_appendStreamAsyncPartRunner;
170 Member<Stream> m_stream; 171 Member<Stream> m_stream;
171 OwnPtr<FileReaderLoader> m_loader; 172 std::unique_ptr<FileReaderLoader> m_loader;
172 }; 173 };
173 174
174 } // namespace blink 175 } // namespace blink
175 176
176 #endif // SourceBuffer_h 177 #endif // SourceBuffer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698