2011-02-15 Anders Carlsson <andersca@apple.com>
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Feb 2011 00:49:26 +0000 (00:49 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Feb 2011 00:49:26 +0000 (00:49 +0000)
        Reviewed by Jon Honeycutt.

        Implement WKPluginSiteDataManagerGetSitesWithData
        https://bugs.webkit.org/show_bug.cgi?id=54510
        <rdar://problem/8689312>

        * UIProcess/API/C/WKContext.cpp:
        (WKContextGetPluginSiteDataManager):
        Call WebContext::pluginSiteDataManager.

        * UIProcess/API/C/WKPluginSiteDataManager.cpp:
        (WKPluginSiteDataManagerGetSitesWithData):
        Call WebPluginSiteDataManager::getSitesWithData.

        * UIProcess/Plugins/PluginInfoStore.cpp:
        (WebKit::PluginInfoStore::getPluginPaths):
        * UIProcess/Plugins/PluginInfoStore.h:
        Populate the paths argument with the paths of all plug-ins.

        * UIProcess/Plugins/WebPluginSiteDataManager.cpp: Added.
        (WebKit::WebPluginSiteDataManager::invalidate):
        Invalidate the callbacks map.

        (WebKit::WebPluginSiteDataManager::getSitesWithData):
        Ask the plug-in info store for all plug-in paths and send a
        GetSitesWithPluginData message to the web process.

        (WebKit::WebPluginSiteDataManager::didGetSitesWithPluginData):
        Call the callback.

        * UIProcess/Plugins/WebPluginSiteDataManager.h: Added.
        (WebKit::WebPluginSiteDataManager::clearContext):
        Clear the context.

        * UIProcess/WebContext.cpp:
        (WebKit::WebContext::WebContext):
        Initialize m_pluginSiteDataManager.

        (WebKit::WebContext::~WebContext):
        Invalidate the plug-in site data manager and clear its context.

        (WebKit::WebContext::processDidClose):
        Invalidate the plug-in site data manager.

        (WebKit::WebContext::didGetSitesWithPluginData):
        Call through to the plug-in site data manager.

        * UIProcess/WebContext.h:
        * UIProcess/WebContext.messages.in:
        Add GetSitesWithPluginData message.

        * WebKit2.pro:
        * WebKit2.xcodeproj/project.pbxproj:
        * win/WebKit2.vcproj:
        Add new files.

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::getSitesWithPluginData):
        Iterate over all plug-in paths and get the sites from all plug-ins.

        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:
        Add DidGetSitesWithPluginData.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@78647 268f45cc-cd09-0410-ab3c-d52691b4dbfc

16 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/C/WKContext.cpp
Source/WebKit2/UIProcess/API/C/WKPluginSiteDataManager.cpp
Source/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp
Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h
Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.cpp [new file with mode: 0644]
Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.h [new file with mode: 0644]
Source/WebKit2/UIProcess/WebContext.cpp
Source/WebKit2/UIProcess/WebContext.h
Source/WebKit2/UIProcess/WebContext.messages.in
Source/WebKit2/WebKit2.pro
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/WebProcess.cpp
Source/WebKit2/WebProcess/WebProcess.h
Source/WebKit2/WebProcess/WebProcess.messages.in
Source/WebKit2/win/WebKit2.vcproj

index 4caedad..4cd5e9a 100644 (file)
@@ -1,5 +1,71 @@
 2011-02-15  Anders Carlsson  <andersca@apple.com>
 
+        Reviewed by Jon Honeycutt.
+
+        Implement WKPluginSiteDataManagerGetSitesWithData
+        https://bugs.webkit.org/show_bug.cgi?id=54510
+        <rdar://problem/8689312>
+
+        * UIProcess/API/C/WKContext.cpp:
+        (WKContextGetPluginSiteDataManager):
+        Call WebContext::pluginSiteDataManager.
+        
+        * UIProcess/API/C/WKPluginSiteDataManager.cpp:
+        (WKPluginSiteDataManagerGetSitesWithData):
+        Call WebPluginSiteDataManager::getSitesWithData.
+
+        * UIProcess/Plugins/PluginInfoStore.cpp:
+        (WebKit::PluginInfoStore::getPluginPaths):
+        * UIProcess/Plugins/PluginInfoStore.h:
+        Populate the paths argument with the paths of all plug-ins.
+        
+        * UIProcess/Plugins/WebPluginSiteDataManager.cpp: Added.
+        (WebKit::WebPluginSiteDataManager::invalidate):
+        Invalidate the callbacks map.
+
+        (WebKit::WebPluginSiteDataManager::getSitesWithData):
+        Ask the plug-in info store for all plug-in paths and send a
+        GetSitesWithPluginData message to the web process.
+
+        (WebKit::WebPluginSiteDataManager::didGetSitesWithPluginData):
+        Call the callback.
+
+        * UIProcess/Plugins/WebPluginSiteDataManager.h: Added.
+        (WebKit::WebPluginSiteDataManager::clearContext):
+        Clear the context.
+
+        * UIProcess/WebContext.cpp:
+        (WebKit::WebContext::WebContext):
+        Initialize m_pluginSiteDataManager.
+
+        (WebKit::WebContext::~WebContext):
+        Invalidate the plug-in site data manager and clear its context.
+
+        (WebKit::WebContext::processDidClose):
+        Invalidate the plug-in site data manager.
+        
+        (WebKit::WebContext::didGetSitesWithPluginData):
+        Call through to the plug-in site data manager.
+
+        * UIProcess/WebContext.h:
+        * UIProcess/WebContext.messages.in:
+        Add GetSitesWithPluginData message.
+
+        * WebKit2.pro:
+        * WebKit2.xcodeproj/project.pbxproj:
+        * win/WebKit2.vcproj:
+        Add new files.
+
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::getSitesWithPluginData):
+        Iterate over all plug-in paths and get the sites from all plug-ins.
+
+        * WebProcess/WebProcess.h:
+        * WebProcess/WebProcess.messages.in:
+        Add DidGetSitesWithPluginData.
+
+2011-02-15  Anders Carlsson  <andersca@apple.com>
+
         Fix Qt build.
 
         * WebKit2.pro:
index 334708a..0de5e01 100644 (file)
@@ -170,8 +170,7 @@ WKGeolocationManagerRef WKContextGetGeolocationManager(WKContextRef contextRef)
 
 WKPluginSiteDataManagerRef WKContextGetPluginSiteDataManager(WKContextRef contextRef)
 {
-    // FIXME: Implement.
-    return 0;
+    return toAPI(toImpl(contextRef)->pluginSiteDataManager());
 }
 
 void WKContextStartMemorySampler(WKContextRef contextRef, WKDoubleRef interval)
index 556cf48..ed4992b 100644 (file)
 #include "WKPluginSiteDataManager.h"
 
 #include "WKAPICast.h"
-#include <WebKit/npapi.h>
-
-#ifdef __BLOCKS__
-#include <Block.h>
-#endif
+#include "WebPluginSiteDataManager.h"
+#include <WebCore/npapi.h>
 
 using namespace WebKit;
 
@@ -41,9 +38,9 @@ WKTypeID WKPluginSiteDataManagerGetTypeID()
     return 0;
 }
 
-void WKPluginSiteDataManagerGetSitesWithData(WKPluginSiteDataManagerRef manager, void* context, WKPluginSiteDataManagerGetSitesWithDataFunction callback)
+void WKPluginSiteDataManagerGetSitesWithData(WKPluginSiteDataManagerRef managerRef, void* context, WKPluginSiteDataManagerGetSitesWithDataFunction callback)
 {
-    // FIXME: Implement.
+    toImpl(managerRef)->getSitesWithData(ArrayCallback::create(context, callback));
 }
 
 void WKPluginSiteDataManagerClearSiteData(WKPluginSiteDataManagerRef manager, WKArrayRef sites, WKClearSiteDataFlags flags, uint64_t maxAgeInSeconds)
index b3d9183..0e2a5fe 100644 (file)
@@ -115,6 +115,14 @@ void PluginInfoStore::getPlugins(Vector<PluginInfo>& plugins)
         plugins.append(m_plugins[i].info);
 }
 
+void PluginInfoStore::getPluginPaths(Vector<String>& pluginPaths)
+{
+    loadPluginsIfNecessary();
+    
+    for (size_t i = 0; i < m_plugins.size(); ++i)
+        pluginPaths.append(m_plugins[i].path);
+}
+
 PluginInfoStore::Plugin PluginInfoStore::findPluginForMIMEType(const String& mimeType)
 {
     ASSERT(!mimeType.isNull());
index b342203..b578f71 100644 (file)
@@ -41,8 +41,9 @@ public:
     void setAdditionalPluginsDirectories(const Vector<String>&);
 
     void refresh();
-    void getPlugins(Vector<WebCore::PluginInfo>& plugins);
-    
+    void getPlugins(Vector<WebCore::PluginInfo>&);
+    void getPluginPaths(Vector<String>&);
+
     // Represents a single plug-in.
     struct Plugin {
         String path;
diff --git a/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.cpp b/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.cpp
new file mode 100644 (file)
index 0000000..df24467
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebPluginSiteDataManager.h"
+
+#include "ImmutableArray.h"
+#include "WebContext.h"
+#include "WebProcessMessages.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+PassRefPtr<WebPluginSiteDataManager> WebPluginSiteDataManager::create(WebContext* webContext)
+{
+    return adoptRef(new WebPluginSiteDataManager(webContext));
+}
+
+WebPluginSiteDataManager::WebPluginSiteDataManager(WebContext* webContext)
+    : m_webContext(webContext)
+{
+}
+
+WebPluginSiteDataManager::~WebPluginSiteDataManager()
+{
+}
+
+void WebPluginSiteDataManager::invalidate()
+{
+    invalidateCallbackMap(m_arrayCallbacks);
+}
+
+void WebPluginSiteDataManager::getSitesWithData(PassRefPtr<ArrayCallback> prpCallback)
+{
+    RefPtr<ArrayCallback> callback = prpCallback;
+
+    if (!m_webContext) {
+        callback->invalidate();
+        return;
+    }
+        
+#if ENABLE(PLUGIN_PROCESS)
+    // FIXME: Implement.
+    callback->invalidate();
+#else
+    if (!m_webContext->hasValidProcess()) {
+        callback->invalidate();
+        return;
+    }
+    uint64_t callbackID = callback->callbackID();
+    m_arrayCallbacks.set(callbackID, callback.release());
+
+    Vector<String> pluginPaths;
+    m_webContext->pluginInfoStore()->getPluginPaths(pluginPaths);
+    m_webContext->process()->send(Messages::WebProcess::GetSitesWithPluginData(pluginPaths, callbackID), 0);
+#endif
+}
+
+void WebPluginSiteDataManager::didGetSitesWithPluginData(const Vector<String>& sites, uint64_t callbackID)
+{
+    RefPtr<ArrayCallback> callback = m_arrayCallbacks.take(callbackID);
+    if (!callback) {
+        // FIXME: Log error or assert.
+        return;
+    }
+
+    Vector<RefPtr<APIObject> > sitesWK(sites.size());
+
+    for (size_t i = 0; i < sites.size(); ++i)
+        sitesWK[i] = WebString::create(sites[i]);
+
+    RefPtr<ImmutableArray> resultArray = ImmutableArray::adopt(sitesWK);
+    callback->performCallbackWithReturnValue(resultArray.get());
+}
+
+} // namespace WebKit
+
diff --git a/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.h b/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.h
new file mode 100644 (file)
index 0000000..09fcd64
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebPluginSiteDataManagerh
+#define WebPluginSiteDataManager_h
+
+#include "APIObject.h"
+#include "Arguments.h"
+#include "GenericCallback.h"
+#include <wtf/HashMap.h>
+#include <wtf/PassRefPtr.h>
+
+namespace CoreIPC {
+class ArgumentDecoder;
+class Connection;
+class MessageID;
+}
+
+namespace WebKit {
+
+class WebContext;
+
+typedef GenericCallback<WKArrayRef> ArrayCallback;
+
+class WebPluginSiteDataManager : public APIObject {
+public:
+    static const Type APIType = TypePluginSiteDataManager;
+
+    static PassRefPtr<WebPluginSiteDataManager> create(WebContext*);
+    virtual ~WebPluginSiteDataManager();
+
+    void invalidate();
+    void clearContext() { m_webContext = 0; }
+
+    void getSitesWithData(PassRefPtr<ArrayCallback>);
+    void didGetSitesWithPluginData(const Vector<String>& sites, uint64_t callbackID);
+
+private:
+    explicit WebPluginSiteDataManager(WebContext*);
+
+    virtual Type type() const { return APIType; }
+
+    WebContext* m_webContext;
+    HashMap<uint64_t, RefPtr<ArrayCallback> > m_arrayCallbacks;
+};
+
+} // namespace WebKit
+
+#endif // WebPluginSiteDataManager_h
index 5411a36..eec8dc5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -38,6 +38,7 @@
 #include "WebCoreArgumentCoders.h"
 #include "WebDatabaseManagerProxy.h"
 #include "WebGeolocationManagerProxy.h"
+#include "WebPluginSiteDataManager.h"
 #include "WebPageGroup.h"
 #include "WebMemorySampler.h"
 #include "WebProcessCreationParameters.h"
@@ -97,6 +98,7 @@ WebContext::WebContext(ProcessModel processModel, const String& injectedBundlePa
     , m_memorySamplerInterval(1400.0)
     , m_databaseManagerProxy(WebDatabaseManagerProxy::create(this))
     , m_geolocationManagerProxy(WebGeolocationManagerProxy::create(this))
+    , m_pluginSiteDataManager(WebPluginSiteDataManager::create(this))
 #if PLATFORM(WIN)
     , m_shouldPaintNativeControls(true)
 #endif
@@ -120,6 +122,9 @@ WebContext::~WebContext()
     m_databaseManagerProxy->invalidate();
     m_databaseManagerProxy->clearContext();
 
+    m_pluginSiteDataManager->invalidate();
+    m_pluginSiteDataManager->clearContext();
+
 #ifndef NDEBUG
     webContextCounter.decrement();
 #endif
@@ -245,6 +250,7 @@ void WebContext::processDidClose(WebProcessProxy* process)
 
     m_databaseManagerProxy->invalidate();
     m_geolocationManagerProxy->invalidate();
+    m_pluginSiteDataManager->invalidate();
 
     m_process = 0;
 }
@@ -439,6 +445,13 @@ void WebContext::getPluginPath(const String& mimeType, const String& urlString,
     pluginPath = plugin.path;
 }
 
+#if !ENABLE(PLUGIN_PROCESS)
+void WebContext::didGetSitesWithPluginData(const Vector<String>& sites, uint64_t callbackID)
+{
+    m_pluginSiteDataManager->didGetSitesWithPluginData(sites, callbackID);
+}
+#endif
+
 uint64_t WebContext::createDownloadProxy()
 {
     RefPtr<DownloadProxy> downloadProxy = DownloadProxy::create(this);
index ebf1914..979efdd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -129,6 +129,7 @@ public:
 
     WebDatabaseManagerProxy* databaseManagerProxy() const { return m_databaseManagerProxy.get(); }
     WebGeolocationManagerProxy* geolocationManagerProxy() const { return m_geolocationManagerProxy.get(); }
+    WebPluginSiteDataManager* pluginSiteDataManager() const { return m_pluginSiteDataManager.get(); }
 
     struct Statistics {
         unsigned wkViewCount;
@@ -156,7 +157,10 @@ private:
     // Plugins
     void getPlugins(bool refresh, Vector<WebCore::PluginInfo>& plugins);
     void getPluginPath(const String& mimeType, const String& urlString, String& pluginPath);
-
+#if !ENABLE(PLUGIN_PROCESS)
+    void didGetSitesWithPluginData(const Vector<String>& sites, uint64_t callbackID);
+#endif
+        
     // Implemented in generated WebContextMessageReceiver.cpp
     void didReceiveWebContextMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
     CoreIPC::SyncReplyMode didReceiveSyncWebContextMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*);
@@ -204,6 +208,7 @@ private:
 
     RefPtr<WebDatabaseManagerProxy> m_databaseManagerProxy;
     RefPtr<WebGeolocationManagerProxy> m_geolocationManagerProxy;
+    RefPtr<WebPluginSiteDataManager> m_pluginSiteDataManager;
 
 #if PLATFORM(WIN)
     bool m_shouldPaintNativeControls;
index dc15de2..8fb1230 100644 (file)
@@ -35,4 +35,8 @@ messages -> WebContext {
     GetPlugins(bool refresh) -> (Vector<WebCore::PluginInfo> plugins)
     GetPluginPath(WTF::String mimeType, WTF::String urlString) -> (WTF::String pluginPath)
 
+#if !ENABLE(PLUGIN_PROCESS)
+    void DidGetSitesWithPluginData(Vector<WTF::String> sites, uint64_t callbackID)
+#endif
+
 }
index 8a0e98d..ee5ae3f 100644 (file)
@@ -486,6 +486,7 @@ SOURCES += \
     UIProcess/Launcher/qt/ProcessLauncherQt.cpp \
     UIProcess/Launcher/qt/ThreadLauncherQt.cpp \
     UIProcess/Plugins/PluginInfoStore.cpp \
+    UIProcess/Plugins/WebPluginSiteDataManager.cpp \
     UIProcess/Plugins/qt/PluginInfoStoreQt.cpp \
     UIProcess/ResponsivenessTimer.cpp \
     UIProcess/TiledDrawingAreaProxy.cpp \
index 49b2165..b84731e 100644 (file)
                1AC41AC71263C88300054E94 /* BinarySemaphore.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC41AC51263C88300054E94 /* BinarySemaphore.h */; };
                1AC41AC81263C88300054E94 /* BinarySemaphore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC41AC61263C88300054E94 /* BinarySemaphore.cpp */; };
                1AC86FF3130B46D3002C1257 /* WKPluginSiteDataManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC86FF1130B46D3002C1257 /* WKPluginSiteDataManager.cpp */; };
-               1AC86FF4130B46D3002C1257 /* WKPluginSiteDataManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC86FF2130B46D3002C1257 /* WKPluginSiteDataManager.h */; };
+               1AC86FF4130B46D3002C1257 /* WKPluginSiteDataManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC86FF2130B46D3002C1257 /* WKPluginSiteDataManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
+               1AC8702D130B49A2002C1257 /* WebPluginSiteDataManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC8702B130B49A2002C1257 /* WebPluginSiteDataManager.h */; };
+               1AC8702E130B49A2002C1257 /* WebPluginSiteDataManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC8702C130B49A2002C1257 /* WebPluginSiteDataManager.cpp */; };
                1AE117F611DBB30900981615 /* ProcessLauncher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE117F511DBB30900981615 /* ProcessLauncher.cpp */; };
                1AE4976811FF658E0048B464 /* NPJSObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AE4976611FF658E0048B464 /* NPJSObject.h */; };
                1AE4976911FF658E0048B464 /* NPJSObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE4976711FF658E0048B464 /* NPJSObject.cpp */; };
                1AC25FBB12A48EDA00BD2671 /* PluginProcessShim.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = PluginProcessShim.xcconfig; sourceTree = "<group>"; };
                1AC41AC51263C88300054E94 /* BinarySemaphore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BinarySemaphore.h; sourceTree = "<group>"; };
                1AC41AC61263C88300054E94 /* BinarySemaphore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BinarySemaphore.cpp; sourceTree = "<group>"; };
-               1AC86FF1130B46D3002C1257 /* WKPluginSiteDataManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WKPluginSiteDataManager.cpp; path = UIProcess/API/C/WKPluginSiteDataManager.cpp; sourceTree = SOURCE_ROOT; };
-               1AC86FF2130B46D3002C1257 /* WKPluginSiteDataManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKPluginSiteDataManager.h; path = UIProcess/API/C/WKPluginSiteDataManager.h; sourceTree = SOURCE_ROOT; };
+               1AC86FF1130B46D3002C1257 /* WKPluginSiteDataManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKPluginSiteDataManager.cpp; sourceTree = "<group>"; };
+               1AC86FF2130B46D3002C1257 /* WKPluginSiteDataManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPluginSiteDataManager.h; sourceTree = "<group>"; };
+               1AC8702B130B49A2002C1257 /* WebPluginSiteDataManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginSiteDataManager.h; sourceTree = "<group>"; };
+               1AC8702C130B49A2002C1257 /* WebPluginSiteDataManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPluginSiteDataManager.cpp; sourceTree = "<group>"; };
                1AE117F511DBB30900981615 /* ProcessLauncher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessLauncher.cpp; sourceTree = "<group>"; };
                1AE4976611FF658E0048B464 /* NPJSObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NPJSObject.h; sourceTree = "<group>"; };
                1AE4976711FF658E0048B464 /* NPJSObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NPJSObject.cpp; sourceTree = "<group>"; };
                                1A0EC75D124BC7B2007EF4A5 /* PluginProcessProxy.cpp */,
                                1A0EC75C124BC7B2007EF4A5 /* PluginProcessProxy.h */,
                                1A043B4C124D5E3600FFBFB5 /* PluginProcessProxy.messages.in */,
+                               1AC8702C130B49A2002C1257 /* WebPluginSiteDataManager.cpp */,
+                               1AC8702B130B49A2002C1257 /* WebPluginSiteDataManager.h */,
                        );
                        path = Plugins;
                        sourceTree = "<group>";
                                BC7B633612A45ABA00D174A4 /* WKPageGroup.cpp */,
                                BC7B633512A45ABA00D174A4 /* WKPageGroup.h */,
                                BC177464118B9FF4007D9E9A /* WKPagePrivate.h */,
+                               1AC86FF1130B46D3002C1257 /* WKPluginSiteDataManager.cpp */,
+                               1AC86FF2130B46D3002C1257 /* WKPluginSiteDataManager.h */,
                                BCD597CF112B56AC00EC8C23 /* WKPreferences.cpp */,
                                BCD597CE112B56AC00EC8C23 /* WKPreferences.h */,
                                762B7484120BBA2D00819339 /* WKPreferencesPrivate.h */,
                                BC4075E5124FF0270068F20A /* WKNumber.cpp */,
                                BC4075E6124FF0270068F20A /* WKNumber.h */,
                                BC2D021812AC426C00E732A3 /* WKPageLoadTypes.h */,
-                               1AC86FF1130B46D3002C1257 /* WKPluginSiteDataManager.cpp */,
-                               1AC86FF2130B46D3002C1257 /* WKPluginSiteDataManager.h */,
                                F634445A12A885E9000612D8 /* WKSecurityOrigin.cpp */,
                                F634445B12A885E9000612D8 /* WKSecurityOrigin.h */,
                                BC4075E7124FF0270068F20A /* WKSerializedScriptValue.cpp */,
                                BCA56A6512F9C8F900C566C7 /* WKGraphicsContext.h in Headers */,
                                BCA56A6912F9C9AD00C566C7 /* WKGraphicsContextCG.h in Headers */,
                                1AC86FF4130B46D3002C1257 /* WKPluginSiteDataManager.h in Headers */,
+                               1AC8702D130B49A2002C1257 /* WebPluginSiteDataManager.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                BCA56A6A12F9C9AD00C566C7 /* WKGraphicsContextCG.cpp in Sources */,
                                659C551E130006410025C0C2 /* InjectedBundlePageResourceLoadClient.cpp in Sources */,
                                1AC86FF3130B46D3002C1257 /* WKPluginSiteDataManager.cpp in Sources */,
+                               1AC8702E130B49A2002C1257 /* WebPluginSiteDataManager.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 97faec4..c050d85 100644 (file)
 #include <unistd.h>
 #endif
 
+#if !ENABLE(PLUGIN_PROCESS)
+#include "NetscapePluginModule.h"
+#endif
+
 using namespace WebCore;
 
 namespace WebKit {
@@ -635,6 +639,28 @@ void WebProcess::clearApplicationCache()
 #endif
 }
 
+#if !ENABLE(PLUGIN_PROCESS)
+void WebProcess::getSitesWithPluginData(const Vector<String>& pluginPaths, uint64_t callbackID)
+{
+    HashSet<String> sitesSet;
+
+    for (size_t i = 0; i < pluginPaths.size(); ++i) {
+        RefPtr<NetscapePluginModule> netscapePluginModule = NetscapePluginModule::getOrCreate(pluginPaths[i]);
+        if (!netscapePluginModule)
+            continue;
+
+        Vector<String> sites = netscapePluginModule->sitesWithData();
+        for (size_t i = 0; i < sites.size(); ++i)
+            sitesSet.add(sites[i]);
+    }
+
+    Vector<String> sites;
+    copyToVector(sitesSet, sites);
+
+    m_connection->send(Messages::WebContext::DidGetSitesWithPluginData(sites, callbackID), 0);
+}
+#endif
+
 void WebProcess::downloadRequest(uint64_t downloadID, uint64_t initiatingPageID, const ResourceRequest& request)
 {
     WebPage* initiatingPage = initiatingPageID ? webPage(initiatingPageID) : 0;
index 993cf38..8bdb7f4 100644 (file)
@@ -143,6 +143,10 @@ private:
     void platformClearResourceCaches();
     void clearApplicationCache();
 
+#if !ENABLE(PLUGIN_PROCESS)
+    void getSitesWithPluginData(const Vector<String>& pluginPaths, uint64_t callbackID);
+#endif
+    
     void startMemorySampler(const SandboxExtension::Handle&, const String&, const double);
     void stopMemorySampler();
 
index 2ea9237..0263ccc 100644 (file)
@@ -44,6 +44,11 @@ messages -> WebProcess {
     SetShouldPaintNativeControls(bool shouldPaintNativeControls)
 #endif
 
+#if !ENABLE(PLUGIN_PROCESS)
+    # Plug-ins.
+    GetSitesWithPluginData(Vector<WTF::String> pluginPaths, uint64_t callbackID)
+#endif
+
     ClearResourceCaches();
     ClearApplicationCache();
     
index 861f9a9..0b4ed29 100755 (executable)
                                        RelativePath="..\UIProcess\Plugins\PluginInfoStore.h"
                                        >
                                </File>
+                               <File
+                                       RelativePath="..\UIProcess\Plugins\WebPluginSiteDataManager.cpp"
+                                       >
+                               </File>
+                               <File
+                                       RelativePath="..\UIProcess\Plugins\WebPluginSiteDataManager.h"
+                                       >
+                               </File>
                                <Filter
                                        Name="win"
                                        >