summaryrefslogtreecommitdiff
path: root/Source/WebCore/page/UserContentController.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/page/UserContentController.h')
-rw-r--r--Source/WebCore/page/UserContentController.h65
1 files changed, 27 insertions, 38 deletions
diff --git a/Source/WebCore/page/UserContentController.h b/Source/WebCore/page/UserContentController.h
index 9ddb8d0e1..8d100dcdf 100644
--- a/Source/WebCore/page/UserContentController.h
+++ b/Source/WebCore/page/UserContentController.h
@@ -23,56 +23,45 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef UserContentController_h
-#define UserContentController_h
+#pragma once
-#include "UserScriptTypes.h"
-#include "UserStyleSheetTypes.h"
-#include <wtf/HashSet.h>
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
+#include "UserContentProvider.h"
namespace WebCore {
-class DOMWrapperWorld;
-class Page;
-class URL;
-class UserScript;
-class UserStyleSheet;
-
-class UserContentController : public RefCounted<UserContentController> {
+class UserContentController final : public UserContentProvider {
public:
- static RefPtr<UserContentController> create();
- ~UserContentController();
-
- void addPage(Page&);
- void removePage(Page&);
-
- const UserScriptMap* userScripts() const { return m_userScripts.get(); }
-
- void addUserScript(DOMWrapperWorld&, std::unique_ptr<UserScript>);
- void removeUserScript(DOMWrapperWorld&, const URL&);
- void removeUserScripts(DOMWrapperWorld&);
+ WEBCORE_EXPORT static Ref<UserContentController> create();
+ WEBCORE_EXPORT ~UserContentController();
- const UserStyleSheetMap* userStyleSheets() const { return m_userStyleSheets.get(); }
+ WEBCORE_EXPORT void addUserScript(DOMWrapperWorld&, std::unique_ptr<UserScript>);
+ WEBCORE_EXPORT void removeUserScript(DOMWrapperWorld&, const URL&);
+ WEBCORE_EXPORT void removeUserScripts(DOMWrapperWorld&);
- void addUserStyleSheet(DOMWrapperWorld&, std::unique_ptr<UserStyleSheet>, UserStyleInjectionTime);
- void removeUserStyleSheet(DOMWrapperWorld&, const URL&);
- void removeUserStyleSheets(DOMWrapperWorld&);
+ WEBCORE_EXPORT void addUserStyleSheet(DOMWrapperWorld&, std::unique_ptr<UserStyleSheet>, UserStyleInjectionTime);
+ WEBCORE_EXPORT void removeUserStyleSheet(DOMWrapperWorld&, const URL&);
+ WEBCORE_EXPORT void removeUserStyleSheets(DOMWrapperWorld&);
- void removeAllUserContent();
+ WEBCORE_EXPORT void removeAllUserContent();
private:
UserContentController();
- void invalidateInjectedStyleSheetCacheInAllFrames();
-
- HashSet<Page*> m_pages;
-
- std::unique_ptr<UserScriptMap> m_userScripts;
- std::unique_ptr<UserStyleSheetMap> m_userStyleSheets;
+ // UserContentProvider
+ void forEachUserScript(const std::function<void(DOMWrapperWorld&, const UserScript&)>&) const override;
+ void forEachUserStyleSheet(const std::function<void(const UserStyleSheet&)>&) const override;
+#if ENABLE(USER_MESSAGE_HANDLERS)
+ void forEachUserMessageHandler(const std::function<void(const UserMessageHandlerDescriptor&)>&) const override;
+#endif
+#if ENABLE(CONTENT_EXTENSIONS)
+ ContentExtensions::ContentExtensionsBackend& userContentExtensionBackend() override { return m_contentExtensionBackend; }
+#endif
+
+ UserScriptMap m_userScripts;
+ UserStyleSheetMap m_userStyleSheets;
+#if ENABLE(CONTENT_EXTENSIONS)
+ ContentExtensions::ContentExtensionsBackend m_contentExtensionBackend;
+#endif
};
} // namespace WebCore
-
-#endif // UserContentController_h