| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 MEDIA_BLINK_MULTIBUFFER_DATA_SOURCE_H_ | 5 #ifndef MEDIA_BLINK_MULTIBUFFER_DATA_SOURCE_H_ |
| 6 #define MEDIA_BLINK_MULTIBUFFER_DATA_SOURCE_H_ | 6 #define MEDIA_BLINK_MULTIBUFFER_DATA_SOURCE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> |
| 10 #include <string> | 11 #include <string> |
| 11 #include <vector> | 12 #include <vector> |
| 12 | 13 |
| 13 #include "base/callback.h" | 14 #include "base/callback.h" |
| 14 #include "base/macros.h" | 15 #include "base/macros.h" |
| 15 #include "base/memory/linked_ptr.h" | 16 #include "base/memory/linked_ptr.h" |
| 16 #include "base/memory/scoped_ptr.h" | |
| 17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 18 #include "base/synchronization/lock.h" | 18 #include "base/synchronization/lock.h" |
| 19 #include "media/base/data_source.h" | 19 #include "media/base/data_source.h" |
| 20 #include "media/base/ranges.h" | 20 #include "media/base/ranges.h" |
| 21 #include "media/blink/buffered_data_source.h" | 21 #include "media/blink/buffered_data_source.h" |
| 22 #include "media/blink/media_blink_export.h" | 22 #include "media/blink/media_blink_export.h" |
| 23 #include "media/blink/url_index.h" | 23 #include "media/blink/url_index.h" |
| 24 #include "url/gurl.h" | 24 #include "url/gurl.h" |
| 25 | 25 |
| 26 namespace base { | 26 namespace base { |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 // The task runner of the render thread. | 175 // The task runner of the render thread. |
| 176 const scoped_refptr<base::SingleThreadTaskRunner> render_task_runner_; | 176 const scoped_refptr<base::SingleThreadTaskRunner> render_task_runner_; |
| 177 | 177 |
| 178 // Shared cache. | 178 // Shared cache. |
| 179 linked_ptr<UrlIndex> url_index_; | 179 linked_ptr<UrlIndex> url_index_; |
| 180 | 180 |
| 181 // A webframe for loading. | 181 // A webframe for loading. |
| 182 blink::WebFrame* frame_; | 182 blink::WebFrame* frame_; |
| 183 | 183 |
| 184 // A resource reader for the media resource. | 184 // A resource reader for the media resource. |
| 185 scoped_ptr<MultiBufferReader> reader_; | 185 std::unique_ptr<MultiBufferReader> reader_; |
| 186 | 186 |
| 187 // Callback method from the pipeline for initialization. | 187 // Callback method from the pipeline for initialization. |
| 188 InitializeCB init_cb_; | 188 InitializeCB init_cb_; |
| 189 | 189 |
| 190 // Read parameters received from the Read() method call. Must be accessed | 190 // Read parameters received from the Read() method call. Must be accessed |
| 191 // under |lock_|. | 191 // under |lock_|. |
| 192 class ReadOperation; | 192 class ReadOperation; |
| 193 scoped_ptr<ReadOperation> read_op_; | 193 std::unique_ptr<ReadOperation> read_op_; |
| 194 | 194 |
| 195 // Protects |stop_signal_received_|, |read_op_| and |total_bytes_|. | 195 // Protects |stop_signal_received_|, |read_op_| and |total_bytes_|. |
| 196 base::Lock lock_; | 196 base::Lock lock_; |
| 197 | 197 |
| 198 // Whether we've been told to stop via Abort() or Stop(). | 198 // Whether we've been told to stop via Abort() or Stop(). |
| 199 bool stop_signal_received_; | 199 bool stop_signal_received_; |
| 200 | 200 |
| 201 // This variable is true when the user has requested the video to play at | 201 // This variable is true when the user has requested the video to play at |
| 202 // least once. | 202 // least once. |
| 203 bool media_has_played_; | 203 bool media_has_played_; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 // reaching into this class from multiple threads to attain a WeakPtr. | 242 // reaching into this class from multiple threads to attain a WeakPtr. |
| 243 base::WeakPtr<MultibufferDataSource> weak_ptr_; | 243 base::WeakPtr<MultibufferDataSource> weak_ptr_; |
| 244 base::WeakPtrFactory<MultibufferDataSource> weak_factory_; | 244 base::WeakPtrFactory<MultibufferDataSource> weak_factory_; |
| 245 | 245 |
| 246 DISALLOW_COPY_AND_ASSIGN(MultibufferDataSource); | 246 DISALLOW_COPY_AND_ASSIGN(MultibufferDataSource); |
| 247 }; | 247 }; |
| 248 | 248 |
| 249 } // namespace media | 249 } // namespace media |
| 250 | 250 |
| 251 #endif // MEDIA_BLINK_MULTIBUFFER_DATA_SOURCE_H_ | 251 #endif // MEDIA_BLINK_MULTIBUFFER_DATA_SOURCE_H_ |
| OLD | NEW |