forked from Pissandshittium/pissandshittium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathidentification_settings_manager_renderer.h
46 lines (37 loc) · 1.79 KB
/
identification_settings_manager_renderer.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 2020 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 CHROMECAST_RENDERER_IDENTIFICATION_SETTINGS_MANAGER_RENDERER_H_
#define CHROMECAST_RENDERER_IDENTIFICATION_SETTINGS_MANAGER_RENDERER_H_
#include "base/callback_forward.h"
#include "chromecast/common/identification_settings_manager.h"
#include "content/public/renderer/render_frame_observer.h"
#include "mojo/public/cpp/bindings/associated_receiver.h"
#include "mojo/public/cpp/bindings/pending_associated_receiver.h"
namespace chromecast {
// Receives messages from the browser process and stores identification settings
// to feed into URLLoaderThrottles for throttling url requests in renderers.
class IdentificationSettingsManagerRenderer
: public content::RenderFrameObserver,
public IdentificationSettingsManager {
public:
IdentificationSettingsManagerRenderer(
content::RenderFrame* render_frame,
base::OnceCallback<void()> on_removed_callback);
IdentificationSettingsManagerRenderer(
const IdentificationSettingsManagerRenderer&) = delete;
IdentificationSettingsManagerRenderer& operator=(
const IdentificationSettingsManagerRenderer&) = delete;
~IdentificationSettingsManagerRenderer() override;
private:
// content::RenderFrameObserver implementation:
void OnDestruct() override;
void OnIdentificationSettingsManagerAssociatedRequest(
mojo::PendingAssociatedReceiver<mojom::IdentificationSettingsManager>
receiver);
base::OnceCallback<void()> on_removed_callback_;
mojo::AssociatedReceiver<mojom::IdentificationSettingsManager>
associated_receiver_{this};
};
} // namespace chromecast
#endif // CHROMECAST_RENDERER_IDENTIFICATION_SETTINGS_MANAGER_RENDERER_H_