[EFL][WK2] Change Ewk_Context_Menu_Item's parent menu to raw pointer
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 May 2013 09:37:49 +0000 (09:37 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 May 2013 09:37:49 +0000 (09:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=116549

Patch by Michał Pakuła vel Rutka <m.pakula@samsung.com> on 2013-05-22
Reviewed by Christophe Dumez.

A context menu item should have only a pointer to parent menu instead
of owning parent menu.

* UIProcess/API/efl/ewk_context_menu_item.cpp:
(EwkContextMenuItem::EwkContextMenuItem):
* UIProcess/API/efl/ewk_context_menu_item_private.h:
(EwkContextMenuItem::create):
(EwkContextMenuItem::parentMenu):
(EwkContextMenuItem):

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/efl/ewk_context_menu_item.cpp
Source/WebKit2/UIProcess/API/efl/ewk_context_menu_item_private.h

index 53dd215..6dfb9d5 100644 (file)
@@ -1,3 +1,20 @@
+2013-05-22  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
+
+        [EFL][WK2] Change Ewk_Context_Menu_Item's parent menu to raw pointer
+        https://bugs.webkit.org/show_bug.cgi?id=116549
+
+        Reviewed by Christophe Dumez.
+
+        A context menu item should have only a pointer to parent menu instead
+        of owning parent menu.
+
+        * UIProcess/API/efl/ewk_context_menu_item.cpp:
+        (EwkContextMenuItem::EwkContextMenuItem):
+        * UIProcess/API/efl/ewk_context_menu_item_private.h:
+        (EwkContextMenuItem::create):
+        (EwkContextMenuItem::parentMenu):
+        (EwkContextMenuItem):
+
 2013-05-22  Csaba Osztrogonác  <ossy@webkit.org>
 
         [Qt][WK2] Unreviewed buildfix after r150484.
index 0300f79..8c555db 100644 (file)
@@ -36,7 +36,7 @@ using namespace WebKit;
 
 static Ewk_Context_Menu_Item_Action getEwkActionFromWKTag(WKContextMenuItemTag action);
 
-EwkContextMenuItem::EwkContextMenuItem(WKContextMenuItemRef item, PassRefPtr<EwkContextMenu> parentMenu)
+EwkContextMenuItem::EwkContextMenuItem(WKContextMenuItemRef item, EwkContextMenu* parentMenu)
     : m_type(static_cast<Ewk_Context_Menu_Item_Type>(WKContextMenuItemGetType(item)))
     , m_action(getEwkActionFromWKTag((WKContextMenuItemGetTag(item))))
     , m_title(WKEinaSharedString(AdoptWK, WKContextMenuItemCopyTitle(item)))
@@ -50,7 +50,7 @@ EwkContextMenuItem::EwkContextMenuItem(WKContextMenuItemRef item, PassRefPtr<Ewk
     }
 }
 
-EwkContextMenuItem::EwkContextMenuItem(Ewk_Context_Menu_Item_Type type, Ewk_Context_Menu_Item_Action action, const char* title, Eina_Bool checked, Eina_Bool enabled, PassRefPtr<EwkContextMenu> subMenu, PassRefPtr<EwkContextMenu> parentMenu)
+EwkContextMenuItem::EwkContextMenuItem(Ewk_Context_Menu_Item_Type type, Ewk_Context_Menu_Item_Action action, const char* title, Eina_Bool checked, Eina_Bool enabled, PassRefPtr<EwkContextMenu> subMenu, EwkContextMenu* parentMenu)
     : m_type(type)
     , m_action(action)
     , m_title(title)
index 3287d10..22158ec 100644 (file)
  */
 class EwkContextMenuItem {
 public:
-    static PassOwnPtr<EwkContextMenuItem> create(WKContextMenuItemRef item, PassRefPtr<EwkContextMenu> parentMenu = 0)
+    static PassOwnPtr<EwkContextMenuItem> create(WKContextMenuItemRef item, EwkContextMenu* parentMenu)
     {
         return adoptPtr(new EwkContextMenuItem(item, parentMenu));
     }
 
-    static PassOwnPtr<EwkContextMenuItem> create(Ewk_Context_Menu_Item_Type type, Ewk_Context_Menu_Item_Action action, const char* title, Eina_Bool checked, Eina_Bool enabled, PassRefPtr<EwkContextMenu> subMenu = 0, PassRefPtr<EwkContextMenu> parentMenu = 0)
+    static PassOwnPtr<EwkContextMenuItem> create(Ewk_Context_Menu_Item_Type type, Ewk_Context_Menu_Item_Action action, const char* title, Eina_Bool checked, Eina_Bool enabled, PassRefPtr<EwkContextMenu> subMenu = 0, EwkContextMenu* parentMenu = 0)
     {
         return adoptPtr(new EwkContextMenuItem(type, action, title, checked, enabled, subMenu, parentMenu));
     }
@@ -66,14 +66,14 @@ public:
     bool enabled() const { return m_isEnabled; }
     void setEnabled(bool enabled) { m_isEnabled = enabled; }
 
-    EwkContextMenu* parentMenu() const { return m_parentMenu.get(); }
+    EwkContextMenu* parentMenu() const { return m_parentMenu; }
     void setParentMenu(EwkContextMenu* parentMenu) { m_parentMenu = parentMenu; }
 
     EwkContextMenu* subMenu() const { return m_subMenu.get(); }
 
 private:
-    EwkContextMenuItem(WKContextMenuItemRef, PassRefPtr<EwkContextMenu> parentMenu);
-    EwkContextMenuItem(Ewk_Context_Menu_Item_Type type, Ewk_Context_Menu_Item_Action action, const char* title, Eina_Bool checked, Eina_Bool enabled, PassRefPtr<EwkContextMenu> subMenu, PassRefPtr<EwkContextMenu> parentMenu);
+    EwkContextMenuItem(WKContextMenuItemRef, EwkContextMenu* parentMenu);
+    EwkContextMenuItem(Ewk_Context_Menu_Item_Type type, Ewk_Context_Menu_Item_Action action, const char* title, Eina_Bool checked, Eina_Bool enabled, PassRefPtr<EwkContextMenu> subMenu, EwkContextMenu* parentMenu);
 
     Ewk_Context_Menu_Item_Type m_type;
     Ewk_Context_Menu_Item_Action m_action;
@@ -83,7 +83,7 @@ private:
     bool m_isChecked;
     bool m_isEnabled;
 
-    RefPtr<EwkContextMenu> m_parentMenu;
+    EwkContextMenu* m_parentMenu;
     RefPtr<EwkContextMenu> m_subMenu;
 };