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 "net/http/partial_data.h" | 5 #include "net/http/partial_data.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/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/profiler/scoped_profile.h" | 11 #include "base/profiler/scoped_tracker.h" |
12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
14 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
15 #include "net/base/net_errors.h" | 15 #include "net/base/net_errors.h" |
16 #include "net/disk_cache/disk_cache.h" | 16 #include "net/disk_cache/disk_cache.h" |
17 #include "net/http/http_response_headers.h" | 17 #include "net/http/http_response_headers.h" |
18 #include "net/http/http_util.h" | 18 #include "net/http/http_util.h" |
19 | 19 |
20 namespace net { | 20 namespace net { |
21 | 21 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 base::Unretained(this))); | 83 base::Unretained(this))); |
84 if (rv != net::ERR_IO_PENDING) { | 84 if (rv != net::ERR_IO_PENDING) { |
85 // The callback will not be invoked. Lets cleanup. | 85 // The callback will not be invoked. Lets cleanup. |
86 *start = start_; | 86 *start = start_; |
87 delete this; | 87 delete this; |
88 } | 88 } |
89 return rv; | 89 return rv; |
90 } | 90 } |
91 | 91 |
92 void PartialData::Core::OnIOComplete(int result) { | 92 void PartialData::Core::OnIOComplete(int result) { |
93 // TODO(vadimt): Remove ScopedProfile below once crbug.com/422516 is fixed. | 93 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422516 is fixed. |
94 tracked_objects::ScopedProfile tracking_profile( | 94 tracked_objects::ScopedTracker tracking_profile( |
95 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 95 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
96 "422516 PartialData::Core::OnIOComplete")); | 96 "422516 PartialData::Core::OnIOComplete")); |
97 | 97 |
98 if (owner_) | 98 if (owner_) |
99 owner_->GetAvailableRangeCompleted(result, start_); | 99 owner_->GetAvailableRangeCompleted(result, start_); |
100 delete this; | 100 delete this; |
101 } | 101 } |
102 | 102 |
103 // ----------------------------------------------------------------------------- | 103 // ----------------------------------------------------------------------------- |
104 | 104 |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 cached_min_len_ = result; | 482 cached_min_len_ = result; |
483 if (result >= 0) | 483 if (result >= 0) |
484 result = 1; // Return success, go ahead and validate the entry. | 484 result = 1; // Return success, go ahead and validate the entry. |
485 | 485 |
486 CompletionCallback cb = callback_; | 486 CompletionCallback cb = callback_; |
487 callback_.Reset(); | 487 callback_.Reset(); |
488 cb.Run(result); | 488 cb.Run(result); |
489 } | 489 } |
490 | 490 |
491 } // namespace net | 491 } // namespace net |
OLD | NEW |