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