| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 WEBKIT_GLUE_MEDIA_BUFFERED_DATA_SOURCE_H_ | 5 #ifndef WEBKIT_GLUE_MEDIA_BUFFERED_DATA_SOURCE_H_ |
| 6 #define WEBKIT_GLUE_MEDIA_BUFFERED_DATA_SOURCE_H_ | 6 #define WEBKIT_GLUE_MEDIA_BUFFERED_DATA_SOURCE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 92 |
| 93 // Returns the position of the last byte buffered. Returns -1 if such value | 93 // Returns the position of the last byte buffered. Returns -1 if such value |
| 94 // is not available. | 94 // is not available. |
| 95 virtual int64 GetBufferedLastBytePosition(); | 95 virtual int64 GetBufferedLastBytePosition(); |
| 96 | 96 |
| 97 // Sets whether deferring data is allowed or disallowed. | 97 // Sets whether deferring data is allowed or disallowed. |
| 98 virtual void SetAllowDefer(bool is_allowed); | 98 virtual void SetAllowDefer(bool is_allowed); |
| 99 | 99 |
| 100 // Gets the content length in bytes of the instance after this loader has been | 100 // Gets the content length in bytes of the instance after this loader has been |
| 101 // started. If this value is -1, then content length is unknown. | 101 // started. If this value is -1, then content length is unknown. |
| 102 virtual int64 content_length() { return content_length_; } | 102 virtual int64 content_length(); |
| 103 | 103 |
| 104 // Gets the original size of the file requested. If this value is -1, then | 104 // Gets the original size of the file requested. If this value is -1, then |
| 105 // the size is unknown. | 105 // the size is unknown. |
| 106 virtual int64 instance_size() { return instance_size_; } | 106 virtual int64 instance_size(); |
| 107 | 107 |
| 108 // Returns true if the response for this loader is a partial response. | 108 // Returns true if the response for this loader is a partial response. |
| 109 // It means a 206 response in HTTP/HTTPS protocol. | 109 // It means a 206 response in HTTP/HTTPS protocol. |
| 110 virtual bool partial_response() { return partial_response_; } | 110 virtual bool partial_response(); |
| 111 | 111 |
| 112 // Returns true if network is currently active. | 112 // Returns true if network is currently active. |
| 113 virtual bool network_activity() { return !completed_ && !deferred_; } | 113 virtual bool network_activity(); |
| 114 | 114 |
| 115 // Returns resulting URL. | 115 // Returns resulting URL. |
| 116 virtual const GURL& url() { return url_; } | 116 virtual const GURL& url(); |
| 117 | 117 |
| 118 // Used to inject a mock used for unittests. | 118 // Used to inject a mock used for unittests. |
| 119 virtual void SetURLLoaderForTest(WebKit::WebURLLoader* mock_loader); | 119 virtual void SetURLLoaderForTest(WebKit::WebURLLoader* mock_loader); |
| 120 | 120 |
| 121 ///////////////////////////////////////////////////////////////////////////// | 121 ///////////////////////////////////////////////////////////////////////////// |
| 122 // WebKit::WebURLLoaderClient implementations. | 122 // WebKit::WebURLLoaderClient implementations. |
| 123 virtual void willSendRequest( | 123 virtual void willSendRequest( |
| 124 WebKit::WebURLLoader* loader, | 124 WebKit::WebURLLoader* loader, |
| 125 WebKit::WebURLRequest& newRequest, | 125 WebKit::WebURLRequest& newRequest, |
| 126 const WebKit::WebURLResponse& redirectResponse); | 126 const WebKit::WebURLResponse& redirectResponse); |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 // Keeps track of whether we used a Range header in the initialization | 433 // Keeps track of whether we used a Range header in the initialization |
| 434 // request. | 434 // request. |
| 435 bool using_range_request_; | 435 bool using_range_request_; |
| 436 | 436 |
| 437 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource); | 437 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource); |
| 438 }; | 438 }; |
| 439 | 439 |
| 440 } // namespace webkit_glue | 440 } // namespace webkit_glue |
| 441 | 441 |
| 442 #endif // WEBKIT_GLUE_MEDIA_BUFFERED_DATA_SOURCE_H_ | 442 #endif // WEBKIT_GLUE_MEDIA_BUFFERED_DATA_SOURCE_H_ |
| OLD | NEW |