| OLD | NEW |
| (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_SHELL_NETWORK_APPLICATION_LOADER_H_ | |
| 6 #define MOJO_SHELL_NETWORK_APPLICATION_LOADER_H_ | |
| 7 | |
| 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" | |
| 15 | |
| 16 namespace mojo { | |
| 17 | |
| 18 class ApplicationImpl; | |
| 19 class NetworkService; | |
| 20 | |
| 21 namespace shell { | |
| 22 | |
| 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(); | |
| 30 | |
| 31 private: | |
| 32 // ApplicationLoader overrides: | |
| 33 virtual void Load(ApplicationManager* manager, | |
| 34 const GURL& url, | |
| 35 ScopedMessagePipeHandle shell_handle, | |
| 36 LoadCallback callback) override; | |
| 37 virtual void OnApplicationError(ApplicationManager* manager, | |
| 38 const GURL& url) override; | |
| 39 | |
| 40 // ApplicationDelegate overrides. | |
| 41 virtual void Initialize(ApplicationImpl* app) override; | |
| 42 virtual bool ConfigureIncomingConnection( | |
| 43 ApplicationConnection* connection) override; | |
| 44 | |
| 45 // InterfaceFactory<NetworkService> overrides. | |
| 46 virtual void Create(ApplicationConnection* connection, | |
| 47 InterfaceRequest<NetworkService> request) override; | |
| 48 | |
| 49 base::ScopedPtrHashMap<uintptr_t, ApplicationImpl> apps_; | |
| 50 scoped_ptr<NetworkContext> context_; | |
| 51 | |
| 52 DISALLOW_COPY_AND_ASSIGN(NetworkApplicationLoader); | |
| 53 }; | |
| 54 | |
| 55 } // namespace shell | |
| 56 } // namespace mojo | |
| 57 | |
| 58 #endif // MOJO_SHELL_NETWORK_APPLICATION_LOADER_H_ | |
| OLD | NEW |