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 #include "content/browser/appcache/appcache_internals_ui.h" | 5 #include "content/browser/appcache/appcache_internals_ui.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 response_enquiries_.pop_front(); | 285 response_enquiries_.pop_front(); |
286 if (response) { | 286 if (response) { |
287 scoped_refptr<AppCacheResponseInfo> response_info = response; | 287 scoped_refptr<AppCacheResponseInfo> response_info = response; |
288 const int64_t kLimit = 100 * 1000; | 288 const int64_t kLimit = 100 * 1000; |
289 int64_t amount_to_read = | 289 int64_t amount_to_read = |
290 std::min(kLimit, response_info->response_data_size()); | 290 std::min(kLimit, response_info->response_data_size()); |
291 scoped_refptr<net::IOBuffer> response_data(new net::IOBuffer( | 291 scoped_refptr<net::IOBuffer> response_data(new net::IOBuffer( |
292 base::CheckedNumeric<size_t>(amount_to_read).ValueOrDie())); | 292 base::CheckedNumeric<size_t>(amount_to_read).ValueOrDie())); |
293 std::unique_ptr<AppCacheResponseReader> reader( | 293 std::unique_ptr<AppCacheResponseReader> reader( |
294 appcache_service_->storage()->CreateResponseReader( | 294 appcache_service_->storage()->CreateResponseReader( |
295 GURL(response_enquiry.manifest_url), response_enquiry.group_id, | 295 GURL(response_enquiry.manifest_url), response_enquiry.response_id)); |
296 response_enquiry.response_id)); | |
297 | 296 |
298 reader->ReadData( | 297 reader->ReadData( |
299 response_data.get(), amount_to_read, | 298 response_data.get(), amount_to_read, |
300 base::Bind(&Proxy::OnResponseDataReadComplete, this, response_enquiry, | 299 base::Bind(&Proxy::OnResponseDataReadComplete, this, response_enquiry, |
301 response_info, base::Passed(&reader), response_data)); | 300 response_info, base::Passed(&reader), response_data)); |
302 } else { | 301 } else { |
303 OnResponseDataReadComplete(response_enquiry, nullptr, nullptr, nullptr, -1); | 302 OnResponseDataReadComplete(response_enquiry, nullptr, nullptr, nullptr, -1); |
304 } | 303 } |
305 } | 304 } |
306 | 305 |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 const base::FilePath& partition_path) { | 503 const base::FilePath& partition_path) { |
505 for (const scoped_refptr<Proxy>& proxy : appcache_proxies_) { | 504 for (const scoped_refptr<Proxy>& proxy : appcache_proxies_) { |
506 if (proxy->partition_path_ == partition_path) | 505 if (proxy->partition_path_ == partition_path) |
507 return proxy.get(); | 506 return proxy.get(); |
508 } | 507 } |
509 NOTREACHED(); | 508 NOTREACHED(); |
510 return nullptr; | 509 return nullptr; |
511 } | 510 } |
512 | 511 |
513 } // namespace content | 512 } // namespace content |
OLD | NEW |