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_FETCHER_LOCAL_FETCHER_H_ |
6 #define MOJO_SHELL_LOCAL_FETCHER_H_ | 6 #define MOJO_FETCHER_LOCAL_FETCHER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "mojo/shell/fetcher.h" | 11 #include "mojo/shell/fetcher.h" |
12 #include "url/gurl.h" | 12 #include "url/gurl.h" |
13 | 13 |
14 namespace mojo { | 14 namespace mojo { |
15 | 15 |
16 class NetworkService; | 16 class NetworkService; |
17 | 17 |
18 namespace shell { | 18 namespace fetcher { |
19 | 19 |
20 // Implements Fetcher for file:// URLs. | 20 // Implements Fetcher for file:// URLs. |
21 class LocalFetcher : public Fetcher { | 21 class LocalFetcher : public shell::Fetcher { |
22 public: | 22 public: |
23 LocalFetcher(NetworkService* network_service, | 23 LocalFetcher(NetworkService* network_service, |
24 const GURL& url, | 24 const GURL& url, |
25 const GURL& url_without_query, | 25 const GURL& url_without_query, |
26 const FetchCallback& loader_callback); | 26 const FetchCallback& loader_callback); |
27 | 27 |
28 void GetMimeTypeFromFileCallback(const mojo::String& mime_type); | 28 void GetMimeTypeFromFileCallback(const mojo::String& mime_type); |
29 | 29 |
30 private: | 30 private: |
31 const GURL& GetURL() const override; | 31 const GURL& GetURL() const override; |
(...skipping 13 matching lines...) Expand all Loading... |
45 | 45 |
46 bool PeekFirstLine(std::string* line) override; | 46 bool PeekFirstLine(std::string* line) override; |
47 | 47 |
48 GURL url_; | 48 GURL url_; |
49 base::FilePath path_; | 49 base::FilePath path_; |
50 std::string mime_type_; | 50 std::string mime_type_; |
51 | 51 |
52 DISALLOW_COPY_AND_ASSIGN(LocalFetcher); | 52 DISALLOW_COPY_AND_ASSIGN(LocalFetcher); |
53 }; | 53 }; |
54 | 54 |
55 } // namespace shell | 55 } // namespace fetcher |
56 | |
57 } // namespace mojo | 56 } // namespace mojo |
58 | 57 |
59 #endif // MOJO_SHELL_LOCAL_FETCHER_H_ | 58 #endif // MOJO_FETCHER_LOCAL_FETCHER_H_ |
OLD | NEW |