File: synchronous_shutdown_object_container_impl.h

package info (click to toggle)
chromium 138.0.7204.183-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,071,908 kB
  • sloc: cpp: 34,937,088; ansic: 7,176,967; javascript: 4,110,704; python: 1,419,953; asm: 946,768; xml: 739,971; pascal: 187,324; sh: 89,623; perl: 88,663; objc: 79,944; sql: 50,304; cs: 41,786; fortran: 24,137; makefile: 21,806; php: 13,980; tcl: 13,166; yacc: 8,925; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (158 lines) | stat: -rw-r--r-- 5,871 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROMEOS_ASH_COMPONENTS_TETHER_SYNCHRONOUS_SHUTDOWN_OBJECT_CONTAINER_IMPL_H_
#define CHROMEOS_ASH_COMPONENTS_TETHER_SYNCHRONOUS_SHUTDOWN_OBJECT_CONTAINER_IMPL_H_

#include <memory>

#include "base/memory/raw_ptr.h"
#include "chromeos/ash/components/network/network_handler.h"
#include "chromeos/ash/components/tether/synchronous_shutdown_object_container.h"

class PrefService;

namespace session_manager {
class SessionManager;
}  // namespace session_manager

namespace ash {

namespace device_sync {
class DeviceSyncClient;
}

namespace secure_channel {
class SecureChannelClient;
}

class NetworkConnect;
class NetworkStateHandler;

namespace tether {

class ActiveHost;
class ActiveHostNetworkStateUpdater;
class AsynchronousShutdownObjectContainer;
class ConnectionPreserver;
class NetworkConnectionHandlerTetherDelegate;
class DeviceIdTetherNetworkGuidMap;
class GmsCoreNotificationsStateTrackerImpl;
class HostScanner;
class HostScanScheduler;
class HotspotUsageDurationTracker;
class KeepAliveScheduler;
class HostConnectionMetricsLogger;
class TopLevelHostScanCache;
class NetworkHostScanCache;
class NetworkListSorter;
class NotificationPresenter;
class NotificationRemover;
class PersistentHostScanCache;
class TetherConnector;
class TetherDisconnector;
class TetherHostResponseRecorder;
class TetherNetworkDisconnectionHandler;
class TetherSessionCompletionLogger;
class WifiHotspotConnector;

// Concrete SynchronousShutdownObjectContainer implementation.
class SynchronousShutdownObjectContainerImpl
    : public SynchronousShutdownObjectContainer {
 public:
  class Factory {
   public:
    static std::unique_ptr<SynchronousShutdownObjectContainer> Create(
        AsynchronousShutdownObjectContainer* asychronous_container,
        NotificationPresenter* notification_presenter,
        GmsCoreNotificationsStateTrackerImpl*
            gms_core_notifications_state_tracker,
        PrefService* pref_service,
        NetworkHandler* network_handler,
        NetworkConnect* network_connect,
        session_manager::SessionManager* session_manager,
        device_sync::DeviceSyncClient* device_sync_client,
        secure_channel::SecureChannelClient* secure_channel_client);
    static void SetFactoryForTesting(Factory* factory);

   protected:
    virtual std::unique_ptr<SynchronousShutdownObjectContainer> CreateInstance(
        AsynchronousShutdownObjectContainer* asychronous_container,
        NotificationPresenter* notification_presenter,
        GmsCoreNotificationsStateTrackerImpl*
            gms_core_notifications_state_tracker,
        PrefService* pref_service,
        NetworkHandler* network_handler,
        NetworkConnect* network_connect,
        session_manager::SessionManager* session_manager,
        device_sync::DeviceSyncClient* device_sync_client,
        secure_channel::SecureChannelClient* secure_channel_client) = 0;
    virtual ~Factory();

   private:
    static Factory* factory_instance_;
  };

  SynchronousShutdownObjectContainerImpl(
      const SynchronousShutdownObjectContainerImpl&) = delete;
  SynchronousShutdownObjectContainerImpl& operator=(
      const SynchronousShutdownObjectContainerImpl&) = delete;

  ~SynchronousShutdownObjectContainerImpl() override;

  // SynchronousShutdownObjectContainer:
  ActiveHost* active_host() override;
  HostScanCache* host_scan_cache() override;
  HostScanScheduler* host_scan_scheduler() override;
  TetherDisconnector* tether_disconnector() override;

 protected:
  SynchronousShutdownObjectContainerImpl(
      AsynchronousShutdownObjectContainer* asychronous_container,
      NotificationPresenter* notification_presenter,
      GmsCoreNotificationsStateTrackerImpl*
          gms_core_notifications_state_tracker,
      PrefService* pref_service,
      NetworkHandler* network_handler,
      NetworkConnect* network_connect,
      session_manager::SessionManager* session_manager,
      device_sync::DeviceSyncClient* device_sync_client,
      secure_channel::SecureChannelClient* secure_channel_client);

 private:
  raw_ptr<NetworkStateHandler> network_state_handler_;

  std::unique_ptr<NetworkListSorter> network_list_sorter_;
  std::unique_ptr<TetherHostResponseRecorder> tether_host_response_recorder_;
  std::unique_ptr<DeviceIdTetherNetworkGuidMap>
      device_id_tether_network_guid_map_;
  std::unique_ptr<TetherSessionCompletionLogger>
      tether_session_completion_logger_;
  std::unique_ptr<WifiHotspotConnector> wifi_hotspot_connector_;
  std::unique_ptr<ActiveHost> active_host_;
  std::unique_ptr<ActiveHostNetworkStateUpdater>
      active_host_network_state_updater_;
  std::unique_ptr<PersistentHostScanCache> persistent_host_scan_cache_;
  std::unique_ptr<NetworkHostScanCache> network_host_scan_cache_;
  std::unique_ptr<TopLevelHostScanCache> top_level_host_scan_cache_;
  std::unique_ptr<NotificationRemover> notification_remover_;
  std::unique_ptr<KeepAliveScheduler> keep_alive_scheduler_;
  std::unique_ptr<HotspotUsageDurationTracker> hotspot_usage_duration_tracker_;
  std::unique_ptr<ConnectionPreserver> connection_preserver_;
  std::unique_ptr<HostScanner> host_scanner_;
  std::unique_ptr<HostScanScheduler> host_scan_scheduler_;
  std::unique_ptr<HostConnectionMetricsLogger> host_connection_metrics_logger_;
  std::unique_ptr<TetherConnector> tether_connector_;
  std::unique_ptr<TetherDisconnector> tether_disconnector_;
  std::unique_ptr<TetherNetworkDisconnectionHandler>
      tether_network_disconnection_handler_;
  std::unique_ptr<NetworkConnectionHandlerTetherDelegate>
      network_connection_handler_tether_delegate_;
};

}  // namespace tether

}  // namespace ash

#endif  // CHROMEOS_ASH_COMPONENTS_TETHER_SYNCHRONOUS_SHUTDOWN_OBJECT_CONTAINER_IMPL_H_