<!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>[182494] trunk/Source</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/182494">182494</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2015-04-07 14:29:00 -0700 (Tue, 07 Apr 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>ContextMenuItem refactoring
https://bugs.webkit.org/show_bug.cgi?id=143485
Reviewed by Beth Dakin.
Source/WebCore:
* platform/ContextMenuItem.h:
(WebCore::ContextMenuItem::isNull):
* platform/gtk/ContextMenuItemGtk.cpp:
(WebCore::ContextMenuItem::ContextMenuItem):
* platform/mac/ContextMenuItemMac.mm:
(WebCore::ContextMenuItem::ContextMenuItem):
(WebCore::ContextMenuItem::platformDescription):
(WebCore::ContextMenuItem::setSubMenu):
(WebCore::ContextMenuItem::releasePlatformDescription): Deleted.
(WebCore::ContextMenuItem::getPlatformDescription): Deleted.
* platform/mac/ContextMenuMac.mm:
(WebCore::ContextMenu::appendItem):
(WebCore::ContextMenu::insertItem):
(WebCore::platformMenuDescription):
* platform/win/ContextMenuItemWin.cpp:
(WebCore::ContextMenuItem::ContextMenuItem):
Source/WebKit/mac:
* WebCoreSupport/WebContextMenuClient.mm:
(WebContextMenuClient::contextMenuItemSelected):
Source/WebKit2:
* Shared/mac/NativeContextMenuItem.mm:
(WebKit::NativeContextMenuItem::NativeContextMenuItem):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformContextMenuItemh">trunk/Source/WebCore/platform/ContextMenuItem.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgtkContextMenuItemGtkcpp">trunk/Source/WebCore/platform/gtk/ContextMenuItemGtk.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmacContextMenuItemMacmm">trunk/Source/WebCore/platform/mac/ContextMenuItemMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacContextMenuMacmm">trunk/Source/WebCore/platform/mac/ContextMenuMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformwinContextMenuItemWincpp">trunk/Source/WebCore/platform/win/ContextMenuItemWin.cpp</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebContextMenuClientmm">trunk/Source/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedmacNativeContextMenuItemmm">trunk/Source/WebKit2/Shared/mac/NativeContextMenuItem.mm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (182493 => 182494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-04-07 21:28:57 UTC (rev 182493)
+++ trunk/Source/WebCore/ChangeLog        2015-04-07 21:29:00 UTC (rev 182494)
</span><span class="lines">@@ -1,3 +1,31 @@
</span><ins>+2015-04-07 Brady Eidson <beidson@apple.com>
+
+ ContextMenuItem refactoring
+ https://bugs.webkit.org/show_bug.cgi?id=143485
+
+ Reviewed by Beth Dakin.
+
+ * platform/ContextMenuItem.h:
+ (WebCore::ContextMenuItem::isNull):
+
+ * platform/gtk/ContextMenuItemGtk.cpp:
+ (WebCore::ContextMenuItem::ContextMenuItem):
+
+ * platform/mac/ContextMenuItemMac.mm:
+ (WebCore::ContextMenuItem::ContextMenuItem):
+ (WebCore::ContextMenuItem::platformDescription):
+ (WebCore::ContextMenuItem::setSubMenu):
+ (WebCore::ContextMenuItem::releasePlatformDescription): Deleted.
+ (WebCore::ContextMenuItem::getPlatformDescription): Deleted.
+
+ * platform/mac/ContextMenuMac.mm:
+ (WebCore::ContextMenu::appendItem):
+ (WebCore::ContextMenu::insertItem):
+ (WebCore::platformMenuDescription):
+
+ * platform/win/ContextMenuItemWin.cpp:
+ (WebCore::ContextMenuItem::ContextMenuItem):
+
</ins><span class="cx"> 2015-04-07 Alex Christensen <achristensen@webkit.org>
</span><span class="cx">
</span><span class="cx"> Optimize content extensions interpreting speed.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformContextMenuItemh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ContextMenuItem.h (182493 => 182494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ContextMenuItem.h        2015-04-07 21:28:57 UTC (rev 182493)
+++ trunk/Source/WebCore/platform/ContextMenuItem.h        2015-04-07 21:29:00 UTC (rev 182494)
</span><span class="lines">@@ -228,12 +228,18 @@
</span><span class="cx"> #else
</span><span class="cx"> public:
</span><span class="cx"> WEBCORE_EXPORT explicit ContextMenuItem(PlatformMenuItemDescription);
</span><del>- explicit ContextMenuItem(ContextMenu* subMenu = 0);
</del><ins>+ explicit ContextMenuItem(ContextMenu* subMenu);
</ins><span class="cx"> ContextMenuItem(ContextMenuAction, const String&, bool enabled, bool checked, Vector<ContextMenuItem>& submenuItems);
</span><ins>+ ContextMenuItem();
</ins><span class="cx">
</span><ins>+ bool isNull() const { return !m_platformDescription; }
+
+#if PLATFORM(GTK)
</ins><span class="cx"> WEBCORE_EXPORT PlatformMenuItemDescription releasePlatformDescription();
</span><del>- WEBCORE_EXPORT PlatformMenuItemDescription getPlatformDescription() const;
</del><ins>+#endif
</ins><span class="cx">
</span><ins>+ WEBCORE_EXPORT PlatformMenuItemDescription platformDescription() const;
+
</ins><span class="cx"> WEBCORE_EXPORT String title() const;
</span><span class="cx"> void setTitle(const String&);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgtkContextMenuItemGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/gtk/ContextMenuItemGtk.cpp (182493 => 182494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/gtk/ContextMenuItemGtk.cpp        2015-04-07 21:28:57 UTC (rev 182493)
+++ trunk/Source/WebCore/platform/gtk/ContextMenuItemGtk.cpp        2015-04-07 21:29:00 UTC (rev 182494)
</span><span class="lines">@@ -140,6 +140,11 @@
</span><span class="cx"> return item;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ContextMenuItem::ContextMenuItem()
+ : m_platformDescription(nullptr)
+{
+}
+
</ins><span class="cx"> // Extract the ActionType from the menu item
</span><span class="cx"> ContextMenuItem::ContextMenuItem(PlatformMenuItemDescription item)
</span><span class="cx"> : m_platformDescription(item)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacContextMenuItemMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/ContextMenuItemMac.mm (182493 => 182494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/ContextMenuItemMac.mm        2015-04-07 21:28:57 UTC (rev 182493)
+++ trunk/Source/WebCore/platform/mac/ContextMenuItemMac.mm        2015-04-07 21:29:00 UTC (rev 182494)
</span><span class="lines">@@ -43,6 +43,10 @@
</span><span class="cx"> return itemsArray;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ContextMenuItem::ContextMenuItem()
+{
+}
+
</ins><span class="cx"> ContextMenuItem::ContextMenuItem(NSMenuItem* item)
</span><span class="cx"> {
</span><span class="cx"> m_platformDescription = item;
</span><span class="lines">@@ -96,15 +100,8 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-NSMenuItem *ContextMenuItem::releasePlatformDescription()
</del><ins>+NSMenuItem *ContextMenuItem::platformDescription() const
</ins><span class="cx"> {
</span><del>- NSMenuItem *item = [m_platformDescription.get() retain];
- m_platformDescription = 0;
- return item;
-}
-
-NSMenuItem *ContextMenuItem::getPlatformDescription() const
-{
</del><span class="cx"> return m_platformDescription.get();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -164,7 +161,7 @@
</span><span class="cx"> NSMenu* subMenu = [[NSMenu alloc] init];
</span><span class="cx"> [subMenu setAutoenablesItems:NO];
</span><span class="cx"> for (unsigned i = 0; i < subMenuItems.size(); ++i)
</span><del>- [subMenu addItem:subMenuItems[i].releasePlatformDescription()];
</del><ins>+ [subMenu addItem:subMenuItems[i].platformDescription()];
</ins><span class="cx">
</span><span class="cx"> [m_platformDescription.get() setSubmenu:subMenu];
</span><span class="cx"> [subMenu release];
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacContextMenuMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/ContextMenuMac.mm (182493 => 182494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/ContextMenuMac.mm        2015-04-07 21:28:57 UTC (rev 182493)
+++ trunk/Source/WebCore/platform/mac/ContextMenuMac.mm        2015-04-07 21:29:00 UTC (rev 182494)
</span><span class="lines">@@ -48,18 +48,12 @@
</span><span class="cx">
</span><span class="cx"> void ContextMenu::appendItem(ContextMenuItem& item)
</span><span class="cx"> {
</span><del>- NSMenuItem* platformItem = item.releasePlatformDescription();
-
- [m_platformDescription.get() addObject:platformItem];
- [platformItem release];
</del><ins>+ [m_platformDescription.get() addObject:item.platformDescription()];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void ContextMenu::insertItem(unsigned position, ContextMenuItem& item)
</span><span class="cx"> {
</span><del>- NSMenuItem* platformItem = item.releasePlatformDescription();
-
- [m_platformDescription.get() insertObject:platformItem atIndex:position];
- [platformItem release];
</del><ins>+ [m_platformDescription.get() insertObject:item.platformDescription() atIndex:position];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> unsigned ContextMenu::itemCount() const
</span><span class="lines">@@ -99,12 +93,9 @@
</span><span class="cx"> PlatformMenuDescription platformMenuDescription(Vector<ContextMenuItem>& menuItemVector)
</span><span class="cx"> {
</span><span class="cx"> PlatformMenuDescription platformMenu = [[NSMutableArray alloc] initWithCapacity:menuItemVector.size()];
</span><del>- for (unsigned i = 0; i < menuItemVector.size(); ++i) {
- PlatformMenuItemDescription platformItem = menuItemVector[i].releasePlatformDescription();
- [platformMenu addObject:platformItem];
- [platformItem release];
- }
-
</del><ins>+ for (unsigned i = 0; i < menuItemVector.size(); ++i)
+ [platformMenu addObject:menuItemVector[i].platformDescription()];
+
</ins><span class="cx"> return [platformMenu autorelease];
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformwinContextMenuItemWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/win/ContextMenuItemWin.cpp (182493 => 182494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/win/ContextMenuItemWin.cpp        2015-04-07 21:28:57 UTC (rev 182493)
+++ trunk/Source/WebCore/platform/win/ContextMenuItemWin.cpp        2015-04-07 21:29:00 UTC (rev 182494)
</span><span class="lines">@@ -30,6 +30,10 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><ins>+ContextMenuItem::ContextMenuItem()
+{
+}
+
</ins><span class="cx"> ContextMenuItem::ContextMenuItem(const MENUITEMINFO& info)
</span><span class="cx"> {
</span><span class="cx"> if (info.fMask & MIIM_FTYPE)
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (182493 => 182494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2015-04-07 21:28:57 UTC (rev 182493)
+++ trunk/Source/WebKit/mac/ChangeLog        2015-04-07 21:29:00 UTC (rev 182494)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2015-04-07 Brady Eidson <beidson@apple.com>
+
+ ContextMenuItem refactoring
+ https://bugs.webkit.org/show_bug.cgi?id=143485
+
+ Reviewed by Beth Dakin.
+
+ * WebCoreSupport/WebContextMenuClient.mm:
+ (WebContextMenuClient::contextMenuItemSelected):
+
</ins><span class="cx"> 2015-04-06 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> Bing video search result pages are not PageCacheable
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebContextMenuClientmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm (182493 => 182494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm        2015-04-07 21:28:57 UTC (rev 182493)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm        2015-04-07 21:29:00 UTC (rev 182494)
</span><span class="lines">@@ -321,12 +321,10 @@
</span><span class="cx"> SEL selector = @selector(webView:contextMenuItemSelected:forElement:);
</span><span class="cx"> if ([delegate respondsToSelector:selector]) {
</span><span class="cx"> NSDictionary *element = [[WebElementDictionary alloc] initWithHitTestResult:[m_webView page]->contextMenuController().hitTestResult()];
</span><del>- NSMenuItem *platformItem = item->releasePlatformDescription();
</del><span class="cx">
</span><del>- CallUIDelegate(m_webView, selector, platformItem, element);
</del><ins>+ CallUIDelegate(m_webView, selector, item->platformDescription(), element);
</ins><span class="cx">
</span><span class="cx"> [element release];
</span><del>- [platformItem release];
</del><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (182493 => 182494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-04-07 21:28:57 UTC (rev 182493)
+++ trunk/Source/WebKit2/ChangeLog        2015-04-07 21:29:00 UTC (rev 182494)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2015-04-07 Brady Eidson <beidson@apple.com>
+
+ ContextMenuItem refactoring
+ https://bugs.webkit.org/show_bug.cgi?id=143485
+
+ Reviewed by Beth Dakin.
+
+ * Shared/mac/NativeContextMenuItem.mm:
+ (WebKit::NativeContextMenuItem::NativeContextMenuItem):
+
</ins><span class="cx"> 2015-04-07 Simon Fraser <simon.fraser@apple.com>
</span><span class="cx">
</span><span class="cx"> Add a new setting, AntialiasedFontDilationEnabled, exposed via WK2.
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedmacNativeContextMenuItemmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/mac/NativeContextMenuItem.mm (182493 => 182494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/mac/NativeContextMenuItem.mm        2015-04-07 21:28:57 UTC (rev 182493)
+++ trunk/Source/WebKit2/Shared/mac/NativeContextMenuItem.mm        2015-04-07 21:29:00 UTC (rev 182494)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx"> namespace WebKit {
</span><span class="cx">
</span><span class="cx"> NativeContextMenuItem::NativeContextMenuItem(const ContextMenuItem& coreItem)
</span><del>- : m_nsMenuItem(coreItem.getPlatformDescription())
</del><ins>+ : m_nsMenuItem(coreItem.platformDescription())
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>