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 #include "base/callback.h" | 5 #include "base/callback.h" |
6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
10 #include "base/stl_util-inl.h" | 10 #include "base/stl_util-inl.h" |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 if (buffer_.get()) | 246 if (buffer_.get()) |
247 return offset_ + static_cast<int>(buffer_->forward_bytes()) - 1; | 247 return offset_ + static_cast<int>(buffer_->forward_bytes()) - 1; |
248 return kPositionNotSpecified; | 248 return kPositionNotSpecified; |
249 } | 249 } |
250 | 250 |
251 void BufferedResourceLoader::SetAllowDefer(bool is_allowed) { | 251 void BufferedResourceLoader::SetAllowDefer(bool is_allowed) { |
252 defer_allowed_ = is_allowed; | 252 defer_allowed_ = is_allowed; |
253 DisableDeferIfNeeded(); | 253 DisableDeferIfNeeded(); |
254 } | 254 } |
255 | 255 |
| 256 int64 BufferedResourceLoader::content_length() { |
| 257 return content_length_; |
| 258 } |
| 259 |
| 260 int64 BufferedResourceLoader::instance_size() { |
| 261 return instance_size_; |
| 262 } |
| 263 |
| 264 bool BufferedResourceLoader::partial_response() { |
| 265 return partial_response_; |
| 266 } |
| 267 |
| 268 bool BufferedResourceLoader::network_activity() { |
| 269 return !completed_ && !deferred_; |
| 270 } |
| 271 |
| 272 const GURL& BufferedResourceLoader::url() { |
| 273 return url_; |
| 274 } |
| 275 |
256 void BufferedResourceLoader::SetURLLoaderForTest(WebURLLoader* mock_loader) { | 276 void BufferedResourceLoader::SetURLLoaderForTest(WebURLLoader* mock_loader) { |
257 url_loader_.reset(mock_loader); | 277 url_loader_.reset(mock_loader); |
258 keep_test_loader_ = true; | 278 keep_test_loader_ = true; |
259 } | 279 } |
260 | 280 |
261 ///////////////////////////////////////////////////////////////////////////// | 281 ///////////////////////////////////////////////////////////////////////////// |
262 // BufferedResourceLoader, WebKit::WebURLLoaderClient implementations. | 282 // BufferedResourceLoader, WebKit::WebURLLoaderClient implementations. |
263 void BufferedResourceLoader::willSendRequest( | 283 void BufferedResourceLoader::willSendRequest( |
264 WebURLLoader* loader, | 284 WebURLLoader* loader, |
265 WebURLRequest& newRequest, | 285 WebURLRequest& newRequest, |
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1150 return; | 1170 return; |
1151 | 1171 |
1152 if (network_activity != network_activity_) { | 1172 if (network_activity != network_activity_) { |
1153 network_activity_ = network_activity; | 1173 network_activity_ = network_activity; |
1154 host()->SetNetworkActivity(network_activity); | 1174 host()->SetNetworkActivity(network_activity); |
1155 } | 1175 } |
1156 host()->SetBufferedBytes(buffered_last_byte_position + 1); | 1176 host()->SetBufferedBytes(buffered_last_byte_position + 1); |
1157 } | 1177 } |
1158 | 1178 |
1159 } // namespace webkit_glue | 1179 } // namespace webkit_glue |
OLD | NEW |