OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_MOJO_URL_RESOLVER_H_ | 5 #ifndef MOJO_SHELL_MOJO_URL_RESOLVER_H_ |
6 #define MOJO_SHELL_MOJO_URL_RESOLVER_H_ | 6 #define MOJO_SHELL_MOJO_URL_RESOLVER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 // If specified, then unknown "mojo:" URLs will be resolved relative to this | 24 // If specified, then unknown "mojo:" URLs will be resolved relative to this |
25 // base URL. That is, the portion after the colon will be appeneded to | 25 // base URL. That is, the portion after the colon will be appeneded to |
26 // |base_url| with platform-specific shared library prefix and suffix | 26 // |base_url| with platform-specific shared library prefix and suffix |
27 // inserted. | 27 // inserted. |
28 void SetBaseURL(const GURL& base_url); | 28 void SetBaseURL(const GURL& base_url); |
29 | 29 |
30 // Add a custom mapping for a particular "mojo:" URL. | 30 // Add a custom mapping for a particular "mojo:" URL. |
31 void AddCustomMapping(const GURL& mojo_url, const GURL& resolved_url); | 31 void AddCustomMapping(const GURL& mojo_url, const GURL& resolved_url); |
32 | 32 |
33 // Add a local file mapping for a particular "mojo:" URL. This causes the | 33 // Add a local file mapping for a particular "mojo:" URL. This causes the |
34 // "mojo:" URL to be resolved to an base::DIR_EXE-relative shared library. | 34 // "mojo:" URL to be resolved to a base::DIR_MODULE-relative shared library. |
35 void AddLocalFileMapping(const GURL& mojo_url); | 35 void AddLocalFileMapping(const GURL& mojo_url); |
36 | 36 |
37 // Resolve the given "mojo:" URL to the URL that should be used to fetch the | 37 // Resolve the given "mojo:" URL to the URL that should be used to fetch the |
38 // code for the corresponding Mojo App. | 38 // code for the corresponding Mojo App. |
39 GURL Resolve(const GURL& mojo_url) const; | 39 GURL Resolve(const GURL& mojo_url) const; |
40 | 40 |
41 private: | 41 private: |
42 std::map<GURL, GURL> url_map_; | 42 std::map<GURL, GURL> url_map_; |
43 std::set<GURL> local_file_set_; | 43 std::set<GURL> local_file_set_; |
| 44 GURL default_base_url_; |
44 GURL base_url_; | 45 GURL base_url_; |
45 }; | 46 }; |
46 | 47 |
47 } // namespace shell | 48 } // namespace shell |
48 } // namespace mojo | 49 } // namespace mojo |
49 | 50 |
50 #endif // MOJO_SHELL_MOJO_URL_RESOLVER_H_ | 51 #endif // MOJO_SHELL_MOJO_URL_RESOLVER_H_ |
OLD | NEW |