<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[164618] trunk/Source/WebKit</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/164618">164618</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2014-02-24 17:41:39 -0800 (Mon, 24 Feb 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add WebViewGroup
https://bugs.webkit.org/show_bug.cgi?id=129280

Reviewed by Dan Bernstein.

Source/WebKit:

Add new files.

* WebKit.xcodeproj/project.pbxproj:

Source/WebKit/mac:

This is a first step towards getting rid of page groups in WebCore. The idea is that
everything that is per page group in WebCore will be per page. In order to retain WebKit1 compatibility
WebViewGroup is going to take over more and more responsibility from WebCore::PageGroup.

* WebCoreSupport/WebViewGroup.h: Added.
* WebCoreSupport/WebViewGroup.mm: Added.
(webViewGroups):
(WebViewGroup::getOrCreate):
(WebViewGroup::WebViewGroup):
(WebViewGroup::~WebViewGroup):
(WebViewGroup::addWebView):
(WebViewGroup::removeWebView):
* WebView/WebView.mm:
(-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):
(-[WebView _close]):
(-[WebView setGroupName:]):
* WebView/WebViewData.h:
* WebView/WebViewData.mm:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitWebKitxcodeprojprojectpbxproj">trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewmm">trunk/Source/WebKit/mac/WebView/WebView.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewDatah">trunk/Source/WebKit/mac/WebView/WebViewData.h</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewDatamm">trunk/Source/WebKit/mac/WebView/WebViewData.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebViewGrouph">trunk/Source/WebKit/mac/WebCoreSupport/WebViewGroup.h</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebViewGroupmm">trunk/Source/WebKit/mac/WebCoreSupport/WebViewGroup.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (164617 => 164618)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog        2014-02-25 00:40:06 UTC (rev 164617)
+++ trunk/Source/WebKit/ChangeLog        2014-02-25 01:41:39 UTC (rev 164618)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2014-02-24  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Add WebViewGroup
+        https://bugs.webkit.org/show_bug.cgi?id=129280
+
+        Reviewed by Dan Bernstein.
+
+        Add new files.
+
+        * WebKit.xcodeproj/project.pbxproj:
+
</ins><span class="cx"> 2014-02-24  Roger Fong  &lt;roger_fong@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [WinCairo] Disable ANGLE build on WinCairo port.
</span></span></pre></div>
<a id="trunkSourceWebKitWebKitxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (164617 => 164618)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj        2014-02-25 00:40:06 UTC (rev 164617)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj        2014-02-25 01:41:39 UTC (rev 164618)
</span><span class="lines">@@ -58,6 +58,8 @@
</span><span class="cx">                 1AAF5D0F0EDDE7A7008D883D /* WebKitPluginAgent.defs in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF588A0EDCCEA3008D883D /* WebKitPluginAgent.defs */; };
</span><span class="cx">                 1AAF5FBF0EDE3A92008D883D /* WebHostedNetscapePluginView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5FBD0EDE3A92008D883D /* WebHostedNetscapePluginView.h */; };
</span><span class="cx">                 1AAF5FC00EDE3A92008D883D /* WebHostedNetscapePluginView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5FBE0EDE3A92008D883D /* WebHostedNetscapePluginView.mm */; };
</span><ins>+                1AB1DAC118BC0232004B6A9F /* WebViewGroup.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AB1DABF18BC0232004B6A9F /* WebViewGroup.mm */; };
+                1AB1DAC218BC0232004B6A9F /* WebViewGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB1DAC018BC0232004B6A9F /* WebViewGroup.h */; };
</ins><span class="cx">                 1AEA66D40DC6B1FF003D12BF /* WebNetscapePluginEventHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AEA66D20DC6B1FF003D12BF /* WebNetscapePluginEventHandler.h */; };
</span><span class="cx">                 1AEA66D50DC6B1FF003D12BF /* WebNetscapePluginEventHandler.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AEA66D30DC6B1FF003D12BF /* WebNetscapePluginEventHandler.mm */; };
</span><span class="cx">                 1AEA66D80DC6B209003D12BF /* WebNetscapePluginEventHandlerCarbon.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AEA66D60DC6B209003D12BF /* WebNetscapePluginEventHandlerCarbon.h */; };
</span><span class="lines">@@ -498,6 +500,8 @@
</span><span class="cx">                 1AAF5D080EDDE71D008D883D /* WebKitPluginHostTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitPluginHostTypes.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1AAF5FBD0EDE3A92008D883D /* WebHostedNetscapePluginView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebHostedNetscapePluginView.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1AAF5FBE0EDE3A92008D883D /* WebHostedNetscapePluginView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebHostedNetscapePluginView.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                1AB1DABF18BC0232004B6A9F /* WebViewGroup.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebViewGroup.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                1AB1DAC018BC0232004B6A9F /* WebViewGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebViewGroup.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 1AEA66D20DC6B1FF003D12BF /* WebNetscapePluginEventHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNetscapePluginEventHandler.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1AEA66D30DC6B1FF003D12BF /* WebNetscapePluginEventHandler.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNetscapePluginEventHandler.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1AEA66D60DC6B209003D12BF /* WebNetscapePluginEventHandlerCarbon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNetscapePluginEventHandlerCarbon.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -1568,6 +1572,8 @@
</span><span class="cx">                                 A5DEFC0911D5331C00885273 /* WebSecurityOriginPrivate.h */,
</span><span class="cx">                                 93EB178E09F88D510091F8FF /* WebSystemInterface.h */,
</span><span class="cx">                                 93EB178C09F88D460091F8FF /* WebSystemInterface.mm */,
</span><ins>+                                1AB1DAC018BC0232004B6A9F /* WebViewGroup.h */,
+                                1AB1DABF18BC0232004B6A9F /* WebViewGroup.mm */,
</ins><span class="cx">                         );
</span><span class="cx">                         name = WebCoreSupport;
</span><span class="cx">                         path = mac/WebCoreSupport;
</span><span class="lines">@@ -1704,6 +1710,7 @@
</span><span class="cx">                                 939810490824BF01008DF038 /* WebClipView.h in Headers */,
</span><span class="cx">                                 065AD5A30B0C32C7005A2B1D /* WebContextMenuClient.h in Headers */,
</span><span class="cx">                                 939810160824BF01008DF038 /* WebCoreStatistics.h in Headers */,
</span><ins>+                                1AB1DAC218BC0232004B6A9F /* WebViewGroup.h in Headers */,
</ins><span class="cx">                                 93E2A1A4123B0B3C009FE12A /* WebDashboardRegion.h in Headers */,
</span><span class="cx">                                 511F3FD70CECC88F00852565 /* WebDatabaseManagerClient.h in Headers */,
</span><span class="cx">                                 51AEDEF10CECF45700854328 /* WebDatabaseManagerInternal.h in Headers */,
</span><span class="lines">@@ -2333,6 +2340,7 @@
</span><span class="cx">                                 A10C1D1D18202F9C0036883A /* WebDefaultResourceLoadDelegate.m in Sources */,
</span><span class="cx">                                 939810BE0824BF01008DF038 /* WebURLsWithTitles.m in Sources */,
</span><span class="cx">                                 C0C5B3EF1177A4A0002B0AEF /* WebUserContentURLPattern.mm in Sources */,
</span><ins>+                                1AB1DAC118BC0232004B6A9F /* WebViewGroup.mm in Sources */,
</ins><span class="cx">                                 939811070824BF01008DF038 /* WebView.mm in Sources */,
</span><span class="cx">                                 BC2E464E0FD8A96800A9D9DE /* WebViewData.mm in Sources */,
</span><span class="cx">                         );
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (164617 => 164618)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2014-02-25 00:40:06 UTC (rev 164617)
+++ trunk/Source/WebKit/mac/ChangeLog        2014-02-25 01:41:39 UTC (rev 164618)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2014-02-24  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Add WebViewGroup
+        https://bugs.webkit.org/show_bug.cgi?id=129280
+
+        Reviewed by Dan Bernstein.
+
+        This is a first step towards getting rid of page groups in WebCore. The idea is that
+        everything that is per page group in WebCore will be per page. In order to retain WebKit1 compatibility
+        WebViewGroup is going to take over more and more responsibility from WebCore::PageGroup.
+
+        * WebCoreSupport/WebViewGroup.h: Added.
+        * WebCoreSupport/WebViewGroup.mm: Added.
+        (webViewGroups):
+        (WebViewGroup::getOrCreate):
+        (WebViewGroup::WebViewGroup):
+        (WebViewGroup::~WebViewGroup):
+        (WebViewGroup::addWebView):
+        (WebViewGroup::removeWebView):
+        * WebView/WebView.mm:
+        (-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):
+        (-[WebView _close]):
+        (-[WebView setGroupName:]):
+        * WebView/WebViewData.h:
+        * WebView/WebViewData.mm:
+
</ins><span class="cx"> 2014-02-24  Tamas Gergely  &lt;tgergely.u-szeged@partner.samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Code cleanup: remove leftover ENABLE(WORKERS) macros and support.
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebViewGrouph"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit/mac/WebCoreSupport/WebViewGroup.h (0 => 164618)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebViewGroup.h                                (rev 0)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebViewGroup.h        2014-02-25 01:41:39 UTC (rev 164618)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+/*
+ * Copyright (C) 2014 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.
+ */
+
+#import &lt;wtf/HashSet.h&gt;
+#import &lt;wtf/RefCounted.h&gt;
+#import &lt;wtf/PassRefPtr.h&gt;
+#import &lt;wtf/text/WTFString.h&gt;
+
+@class WebView;
+
+class WebViewGroup : public RefCounted&lt;WebViewGroup&gt; {
+public:
+    static PassRefPtr&lt;WebViewGroup&gt; getOrCreate(const String&amp; name);
+    ~WebViewGroup();
+
+    void addWebView(WebView *);
+    void removeWebView(WebView *);
+    
+private:
+    WebViewGroup(const String&amp; name);
+
+    String m_name;
+    HashSet&lt;WebView *&gt; m_webViews;
+};
</ins></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebViewGroupmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit/mac/WebCoreSupport/WebViewGroup.mm (0 => 164618)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebViewGroup.mm                                (rev 0)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebViewGroup.mm        2014-02-25 01:41:39 UTC (rev 164618)
</span><span class="lines">@@ -0,0 +1,77 @@
</span><ins>+/*
+ * Copyright (C) 2014 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.
+ */
+
+#import &quot;WebViewGroup.h&quot;
+
+#import &quot;WebView.h&quot;
+#import &lt;wtf/HashMap.h&gt;
+#import &lt;wtf/NeverDestroyed.h&gt;
+#import &lt;wtf/RefPtr.h&gt;
+#import &lt;wtf/text/StringHash.h&gt;
+
+// Any named groups will live for the lifetime of the process, thanks to the reference held by the RefPtr.
+static HashMap&lt;String, RefPtr&lt;WebViewGroup&gt;&gt;&amp; webViewGroups()
+{
+    static NeverDestroyed&lt;HashMap&lt;String, RefPtr&lt;WebViewGroup&gt;&gt;&gt; webViewGroups;
+
+    return webViewGroups;
+}
+
+PassRefPtr&lt;WebViewGroup&gt; WebViewGroup::getOrCreate(const String&amp; name)
+{
+    if (name.isEmpty())
+        return adoptRef(new WebViewGroup(String()));
+
+    auto&amp; webViewGroup = webViewGroups().add(name, nullptr).iterator-&gt;value;
+    if (!webViewGroup)
+        webViewGroup = adoptRef(new WebViewGroup(name));
+
+    return webViewGroup;
+}
+
+WebViewGroup::WebViewGroup(const String&amp; name)
+    : m_name(name)
+{
+}
+
+WebViewGroup::~WebViewGroup()
+{
+    ASSERT(m_name.isEmpty());
+    ASSERT(m_webViews.isEmpty());
+}
+
+void WebViewGroup::addWebView(WebView *webView)
+{
+    ASSERT(!m_webViews.contains(webView));
+
+    m_webViews.add(webView);
+}
+
+void WebViewGroup::removeWebView(WebView *webView)
+{
+    ASSERT(m_webViews.contains(webView));
+
+    m_webViews.remove(webView);
+}
</ins></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (164617 => 164618)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebView.mm        2014-02-25 00:40:06 UTC (rev 164617)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm        2014-02-25 01:41:39 UTC (rev 164618)
</span><span class="lines">@@ -104,6 +104,7 @@
</span><span class="cx"> #import &quot;WebUIDelegate.h&quot;
</span><span class="cx"> #import &quot;WebUIDelegatePrivate.h&quot;
</span><span class="cx"> #import &quot;WebUserMediaClient.h&quot;
</span><ins>+#import &quot;WebViewGroup.h&quot;
</ins><span class="cx"> #import &lt;CoreFoundation/CFSet.h&gt;
</span><span class="cx"> #import &lt;Foundation/NSURLConnection.h&gt;
</span><span class="cx"> #import &lt;JavaScriptCore/APICast.h&gt;
</span><span class="lines">@@ -1181,7 +1182,7 @@
</span><span class="cx">     // FIXME: this is a workaround for &lt;rdar://problem/11820090&gt; Quoted text changes in size when replying to certain email
</span><span class="cx">     _private-&gt;page-&gt;settings().setMinimumFontSize([_private-&gt;preferences minimumFontSize]);
</span><span class="cx"> 
</span><del>-    _private-&gt;page-&gt;setGroupName(groupName);
</del><ins>+    [self setGroupName:groupName];
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(REMOTE_INSPECTOR)
</span><span class="cx">     // Production installs always disallow debugging simple HTML documents.
</span><span class="lines">@@ -1732,7 +1733,9 @@
</span><span class="cx">     [self removeDragCaret];
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    // Deleteing the WebCore::Page will clear the page cache so we call destroy on 
</del><ins>+    _private-&gt;group-&gt;removeWebView(self);
+
+    // Deleteing the WebCore::Page will clear the page cache so we call destroy on
</ins><span class="cx">     // all the plug-ins in the page cache to break any retain cycles.
</span><span class="cx">     // See comment in HistoryItem::releaseAllPendingPageCaches() for more information.
</span><span class="cx">     Page* page = _private-&gt;page;
</span><span class="lines">@@ -6123,6 +6126,12 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)setGroupName:(NSString *)groupName
</span><span class="cx"> {
</span><ins>+    if (_private-&gt;group)
+        _private-&gt;group-&gt;removeWebView(self);
+
+    _private-&gt;group = WebViewGroup::getOrCreate(groupName);
+    _private-&gt;group-&gt;addWebView(self);
+
</ins><span class="cx">     if (!_private-&gt;page)
</span><span class="cx">         return;
</span><span class="cx">     _private-&gt;page-&gt;setGroupName(groupName);
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebViewData.h (164617 => 164618)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebViewData.h        2014-02-25 00:40:06 UTC (rev 164617)
+++ trunk/Source/WebKit/mac/WebView/WebViewData.h        2014-02-25 01:41:39 UTC (rev 164618)
</span><span class="lines">@@ -81,6 +81,7 @@
</span><span class="cx"> extern int pluginDatabaseClientCount;
</span><span class="cx"> 
</span><span class="cx"> class LayerFlushController;
</span><ins>+class WebViewGroup;
</ins><span class="cx"> 
</span><span class="cx"> class WebViewLayerFlushScheduler : public WebCore::LayerFlushScheduler {
</span><span class="cx"> public:
</span><span class="lines">@@ -120,7 +121,8 @@
</span><span class="cx"> @interface WebViewPrivate : NSObject {
</span><span class="cx"> @public
</span><span class="cx">     WebCore::Page* page;
</span><del>-    
</del><ins>+    RefPtr&lt;WebViewGroup&gt; group;
+
</ins><span class="cx">     id UIDelegate;
</span><span class="cx">     id UIDelegateForwarder;
</span><span class="cx">     id resourceProgressDelegate;
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewDatamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebViewData.mm (164617 => 164618)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebViewData.mm        2014-02-25 00:40:06 UTC (rev 164617)
+++ trunk/Source/WebKit/mac/WebView/WebViewData.mm        2014-02-25 01:41:39 UTC (rev 164618)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> 
</span><span class="cx"> #import &quot;WebKitLogging.h&quot;
</span><span class="cx"> #import &quot;WebPreferenceKeysPrivate.h&quot;
</span><ins>+#import &quot;WebViewGroup.h&quot;
</ins><span class="cx"> #import &lt;WebCore/AlternativeTextUIController.h&gt;
</span><span class="cx"> #import &lt;WebCore/WebCoreObjCExtras.h&gt;
</span><span class="cx"> #import &lt;WebCore/HistoryItem.h&gt;
</span></span></pre>
</div>
</div>

</body>
</html>