diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h')
-rw-r--r-- | Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h | 76 |
1 files changed, 39 insertions, 37 deletions
diff --git a/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h b/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h index 484a20c29..ef43eabb0 100644 --- a/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h +++ b/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h @@ -37,21 +37,15 @@ #include "WebProcessProxyMessages.h" #include <wtf/Deque.h> -#if PLATFORM(MAC) +#if PLATFORM(COCOA) #include <wtf/RetainPtr.h> OBJC_CLASS NSObject; OBJC_CLASS WKPlaceholderModalWindow; #endif -// FIXME: This is platform specific. -namespace IPC { - class MachPort; -} - namespace WebKit { class PluginProcessManager; -class WebPluginSiteDataManager; class WebProcessProxy; struct PluginProcessCreationParameters; @@ -60,17 +54,21 @@ struct RawPluginMetaData { String name; String description; String mimeDescription; + +#if PLATFORM(GTK) + bool requiresGtk2; +#endif }; #endif -#if PLATFORM(MAC) +#if PLATFORM(COCOA) int pluginProcessLatencyQOS(); int pluginProcessThroughputQOS(); #endif class PluginProcessProxy : public ChildProcessProxy { public: - static PassRefPtr<PluginProcessProxy> create(PluginProcessManager*, const PluginProcessAttributes&, uint64_t pluginProcessToken); + static Ref<PluginProcessProxy> create(PluginProcessManager*, const PluginProcessAttributes&, uint64_t pluginProcessToken); ~PluginProcessProxy(); const PluginProcessAttributes& pluginProcessAttributes() const { return m_pluginProcessAttributes; } @@ -78,26 +76,24 @@ public: // Asks the plug-in process to create a new connection to a web process. The connection identifier will be // encoded in the given argument encoder and sent back to the connection of the given web process. - void getPluginProcessConnection(PassRefPtr<Messages::WebProcessProxy::GetPluginProcessConnection::DelayedReply>); - - // Asks the plug-in process to get a list of domains for which the plug-in has data stored. - void getSitesWithData(WebPluginSiteDataManager*, uint64_t callbackID); + void getPluginProcessConnection(Ref<Messages::WebProcessProxy::GetPluginProcessConnection::DelayedReply>&&); - // Asks the plug-in process to clear the data for the given sites. - void clearSiteData(WebPluginSiteDataManager*, const Vector<String>& sites, uint64_t flags, uint64_t maxAgeInSeconds, uint64_t callbackID); + void fetchWebsiteData(std::function<void (Vector<String>)> completionHandler); + void deleteWebsiteData(std::chrono::system_clock::time_point modifiedSince, std::function<void ()> completionHandler); + void deleteWebsiteDataForHostNames(const Vector<String>& hostNames, std::function<void ()> completionHandler); bool isValid() const { return m_connection; } -#if PLATFORM(MAC) +#if PLATFORM(COCOA) void setProcessSuppressionEnabled(bool); - // Returns whether the plug-in needs the heap to be marked executable. - static bool pluginNeedsExecutableHeap(const PluginModuleInfo&); - +#if __MAC_OS_X_VERSION_MIN_REQUIRED <= 101000 // Creates a property list in ~/Library/Preferences that contains all the MIME types supported by the plug-in. static bool createPropertyListFile(const PluginModuleInfo&); #endif +#endif + #if PLUGIN_ARCHITECTURE(X11) static bool scanPlugin(const String& pluginPath, RawPluginMetaData& result); #endif @@ -105,27 +101,29 @@ public: private: PluginProcessProxy(PluginProcessManager*, const PluginProcessAttributes&, uint64_t pluginProcessToken); - virtual void getLaunchOptions(ProcessLauncher::LaunchOptions&) override; + void getLaunchOptions(ProcessLauncher::LaunchOptions&) override; void platformGetLaunchOptions(ProcessLauncher::LaunchOptions&, const PluginProcessAttributes&); + void processWillShutDown(IPC::Connection&) override; void pluginProcessCrashedOrFailedToLaunch(); // IPC::Connection::Client - virtual void didReceiveMessage(IPC::Connection*, IPC::MessageDecoder&) override; - virtual void didReceiveSyncMessage(IPC::Connection*, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&) override; + void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override; + void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override; - virtual void didClose(IPC::Connection*) override; - virtual void didReceiveInvalidMessage(IPC::Connection*, IPC::StringReference messageReceiverName, IPC::StringReference messageName) override; + void didClose(IPC::Connection&) override; + void didReceiveInvalidMessage(IPC::Connection&, IPC::StringReference messageReceiverName, IPC::StringReference messageName) override; // ProcessLauncher::Client - virtual void didFinishLaunching(ProcessLauncher*, IPC::Connection::Identifier); + void didFinishLaunching(ProcessLauncher*, IPC::Connection::Identifier) override; // Message handlers void didCreateWebProcessConnection(const IPC::Attachment&, bool supportsAsynchronousPluginInitialization); void didGetSitesWithData(const Vector<String>& sites, uint64_t callbackID); - void didClearSiteData(uint64_t callbackID); + void didDeleteWebsiteData(uint64_t callbackID); + void didDeleteWebsiteDataForHostNames(uint64_t callbackID); -#if PLATFORM(MAC) +#if PLATFORM(COCOA) bool getPluginProcessSerialNumber(ProcessSerialNumber&); void makePluginProcessTheFrontProcess(); void makeUIProcessTheFrontProcess(); @@ -139,7 +137,6 @@ private: void endModal(); void applicationDidBecomeActive(); - void openPluginPreferencePane(); void launchProcess(const String& launchPath, const Vector<String>& arguments, bool& result); void launchApplicationAtURL(const String& urlString, const Vector<String>& arguments, bool& result); void openURL(const String& url, bool& result, int32_t& status, String& launchedURLString); @@ -159,23 +156,28 @@ private: Deque<RefPtr<Messages::WebProcessProxy::GetPluginProcessConnection::DelayedReply>> m_pendingConnectionReplies; - Vector<uint64_t> m_pendingGetSitesRequests; - HashMap<uint64_t, RefPtr<WebPluginSiteDataManager>> m_pendingGetSitesReplies; + Vector<uint64_t> m_pendingFetchWebsiteDataRequests; + HashMap<uint64_t, std::function<void (Vector<String>)>> m_pendingFetchWebsiteDataCallbacks; + + struct DeleteWebsiteDataRequest { + std::chrono::system_clock::time_point modifiedSince; + uint64_t callbackID; + }; + Vector<DeleteWebsiteDataRequest> m_pendingDeleteWebsiteDataRequests; + HashMap<uint64_t, std::function<void ()>> m_pendingDeleteWebsiteDataCallbacks; - struct ClearSiteDataRequest { - Vector<String> sites; - uint64_t flags; - uint64_t maxAgeInSeconds; + struct DeleteWebsiteDataForHostNamesRequest { + Vector<String> hostNames; uint64_t callbackID; }; - Vector<ClearSiteDataRequest> m_pendingClearSiteDataRequests; - HashMap<uint64_t, RefPtr<WebPluginSiteDataManager>> m_pendingClearSiteDataReplies; + Vector<DeleteWebsiteDataForHostNamesRequest> m_pendingDeleteWebsiteDataForHostNamesRequests; + HashMap<uint64_t, std::function<void ()>> m_pendingDeleteWebsiteDataForHostNamesCallbacks; // If createPluginConnection is called while the process is still launching we'll keep count of it and send a bunch of requests // when the process finishes launching. unsigned m_numPendingConnectionRequests; -#if PLATFORM(MAC) +#if PLATFORM(COCOA) RetainPtr<NSObject> m_activationObserver; RetainPtr<WKPlaceholderModalWindow *> m_placeholderWindow; bool m_modalWindowIsShowing; |