| 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 <algorithm> | 8 #include <algorithm> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 const webkit_glue::ResourceLoaderBridge::ResponseInfo& info, | 119 const webkit_glue::ResourceLoaderBridge::ResponseInfo& info, |
| 120 bool content_filtered); | 120 bool content_filtered); |
| 121 virtual void OnReceivedData(const char* data, int len); | 121 virtual void OnReceivedData(const char* data, int len); |
| 122 virtual void OnCompletedRequest(const URLRequestStatus& status, | 122 virtual void OnCompletedRequest(const URLRequestStatus& status, |
| 123 const std::string& security_info); | 123 const std::string& security_info); |
| 124 GURL GetURLForDebugging() const { return url_; } | 124 GURL GetURLForDebugging() const { return url_; } |
| 125 | 125 |
| 126 protected: | 126 protected: |
| 127 friend class base::RefCountedThreadSafe<BufferedResourceLoader>; | 127 friend class base::RefCountedThreadSafe<BufferedResourceLoader>; |
| 128 | 128 |
| 129 // An empty constructor so mock classes can be constructed. | |
| 130 BufferedResourceLoader() { | |
| 131 } | |
| 132 | |
| 133 virtual ~BufferedResourceLoader(); | 129 virtual ~BufferedResourceLoader(); |
| 134 | 130 |
| 135 private: | 131 private: |
| 136 friend class BufferedResourceLoaderTest; | 132 friend class BufferedResourceLoaderTest; |
| 137 | 133 |
| 138 // Defer the resource loading if the buffer is full. | 134 // Defer the resource loading if the buffer is full. |
| 139 void EnableDeferIfNeeded(); | 135 void EnableDeferIfNeeded(); |
| 140 | 136 |
| 141 // Disable defer loading if we are under-buffered. | 137 // Disable defer loading if we are under-buffered. |
| 142 void DisableDeferIfNeeded(); | 138 void DisableDeferIfNeeded(); |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 // loop. The RepeatingTimer does PostDelayedTask() internally, by using it | 404 // loop. The RepeatingTimer does PostDelayedTask() internally, by using it |
| 409 // the message loop doesn't hold a reference for the watch dog task. | 405 // the message loop doesn't hold a reference for the watch dog task. |
| 410 base::RepeatingTimer<BufferedDataSource> watch_dog_timer_; | 406 base::RepeatingTimer<BufferedDataSource> watch_dog_timer_; |
| 411 | 407 |
| 412 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource); | 408 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource); |
| 413 }; | 409 }; |
| 414 | 410 |
| 415 } // namespace webkit_glue | 411 } // namespace webkit_glue |
| 416 | 412 |
| 417 #endif // WEBKIT_GLUE_MEDIA_BUFFERED_DATA_SOURCE_H_ | 413 #endif // WEBKIT_GLUE_MEDIA_BUFFERED_DATA_SOURCE_H_ |
| OLD | NEW |