| 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/loader/redirect_to_file_resource_handler.h" | 5 #include "content/browser/loader/redirect_to_file_resource_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/threading/thread_restrictions.h" | 9 #include "base/threading/thread_restrictions.h" |
| 10 #include "content/browser/loader/resource_request_info_impl.h" | 10 #include "content/browser/loader/resource_request_info_impl.h" |
| 11 #include "content/browser/loader/temporary_file_stream.h" | 11 #include "content/browser/loader/temporary_file_stream.h" |
| 12 #include "content/public/browser/resource_controller.h" | 12 #include "content/public/browser/resource_controller.h" |
| 13 #include "content/public/common/resource_response.h" | 13 #include "content/public/common/resource_response.h" |
| 14 #include "net/base/file_stream.h" | 14 #include "net/base/file_stream.h" |
| 15 #include "net/base/io_buffer.h" | 15 #include "net/base/io_buffer.h" |
| 16 #include "net/base/mime_sniffer.h" | 16 #include "net/base/mime_sniffer.h" |
| 17 #include "net/base/net_errors.h" | 17 #include "net/base/net_errors.h" |
| 18 #include "storage/common/blob/shareable_file_reference.h" | 18 #include "storage/browser/blob/shareable_file_reference.h" |
| 19 | 19 |
| 20 using storage::ShareableFileReference; | 20 using storage::ShareableFileReference; |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 // This class is similar to identically named classes in AsyncResourceHandler | 24 // This class is similar to identically named classes in AsyncResourceHandler |
| 25 // and BufferedResourceHandler, but not quite. | 25 // and BufferedResourceHandler, but not quite. |
| 26 // TODO(ncbray) generalize and unify these cases? | 26 // TODO(ncbray) generalize and unify these cases? |
| 27 // In general, it's a bad idea to point to a subbuffer (particularly with | 27 // In general, it's a bad idea to point to a subbuffer (particularly with |
| 28 // GrowableIOBuffer) because the backing IOBuffer may realloc its data. In this | 28 // GrowableIOBuffer) because the backing IOBuffer may realloc its data. In this |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 } | 359 } |
| 360 | 360 |
| 361 void RedirectToFileResourceHandler::ResumeIfDeferred() { | 361 void RedirectToFileResourceHandler::ResumeIfDeferred() { |
| 362 if (did_defer_) { | 362 if (did_defer_) { |
| 363 did_defer_ = false; | 363 did_defer_ = false; |
| 364 controller()->Resume(); | 364 controller()->Resume(); |
| 365 } | 365 } |
| 366 } | 366 } |
| 367 | 367 |
| 368 } // namespace content | 368 } // namespace content |
| OLD | NEW |