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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 friend class ResourceMultiBufferDataProviderTest; | 69 friend class ResourceMultiBufferDataProviderTest; |
70 friend class MockBufferedDataSource; | 70 friend class MockBufferedDataSource; |
71 | 71 |
72 // Parse a Content-Range header into its component pieces and return true if | 72 // Parse a Content-Range header into its component pieces and return true if |
73 // each of the expected elements was found & parsed correctly. | 73 // each of the expected elements was found & parsed correctly. |
74 // |*instance_size| may be set to kPositionNotSpecified if the range ends in | 74 // |*instance_size| may be set to kPositionNotSpecified if the range ends in |
75 // "/*". | 75 // "/*". |
76 // NOTE: only public for testing! This is an implementation detail of | 76 // NOTE: only public for testing! This is an implementation detail of |
77 // VerifyPartialResponse (a private method). | 77 // VerifyPartialResponse (a private method). |
78 static bool ParseContentRange(const std::string& content_range_str, | 78 static bool ParseContentRange(const std::string& content_range_str, |
79 int64* first_byte_position, | 79 int64_t* first_byte_position, |
80 int64* last_byte_position, | 80 int64_t* last_byte_position, |
81 int64* instance_size); | 81 int64_t* instance_size); |
82 | 82 |
83 int64_t byte_pos() const; | 83 int64_t byte_pos() const; |
84 int64_t block_size() const; | 84 int64_t block_size() const; |
85 | 85 |
86 // If we have made a range request, verify the response from the server. | 86 // If we have made a range request, verify the response from the server. |
87 bool VerifyPartialResponse(const blink::WebURLResponse& response); | 87 bool VerifyPartialResponse(const blink::WebURLResponse& response); |
88 | 88 |
89 // Current Position. | 89 // Current Position. |
90 MultiBufferBlockId pos_; | 90 MultiBufferBlockId pos_; |
91 | 91 |
(...skipping 25 matching lines...) Expand all Loading... |
117 | 117 |
118 // When we encounter a redirect, this is the source of the redirect. | 118 // When we encounter a redirect, this is the source of the redirect. |
119 GURL redirects_to_; | 119 GURL redirects_to_; |
120 | 120 |
121 base::WeakPtrFactory<ResourceMultiBufferDataProvider> weak_factory_; | 121 base::WeakPtrFactory<ResourceMultiBufferDataProvider> weak_factory_; |
122 }; | 122 }; |
123 | 123 |
124 } // namespace media | 124 } // namespace media |
125 | 125 |
126 #endif // MEDIA_BLINK_RESOURCE_MULTIBUFFER_RESOURCE_LOADER_H_ | 126 #endif // MEDIA_BLINK_RESOURCE_MULTIBUFFER_RESOURCE_LOADER_H_ |
OLD | NEW |