forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnetwork_checker.h
34 lines (25 loc) · 1.19 KB
/
network_checker.h
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
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_CHROME_CLEANER_LOGGING_NETWORK_CHECKER_H_
#define CHROME_CHROME_CLEANER_LOGGING_NETWORK_CHECKER_H_
#include "base/time/time.h"
#include "url/gurl.h"
namespace chrome_cleaner {
// Base class that provides methods to test whether Safe Browsing is reachable
// or not, and to wait for it to be reachable.
class NetworkChecker {
public:
virtual ~NetworkChecker() = default;
// Returns whether Safe Browsing is currently reachable or not.
virtual bool IsSafeBrowsingReachable(const GURL& upload_url) const = 0;
// Blocks until Safe Browsing is reachable, up to |wait_time|, whichever
// happens first. Returns whether Safe Browsing is reachable or not when this
// function exits.
virtual bool WaitForSafeBrowsing(const GURL& upload_url,
const base::TimeDelta& wait_time) = 0;
// Cancels all current and future waits, to speed up system shutdown.
virtual void CancelWaitForShutdown() = 0;
};
} // namespace chrome_cleaner
#endif // CHROME_CHROME_CLEANER_LOGGING_NETWORK_CHECKER_H_