| 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 // For loading files, we make use of overlapped i/o to ensure that reading from | 5 // For loading files, we make use of overlapped i/o to ensure that reading from |
| 6 // the filesystem (e.g., a network filesystem) does not block the calling | 6 // the filesystem (e.g., a network filesystem) does not block the calling |
| 7 // thread. An alternative approach would be to use a background thread or pool | 7 // thread. An alternative approach would be to use a background thread or pool |
| 8 // of threads, but it seems better to leverage the operating system's ability | 8 // of threads, but it seems better to leverage the operating system's ability |
| 9 // to do background file reads for us. | 9 // to do background file reads for us. |
| 10 // | 10 // |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "base/bind.h" | 22 #include "base/bind.h" |
| 23 #include "base/compiler_specific.h" | 23 #include "base/compiler_specific.h" |
| 24 #include "base/file_util.h" | 24 #include "base/file_util.h" |
| 25 #include "base/message_loop/message_loop.h" | 25 #include "base/message_loop/message_loop.h" |
| 26 #include "base/strings/string_util.h" | 26 #include "base/strings/string_util.h" |
| 27 #include "base/synchronization/lock.h" | 27 #include "base/synchronization/lock.h" |
| 28 #include "base/task_runner.h" | 28 #include "base/task_runner.h" |
| 29 #include "base/threading/thread_restrictions.h" | 29 #include "base/threading/thread_restrictions.h" |
| 30 #include "build/build_config.h" | 30 #include "build/build_config.h" |
| 31 #include "net/base/file_stream.h" | 31 #include "net/base/file_stream.h" |
| 32 #include "net/base/filename_util.h" | |
| 33 #include "net/base/io_buffer.h" | 32 #include "net/base/io_buffer.h" |
| 34 #include "net/base/load_flags.h" | 33 #include "net/base/load_flags.h" |
| 35 #include "net/base/mime_util.h" | 34 #include "net/base/mime_util.h" |
| 36 #include "net/base/net_errors.h" | 35 #include "net/base/net_errors.h" |
| 36 #include "net/base/net_util.h" |
| 37 #include "net/filter/filter.h" | 37 #include "net/filter/filter.h" |
| 38 #include "net/http/http_util.h" | 38 #include "net/http/http_util.h" |
| 39 #include "net/url_request/url_request_error_job.h" | 39 #include "net/url_request/url_request_error_job.h" |
| 40 #include "net/url_request/url_request_file_dir_job.h" | 40 #include "net/url_request/url_request_file_dir_job.h" |
| 41 #include "url/gurl.h" | 41 #include "url/gurl.h" |
| 42 | 42 |
| 43 #if defined(OS_WIN) | 43 #if defined(OS_WIN) |
| 44 #include "base/win/shortcut.h" | 44 #include "base/win/shortcut.h" |
| 45 #endif | 45 #endif |
| 46 | 46 |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, result)); | 292 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, result)); |
| 293 } | 293 } |
| 294 | 294 |
| 295 remaining_bytes_ -= result; | 295 remaining_bytes_ -= result; |
| 296 DCHECK_GE(remaining_bytes_, 0); | 296 DCHECK_GE(remaining_bytes_, 0); |
| 297 | 297 |
| 298 NotifyReadComplete(result); | 298 NotifyReadComplete(result); |
| 299 } | 299 } |
| 300 | 300 |
| 301 } // namespace net | 301 } // namespace net |
| OLD | NEW |