| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "net/url_request/url_request_file_job.h" | 5 #include "net/url_request/url_request_file_job.h" |
| 6 | 6 |
| 7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
| 8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 : path_(path), observer_(observer) { | 67 : path_(path), observer_(observer) { |
| 68 } | 68 } |
| 69 | 69 |
| 70 ~CallbacksJobFactory() override {} | 70 ~CallbacksJobFactory() override {} |
| 71 | 71 |
| 72 URLRequestJob* MaybeCreateJobWithProtocolHandler( | 72 URLRequestJob* MaybeCreateJobWithProtocolHandler( |
| 73 const std::string& scheme, | 73 const std::string& scheme, |
| 74 URLRequest* request, | 74 URLRequest* request, |
| 75 NetworkDelegate* network_delegate) const override { | 75 NetworkDelegate* network_delegate) const override { |
| 76 URLRequestFileJobWithCallbacks* job = new URLRequestFileJobWithCallbacks( | 76 URLRequestFileJobWithCallbacks* job = new URLRequestFileJobWithCallbacks( |
| 77 request, | 77 request, network_delegate, path_, |
| 78 network_delegate, | 78 base::MessageLoop::current()->task_runner()); |
| 79 path_, | |
| 80 base::MessageLoop::current()->message_loop_proxy()); | |
| 81 observer_->OnJobCreated(job); | 79 observer_->OnJobCreated(job); |
| 82 return job; | 80 return job; |
| 83 } | 81 } |
| 84 | 82 |
| 85 URLRequestJob* MaybeInterceptRedirect(URLRequest* request, | 83 URLRequestJob* MaybeInterceptRedirect(URLRequest* request, |
| 86 NetworkDelegate* network_delegate, | 84 NetworkDelegate* network_delegate, |
| 87 const GURL& location) const override { | 85 const GURL& location) const override { |
| 88 return nullptr; | 86 return nullptr; |
| 89 } | 87 } |
| 90 | 88 |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 // Use a 15KB content file and read a range chosen somewhat arbitrarily but | 257 // Use a 15KB content file and read a range chosen somewhat arbitrarily but |
| 260 // not aligned on any likely page boundaries. | 258 // not aligned on any likely page boundaries. |
| 261 int size = 15 * 1024; | 259 int size = 15 * 1024; |
| 262 Range range(1701, (6 * 1024) + 3); | 260 Range range(1701, (6 * 1024) + 3); |
| 263 RunRequest(MakeContentOfSize(size), &range); | 261 RunRequest(MakeContentOfSize(size), &range); |
| 264 } | 262 } |
| 265 | 263 |
| 266 } // namespace | 264 } // namespace |
| 267 | 265 |
| 268 } // namespace net | 266 } // namespace net |
| OLD | NEW |