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

Side by Side Diff: mojo/tools/package_manager/package_manager_application.h

Issue 705703002: Remove mojo/tools/, not needed in chromium (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove gyp Created 6 years, 1 month 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MOJO_PACKAGE_MANAGER_PACKAGE_MANAGER_APPLICATION_H_
6 #define MOJO_PACKAGE_MANAGER_PACKAGE_MANAGER_APPLICATION_H_
7
8 #include <map>
9 #include <set>
10
11 #include "mojo/public/cpp/application/application_delegate.h"
12 #include "mojo/public/cpp/application/interface_factory.h"
13 #include "mojo/public/cpp/system/macros.h"
14 #include "mojo/services/public/interfaces/network/network_service.mojom.h"
15 #include "mojo/tools/package_manager/package_fetcher.h"
16
17 namespace mojo {
18
19 class Manifest;
20
21 class PackageManagerApplication
22 : public ApplicationDelegate,
23 public PackageFetcherDelegate {
24 public:
25 PackageManagerApplication();
26 virtual ~PackageManagerApplication();
27
28 private:
29 struct PendingLoad {
30 PendingLoad();
31 ~PendingLoad();
32
33 scoped_ptr<PackageFetcher> fetcher;
34 };
35 typedef std::map<GURL, PendingLoad*> PendingLoadMap;
36
37 void StartLoad(const GURL& url);
38
39 void LoadDeps(const Manifest& manifest);
40
41 // Deletes the pending load entry for the given URL and possibly exits the
42 // message loop if all loads are done.
43 void PendingLoadComplete(const GURL& url);
44
45 // ApplicationDelegate implementation.
46 virtual void Initialize(ApplicationImpl* app) override;
47
48 // PackageFetcher.
49 virtual void FetchSucceeded(const GURL& url,
50 const base::FilePath& name) override;
51 virtual void FetchFailed(const GURL& url) override;
52
53 mojo::NetworkServicePtr network_service_;
54
55 PendingLoadMap pending_; // Owning pointers.
56 std::set<GURL> completed_;
57
58 MOJO_DISALLOW_COPY_AND_ASSIGN(PackageManagerApplication);
59 };
60
61 } // namespace mojo
62
63 #endif // MOJO_PACKAGE_MANAGER_PACKAGE_MANAGER_APPLICATION_H
OLDNEW
« no previous file with comments | « mojo/tools/package_manager/package_manager.cc ('k') | mojo/tools/package_manager/package_manager_application.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698