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

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

Issue 1338283003: Revert of Move fetching logic out of ApplicationManager, eliminate url mappings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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/base_application_fetcher.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 <string>
9
10 #include "base/files/file_path.h"
11 #include "mojo/shell/fetcher.h"
12 #include "url/gurl.h"
13
14 namespace mojo {
15
16 class NetworkService;
17
18 namespace fetcher {
19
20 // Implements Fetcher for file:// URLs.
21 class LocalFetcher : public shell::Fetcher {
22 public:
23 LocalFetcher(NetworkService* network_service,
24 const GURL& url,
25 const GURL& url_without_query,
26 const FetchCallback& loader_callback);
27
28 void GetMimeTypeFromFileCallback(const mojo::String& mime_type);
29
30 private:
31 const GURL& GetURL() const override;
32 GURL GetRedirectURL() const override;
33 GURL GetRedirectReferer() const override;
34
35 URLResponsePtr AsURLResponse(base::TaskRunner* task_runner,
36 uint32_t skip) override;
37
38 void AsPath(
39 base::TaskRunner* task_runner,
40 base::Callback<void(const base::FilePath&, bool)> callback) override;
41
42 std::string MimeType() override;
43
44 bool HasMojoMagic() override;
45
46 bool PeekFirstLine(std::string* line) override;
47
48 GURL url_;
49 base::FilePath path_;
50 std::string mime_type_;
51
52 DISALLOW_COPY_AND_ASSIGN(LocalFetcher);
53 };
54
55 } // namespace fetcher
56 } // namespace mojo
57
58 #endif // MOJO_FETCHER_LOCAL_FETCHER_H_
OLDNEW
« no previous file with comments | « mojo/fetcher/base_application_fetcher.cc ('k') | mojo/fetcher/local_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698