forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
http_server_properties_pref_delegate.h
46 lines (34 loc) · 1.57 KB
/
http_server_properties_pref_delegate.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
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright 2017 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 SERVICES_NETWORK_HTTP_SERVER_PROPERTIES_PREF_DELEGATE_H_
#define SERVICES_NETWORK_HTTP_SERVER_PROPERTIES_PREF_DELEGATE_H_
#include "base/callback.h"
#include "base/memory/raw_ptr.h"
#include "components/prefs/pref_change_registrar.h"
#include "net/http/http_server_properties.h"
class PrefRegistrySimple;
namespace network {
// Manages disk storage for a net::HttpServerPropertiesManager.
class HttpServerPropertiesPrefDelegate
: public net::HttpServerProperties::PrefDelegate {
public:
// The created object must be destroyed before |pref_service|.
explicit HttpServerPropertiesPrefDelegate(PrefService* pref_service);
HttpServerPropertiesPrefDelegate(const HttpServerPropertiesPrefDelegate&) =
delete;
HttpServerPropertiesPrefDelegate& operator=(
const HttpServerPropertiesPrefDelegate&) = delete;
~HttpServerPropertiesPrefDelegate() override;
static void RegisterPrefs(PrefRegistrySimple* pref_registry);
// net::HttpServerProperties::PrefDelegate implementation.
const base::Value* GetServerProperties() const override;
void SetServerProperties(const base::Value& value,
base::OnceClosure callback) override;
void WaitForPrefLoad(base::OnceClosure callback) override;
private:
raw_ptr<PrefService> pref_service_;
PrefChangeRegistrar pref_change_registrar_;
};
} // namespace network
#endif // SERVICES_NETWORK_HTTP_SERVER_PROPERTIES_PREF_DELEGATE_H_