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

Side by Side Diff: components/arc/net/arc_net_host_impl.h

Issue 2133503002: arc: Revamp the ArcBridgeService interface (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: More rebasing Created 4 years, 5 months 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
« no previous file with comments | « components/arc/metrics/arc_metrics_service.cc ('k') | components/arc/net/arc_net_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 COMPONENTS_ARC_NET_ARC_NET_HOST_IMPL_H_ 5 #ifndef COMPONENTS_ARC_NET_ARC_NET_HOST_IMPL_H_
6 #define COMPONENTS_ARC_NET_ARC_NET_HOST_IMPL_H_ 6 #define COMPONENTS_ARC_NET_ARC_NET_HOST_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/files/scoped_file.h" 12 #include "base/files/scoped_file.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "base/threading/thread_checker.h" 15 #include "base/threading/thread_checker.h"
16 #include "chromeos/network/network_state_handler_observer.h" 16 #include "chromeos/network/network_state_handler_observer.h"
17 #include "components/arc/arc_bridge_service.h" 17 #include "components/arc/arc_bridge_service.h"
18 #include "components/arc/arc_service.h" 18 #include "components/arc/arc_service.h"
19 #include "components/arc/common/net.mojom.h" 19 #include "components/arc/common/net.mojom.h"
20 #include "components/arc/instance_holder.h"
20 #include "mojo/public/cpp/bindings/binding.h" 21 #include "mojo/public/cpp/bindings/binding.h"
21 22
22 namespace base { 23 namespace base {
23 24
24 class DictionaryValue; 25 class DictionaryValue;
25 26
26 } // namespace base 27 } // namespace base
27 28
28 namespace arc { 29 namespace arc {
29 30
30 class ArcBridgeService; 31 class ArcBridgeService;
31 32
32 // Private implementation of ArcNetHost. 33 // Private implementation of ArcNetHost.
33 class ArcNetHostImpl : public ArcService, 34 class ArcNetHostImpl : public ArcService,
34 public ArcBridgeService::Observer, 35 public InstanceHolder<mojom::NetInstance>::Observer,
35 public chromeos::NetworkStateHandlerObserver, 36 public chromeos::NetworkStateHandlerObserver,
36 public mojom::NetHost { 37 public mojom::NetHost {
37 public: 38 public:
38 // The constructor will register an Observer with ArcBridgeService. 39 // The constructor will register an Observer with ArcBridgeService.
39 explicit ArcNetHostImpl(ArcBridgeService* arc_bridge_service); 40 explicit ArcNetHostImpl(ArcBridgeService* arc_bridge_service);
40 ~ArcNetHostImpl() override; 41 ~ArcNetHostImpl() override;
41 42
42 // ARC -> Chrome calls: 43 // ARC -> Chrome calls:
43 44
44 void GetNetworksDeprecated( 45 void GetNetworksDeprecated(
(...skipping 25 matching lines...) Expand all
70 void StartDisconnect(const mojo::String& guid, 71 void StartDisconnect(const mojo::String& guid,
71 const StartDisconnectCallback& callback) override; 72 const StartDisconnectCallback& callback) override;
72 73
73 // Overriden from chromeos::NetworkStateHandlerObserver. 74 // Overriden from chromeos::NetworkStateHandlerObserver.
74 void ScanCompleted(const chromeos::DeviceState* /*unused*/) override; 75 void ScanCompleted(const chromeos::DeviceState* /*unused*/) override;
75 void OnShuttingDown() override; 76 void OnShuttingDown() override;
76 void DefaultNetworkChanged(const chromeos::NetworkState* network) override; 77 void DefaultNetworkChanged(const chromeos::NetworkState* network) override;
77 void DeviceListChanged() override; 78 void DeviceListChanged() override;
78 void GetDefaultNetwork(const GetDefaultNetworkCallback& callback) override; 79 void GetDefaultNetwork(const GetDefaultNetworkCallback& callback) override;
79 80
80 // Overridden from ArcBridgeService::Observer: 81 // Overridden from ArcBridgeService::InterfaceObserver<mojom::NetInstance>:
81 void OnNetInstanceReady() override; 82 void OnInstanceReady() override;
82 83
83 private: 84 private:
84 void DefaultNetworkSuccessCallback(const std::string& service_path, 85 void DefaultNetworkSuccessCallback(const std::string& service_path,
85 const base::DictionaryValue& dictionary); 86 const base::DictionaryValue& dictionary);
86 base::ThreadChecker thread_checker_; 87 base::ThreadChecker thread_checker_;
87 mojo::Binding<arc::mojom::NetHost> binding_; 88 mojo::Binding<arc::mojom::NetHost> binding_;
88 base::WeakPtrFactory<ArcNetHostImpl> weak_factory_; 89 base::WeakPtrFactory<ArcNetHostImpl> weak_factory_;
89 90
90 DISALLOW_COPY_AND_ASSIGN(ArcNetHostImpl); 91 DISALLOW_COPY_AND_ASSIGN(ArcNetHostImpl);
91 }; 92 };
92 93
93 } // namespace arc 94 } // namespace arc
94 95
95 #endif // COMPONENTS_ARC_NET_ARC_NET_HOST_IMPL_H_ 96 #endif // COMPONENTS_ARC_NET_ARC_NET_HOST_IMPL_H_
OLDNEW
« no previous file with comments | « components/arc/metrics/arc_metrics_service.cc ('k') | components/arc/net/arc_net_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698