OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/chromeos/fileapi/external_file_url_request_job.h" | 5 #include "chrome/browser/chromeos/fileapi/external_file_url_request_job.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 // net::URLRequestJobFactory override: | 57 // net::URLRequestJobFactory override: |
58 virtual net::URLRequestJob* MaybeCreateJobWithProtocolHandler( | 58 virtual net::URLRequestJob* MaybeCreateJobWithProtocolHandler( |
59 const std::string& scheme, | 59 const std::string& scheme, |
60 net::URLRequest* request, | 60 net::URLRequest* request, |
61 net::NetworkDelegate* network_delegate) const override { | 61 net::NetworkDelegate* network_delegate) const override { |
62 return new ExternalFileURLRequestJob( | 62 return new ExternalFileURLRequestJob( |
63 profile_id_, request, network_delegate); | 63 profile_id_, request, network_delegate); |
64 } | 64 } |
65 | 65 |
| 66 net::URLRequestJob* MaybeInterceptRedirect( |
| 67 net::URLRequest* request, |
| 68 net::NetworkDelegate* network_delegate, |
| 69 const GURL& location) const override { |
| 70 return nullptr; |
| 71 } |
| 72 |
| 73 net::URLRequestJob* MaybeInterceptResponse( |
| 74 net::URLRequest* request, |
| 75 net::NetworkDelegate* network_delegate) const override { |
| 76 return nullptr; |
| 77 } |
| 78 |
66 virtual bool IsHandledProtocol(const std::string& scheme) const override { | 79 virtual bool IsHandledProtocol(const std::string& scheme) const override { |
67 return scheme == chrome::kExternalFileScheme; | 80 return scheme == chrome::kExternalFileScheme; |
68 } | 81 } |
69 | 82 |
70 virtual bool IsHandledURL(const GURL& url) const override { | 83 virtual bool IsHandledURL(const GURL& url) const override { |
71 return url.is_valid() && IsHandledProtocol(url.scheme()); | 84 return url.is_valid() && IsHandledProtocol(url.scheme()); |
72 } | 85 } |
73 | 86 |
74 virtual bool IsSafeRedirectTarget(const GURL& location) const override { | 87 virtual bool IsSafeRedirectTarget(const GURL& location) const override { |
75 return true; | 88 return true; |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 "Range", "Wrong Range Header Value", false /* overwrite */); | 430 "Range", "Wrong Range Header Value", false /* overwrite */); |
418 request->Start(); | 431 request->Start(); |
419 | 432 |
420 base::RunLoop().Run(); | 433 base::RunLoop().Run(); |
421 | 434 |
422 EXPECT_EQ(net::URLRequestStatus::FAILED, request->status().status()); | 435 EXPECT_EQ(net::URLRequestStatus::FAILED, request->status().status()); |
423 EXPECT_EQ(net::ERR_REQUEST_RANGE_NOT_SATISFIABLE, request->status().error()); | 436 EXPECT_EQ(net::ERR_REQUEST_RANGE_NOT_SATISFIABLE, request->status().error()); |
424 } | 437 } |
425 | 438 |
426 } // namespace chromeos | 439 } // namespace chromeos |
OLD | NEW |