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 "webkit/blob/blob_url_request_job.h" | 5 #include "webkit/blob/blob_url_request_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/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 return; | 95 return; |
96 } | 96 } |
97 | 97 |
98 CountSize(); | 98 CountSize(); |
99 } | 99 } |
100 | 100 |
101 void BlobURLRequestJob::CloseStream() { | 101 void BlobURLRequestJob::CloseStream() { |
102 if (stream_ != NULL) { | 102 if (stream_ != NULL) { |
103 // stream_.Close() blocks the IO thread, see http://crbug.com/75548. | 103 // stream_.Close() blocks the IO thread, see http://crbug.com/75548. |
104 base::ThreadRestrictions::ScopedAllowIO allow_io; | 104 base::ThreadRestrictions::ScopedAllowIO allow_io; |
105 stream_->Close(); | 105 stream_->CloseSync(); |
106 stream_.reset(NULL); | 106 stream_.reset(NULL); |
107 } | 107 } |
108 } | 108 } |
109 | 109 |
110 void BlobURLRequestJob::Kill() { | 110 void BlobURLRequestJob::Kill() { |
111 CloseStream(); | 111 CloseStream(); |
112 | 112 |
113 net::URLRequestJob::Kill(); | 113 net::URLRequestJob::Kill(); |
114 weak_factory_.InvalidateWeakPtrs(); | 114 weak_factory_.InvalidateWeakPtrs(); |
115 } | 115 } |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 // We don't support multiple range requests in one single URL request, | 560 // We don't support multiple range requests in one single URL request, |
561 // because we need to do multipart encoding here. | 561 // because we need to do multipart encoding here. |
562 // TODO(jianli): Support multipart byte range requests. | 562 // TODO(jianli): Support multipart byte range requests. |
563 NotifyFailure(net::ERR_REQUEST_RANGE_NOT_SATISFIABLE); | 563 NotifyFailure(net::ERR_REQUEST_RANGE_NOT_SATISFIABLE); |
564 } | 564 } |
565 } | 565 } |
566 } | 566 } |
567 } | 567 } |
568 | 568 |
569 } // namespace webkit_blob | 569 } // namespace webkit_blob |
OLD | NEW |