| 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_FETCHER_LOCAL_FETCHER_H_ | 5 #ifndef MOJO_SHELL_FETCHER_LOCAL_FETCHER_H_ |
| 6 #define MOJO_FETCHER_LOCAL_FETCHER_H_ | 6 #define MOJO_SHELL_FETCHER_LOCAL_FETCHER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "mojo/shell/fetcher.h" | 14 #include "mojo/shell/fetcher.h" |
| 15 #include "url/gurl.h" | 15 #include "url/gurl.h" |
| 16 | 16 |
| 17 namespace mojo { | 17 namespace mojo { |
| 18 | 18 |
| 19 class NetworkService; | 19 class NetworkService; |
| 20 | 20 |
| 21 namespace fetcher { | 21 namespace shell { |
| 22 | 22 |
| 23 // Implements Fetcher for file:// URLs. | 23 // Implements Fetcher for file:// URLs. |
| 24 class LocalFetcher : public shell::Fetcher { | 24 class LocalFetcher : public Fetcher { |
| 25 public: | 25 public: |
| 26 LocalFetcher(NetworkService* network_service, | 26 LocalFetcher(NetworkService* network_service, |
| 27 const GURL& url, | 27 const GURL& url, |
| 28 const GURL& url_without_query, | 28 const GURL& url_without_query, |
| 29 const base::FilePath& shell_file_root, | 29 const base::FilePath& shell_file_root, |
| 30 const FetchCallback& loader_callback); | 30 const FetchCallback& loader_callback); |
| 31 | 31 |
| 32 ~LocalFetcher() override; | 32 ~LocalFetcher() override; |
| 33 | 33 |
| 34 void GetMimeTypeFromFileCallback(const mojo::String& mime_type); | 34 void GetMimeTypeFromFileCallback(const mojo::String& mime_type); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 52 bool PeekFirstLine(std::string* line) override; | 52 bool PeekFirstLine(std::string* line) override; |
| 53 | 53 |
| 54 GURL url_; | 54 GURL url_; |
| 55 base::FilePath path_; | 55 base::FilePath path_; |
| 56 base::FilePath shell_file_root_; | 56 base::FilePath shell_file_root_; |
| 57 std::string mime_type_; | 57 std::string mime_type_; |
| 58 | 58 |
| 59 DISALLOW_COPY_AND_ASSIGN(LocalFetcher); | 59 DISALLOW_COPY_AND_ASSIGN(LocalFetcher); |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 } // namespace fetcher | 62 } // namespace shell |
| 63 } // namespace mojo | 63 } // namespace mojo |
| 64 | 64 |
| 65 #endif // MOJO_FETCHER_LOCAL_FETCHER_H_ | 65 #endif // MOJO_SHELL_FETCHER_LOCAL_FETCHER_H_ |
| OLD | NEW |