cc: Make picture pile base thread safe.
[chromium-blink-merge.git] / mojo / shell / network_application_loader.h
blob0f426b0aa62f3529a932c11a2e583a29d007316c
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.
5 #ifndef MOJO_SHELL_NETWORK_APPLICATION_LOADER_H_
6 #define MOJO_SHELL_NETWORK_APPLICATION_LOADER_H_
8 #include "base/containers/scoped_ptr_hash_map.h"
9 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "mojo/application_manager/application_loader.h"
12 #include "mojo/public/cpp/application/application_delegate.h"
13 #include "mojo/public/cpp/application/interface_factory.h"
14 #include "mojo/services/network/network_context.h"
16 namespace mojo {
18 class ApplicationImpl;
19 class NetworkService;
21 namespace shell {
23 // ApplicationLoader responsible for creating connections to the NetworkService.
24 class NetworkApplicationLoader : public ApplicationLoader,
25 public ApplicationDelegate,
26 public InterfaceFactory<NetworkService> {
27 public:
28 NetworkApplicationLoader();
29 virtual ~NetworkApplicationLoader();
31 private:
32 // ApplicationLoader overrides:
33 virtual void Load(ApplicationManager* manager,
34 const GURL& url,
35 scoped_refptr<LoadCallbacks> callbacks) override;
36 virtual void OnApplicationError(ApplicationManager* manager,
37 const GURL& url) override;
39 // ApplicationDelegate overrides.
40 virtual void Initialize(ApplicationImpl* app) override;
41 virtual bool ConfigureIncomingConnection(
42 ApplicationConnection* connection) override;
44 // InterfaceFactory<NetworkService> overrides.
45 virtual void Create(ApplicationConnection* connection,
46 InterfaceRequest<NetworkService> request) override;
48 base::ScopedPtrHashMap<uintptr_t, ApplicationImpl> apps_;
49 scoped_ptr<NetworkContext> context_;
51 DISALLOW_COPY_AND_ASSIGN(NetworkApplicationLoader);
54 } // namespace shell
55 } // namespace mojo
57 #endif // MOJO_SHELL_NETWORK_APPLICATION_LOADER_H_