Stop retring GCM unregistration requests after reaching maximum number
[chromium-blink-merge.git] / mojo / shell / local_fetcher.h
blobcd25c88d071b4661d89bf77e82ff6b93165f2d36
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.
5 #ifndef MOJO_SHELL_LOCAL_FETCHER_H_
6 #define MOJO_SHELL_LOCAL_FETCHER_H_
8 #include "base/files/file_path.h"
9 #include "mojo/services/network/public/interfaces/url_loader.mojom.h"
10 #include "mojo/shell/fetcher.h"
11 #include "url/gurl.h"
13 namespace mojo {
14 namespace shell {
16 // Implements Fetcher for file:// URLs.
17 class LocalFetcher : public Fetcher {
18 public:
19 LocalFetcher(const GURL& url,
20 const GURL& url_without_query,
21 const FetchCallback& loader_callback);
23 private:
24 const GURL& GetURL() const override;
25 GURL GetRedirectURL() const override;
26 GURL GetRedirectReferer() const override;
28 URLResponsePtr AsURLResponse(base::TaskRunner* task_runner,
29 uint32_t skip) override;
31 void AsPath(
32 base::TaskRunner* task_runner,
33 base::Callback<void(const base::FilePath&, bool)> callback) override;
35 std::string MimeType() override;
37 bool HasMojoMagic() override;
39 bool PeekFirstLine(std::string* line) override;
41 GURL url_;
42 base::FilePath path_;
44 DISALLOW_COPY_AND_ASSIGN(LocalFetcher);
47 } // namespace shell
48 } // namespace mojo
50 #endif // MOJO_SHELL_LOCAL_FETCHER_H_