summaryrefslogtreecommitdiffstats
path: root/mojo/fetcher/url_resolver.h
blob: 47a69faca19d46376abac78c265d84f0cf22c3f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef MOJO_FETCHER_URL_RESOLVER_H_
#define MOJO_FETCHER_URL_RESOLVER_H_

#include <map>
#include <set>

#include "base/basictypes.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "url/gurl.h"

namespace mojo {
namespace fetcher {

// Supports resolving "mojo:" URLs to a file location, with ".mojo" appended.
class URLResolver {
 public:
  explicit URLResolver(const GURL& mojo_base_url);
  ~URLResolver();

  // Resolve the given "mojo:" URL to the URL that should be used to fetch the
  // code for the corresponding Mojo App.
  GURL ResolveMojoURL(const GURL& mojo_url) const;

 private:
  GURL mojo_base_url_;

  DISALLOW_COPY_AND_ASSIGN(URLResolver);
};

}  // namespace fetcher
}  // namespace mojo

#endif  // MOJO_FETCHER_URL_RESOLVER_H_