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_NETWORK_FETCHER_H_ | 5 #ifndef MOJO_FETCHER_NETWORK_FETCHER_H_ |
6 #define MOJO_SHELL_NETWORK_FETCHER_H_ | 6 #define MOJO_FETCHER_NETWORK_FETCHER_H_ |
7 | 7 |
8 #include "mojo/shell/fetcher.h" | 8 #include "mojo/shell/fetcher.h" |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "mojo/services/network/public/interfaces/url_loader.mojom.h" | 12 #include "mojo/services/network/public/interfaces/url_loader.mojom.h" |
13 #include "url/gurl.h" | 13 #include "url/gurl.h" |
14 | 14 |
15 namespace mojo { | 15 namespace mojo { |
16 | 16 |
17 class URLLoaderFactory; | 17 class URLLoaderFactory; |
18 | 18 |
19 namespace shell { | 19 namespace fetcher { |
20 | 20 |
21 // Implements Fetcher for http[s] files. | 21 // Implements Fetcher for http[s] files. |
22 class NetworkFetcher : public Fetcher { | 22 class NetworkFetcher : public shell::Fetcher { |
23 public: | 23 public: |
24 NetworkFetcher(bool disable_cache, | 24 NetworkFetcher(bool disable_cache, |
25 mojo::URLRequestPtr request, | 25 mojo::URLRequestPtr request, |
26 URLLoaderFactory* url_loader_factory, | 26 URLLoaderFactory* url_loader_factory, |
27 const FetchCallback& loader_callback); | 27 const FetchCallback& loader_callback); |
28 | 28 |
29 ~NetworkFetcher() override; | 29 ~NetworkFetcher() override; |
30 | 30 |
31 private: | 31 private: |
32 // TODO(hansmuller): Revisit this when a real peek operation is available. | 32 // TODO(hansmuller): Revisit this when a real peek operation is available. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 bool disable_cache_; | 72 bool disable_cache_; |
73 const GURL url_; | 73 const GURL url_; |
74 URLLoaderPtr url_loader_; | 74 URLLoaderPtr url_loader_; |
75 URLResponsePtr response_; | 75 URLResponsePtr response_; |
76 base::FilePath path_; | 76 base::FilePath path_; |
77 base::WeakPtrFactory<NetworkFetcher> weak_ptr_factory_; | 77 base::WeakPtrFactory<NetworkFetcher> weak_ptr_factory_; |
78 | 78 |
79 DISALLOW_COPY_AND_ASSIGN(NetworkFetcher); | 79 DISALLOW_COPY_AND_ASSIGN(NetworkFetcher); |
80 }; | 80 }; |
81 | 81 |
82 } // namespace shell | 82 } // namespace fetcher |
83 } // namespace mojo | 83 } // namespace mojo |
84 | 84 |
85 #endif // MOJO_SHELL_NETWORK_FETCHER_H_ | 85 #endif // MOJO_FETCHER_NETWORK_FETCHER_H_ |
OLD | NEW |