OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef MOJO_SHELL_LOCAL_FETCHER_H_ | 5 #ifndef MOJO_SHELL_LOCAL_FETCHER_H_ |
6 #define MOJO_SHELL_LOCAL_FETCHER_H_ | 6 #define MOJO_SHELL_LOCAL_FETCHER_H_ |
7 | 7 |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "mojo/services/network/public/interfaces/url_loader.mojom.h" | 9 #include "mojo/services/network/public/interfaces/url_loader.mojom.h" |
10 #include "mojo/shell/fetcher.h" | 10 #include "mojo/shell/fetcher.h" |
11 #include "url/gurl.h" | 11 #include "url/gurl.h" |
12 | 12 |
13 namespace mojo { | 13 namespace mojo { |
14 namespace shell { | 14 namespace shell { |
15 | 15 |
16 // Implements Fetcher for file:// URLs. | 16 // Implements Fetcher for file:// URLs. |
17 class LocalFetcher : public Fetcher { | 17 class LocalFetcher : public Fetcher { |
18 public: | 18 public: |
19 LocalFetcher(const GURL& url, | 19 LocalFetcher(const GURL& url, |
20 const GURL& url_without_query, | 20 const GURL& url_without_query, |
21 const FetchCallback& loader_callback); | 21 const FetchCallback& loader_callback); |
22 | 22 |
23 private: | 23 private: |
24 const GURL& GetURL() const override; | 24 const GURL& GetURL() const override; |
25 GURL GetRedirectURL() const override; | 25 GURL GetRedirectURL() const override; |
| 26 GURL GetRedirectReferer() const override; |
26 | 27 |
27 URLResponsePtr AsURLResponse(base::TaskRunner* task_runner, | 28 URLResponsePtr AsURLResponse(base::TaskRunner* task_runner, |
28 uint32_t skip) override; | 29 uint32_t skip) override; |
29 | 30 |
30 void AsPath( | 31 void AsPath( |
31 base::TaskRunner* task_runner, | 32 base::TaskRunner* task_runner, |
32 base::Callback<void(const base::FilePath&, bool)> callback) override; | 33 base::Callback<void(const base::FilePath&, bool)> callback) override; |
33 | 34 |
34 std::string MimeType() override; | 35 std::string MimeType() override; |
35 | 36 |
36 bool HasMojoMagic() override; | 37 bool HasMojoMagic() override; |
37 | 38 |
38 bool PeekFirstLine(std::string* line) override; | 39 bool PeekFirstLine(std::string* line) override; |
39 | 40 |
40 GURL url_; | 41 GURL url_; |
41 base::FilePath path_; | 42 base::FilePath path_; |
42 | 43 |
43 DISALLOW_COPY_AND_ASSIGN(LocalFetcher); | 44 DISALLOW_COPY_AND_ASSIGN(LocalFetcher); |
44 }; | 45 }; |
45 | 46 |
46 } // namespace shell | 47 } // namespace shell |
47 } // namespace mojo | 48 } // namespace mojo |
48 | 49 |
49 #endif // MOJO_SHELL_LOCAL_FETCHER_H_ | 50 #endif // MOJO_SHELL_LOCAL_FETCHER_H_ |
OLD | NEW |