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 SHELL_APPLICATION_MANAGER_FETCHER_H_ | 5 #ifndef SHELL_APPLICATION_MANAGER_FETCHER_H_ |
6 #define SHELL_APPLICATION_MANAGER_FETCHER_H_ | 6 #define SHELL_APPLICATION_MANAGER_FETCHER_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 | 10 |
11 #include "mojo/services/network/public/interfaces/url_loader.mojom.h" | 11 #include "mojo/services/network/public/interfaces/url_loader.mojom.h" |
12 | 12 |
13 class GURL; | 13 class GURL; |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 | |
17 class FilePath; | 16 class FilePath; |
18 class TaskRunner; | 17 class TaskRunner; |
19 } | 18 } |
20 | 19 |
21 namespace mojo { | 20 namespace mojo { |
| 21 namespace shell { |
22 | 22 |
23 // Fetcher abstracts getting an application by either file or http[s] URL. | 23 // Fetcher abstracts getting an application by either file or http[s] URL. |
24 // | 24 // |
25 // Although it is possible to use the Network implementation for http[s] URLs | 25 // Although it is possible to use the Network implementation for http[s] URLs |
26 // (because the underlying net library knows how to handle them), it is | 26 // (because the underlying net library knows how to handle them), it is |
27 // extremely slow because network responses must be copied to disk in order to | 27 // extremely slow because network responses must be copied to disk in order to |
28 // get a file handle we can use with dlopen. | 28 // get a file handle we can use with dlopen. |
29 // | 29 // |
30 // Until this is solved, we use two different implementations so that | 30 // Until this is solved, we use two different implementations so that |
31 // performance isn't completely absymal. | 31 // performance isn't completely absymal. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 bool PeekContentHandler(std::string* mojo_shebang, | 63 bool PeekContentHandler(std::string* mojo_shebang, |
64 GURL* mojo_content_handler_url); | 64 GURL* mojo_content_handler_url); |
65 | 65 |
66 protected: | 66 protected: |
67 static const char kMojoMagic[]; | 67 static const char kMojoMagic[]; |
68 static const size_t kMaxShebangLength; | 68 static const size_t kMaxShebangLength; |
69 | 69 |
70 FetchCallback loader_callback_; | 70 FetchCallback loader_callback_; |
71 }; | 71 }; |
72 | 72 |
| 73 } // namespace shell |
73 } // namespace mojo | 74 } // namespace mojo |
74 | 75 |
75 #endif // SHELL_APPLICATION_MANAGER_FETCHER_H_ | 76 #endif // SHELL_APPLICATION_MANAGER_FETCHER_H_ |
OLD | NEW |