OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_dir_job.h" | 5 #include "net/url_request/url_request_file_dir_job.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 URLRequestJob* MaybeInterceptResponse( | 57 URLRequestJob* MaybeInterceptResponse( |
58 URLRequest* request, | 58 URLRequest* request, |
59 NetworkDelegate* network_delegate) const override { | 59 NetworkDelegate* network_delegate) const override { |
60 return nullptr; | 60 return nullptr; |
61 } | 61 } |
62 | 62 |
63 bool IsHandledProtocol(const std::string& scheme) const override { | 63 bool IsHandledProtocol(const std::string& scheme) const override { |
64 return scheme == "file"; | 64 return scheme == "file"; |
65 } | 65 } |
66 | 66 |
67 bool IsHandledURL(const GURL& url) const override { | |
68 return IsHandledProtocol(url.scheme()); | |
69 } | |
70 | |
71 bool IsSafeRedirectTarget(const GURL& location) const override { | 67 bool IsSafeRedirectTarget(const GURL& location) const override { |
72 return false; | 68 return false; |
73 } | 69 } |
74 | 70 |
75 private: | 71 private: |
76 const base::FilePath path_; | 72 const base::FilePath path_; |
77 | 73 |
78 DISALLOW_COPY_AND_ASSIGN(TestJobFactory); | 74 DISALLOW_COPY_AND_ASSIGN(TestJobFactory); |
79 }; | 75 }; |
80 | 76 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 ASSERT_GT(delegate.bytes_received(), 0); | 245 ASSERT_GT(delegate.bytes_received(), 0); |
250 ASSERT_LE(delegate.bytes_received(), kBufferSize); | 246 ASSERT_LE(delegate.bytes_received(), kBufferSize); |
251 EXPECT_TRUE(delegate.data_received().find( | 247 EXPECT_TRUE(delegate.data_received().find( |
252 directory.GetPath().BaseName().MaybeAsASCII()) != | 248 directory.GetPath().BaseName().MaybeAsASCII()) != |
253 std::string::npos); | 249 std::string::npos); |
254 } | 250 } |
255 | 251 |
256 } // namespace | 252 } // namespace |
257 | 253 |
258 } // namespace net | 254 } // namespace net |
OLD | NEW |