Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(648)

Side by Side Diff: mojo/fetcher/local_fetcher.h

Issue 1563413002: Move fetchers into mojo/shell/fetcher (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/fetcher/data_fetcher_unittest.cc ('k') | mojo/fetcher/local_fetcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MOJO_FETCHER_LOCAL_FETCHER_H_
6 #define MOJO_FETCHER_LOCAL_FETCHER_H_
7
8 #include <stdint.h>
9
10 #include <string>
11
12 #include "base/files/file_path.h"
13 #include "base/macros.h"
14 #include "mojo/shell/fetcher.h"
15 #include "url/gurl.h"
16
17 namespace mojo {
18
19 class NetworkService;
20
21 namespace fetcher {
22
23 // Implements Fetcher for file:// URLs.
24 class LocalFetcher : public shell::Fetcher {
25 public:
26 LocalFetcher(NetworkService* network_service,
27 const GURL& url,
28 const GURL& url_without_query,
29 const base::FilePath& shell_file_root,
30 const FetchCallback& loader_callback);
31
32 ~LocalFetcher() override;
33
34 void GetMimeTypeFromFileCallback(const mojo::String& mime_type);
35
36 private:
37 const GURL& GetURL() const override;
38 GURL GetRedirectURL() const override;
39 GURL GetRedirectReferer() const override;
40
41 URLResponsePtr AsURLResponse(base::TaskRunner* task_runner,
42 uint32_t skip) override;
43
44 void AsPath(
45 base::TaskRunner* task_runner,
46 base::Callback<void(const base::FilePath&, bool)> callback) override;
47
48 std::string MimeType() override;
49
50 bool HasMojoMagic() override;
51
52 bool PeekFirstLine(std::string* line) override;
53
54 GURL url_;
55 base::FilePath path_;
56 base::FilePath shell_file_root_;
57 std::string mime_type_;
58
59 DISALLOW_COPY_AND_ASSIGN(LocalFetcher);
60 };
61
62 } // namespace fetcher
63 } // namespace mojo
64
65 #endif // MOJO_FETCHER_LOCAL_FETCHER_H_
OLDNEW
« no previous file with comments | « mojo/fetcher/data_fetcher_unittest.cc ('k') | mojo/fetcher/local_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698