blob: 9cd5926dcdcacf883c1af52589ded58b74d2ee05 [file] [log] [blame]
Avi Drissman4e1b7bc32022-09-15 14:03:501// Copyright 2018 The Chromium Authors
Jeremy Romanb7024742018-06-18 22:00:222// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CONTENT_BROWSER_RENDERER_HOST_PLUGIN_REGISTRY_IMPL_H_
6#define CONTENT_BROWSER_RENDERER_HOST_PLUGIN_REGISTRY_IMPL_H_
7
8#include "base/memory/weak_ptr.h"
9#include "base/time/time.h"
Miyoung Shinad0de7f2019-09-02 08:55:1110#include "mojo/public/cpp/bindings/pending_receiver.h"
11#include "mojo/public/cpp/bindings/receiver_set.h"
Jeremy Romanb7024742018-06-18 22:00:2212#include "third_party/blink/public/mojom/plugins/plugin_registry.mojom.h"
13
14namespace content {
15
Jeremy Romanb7024742018-06-18 22:00:2216struct WebPluginInfo;
17
18class PluginRegistryImpl : public blink::mojom::PluginRegistry {
19 public:
Clark DuVall1df2052b2019-08-05 19:58:4620 explicit PluginRegistryImpl(int render_process_id);
Jeremy Romanb7024742018-06-18 22:00:2221 ~PluginRegistryImpl() override;
22
Miyoung Shinad0de7f2019-09-02 08:55:1123 void Bind(mojo::PendingReceiver<blink::mojom::PluginRegistry> receiver);
Jeremy Romanb7024742018-06-18 22:00:2224
25 // blink::mojom::PluginRegistry
K. Moon1829fee2022-01-26 02:36:0226 void GetPlugins(bool refresh, GetPluginsCallback callback) override;
Jeremy Romanb7024742018-06-18 22:00:2227
28 private:
K. Moon1829fee2022-01-26 02:36:0229 void GetPluginsComplete(GetPluginsCallback callback,
Jeremy Romanb7024742018-06-18 22:00:2230 const std::vector<WebPluginInfo>& all_plugins);
31
Clark DuVall1df2052b2019-08-05 19:58:4632 int render_process_id_;
Miyoung Shinad0de7f2019-09-02 08:55:1133 mojo::ReceiverSet<PluginRegistry> receivers_;
Jeremy Romanb7024742018-06-18 22:00:2234 base::TimeTicks last_plugin_refresh_time_;
Jeremy Roman3bca4bf2019-07-11 03:41:2535 base::WeakPtrFactory<PluginRegistryImpl> weak_factory_{this};
Jeremy Romanb7024742018-06-18 22:00:2236};
37
38} // namespace content
39
40#endif // CONTENT_BROWSER_RENDERER_HOST_PLUGIN_REGISTRY_IMPL_H_