OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_response.h" | 5 #include "content/browser/appcache/appcache_response.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 DCHECK(entry_); | 120 DCHECK(entry_); |
121 int rv = entry_->Write( | 121 int rv = entry_->Write( |
122 index, offset, buf, buf_len, | 122 index, offset, buf, buf_len, |
123 base::Bind(&AppCacheResponseIO::OnRawIOComplete, | 123 base::Bind(&AppCacheResponseIO::OnRawIOComplete, |
124 weak_factory_.GetWeakPtr())); | 124 weak_factory_.GetWeakPtr())); |
125 if (rv != net::ERR_IO_PENDING) | 125 if (rv != net::ERR_IO_PENDING) |
126 ScheduleIOCompletionCallback(rv); | 126 ScheduleIOCompletionCallback(rv); |
127 } | 127 } |
128 | 128 |
129 void AppCacheResponseIO::OnRawIOComplete(int result) { | 129 void AppCacheResponseIO::OnRawIOComplete(int result) { |
130 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422516 is fixed. | 130 // TODO(rtenneti): Remove ScopedTracker below once crbug.com/422516 is fixed. |
131 tracked_objects::ScopedTracker tracking_profile( | 131 tracked_objects::ScopedTracker tracking_profile( |
132 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 132 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
133 "422516 AppCacheResponseIO::OnRawIOComplete")); | 133 "422516 AppCacheResponseIO::OnRawIOComplete")); |
134 | 134 |
135 DCHECK_NE(net::ERR_IO_PENDING, result); | 135 DCHECK_NE(net::ERR_IO_PENDING, result); |
136 OnIOComplete(result); | 136 OnIOComplete(result); |
137 } | 137 } |
138 | 138 |
139 void AppCacheResponseIO::OpenEntryIfNeeded() { | 139 void AppCacheResponseIO::OpenEntryIfNeeded() { |
140 int rv; | 140 int rv; |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 } | 474 } |
475 WriteRaw(kResponseMetadataIndex, 0, buffer_.get(), write_amount_); | 475 WriteRaw(kResponseMetadataIndex, 0, buffer_.get(), write_amount_); |
476 } | 476 } |
477 | 477 |
478 void AppCacheResponseMetadataWriter::OnIOComplete(int result) { | 478 void AppCacheResponseMetadataWriter::OnIOComplete(int result) { |
479 DCHECK(result < 0 || write_amount_ == result); | 479 DCHECK(result < 0 || write_amount_ == result); |
480 InvokeUserCompletionCallback(result); | 480 InvokeUserCompletionCallback(result); |
481 } | 481 } |
482 | 482 |
483 } // namespace content | 483 } // namespace content |
OLD | NEW |