| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MOJO_SHELL_NETWORK_APPLICATION_LOADER_H_ | 5 #ifndef MOJO_SHELL_NETWORK_APPLICATION_LOADER_H_ |
| 6 #define MOJO_SHELL_NETWORK_APPLICATION_LOADER_H_ | 6 #define MOJO_SHELL_NETWORK_APPLICATION_LOADER_H_ |
| 7 | 7 |
| 8 #include <map> | |
| 9 | |
| 10 #include "base/containers/scoped_ptr_hash_map.h" | 8 #include "base/containers/scoped_ptr_hash_map.h" |
| 9 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 12 #include "mojo/application_manager/application_loader.h" | 11 #include "mojo/application_manager/application_loader.h" |
| 13 #include "mojo/public/cpp/application/application_delegate.h" | 12 #include "mojo/public/cpp/application/application_delegate.h" |
| 14 #include "mojo/public/cpp/application/interface_factory.h" | 13 #include "mojo/public/cpp/application/interface_factory.h" |
| 15 #include "mojo/services/network/network_context.h" | 14 #include "mojo/services/network/network_context.h" |
| 16 | 15 |
| 17 namespace mojo { | 16 namespace mojo { |
| 18 | 17 |
| 19 class ApplicationImpl; | 18 class ApplicationImpl; |
| 20 class NetworkService; | 19 class NetworkService; |
| 21 | 20 |
| 22 namespace shell { | 21 namespace shell { |
| 23 | 22 |
| 24 // ApplicationLoader responsible for creating connections to the NetworkService. | 23 // ApplicationLoader responsible for creating connections to the NetworkService. |
| 25 class NetworkApplicationLoader : public ApplicationLoader, | 24 class NetworkApplicationLoader : public ApplicationLoader, |
| 26 public ApplicationDelegate, | 25 public ApplicationDelegate, |
| 27 public InterfaceFactory<NetworkService> { | 26 public InterfaceFactory<NetworkService> { |
| 28 public: | 27 public: |
| 29 NetworkApplicationLoader(); | 28 NetworkApplicationLoader(); |
| 30 virtual ~NetworkApplicationLoader(); | 29 virtual ~NetworkApplicationLoader(); |
| 31 | 30 |
| 32 private: | 31 private: |
| 33 // ApplicationLoader overrides: | 32 // ApplicationLoader overrides: |
| 34 virtual void Load(ApplicationManager* manager, | 33 virtual void Load(ApplicationManager* manager, |
| 35 const GURL& url, | 34 const GURL& url, |
| 36 scoped_refptr<LoadCallbacks> callbacks) OVERRIDE; | 35 scoped_refptr<LoadCallbacks> callbacks) override; |
| 37 virtual void OnApplicationError(ApplicationManager* manager, | 36 virtual void OnApplicationError(ApplicationManager* manager, |
| 38 const GURL& url) OVERRIDE; | 37 const GURL& url) override; |
| 39 | 38 |
| 40 // ApplicationDelegate overrides. | 39 // ApplicationDelegate overrides. |
| 41 virtual void Initialize(ApplicationImpl* app) OVERRIDE; | 40 virtual void Initialize(ApplicationImpl* app) override; |
| 42 virtual bool ConfigureIncomingConnection( | 41 virtual bool ConfigureIncomingConnection( |
| 43 ApplicationConnection* connection) OVERRIDE; | 42 ApplicationConnection* connection) override; |
| 44 | 43 |
| 45 // InterfaceFactory<NetworkService> overrides. | 44 // InterfaceFactory<NetworkService> overrides. |
| 46 virtual void Create(ApplicationConnection* connection, | 45 virtual void Create(ApplicationConnection* connection, |
| 47 InterfaceRequest<NetworkService> request) OVERRIDE; | 46 InterfaceRequest<NetworkService> request) override; |
| 48 | 47 |
| 49 base::ScopedPtrHashMap<uintptr_t, ApplicationImpl> apps_; | 48 base::ScopedPtrHashMap<uintptr_t, ApplicationImpl> apps_; |
| 50 scoped_ptr<NetworkContext> context_; | 49 scoped_ptr<NetworkContext> context_; |
| 51 | 50 |
| 52 DISALLOW_COPY_AND_ASSIGN(NetworkApplicationLoader); | 51 DISALLOW_COPY_AND_ASSIGN(NetworkApplicationLoader); |
| 53 }; | 52 }; |
| 54 | 53 |
| 55 } // namespace shell | 54 } // namespace shell |
| 56 } // namespace mojo | 55 } // namespace mojo |
| 57 | 56 |
| 58 #endif // MOJO_SHELL_NETWORK_APPLICATION_LOADER_H_ | 57 #endif // MOJO_SHELL_NETWORK_APPLICATION_LOADER_H_ |
| OLD | NEW |