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 MEDIA_BLINK_RESOURCE_MULTIBUFFER_DATA_PROVIDER_H_ | 5 #ifndef MEDIA_BLINK_RESOURCE_MULTIBUFFER_DATA_PROVIDER_H_ |
6 #define MEDIA_BLINK_RESOURCE_MULTIBUFFER_DATA_PROVIDER_H_ | 6 #define MEDIA_BLINK_RESOURCE_MULTIBUFFER_DATA_PROVIDER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 double finishTime, | 68 double finishTime, |
69 int64_t total_encoded_data_length) override; | 69 int64_t total_encoded_data_length) override; |
70 void didFail(blink::WebURLLoader* loader, const blink::WebURLError&) override; | 70 void didFail(blink::WebURLLoader* loader, const blink::WebURLError&) override; |
71 | 71 |
72 // Use protected instead of private for testing purposes. | 72 // Use protected instead of private for testing purposes. |
73 protected: | 73 protected: |
74 friend class MultibufferDataSourceTest; | 74 friend class MultibufferDataSourceTest; |
75 friend class ResourceMultiBufferDataProviderTest; | 75 friend class ResourceMultiBufferDataProviderTest; |
76 friend class MockBufferedDataSource; | 76 friend class MockBufferedDataSource; |
77 | 77 |
| 78 // Callback used when we're asked to fetch data after the end of the file. |
| 79 void Terminate(); |
| 80 |
78 // Parse a Content-Range header into its component pieces and return true if | 81 // Parse a Content-Range header into its component pieces and return true if |
79 // each of the expected elements was found & parsed correctly. | 82 // each of the expected elements was found & parsed correctly. |
80 // |*instance_size| may be set to kPositionNotSpecified if the range ends in | 83 // |*instance_size| may be set to kPositionNotSpecified if the range ends in |
81 // "/*". | 84 // "/*". |
82 // NOTE: only public for testing! This is an implementation detail of | 85 // NOTE: only public for testing! This is an implementation detail of |
83 // VerifyPartialResponse (a private method). | 86 // VerifyPartialResponse (a private method). |
84 static bool ParseContentRange(const std::string& content_range_str, | 87 static bool ParseContentRange(const std::string& content_range_str, |
85 int64_t* first_byte_position, | 88 int64_t* first_byte_position, |
86 int64_t* last_byte_position, | 89 int64_t* last_byte_position, |
87 int64_t* instance_size); | 90 int64_t* instance_size); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 127 |
125 // When we encounter a redirect, this is the source of the redirect. | 128 // When we encounter a redirect, this is the source of the redirect. |
126 GURL redirects_to_; | 129 GURL redirects_to_; |
127 | 130 |
128 base::WeakPtrFactory<ResourceMultiBufferDataProvider> weak_factory_; | 131 base::WeakPtrFactory<ResourceMultiBufferDataProvider> weak_factory_; |
129 }; | 132 }; |
130 | 133 |
131 } // namespace media | 134 } // namespace media |
132 | 135 |
133 #endif // MEDIA_BLINK_RESOURCE_MULTIBUFFER_DATA_PROVIDER_H_ | 136 #endif // MEDIA_BLINK_RESOURCE_MULTIBUFFER_DATA_PROVIDER_H_ |
OLD | NEW |