[Win] Implement WebViewGroup to support WebView::addxxxToGroup().
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 Jun 2015 16:45:55 +0000 (16:45 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 Jun 2015 16:45:55 +0000 (16:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=145908

Patch by Hyungwook Lee <hyungwook.lee@navercorp.com> on 2015-06-26
Reviewed by Brent Fulgham.

Make WebViewGroup class sharing on Mac and Win port.

Source/WebKit:

* WebCoreSupport: Added.
* WebCoreSupport/WebViewGroup.cpp: Added.
(webViewGroups):
(WebViewGroup::getOrCreate):
(WebViewGroup::get):
(WebViewGroup::WebViewGroup):
(WebViewGroup::~WebViewGroup):
(WebViewGroup::addWebView):
(WebViewGroup::removeWebView):
(WebViewGroup::storageNamespaceProvider):
* WebCoreSupport/WebViewGroup.h: Added.
(WebViewGroup::userContentController):
(WebViewGroup::visitedLinkStore):
* WebKit.vcxproj/WebKit/WebKit.vcxproj:
* WebKit.vcxproj/WebKit/WebKit.vcxproj.filters:
* WebKit.vcxproj/WebKit/WebKitCommon.props:
* WebKit.xcodeproj/project.pbxproj:

Source/WebKit/mac:

* WebCoreSupport/WebViewGroup.h: Removed.
* WebCoreSupport/WebViewGroup.mm: Removed.

Source/WebKit/win:

* WebCoreSupport/WebVisitedLinkStore.cpp:
(visitedLinkStores):
(WebVisitedLinkStore::create):
(WebVisitedLinkStore::WebVisitedLinkStore):
(WebVisitedLinkStore::~WebVisitedLinkStore):
(WebVisitedLinkStore::setShouldTrackVisitedLinks):
(WebVisitedLinkStore::removeAllVisitedLinks):
(WebVisitedLinkStore::singleton): Deleted.
* WebCoreSupport/WebVisitedLinkStore.h:
* WebView.cpp:
(toURL):
(localStorageDatabasePath):
(WebView::WebView):
(WebView::~WebView):
(WebView::shouldInitializeTrackPointHack):
(WebView::initWithFrame):
(WebView::setGroupName):
(WebView::addVisitedLinks):
* WebView.h:

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

13 files changed:
Source/WebKit/ChangeLog
Source/WebKit/WebCoreSupport/WebViewGroup.cpp [moved from Source/WebKit/mac/WebCoreSupport/WebViewGroup.mm with 93% similarity]
Source/WebKit/WebCoreSupport/WebViewGroup.h [moved from Source/WebKit/mac/WebCoreSupport/WebViewGroup.h with 99% similarity]
Source/WebKit/WebKit.vcxproj/WebKit/WebKit.vcxproj
Source/WebKit/WebKit.vcxproj/WebKit/WebKit.vcxproj.filters
Source/WebKit/WebKit.vcxproj/WebKit/WebKitCommon.props
Source/WebKit/WebKit.xcodeproj/project.pbxproj
Source/WebKit/mac/ChangeLog
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/WebVisitedLinkStore.cpp
Source/WebKit/win/WebCoreSupport/WebVisitedLinkStore.h
Source/WebKit/win/WebView.cpp
Source/WebKit/win/WebView.h

index 7d7b84128a406d337ba6a4edc24c3d463063638b..eeb9291f8ff93b464a189bc6ceffef692eb122ff 100644 (file)
@@ -1,3 +1,30 @@
+2015-06-26  Hyungwook Lee  <hyungwook.lee@navercorp.com>
+
+        [Win] Implement WebViewGroup to support WebView::addxxxToGroup().
+        https://bugs.webkit.org/show_bug.cgi?id=145908
+
+        Reviewed by Brent Fulgham.
+
+        Make WebViewGroup class sharing on Mac and Win port.
+
+        * WebCoreSupport: Added.
+        * WebCoreSupport/WebViewGroup.cpp: Added.
+        (webViewGroups):
+        (WebViewGroup::getOrCreate):
+        (WebViewGroup::get):
+        (WebViewGroup::WebViewGroup):
+        (WebViewGroup::~WebViewGroup):
+        (WebViewGroup::addWebView):
+        (WebViewGroup::removeWebView):
+        (WebViewGroup::storageNamespaceProvider):
+        * WebCoreSupport/WebViewGroup.h: Added.
+        (WebViewGroup::userContentController):
+        (WebViewGroup::visitedLinkStore):
+        * WebKit.vcxproj/WebKit/WebKit.vcxproj:
+        * WebKit.vcxproj/WebKit/WebKit.vcxproj.filters:
+        * WebKit.vcxproj/WebKit/WebKitCommon.props:
+        * WebKit.xcodeproj/project.pbxproj:
+
 2015-06-24  Anders Carlsson  <andersca@apple.com>
 
         Move PluginMainThreadScheduler to WebKit/win
similarity index 93%
rename from Source/WebKit/mac/WebCoreSupport/WebViewGroup.mm
rename to Source/WebKit/WebCoreSupport/WebViewGroup.cpp
index 745392441c0d597bfc2996eea0ea274cc9e635c5..d17f224254debd2e2576f435a203294d1f50184e 100644 (file)
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import "WebViewGroup.h"
-
-#import "WebStorageNamespaceProvider.h"
-#import "WebView.h"
-#import "WebVisitedLinkStore.h"
-#import <WebCore/UserContentController.h>
-#import <wtf/NeverDestroyed.h>
-#import <wtf/text/StringHash.h>
+#include "WebViewGroup.h"
+
+#include "WebStorageNamespaceProvider.h"
+#include "WebView.h"
+#include "WebVisitedLinkStore.h"
+#include <WebCore/UserContentController.h>
+#include <wtf/NeverDestroyed.h>
+#include <wtf/text/StringHash.h>
 
 using namespace WebCore;
 
similarity index 99%
rename from Source/WebKit/mac/WebCoreSupport/WebViewGroup.h
rename to Source/WebKit/WebCoreSupport/WebViewGroup.h
index 3ee99ba0184602a3726d7a3bb5e36db7a3c530c7..fe05cd5486905cd29fb6884e7a87fbdc93272b5f 100644 (file)
@@ -34,7 +34,7 @@ class UserContentController;
 
 class WebVisitedLinkStore;
 
-@class WebView;
+OBJC_CLASS WebView;
 
 class WebViewGroup : public RefCounted<WebViewGroup> {
 public:
index db64dfc8ca24f0a03609cf8e40b2d4d42773b5c5..42746b4968e917a41713022cb75bfcbbbf93decb 100644 (file)
     <ClCompile Include="..\..\Storage\WebDatabaseProvider.cpp" />
     <ClCompile Include="..\..\Storage\WebStorageNamespaceProvider.cpp" />
     <ClCompile Include="..\..\cf\WebCoreSupport\WebInspectorClientCF.cpp" />
+    <ClCompile Include="..\..\WebCoreSupport\WebViewGroup.cpp" />
     <ClCompile Include="..\..\win\Plugins\npapi.cpp" />
     <ClCompile Include="..\..\win\Plugins\PluginDatabase.cpp" />
     <ClCompile Include="..\..\win\Plugins\PluginDebug.cpp" />
     <ClInclude Include="..\..\Storage\StorageTrackerClient.h" />
     <ClInclude Include="..\..\Storage\WebDatabaseProvider.h" />
     <ClInclude Include="..\..\Storage\WebStorageNamespaceProvider.h" />
+    <ClInclude Include="..\..\WebCoreSupport\WebViewGroup.h" />
     <ClInclude Include="..\..\win\Plugins\PluginDatabase.h" />
     <ClInclude Include="..\..\win\Plugins\PluginDebug.h" />
     <ClInclude Include="..\..\win\Plugins\PluginPackage.h" />
index bb9b4fec46d44e3d107a9a4460ac336752c740c0..9a6f676b99aa795e534c7749af434c8e531668a5 100644 (file)
     <ClCompile Include="..\..\win\WebKitMessageLoop.cpp">
       <Filter>Sources</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\WebCoreSupport\WebViewGroup.cpp">
+      <Filter>Sources</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\win\WebCoreSupport\EmbeddedWidget.h">
     <ClInclude Include="..\..\win\WebKitMessageLoop.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\WebCoreSupport\WebViewGroup.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="WebKitPostBuild.cmd" />
       <Filter>Sources\Plugins</Filter>
     </MASM>
   </ItemGroup>
-</Project>
+</Project>
\ No newline at end of file
index 259e14e519b15570d9c935b8bbf4b0080466d68b..588600b9c3f35bee783aaeb30b139eab71e15e8f 100644 (file)
@@ -5,7 +5,7 @@
   </PropertyGroup>
   <ItemDefinitionGroup>
     <ClCompile>
-      <AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)\..\..\win;$(ProjectDir)\..\..\win\Plugins;$(ProjectDir)\..\..\win\WebCoreSupport;$(ProjectDir)\..\..\Storage;$(ConfigurationBuildDir)\include\WebKit;$(ConfigurationBuildDir)\Include;$(ConfigurationBuildDir)\Include\private;$(ConfigurationBuildDir)\Include\WebCore;$(ConfigurationBuildDir)\Include\WebCore\ForwardingHeaders;$(ConfigurationBuildDir)\Include\JavaScriptCore;$(ConfigurationBuildDir)\Include\private\JavaScriptCore;$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebKit\DerivedSources;$(WebKit_Libraries)\Include;$(WebKit_Libraries)\Include\private;$(WebKit_Libraries)\Include\WebCore;$(WebKit_Libraries)\Include\WebCore\ForwardingHeaders;$(WebKit_Libraries)\include\sqlite;$(WebKit_Libraries)\Include\JavaScriptCore;$(WebKit_Libraries)\Include\private\JavaScriptCore;$(IntDir)include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)\..\..\win;$(ProjectDir)\..\..\win\Plugins;$(ProjectDir)\..\..\win\WebCoreSupport;$(ProjectDir)\..\..\Storage;$(ProjectDir)\..\..\WebCoreSupport;$(ConfigurationBuildDir)\include\WebKit;$(ConfigurationBuildDir)\Include;$(ConfigurationBuildDir)\Include\private;$(ConfigurationBuildDir)\Include\WebCore;$(ConfigurationBuildDir)\Include\WebCore\ForwardingHeaders;$(ConfigurationBuildDir)\Include\JavaScriptCore;$(ConfigurationBuildDir)\Include\private\JavaScriptCore;$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebKit\DerivedSources;$(WebKit_Libraries)\Include;$(WebKit_Libraries)\Include\private;$(WebKit_Libraries)\Include\WebCore;$(WebKit_Libraries)\Include\WebCore\ForwardingHeaders;$(WebKit_Libraries)\include\sqlite;$(WebKit_Libraries)\Include\JavaScriptCore;$(WebKit_Libraries)\Include\private\JavaScriptCore;$(IntDir)include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WEBKIT_EXPORTS;FRAMEWORK_NAME=WebKit;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PrecompiledHeader>Use</PrecompiledHeader>
       <PrecompiledHeaderFile>WebKitPrefix.h</PrecompiledHeaderFile>
@@ -17,4 +17,4 @@
       <DelayLoadDLLs>usp10.dll;comctl32.dll;version.dll;iphlpapi.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
     </Link>
   </ItemDefinitionGroup>
-</Project>
+</Project>
\ No newline at end of file
index 7c303dd183a988726c52728a8eb0bb06e73172ec..093119cec7cc18d25cda40bb67d8bc81beb94983 100644 (file)
@@ -19,6 +19,8 @@
                0AB752380FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0AB752360FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.mm */; };
                0AEBFF630F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 0AEBFF610F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0AEBFF640F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0AEBFF620F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.mm */; };
+               1430C12C1B2C5DF700DEA01D /* WebViewGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1430C12A1B2C5DF700DEA01D /* WebViewGroup.cpp */; };
+               1430C12D1B2C5DF700DEA01D /* WebViewGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = 1430C12B1B2C5DF700DEA01D /* WebViewGroup.h */; };
                14D8252F0AF955090004F057 /* WebChromeClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 14D8252D0AF955090004F057 /* WebChromeClient.h */; };
                14D825300AF955090004F057 /* WebChromeClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 14D8252E0AF955090004F057 /* WebChromeClient.mm */; };
                1A2DBE9F0F251E3A0036F8A6 /* ProxyInstance.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2DBE9D0F251E3A0036F8A6 /* ProxyInstance.h */; };
@@ -76,8 +78,6 @@
                1AAF5D0F0EDDE7A7008D883D /* WebKitPluginAgent.defs in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF588A0EDCCEA3008D883D /* WebKitPluginAgent.defs */; };
                1AAF5FBF0EDE3A92008D883D /* WebHostedNetscapePluginView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5FBD0EDE3A92008D883D /* WebHostedNetscapePluginView.h */; };
                1AAF5FC00EDE3A92008D883D /* WebHostedNetscapePluginView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5FBE0EDE3A92008D883D /* WebHostedNetscapePluginView.mm */; };
-               1AB1DAC118BC0232004B6A9F /* WebViewGroup.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AB1DABF18BC0232004B6A9F /* WebViewGroup.mm */; };
-               1AB1DAC218BC0232004B6A9F /* WebViewGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB1DAC018BC0232004B6A9F /* WebViewGroup.h */; };
                1AC7176E1A26568A002E3115 /* WebVisitedLinkStore.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AC7176C1A26568A002E3115 /* WebVisitedLinkStore.mm */; };
                1AC7176F1A26568A002E3115 /* WebVisitedLinkStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC7176D1A26568A002E3115 /* WebVisitedLinkStore.h */; };
                1AEA66D40DC6B1FF003D12BF /* WebNetscapePluginEventHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AEA66D20DC6B1FF003D12BF /* WebNetscapePluginEventHandler.h */; };
                0AB752360FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNetscapeContainerCheckContextInfo.mm; sourceTree = "<group>"; };
                0AEBFF610F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = WebNetscapeContainerCheckPrivate.h; sourceTree = "<group>"; };
                0AEBFF620F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNetscapeContainerCheckPrivate.mm; sourceTree = "<group>"; };
+               1430C12A1B2C5DF700DEA01D /* WebViewGroup.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = WebViewGroup.cpp; path = WebCoreSupport/WebViewGroup.cpp; sourceTree = SOURCE_ROOT; };
+               1430C12B1B2C5DF700DEA01D /* WebViewGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebViewGroup.h; path = WebCoreSupport/WebViewGroup.h; sourceTree = SOURCE_ROOT; };
                14D8252D0AF955090004F057 /* WebChromeClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebChromeClient.h; sourceTree = "<group>"; };
                14D8252E0AF955090004F057 /* WebChromeClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebChromeClient.mm; sourceTree = "<group>"; };
                1A2DBE9D0F251E3A0036F8A6 /* ProxyInstance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProxyInstance.h; sourceTree = "<group>"; };
                1AAF5D080EDDE71D008D883D /* WebKitPluginHostTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitPluginHostTypes.h; sourceTree = "<group>"; };
                1AAF5FBD0EDE3A92008D883D /* WebHostedNetscapePluginView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebHostedNetscapePluginView.h; sourceTree = "<group>"; };
                1AAF5FBE0EDE3A92008D883D /* WebHostedNetscapePluginView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebHostedNetscapePluginView.mm; sourceTree = "<group>"; };
-               1AB1DABF18BC0232004B6A9F /* WebViewGroup.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebViewGroup.mm; sourceTree = "<group>"; };
-               1AB1DAC018BC0232004B6A9F /* WebViewGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebViewGroup.h; sourceTree = "<group>"; };
                1AC7176C1A26568A002E3115 /* WebVisitedLinkStore.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebVisitedLinkStore.mm; sourceTree = "<group>"; };
                1AC7176D1A26568A002E3115 /* WebVisitedLinkStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVisitedLinkStore.h; sourceTree = "<group>"; };
                1AEA66D20DC6B1FF003D12BF /* WebNetscapePluginEventHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNetscapePluginEventHandler.h; sourceTree = "<group>"; };
                                2DD632C119E5D1F0002E9C7B /* WebSelectionServiceController.mm */,
                                93EB178E09F88D510091F8FF /* WebSystemInterface.h */,
                                93EB178C09F88D460091F8FF /* WebSystemInterface.mm */,
-                               1AB1DAC018BC0232004B6A9F /* WebViewGroup.h */,
-                               1AB1DABF18BC0232004B6A9F /* WebViewGroup.mm */,
+                               1430C12A1B2C5DF700DEA01D /* WebViewGroup.cpp */,
+                               1430C12B1B2C5DF700DEA01D /* WebViewGroup.h */,
                                1AC7176D1A26568A002E3115 /* WebVisitedLinkStore.h */,
                                1AC7176C1A26568A002E3115 /* WebVisitedLinkStore.mm */,
                        );
                                939810490824BF01008DF038 /* WebClipView.h in Headers */,
                                065AD5A30B0C32C7005A2B1D /* WebContextMenuClient.h in Headers */,
                                939810160824BF01008DF038 /* WebCoreStatistics.h in Headers */,
-                               1AB1DAC218BC0232004B6A9F /* WebViewGroup.h in Headers */,
                                93E2A1A4123B0B3C009FE12A /* WebDashboardRegion.h in Headers */,
                                511F3FD70CECC88F00852565 /* WebDatabaseManagerClient.h in Headers */,
                                51AEDEF10CECF45700854328 /* WebDatabaseManagerInternal.h in Headers */,
                                939810140824BF01008DF038 /* WebHistoryPrivate.h in Headers */,
                                1AAF5FBF0EDE3A92008D883D /* WebHostedNetscapePluginView.h in Headers */,
                                939810550824BF01008DF038 /* WebHTMLRepresentation.h in Headers */,
+                               1430C12D1B2C5DF700DEA01D /* WebViewGroup.h in Headers */,
                                939810560824BF01008DF038 /* WebHTMLRepresentationPrivate.h in Headers */,
                                939810570824BF01008DF038 /* WebHTMLView.h in Headers */,
                                1A6B313D1A51F3A900422975 /* StorageTrackerClient.h in Headers */,
                                1A6B31351A51F3A900422975 /* StorageNamespaceImpl.cpp in Sources */,
                                F834AAD80E64B1C700E2737C /* WebTextIterator.mm in Sources */,
                                A10C1D1D18202F9C0036883A /* WebDefaultResourceLoadDelegate.m in Sources */,
+                               1430C12C1B2C5DF700DEA01D /* WebViewGroup.cpp in Sources */,
                                939810BE0824BF01008DF038 /* WebURLsWithTitles.m in Sources */,
                                C0C5B3EF1177A4A0002B0AEF /* WebUserContentURLPattern.mm in Sources */,
-                               1AB1DAC118BC0232004B6A9F /* WebViewGroup.mm in Sources */,
                                939811070824BF01008DF038 /* WebView.mm in Sources */,
                                1A6B313B1A51F3A900422975 /* StorageTracker.cpp in Sources */,
                                BC2E464E0FD8A96800A9D9DE /* WebViewData.mm in Sources */,
index 685b6591c545bcb0bb8cb950ec6d0c89ea898442..244cdaebd4bdd3d2a78d16836a2d33853959223d 100644 (file)
@@ -1,3 +1,15 @@
+2015-06-26  Hyungwook Lee  <hyungwook.lee@navercorp.com>
+
+        [Win] Implement WebViewGroup to support WebView::addxxxToGroup().
+        https://bugs.webkit.org/show_bug.cgi?id=145908
+
+        Reviewed by Brent Fulgham.
+
+        Make WebViewGroup class sharing on Mac and Win port.
+
+        * WebCoreSupport/WebViewGroup.h: Removed.
+        * WebCoreSupport/WebViewGroup.mm: Removed.
+
 2015-06-25  Joseph Pecoraro  <pecoraro@apple.com>
 
         Web Inspector: Add Support for OS X Full Screen Mode
index 81b6d56aa536de646753f145fe19ac18e5f431ad..bc26b7b4e63c50d4db52a7418b1a4f1b51149716 100644 (file)
@@ -1,3 +1,32 @@
+2015-06-26  Hyungwook Lee  <hyungwook.lee@navercorp.com>
+
+        [Win] Implement WebViewGroup to support WebView::addxxxToGroup().
+        https://bugs.webkit.org/show_bug.cgi?id=145908
+
+        Reviewed by Brent Fulgham.
+
+        Make WebViewGroup class sharing on Mac and Win port.
+
+        * WebCoreSupport/WebVisitedLinkStore.cpp:
+        (visitedLinkStores):
+        (WebVisitedLinkStore::create):
+        (WebVisitedLinkStore::WebVisitedLinkStore):
+        (WebVisitedLinkStore::~WebVisitedLinkStore):
+        (WebVisitedLinkStore::setShouldTrackVisitedLinks):
+        (WebVisitedLinkStore::removeAllVisitedLinks):
+        (WebVisitedLinkStore::singleton): Deleted.
+        * WebCoreSupport/WebVisitedLinkStore.h:
+        * WebView.cpp:
+        (toURL):
+        (localStorageDatabasePath):
+        (WebView::WebView):
+        (WebView::~WebView):
+        (WebView::shouldInitializeTrackPointHack):
+        (WebView::initWithFrame):
+        (WebView::setGroupName):
+        (WebView::addVisitedLinks):
+        * WebView.h:
+
 2015-06-25  Brent Fulgham  <bfulgham@apple.com>
 
         [Win] Need implementation of layoutTestController.setBackingScaleFactor
index c2b19f1099894077cb737294ad04655207118fdc..c6a114bd8bbd107b0bdac692c8318c2ac3b13e10 100644 (file)
@@ -34,20 +34,27 @@ using namespace WebCore;
 
 static bool s_shouldTrackVisitedLinks;
 
-WebVisitedLinkStore& WebVisitedLinkStore::singleton()
+static HashSet<WebVisitedLinkStore*>& visitedLinkStores()
 {
-    static WebVisitedLinkStore& visitedLinkStore = *adoptRef(new WebVisitedLinkStore).leakRef();
-    
-    return visitedLinkStore;
+    static NeverDestroyed<HashSet<WebVisitedLinkStore*>> visitedLinkStores;
+
+    return visitedLinkStores;
+}
+
+Ref<WebVisitedLinkStore> WebVisitedLinkStore::create()
+{
+    return adoptRef(*new WebVisitedLinkStore);
 }
 
 WebVisitedLinkStore::WebVisitedLinkStore()
     : m_visitedLinksPopulated(false)
 {
+    visitedLinkStores().add(this);
 }
 
 WebVisitedLinkStore::~WebVisitedLinkStore()
 {
+    visitedLinkStores().remove(this);
 }
 
 void WebVisitedLinkStore::setShouldTrackVisitedLinks(bool shouldTrackVisitedLinks)
@@ -62,7 +69,8 @@ void WebVisitedLinkStore::setShouldTrackVisitedLinks(bool shouldTrackVisitedLink
 
 void WebVisitedLinkStore::removeAllVisitedLinks()
 {
-    WebVisitedLinkStore::singleton().removeVisitedLinkHashes();
+    for (auto& visitedLinkStore : visitedLinkStores())
+        visitedLinkStore->removeVisitedLinkHashes();
     PageCache::singleton().markPagesForVisitedLinkStyleRecalc();
 }
 
index 64a980f1fa45c804ff6657a4eefa2ba6d6a64f1c..2e8114378a8d576066a5cb9693e418794027fffc 100644 (file)
@@ -32,8 +32,7 @@
 
 class WebVisitedLinkStore final : public WebCore::VisitedLinkStore {
 public:
-    static WebVisitedLinkStore& singleton();
-    WebVisitedLinkStore();
+    static Ref<WebVisitedLinkStore> create();
     virtual ~WebVisitedLinkStore();
 
     static void setShouldTrackVisitedLinks(bool);
@@ -42,6 +41,8 @@ public:
     void addVisitedLink(const String& urlString);
 
 private:
+    WebVisitedLinkStore();
+
     virtual bool isLinkVisited(WebCore::Page&, WebCore::LinkHash, const WebCore::URL& baseURL, const AtomicString& attributeURL) override;
     virtual void addVisitedLink(WebCore::Page&, WebCore::LinkHash) override;
 
index 4fb4c84e2e48a0aa06f72d68596b11772bc37fba..f5d0945f24c877fd0c2144673b840eca4246c2a4 100644 (file)
@@ -69,6 +69,7 @@
 #include "WebPreferences.h"
 #include "WebScriptWorld.h"
 #include "WebStorageNamespaceProvider.h"
+#include "WebViewGroup.h"
 #include "WebVisitedLinkStore.h"
 #include "resource.h"
 #include <JavaScriptCore/APICast.h>
 #include <WebCore/SecurityPolicy.h>
 #include <WebCore/Settings.h>
 #include <WebCore/SystemInfo.h>
+#include <WebCore/UserContentController.h>
 #include <WebCore/WindowMessageBroadcaster.h>
 #include <WebCore/WindowsTouch.h>
 #include <bindings/ScriptValue.h>
@@ -252,6 +254,15 @@ static inline URL toURL(BSTR bstr)
     return URL(URL(), toString(bstr));
 }
 
+static String localStorageDatabasePath(WebPreferences* preferences)
+{
+    BString localStorageDatabasePath;
+    if (FAILED(preferences->localStorageDatabasePath(&localStorageDatabasePath)))
+        return String();
+
+    return toString(localStorageDatabasePath);
+}
+
 class PreferencesChangedOrRemovedObserver : public IWebNotificationObserver {
 public:
     static PreferencesChangedOrRemovedObserver* sharedInstance();
@@ -436,6 +447,9 @@ WebView::WebView()
     if (SUCCEEDED(sharedPreferences->grammarCheckingEnabled(&enabled)))
         grammarCheckingEnabled = !!enabled;
 
+    m_webViewGroup = WebViewGroup::getOrCreate(String(), localStorageDatabasePath(sharedPreferences));
+    m_webViewGroup->addWebView(this);
+
     WebViewCount++;
     gClassCount++;
     gClassNameCount().add("WebView");
@@ -457,6 +471,8 @@ WebView::~WebView()
     ASSERT(!m_layerTreeHost);
 #endif
 
+    m_webViewGroup->removeWebView(this);
+
     WebViewCount--;
     gClassCount--;
     gClassNameCount().remove("WebView");
@@ -2755,15 +2771,6 @@ bool WebView::shouldInitializeTrackPointHack()
     return shouldCreateScrollbars;
 }
 
-static String localStorageDatabasePath(WebPreferences* preferences)
-{
-    BString localStorageDatabasePath;
-    if (FAILED(preferences->localStorageDatabasePath(&localStorageDatabasePath)))
-        return String();
-
-    return toString(localStorageDatabasePath);
-}
-
 HRESULT STDMETHODCALLTYPE WebView::initWithFrame( 
     /* [in] */ RECT frame,
     /* [in] */ BSTR frameName,
@@ -2826,9 +2833,10 @@ HRESULT STDMETHODCALLTYPE WebView::initWithFrame(
     configuration.inspectorClient = m_inspectorClient;
     configuration.loaderClientForMainFrame = new WebFrameLoaderClient;
     configuration.databaseProvider = &WebDatabaseProvider::singleton();
-    configuration.storageNamespaceProvider = WebStorageNamespaceProvider::create(localStorageDatabasePath(m_preferences.get()));
+    configuration.storageNamespaceProvider = &m_webViewGroup->storageNamespaceProvider();
     configuration.progressTrackerClient = static_cast<WebFrameLoaderClient*>(configuration.loaderClientForMainFrame);
-    configuration.visitedLinkStore = &WebVisitedLinkStore::singleton();
+    configuration.userContentController = &m_webViewGroup->userContentController();
+    configuration.visitedLinkStore = &m_webViewGroup->visitedLinkStore();
 
     m_page = new Page(configuration);
     provideGeolocationTo(m_page, new WebGeolocationClient(this));
@@ -3700,8 +3708,17 @@ HRESULT STDMETHODCALLTYPE WebView::registerViewClass(
 HRESULT STDMETHODCALLTYPE WebView::setGroupName( 
         /* [in] */ BSTR groupName)
 {
+    if (m_webViewGroup)
+        m_webViewGroup->removeWebView(this);
+
+    m_webViewGroup = WebViewGroup::getOrCreate(groupName, localStorageDatabasePath(m_preferences.get()));
+    m_webViewGroup->addWebView(this);
+
     if (!m_page)
         return S_OK;
+
+    m_page->setUserContentController(&m_webViewGroup->userContentController());
+    m_page->setVisitedLinkStore(m_webViewGroup->visitedLinkStore());
     m_page->setGroupName(toString(groupName));
     return S_OK;
 }
@@ -6511,7 +6528,7 @@ HRESULT WebView::historyDelegate(IWebHistoryDelegate** historyDelegate)
 
 HRESULT WebView::addVisitedLinks(BSTR* visitedURLs, unsigned visitedURLCount)
 {
-    auto& visitedLinkStore = WebVisitedLinkStore::singleton();
+    auto& visitedLinkStore = m_webViewGroup->visitedLinkStore();
     PageGroup& group = core(this)->group();
     
     for (unsigned i = 0; i < visitedURLCount; ++i) {
index 87cdc73df001ce32ebc380d43ef47c5f7cf57630..641a74de89c5dbbd36a5b4c8d016749ab259a0d4 100644 (file)
@@ -70,6 +70,7 @@ class WebInspectorClient;
 #if USE(TEXTURE_MAPPER_GL)
 class AcceleratedCompositingContext;
 #endif
+class WebViewGroup;
 
 WebView* kit(WebCore::Page*);
 WebCore::Page* core(IWebView*);
@@ -1166,6 +1167,8 @@ protected:
     std::unique_ptr<WebCore::FullScreenController> m_fullscreenController;
     WebCore::IntPoint m_scrollPosition;
 #endif
+
+    RefPtr<WebViewGroup> m_webViewGroup;
 };
 
 #endif