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

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

Issue 1572483002: Implement OnGetNetworks for net.mojom (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_ARC_NET_ARC_NET_HOST_IMPL_H_
6 #define COMPONENTS_ARC_NET_ARC_NET_HOST_IMPL_H_
7
8 #include <stdint.h>
9 #include <string>
10 #include <vector>
11
12 #include "base/files/scoped_file.h"
13 #include "base/macros.h"
14 #include "base/threading/thread_checker.h"
15 #include "components/arc/arc_bridge_service.h"
16 #include "components/arc/common/net.mojom.h"
17 #include "mojo/public/cpp/bindings/binding.h"
18
19 namespace arc {
20
21 class ArcBridgeService;
22
23 // Private implementation of ArcNetHost
hidehiko 2016/01/15 08:38:39 nit: '.' at the end.
cernekee 2016/01/15 22:45:36 Done.
24 class ArcNetHostImpl : public NetHost, public ArcBridgeService::Observer {
25 public:
26 // The constructor will register an Observer with ArcBridgeService.
27 explicit ArcNetHostImpl(ArcBridgeService* arc_bridge_service);
28 ~ArcNetHostImpl() override;
29
30 // Called when a GetNetworks call is sent from ARC.
31 void GetNetworks(bool configured_only,
32 bool visible_only,
33 const GetNetworksCallback& callback);
34
35 // Overridden from ArcBridgeService::Observer:
36 void OnNetInstanceReady() override;
37
38 private:
39 // Owned by ArcServiceManager which makes sure ArcBridgeService is destroyed
40 // after ArcNetHost.
41 ArcBridgeService* arc_bridge_service_;
42
43 base::ThreadChecker thread_checker_;
44 mojo::Binding<arc::NetHost> binding_;
45
46 // WeakPtrFactory to use for callbacks.
47 base::WeakPtrFactory<ArcNetHostImpl> weak_factory_;
48
49 DISALLOW_COPY_AND_ASSIGN(ArcNetHostImpl);
50 };
51
52 } // namespace arc
53
54 #endif // COMPONENTS_ARC_NET_ARC_NET_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698