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/renderer_host/redirect_to_file_resource_handler.h" | 5 #include "content/browser/renderer_host/redirect_to_file_resource_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/file_util_proxy.h" | 9 #include "base/file_util_proxy.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/message_loop_proxy.h" | 11 #include "base/message_loop_proxy.h" |
12 #include "base/platform_file.h" | 12 #include "base/platform_file.h" |
13 #include "base/task.h" | |
14 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 13 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
15 #include "content/public/common/resource_response.h" | 14 #include "content/public/common/resource_response.h" |
16 #include "net/base/file_stream.h" | 15 #include "net/base/file_stream.h" |
17 #include "net/base/io_buffer.h" | 16 #include "net/base/io_buffer.h" |
18 #include "net/base/mime_sniffer.h" | 17 #include "net/base/mime_sniffer.h" |
19 #include "net/base/net_errors.h" | 18 #include "net/base/net_errors.h" |
20 #include "webkit/blob/deletable_file_reference.h" | 19 #include "webkit/blob/deletable_file_reference.h" |
21 | 20 |
22 using webkit_blob::DeletableFileReference; | 21 using webkit_blob::DeletableFileReference; |
23 | 22 |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 | 226 |
228 bool RedirectToFileResourceHandler::BufIsFull() const { | 227 bool RedirectToFileResourceHandler::BufIsFull() const { |
229 // This is a hack to workaround BufferedResourceHandler's inability to | 228 // This is a hack to workaround BufferedResourceHandler's inability to |
230 // deal with a ResourceHandler that returns a buffer size of less than | 229 // deal with a ResourceHandler that returns a buffer size of less than |
231 // 2 * net::kMaxBytesToSniff from its OnWillRead method. | 230 // 2 * net::kMaxBytesToSniff from its OnWillRead method. |
232 // TODO(darin): Fix this retardation! | 231 // TODO(darin): Fix this retardation! |
233 return buf_->RemainingCapacity() <= (2 * net::kMaxBytesToSniff); | 232 return buf_->RemainingCapacity() <= (2 * net::kMaxBytesToSniff); |
234 } | 233 } |
235 | 234 |
236 } // namespace content | 235 } // namespace content |
OLD | NEW |