| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "webkit/blob/blob_url_request_job.h" | 5 #include "webkit/blob/blob_url_request_job.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/file_util_proxy.h" | 10 #include "base/file_util_proxy.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 stream_.Close(); | 93 stream_.Close(); |
| 94 | 94 |
| 95 net::URLRequestJob::Kill(); | 95 net::URLRequestJob::Kill(); |
| 96 callback_factory_.RevokeAll(); | 96 callback_factory_.RevokeAll(); |
| 97 method_factory_.RevokeAll(); | 97 method_factory_.RevokeAll(); |
| 98 } | 98 } |
| 99 | 99 |
| 100 void BlobURLRequestJob::ResolveFile(const FilePath& file_path) { | 100 void BlobURLRequestJob::ResolveFile(const FilePath& file_path) { |
| 101 // If the file thread proxy is provided, we can use it get the file info. | 101 // If the file thread proxy is provided, we can use it get the file info. |
| 102 if (file_thread_proxy_) { | 102 if (file_thread_proxy_) { |
| 103 base::FileUtilProxy::GetFileInfo( | 103 base::FileUtilProxy::GetInstance()->GetFileInfo( |
| 104 file_thread_proxy_, | 104 file_thread_proxy_, |
| 105 file_path, | 105 file_path, |
| 106 callback_factory_.NewCallback(&BlobURLRequestJob::DidResolve)); | 106 callback_factory_.NewCallback(&BlobURLRequestJob::DidResolve)); |
| 107 return; | 107 return; |
| 108 } | 108 } |
| 109 | 109 |
| 110 // Otherwise, we use current thread, i.e. IO thread, as this is the case when | 110 // Otherwise, we use current thread, i.e. IO thread, as this is the case when |
| 111 // we run the unittest or test shell. | 111 // we run the unittest or test shell. |
| 112 // TODO(jianli): Consider using the proxy of current thread. | 112 // TODO(jianli): Consider using the proxy of current thread. |
| 113 base::PlatformFileInfo file_info; | 113 base::PlatformFileInfo file_info; |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 // We don't support multiple range requests in one single URL request, | 536 // We don't support multiple range requests in one single URL request, |
| 537 // because we need to do multipart encoding here. | 537 // because we need to do multipart encoding here. |
| 538 // TODO(jianli): Support multipart byte range requests. | 538 // TODO(jianli): Support multipart byte range requests. |
| 539 NotifyFailure(net::ERR_REQUEST_RANGE_NOT_SATISFIABLE); | 539 NotifyFailure(net::ERR_REQUEST_RANGE_NOT_SATISFIABLE); |
| 540 } | 540 } |
| 541 } | 541 } |
| 542 } | 542 } |
| 543 } | 543 } |
| 544 | 544 |
| 545 } // namespace webkit_blob | 545 } // namespace webkit_blob |
| OLD | NEW |