| 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 SHELL_URL_RESOLVER_H_ | 5 #ifndef SHELL_URL_RESOLVER_H_ |
| 6 #define SHELL_URL_RESOLVER_H_ | 6 #define SHELL_URL_RESOLVER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 13 #include "url/gurl.h" | 13 #include "url/gurl.h" |
| 14 | 14 |
| 15 namespace mojo { | |
| 16 namespace shell { | 15 namespace shell { |
| 17 | 16 |
| 18 // This class supports the mapping of URLs to other URLs. | 17 // This class supports the mapping of URLs to other URLs. |
| 19 // It's commonly used with mojo: URL, to provide a physical location (i.e. | 18 // It's commonly used with mojo: URL, to provide a physical location (i.e. |
| 20 // file: or https:) but works with any URL. | 19 // file: or https:) but works with any URL. |
| 21 // By default, "mojo:" URLs resolve to a file location, with ".mojo" appended, | 20 // By default, "mojo:" URLs resolve to a file location, with ".mojo" appended, |
| 22 // but that resolution can be customized via the AddCustomMapping method. | 21 // but that resolution can be customized via the AddCustomMapping method. |
| 23 class URLResolver { | 22 class URLResolver { |
| 24 public: | 23 public: |
| 25 URLResolver(); | 24 URLResolver(); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 private: | 65 private: |
| 67 using GURLToGURLMap = std::map<GURL, GURL>; | 66 using GURLToGURLMap = std::map<GURL, GURL>; |
| 68 GURLToGURLMap url_map_; | 67 GURLToGURLMap url_map_; |
| 69 GURLToGURLMap origin_map_; | 68 GURLToGURLMap origin_map_; |
| 70 GURL mojo_base_url_; | 69 GURL mojo_base_url_; |
| 71 | 70 |
| 72 DISALLOW_COPY_AND_ASSIGN(URLResolver); | 71 DISALLOW_COPY_AND_ASSIGN(URLResolver); |
| 73 }; | 72 }; |
| 74 | 73 |
| 75 } // namespace shell | 74 } // namespace shell |
| 76 } // namespace mojo | |
| 77 | 75 |
| 78 #endif // SHELL_URL_RESOLVER_H_ | 76 #endif // SHELL_URL_RESOLVER_H_ |
| OLD | NEW |