OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // An extremely simple implementation of DataSource that downloads the entire | 5 // An extremely simple implementation of DataSource that downloads the entire |
6 // media resource into memory before signaling that initialization has finished. | 6 // media resource into memory before signaling that initialization has finished. |
7 // Primarily used to test <audio> and <video> with buffering/caching removed | 7 // Primarily used to test <audio> and <video> with buffering/caching removed |
8 // from the equation. | 8 // from the equation. |
9 | 9 |
10 #ifndef WEBKIT_MEDIA_SIMPLE_DATA_SOURCE_H_ | 10 #ifndef WEBKIT_MEDIA_SIMPLE_DATA_SOURCE_H_ |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 86 |
87 // webkit_glue::WebDataSource implementation. | 87 // webkit_glue::WebDataSource implementation. |
88 virtual void Initialize(const GURL& url, | 88 virtual void Initialize(const GURL& url, |
89 const media::PipelineStatusCB& callback) OVERRIDE; | 89 const media::PipelineStatusCB& callback) OVERRIDE; |
90 virtual bool HasSingleOrigin() OVERRIDE; | 90 virtual bool HasSingleOrigin() OVERRIDE; |
91 virtual void Abort() OVERRIDE; | 91 virtual void Abort() OVERRIDE; |
92 | 92 |
93 private: | 93 private: |
94 // Cancels and deletes the resource loading on the render thread. | 94 // Cancels and deletes the resource loading on the render thread. |
95 void CancelTask(); | 95 void CancelTask(); |
| 96 void CancelTask_Locked(); |
96 | 97 |
97 // Perform initialization completion tasks under a lock. | 98 // Perform initialization completion tasks under a lock. |
98 void DoneInitialization_Locked(bool success); | 99 void DoneInitialization_Locked(bool success); |
99 | 100 |
100 // Update host() stats like total bytes & buffered bytes. | 101 // Update host() stats like total bytes & buffered bytes. |
101 void UpdateHostState(); | 102 void UpdateHostState(); |
102 | 103 |
103 // Primarily used for asserting the bridge is loading on the render thread. | 104 // Primarily used for asserting the bridge is loading on the render thread. |
104 MessageLoop* render_loop_; | 105 MessageLoop* render_loop_; |
105 | 106 |
(...skipping 25 matching lines...) Expand all Loading... |
131 | 132 |
132 // Used to ensure mocks for unittests are used instead of reset in Start(). | 133 // Used to ensure mocks for unittests are used instead of reset in Start(). |
133 bool keep_test_loader_; | 134 bool keep_test_loader_; |
134 | 135 |
135 DISALLOW_COPY_AND_ASSIGN(SimpleDataSource); | 136 DISALLOW_COPY_AND_ASSIGN(SimpleDataSource); |
136 }; | 137 }; |
137 | 138 |
138 } // namespace webkit_media | 139 } // namespace webkit_media |
139 | 140 |
140 #endif // WEBKIT_MEDIA_SIMPLE_DATA_SOURCE_H_ | 141 #endif // WEBKIT_MEDIA_SIMPLE_DATA_SOURCE_H_ |
OLD | NEW |