// Copyright 2013 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef EXTENSIONS_BROWSER_EVENT_LISTENER_MAP_H_ #define EXTENSIONS_BROWSER_EVENT_LISTENER_MAP_H_ #include <map> #include <memory> #include <optional> #include <set> #include <string> #include <vector> #include "base/containers/flat_map.h" #include "base/memory/raw_ptr.h" #include "base/values.h" #include "extensions/common/event_filter.h" #include "extensions/common/extension_id.h" #include "third_party/blink/public/mojom/service_worker/service_worker_database.mojom-forward.h" #include "url/gurl.h" namespace content { class BrowserContext; class RenderProcessHost; } namespace extensions { struct Event; // A listener for an extension event. A listener is essentially an endpoint // that an event can be dispatched to. // // This is a lazy listener if |IsLazy| is returns true, and a filtered listener // if |filter| is defined. // // A lazy listener is added to an event to indicate that a lazy background page // is listening to the event. It is associated with no process, so to dispatch // an event to a lazy listener one must start a process running the associated // extension and dispatch the event to that. class EventListener { … }; // Holds listeners for extension events and can answer questions about which // listeners are interested in what events. class EventListenerMap { … }; } // namespace extensions #endif // EXTENSIONS_BROWSER_EVENT_LISTENER_MAP_H_