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/url_request/url_request_file_dir_job.h" | 5 #include "net/url_request/url_request_file_dir_job.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/profiler/scoped_tracker.h" |
10 #include "base/strings/sys_string_conversions.h" | 11 #include "base/strings/sys_string_conversions.h" |
11 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
12 #include "base/time/time.h" | 13 #include "base/time/time.h" |
13 #include "net/base/io_buffer.h" | 14 #include "net/base/io_buffer.h" |
14 #include "net/base/net_errors.h" | 15 #include "net/base/net_errors.h" |
15 #include "net/base/net_util.h" | 16 #include "net/base/net_util.h" |
16 #include "net/url_request/url_request_status.h" | 17 #include "net/url_request/url_request_status.h" |
17 #include "url/gurl.h" | 18 #include "url/gurl.h" |
18 | 19 |
19 #if defined(OS_POSIX) | 20 #if defined(OS_POSIX) |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 if (!list_complete_) | 61 if (!list_complete_) |
61 lister_.Cancel(); | 62 lister_.Cancel(); |
62 | 63 |
63 URLRequestJob::Kill(); | 64 URLRequestJob::Kill(); |
64 | 65 |
65 weak_factory_.InvalidateWeakPtrs(); | 66 weak_factory_.InvalidateWeakPtrs(); |
66 } | 67 } |
67 | 68 |
68 bool URLRequestFileDirJob::ReadRawData(IOBuffer* buf, int buf_size, | 69 bool URLRequestFileDirJob::ReadRawData(IOBuffer* buf, int buf_size, |
69 int* bytes_read) { | 70 int* bytes_read) { |
| 71 // TODO(vadimt): Remove ScopedTracker below once crbug.com/423948 is fixed. |
| 72 tracked_objects::ScopedTracker tracking_profile( |
| 73 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 74 "423948 URLRequestFileDirJob::ReadRawData")); |
| 75 |
70 DCHECK(bytes_read); | 76 DCHECK(bytes_read); |
71 *bytes_read = 0; | 77 *bytes_read = 0; |
72 | 78 |
73 if (is_done()) | 79 if (is_done()) |
74 return true; | 80 return true; |
75 | 81 |
76 if (FillReadBuffer(buf->data(), buf_size, bytes_read)) | 82 if (FillReadBuffer(buf->data(), buf_size, bytes_read)) |
77 return true; | 83 return true; |
78 | 84 |
79 // We are waiting for more data | 85 // We are waiting for more data |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 *bytes_read = count; | 185 *bytes_read = count; |
180 return true; | 186 return true; |
181 } else if (list_complete_) { | 187 } else if (list_complete_) { |
182 // EOF | 188 // EOF |
183 return true; | 189 return true; |
184 } | 190 } |
185 return false; | 191 return false; |
186 } | 192 } |
187 | 193 |
188 } // namespace net | 194 } // namespace net |
OLD | NEW |