[prev in list] [next in list] [prev in thread] [next in thread] 

List:       webkit-changes
Subject:    [webkit-changes] [109205] trunk/Source/WebKit/efl
From:       commit-queue () webkit ! org
Date:       2012-02-29 8:58:30
Message-ID: 20120229085832.1E99F57BFE73 () lists ! macosforge ! org
[Download RAW message or body]

[Attachment #2 (text/html)]

<!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>[109205] trunk/Source/WebKit/efl</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/109205">109205</a></dd> \
<dt>Author</dt> <dd>commit-queue@webkit.org</dd> <dt>Date</dt> <dd>2012-02-29 \
00:58:22 -0800 (Wed, 29 Feb 2012)</dd> </dl>

<h3>Log Message</h3>
<pre>[EFL] Replace malloc/calloc/free to new/delete.
https://bugs.webkit.org/show_bug.cgi?id=75848

Patch by Tomasz Morawski &lt;t.morawski@samsung.com&gt; on 2012-02-29
Reviewed by Hajime Morita.

Replaced almost all malloc/calloc/free to new/delete operator and where it was \
possible smart pointers were also used. Left few c memory allocation by intention to \
not mix c and c++ memory managment. Left malloc for Ewk_Tile object due to const \
fields present in Ewk_tile structure.

* ewk/ewk_auth_soup.cpp:
* ewk/ewk_contextmenu.cpp:
(ewk_context_menu_unref):
(ewk_context_menu_item_new):
(ewk_context_menu_item_free):
(ewk_context_menu_new):
* ewk/ewk_cookies.cpp:
(ewk_cookies_get_all):
(ewk_cookies_cookie_free):
* ewk/ewk_frame.cpp:
(ewk_frame_hit_test_free):
(ewk_frame_hit_test_new):
* ewk/ewk_history.cpp:
(ewk_history_item_new_from_core):
(_ewk_history_item_free):
(ewk_history_new):
(ewk_history_free):
* ewk/ewk_tiled_backing_store.cpp:
(_Ewk_Tiled_Backing_Store_Item):
(_ewk_tiled_backing_store_pre_render_request_add):
(_ewk_tiled_backing_store_pre_render_request_del):
(_ewk_tiled_backing_store_pre_render_request_flush):
(_ewk_tiled_backing_store_pre_render_request_clear):
(_ewk_tiled_backing_store_item_add):
(_ewk_tiled_backing_store_item_del):
* ewk/ewk_tiled_matrix.cpp:
(_ewk_tile_matrix_tile_free):
(ewk_tile_matrix_new):
(ewk_tile_matrix_zoom_level_set):
(ewk_tile_matrix_invalidate):
(ewk_tile_matrix_free):
* ewk/ewk_tiled_model.cpp:
(tile_account):
(ewk_tile_unused_cache_new):
(_ewk_tile_unused_cache_free):
(ewk_tile_unused_cache_clear):
(ewk_tile_unused_cache_flush):
(ewk_tile_unused_cache_tile_get):
(ewk_tile_unused_cache_tile_put):
* ewk/ewk_tiled_private.h:
* ewk/ewk_view.cpp:
(_Ewk_View_Private_Data):
(_ewk_view_core_frame_new):
(_ewk_view_priv_new):
(_ewk_view_priv_del):
(ewk_view_core_page_get):
(ewk_view_popup_new):
(ewk_view_popup_destroy):
(EWKPrivate::corePage):
* ewk/ewk_window_features.cpp:
(ewk_window_features_unref):
(ewk_window_features_new_from_core):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKiteflChangeLog">trunk/Source/WebKit/efl/ChangeLog</a></li>
 <li><a href="#trunkSourceWebKiteflewkewk_auth_soupcpp">trunk/Source/WebKit/efl/ewk/ewk_auth_soup.cpp</a></li>
 <li><a href="#trunkSourceWebKiteflewkewk_contextmenucpp">trunk/Source/WebKit/efl/ewk/ewk_contextmenu.cpp</a></li>
 <li><a href="#trunkSourceWebKiteflewkewk_cookiescpp">trunk/Source/WebKit/efl/ewk/ewk_cookies.cpp</a></li>
 <li><a href="#trunkSourceWebKiteflewkewk_framecpp">trunk/Source/WebKit/efl/ewk/ewk_frame.cpp</a></li>
 <li><a href="#trunkSourceWebKiteflewkewk_historycpp">trunk/Source/WebKit/efl/ewk/ewk_history.cpp</a></li>
 <li><a href="#trunkSourceWebKiteflewkewk_tiled_backing_storecpp">trunk/Source/WebKit/efl/ewk/ewk_tiled_backing_store.cpp</a></li>
 <li><a href="#trunkSourceWebKiteflewkewk_tiled_matrixcpp">trunk/Source/WebKit/efl/ewk/ewk_tiled_matrix.cpp</a></li>
 <li><a href="#trunkSourceWebKiteflewkewk_tiled_modelcpp">trunk/Source/WebKit/efl/ewk/ewk_tiled_model.cpp</a></li>
 <li><a href="#trunkSourceWebKiteflewkewk_tiled_privateh">trunk/Source/WebKit/efl/ewk/ewk_tiled_private.h</a></li>
 <li><a href="#trunkSourceWebKiteflewkewk_viewcpp">trunk/Source/WebKit/efl/ewk/ewk_view.cpp</a></li>
 <li><a href="#trunkSourceWebKiteflewkewk_window_featurescpp">trunk/Source/WebKit/efl/ewk/ewk_window_features.cpp</a></li>
 </ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKiteflChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/efl/ChangeLog (109204 => \
109205)</h4> <pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/efl/ChangeLog	2012-02-29 08:29:38 UTC (rev \
                109204)
+++ trunk/Source/WebKit/efl/ChangeLog	2012-02-29 08:58:22 UTC (rev 109205)
</span><span class="lines">@@ -1,3 +1,67 @@
</span><ins>+2012-02-29  Tomasz Morawski  &lt;t.morawski@samsung.com&gt;
+
+        [EFL] Replace malloc/calloc/free to new/delete.
+        https://bugs.webkit.org/show_bug.cgi?id=75848
+
+        Reviewed by Hajime Morita.
+
+        Replaced almost all malloc/calloc/free to new/delete operator and where it \
was possible smart pointers were also +        used. Left few c memory allocation by \
intention to not mix c and c++ memory managment. Left malloc for Ewk_Tile +        \
object due to const fields present in Ewk_tile structure. +
+        * ewk/ewk_auth_soup.cpp:
+        * ewk/ewk_contextmenu.cpp:
+        (ewk_context_menu_unref):
+        (ewk_context_menu_item_new):
+        (ewk_context_menu_item_free):
+        (ewk_context_menu_new):
+        * ewk/ewk_cookies.cpp:
+        (ewk_cookies_get_all):
+        (ewk_cookies_cookie_free):
+        * ewk/ewk_frame.cpp:
+        (ewk_frame_hit_test_free):
+        (ewk_frame_hit_test_new):
+        * ewk/ewk_history.cpp:
+        (ewk_history_item_new_from_core):
+        (_ewk_history_item_free):
+        (ewk_history_new):
+        (ewk_history_free):
+        * ewk/ewk_tiled_backing_store.cpp:
+        (_Ewk_Tiled_Backing_Store_Item):
+        (_ewk_tiled_backing_store_pre_render_request_add):
+        (_ewk_tiled_backing_store_pre_render_request_del):
+        (_ewk_tiled_backing_store_pre_render_request_flush):
+        (_ewk_tiled_backing_store_pre_render_request_clear):
+        (_ewk_tiled_backing_store_item_add):
+        (_ewk_tiled_backing_store_item_del):
+        * ewk/ewk_tiled_matrix.cpp:
+        (_ewk_tile_matrix_tile_free):
+        (ewk_tile_matrix_new):
+        (ewk_tile_matrix_zoom_level_set):
+        (ewk_tile_matrix_invalidate):
+        (ewk_tile_matrix_free):
+        * ewk/ewk_tiled_model.cpp:
+        (tile_account):
+        (ewk_tile_unused_cache_new):
+        (_ewk_tile_unused_cache_free):
+        (ewk_tile_unused_cache_clear):
+        (ewk_tile_unused_cache_flush):
+        (ewk_tile_unused_cache_tile_get):
+        (ewk_tile_unused_cache_tile_put):
+        * ewk/ewk_tiled_private.h:
+        * ewk/ewk_view.cpp:
+        (_Ewk_View_Private_Data):
+        (_ewk_view_core_frame_new):
+        (_ewk_view_priv_new):
+        (_ewk_view_priv_del):
+        (ewk_view_core_page_get):
+        (ewk_view_popup_new):
+        (ewk_view_popup_destroy):
+        (EWKPrivate::corePage):
+        * ewk/ewk_window_features.cpp:
+        (ewk_window_features_unref):
+        (ewk_window_features_new_from_core):
+
</ins><span class="cx"> 2012-02-27  JungJik Lee  &lt;jungjik.lee@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [EFL] Pairing up between evas_object_image_data_get \
and evas_object_image_data_set. </span></span></pre></div>
<a id="trunkSourceWebKiteflewkewk_auth_soupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/efl/ewk/ewk_auth_soup.cpp \
(109204 => 109205)</h4> <pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/efl/ewk/ewk_auth_soup.cpp	2012-02-29 \
                08:29:38 UTC (rev 109204)
+++ trunk/Source/WebKit/efl/ewk/ewk_auth_soup.cpp	2012-02-29 08:58:22 UTC (rev \
109205) </span><span class="lines">@@ -93,19 +93,13 @@
</span><span class="cx">     if (!ewk_auth_show_dialog_callback)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    authenticationData = static_cast&lt;Ewk_Auth_Data*&gt;(calloc(1, \
                sizeof(Ewk_Auth_Data)));
-
-    if (!authenticationData) {
-        CRITICAL(&quot;could not allocate Ewk_Auth_Data&quot;);
-        return;
-    }
-
</del><span class="cx">     soup_session_pause_message(session, message);
</span><span class="cx">     // We need to make sure the message sticks around when \
pausing it. </span><span class="cx">     g_object_ref(message);
</span><span class="cx">     g_object_ref(session);
</span><span class="cx">     g_object_ref(auth);
</span><span class="cx"> 
</span><ins>+    authenticationData = new Ewk_Auth_Data;
</ins><span class="cx">     authenticationData-&gt;message = message;
</span><span class="cx">     authenticationData-&gt;auth = auth;
</span><span class="cx">     authenticationData-&gt;session = session;
</span><span class="lines">@@ -122,7 +116,7 @@
</span><span class="cx">     g_object_unref(authData-&gt;message);
</span><span class="cx">     g_object_unref(authData-&gt;session);
</span><span class="cx">     g_object_unref(authData-&gt;auth);
</span><del>-    free(authData);
</del><ins>+    delete authData;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void attach(SoupSessionFeature* manager, SoupSession* \
session) </span></span></pre></div>
<a id="trunkSourceWebKiteflewkewk_contextmenucpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/efl/ewk/ewk_contextmenu.cpp \
(109204 => 109205)</h4> <pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/efl/ewk/ewk_contextmenu.cpp	2012-02-29 \
                08:29:38 UTC (rev 109204)
+++ trunk/Source/WebKit/efl/ewk/ewk_contextmenu.cpp	2012-02-29 08:58:22 UTC (rev \
109205) </span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx">     EINA_LIST_FREE(menu-&gt;items, item)
</span><span class="cx">         \
ewk_context_menu_item_free(static_cast&lt;Ewk_Context_Menu_Item*&gt;(item)); \
</span><span class="cx">  </span><del>-    free(menu);
</del><ins>+    delete menu;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Eina_Bool ewk_context_menu_destroy(Ewk_Context_Menu* menu)
</span><span class="lines">@@ -101,10 +101,7 @@
</span><span class="cx">                                                  \
Ewk_Context_Menu_Action action, Ewk_Context_Menu* submenu, </span><span class="cx">   \
const char* title, Eina_Bool checked, Eina_Bool enabled) </span><span class="cx"> {
</span><del>-    Ewk_Context_Menu_Item* item = \
                static_cast&lt;Ewk_Context_Menu_Item*&gt;(malloc(sizeof(*item)));
-    if (!item)
-        return 0;
-
</del><ins>+    Ewk_Context_Menu_Item* item = new Ewk_Context_Menu_Item;
</ins><span class="cx">     item-&gt;type = type;
</span><span class="cx">     item-&gt;action = action;
</span><span class="cx">     item-&gt;title = eina_stringshare_add(title);
</span><span class="lines">@@ -137,7 +134,7 @@
</span><span class="cx">     EINA_SAFETY_ON_NULL_RETURN(item);
</span><span class="cx"> 
</span><span class="cx">     eina_stringshare_del(item-&gt;title);
</span><del>-    free(item);
</del><ins>+    delete item;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Ewk_Context_Menu_Item_Type \
ewk_context_menu_item_type_get(const Ewk_Context_Menu_Item* item) </span><span \
class="lines">@@ -226,11 +223,7 @@ </span><span class="cx">     \
EINA_SAFETY_ON_NULL_RETURN_VAL(view, 0); </span><span class="cx">     \
EINA_SAFETY_ON_NULL_RETURN_VAL(controller, 0); </span><span class="cx"> 
</span><del>-    menu = static_cast&lt;Ewk_Context_Menu*&gt;(malloc(sizeof(*menu)));
-    if (!menu) {
-        CRITICAL(&quot;Could not allocate context menu memory.&quot;);
-        return 0;
-    }
</del><ins>+    menu = new Ewk_Context_Menu;
</ins><span class="cx"> 
</span><span class="cx">     menu-&gt;__ref = 1;
</span><span class="cx">     menu-&gt;view = view;
</span></span></pre></div>
<a id="trunkSourceWebKiteflewkewk_cookiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/efl/ewk/ewk_cookies.cpp \
(109204 => 109205)</h4> <pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/efl/ewk/ewk_cookies.cpp	2012-02-29 \
                08:29:38 UTC (rev 109204)
+++ trunk/Source/WebKit/efl/ewk/ewk_cookies.cpp	2012-02-29 08:58:22 UTC (rev 109205)
</span><span class="lines">@@ -76,7 +76,7 @@
</span><span class="cx">     list = soup_cookie_jar_all_cookies(cookieJar);
</span><span class="cx">     for (p = list; p; p = p-&gt;next) {
</span><span class="cx">         SoupCookie* cookie = \
static_cast&lt;SoupCookie*&gt;(p-&gt;data); </span><del>-        Ewk_Cookie* \
ewkCookie = static_cast&lt;Ewk_Cookie*&gt;(malloc(sizeof(*ewkCookie))); </del><ins>+  \
Ewk_Cookie* ewkCookie = new Ewk_Cookie; </ins><span class="cx">         \
ewkCookie-&gt;name = strdup(cookie-&gt;name); </span><span class="cx">         \
ewkCookie-&gt;value = strdup(cookie-&gt;value); </span><span class="cx">         \
ewkCookie-&gt;domain = strdup(cookie-&gt;domain); </span><span class="lines">@@ \
-121,7 +121,7 @@ </span><span class="cx">     free(cookie-&gt;value);
</span><span class="cx">     free(cookie-&gt;domain);
</span><span class="cx">     free(cookie-&gt;path);
</span><del>-    free(cookie);
</del><ins>+    delete cookie;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ewk_cookies_policy_set(Ewk_Cookie_Policy cookiePolicy)
</span></span></pre></div>
<a id="trunkSourceWebKiteflewkewk_framecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/efl/ewk/ewk_frame.cpp (109204 \
=> 109205)</h4> <pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/efl/ewk/ewk_frame.cpp	2012-02-29 08:29:38 \
                UTC (rev 109204)
+++ trunk/Source/WebKit/efl/ewk/ewk_frame.cpp	2012-02-29 08:58:22 UTC (rev 109205)
</span><span class="lines">@@ -659,7 +659,7 @@
</span><span class="cx">     eina_stringshare_del(hitTest-&gt;link.title);
</span><span class="cx">     eina_stringshare_del(hitTest-&gt;image_uri);
</span><span class="cx">     eina_stringshare_del(hitTest-&gt;media_uri);
</span><del>-    free(hitTest);
</del><ins>+    delete hitTest;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Ewk_Hit_Test* ewk_frame_hit_test_new(const Evas_Object* \
ewkFrame, int x, int y) </span><span class="lines">@@ -680,12 +680,7 @@
</span><span class="cx">     if (!result.innerNode())
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    Ewk_Hit_Test* hitTest = static_cast&lt;Ewk_Hit_Test*&gt;(calloc(1, \
                sizeof(Ewk_Hit_Test)));
-    if (!hitTest) {
-        CRITICAL(&quot;Could not allocate memory for hit test.&quot;);
-        return 0;
-    }
-
</del><ins>+    Ewk_Hit_Test* hitTest = new Ewk_Hit_Test;
</ins><span class="cx">     hitTest-&gt;x = result.point().x();
</span><span class="cx">     hitTest-&gt;y = result.point().y();
</span><span class="cx"> #if 0
</span></span></pre></div>
<a id="trunkSourceWebKiteflewkewk_historycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/efl/ewk/ewk_history.cpp \
(109204 => 109205)</h4> <pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/efl/ewk/ewk_history.cpp	2012-02-29 \
                08:29:38 UTC (rev 109204)
+++ trunk/Source/WebKit/efl/ewk/ewk_history.cpp	2012-02-29 08:58:22 UTC (rev 109205)
</span><span class="lines">@@ -241,13 +241,10 @@
</span><span class="cx">         return 0;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    item = (Ewk_History_Item*)calloc(1, sizeof(Ewk_History_Item));
-    if (!item) {
-        CRITICAL(&quot;Could not allocate item memory.&quot;);
-        return 0;
-    }
-
</del><span class="cx">     core-&gt;ref();
</span><ins>+
+    item = new Ewk_History_Item;
+    memset(item, 0, sizeof(*item));
</ins><span class="cx">     item-&gt;core = core;
</span><span class="cx"> 
</span><span class="cx">     return item;
</span><span class="lines">@@ -265,7 +262,7 @@
</span><span class="cx"> static inline void _ewk_history_item_free(Ewk_History_Item* \
item, WebCore::HistoryItem* core) </span><span class="cx"> {
</span><span class="cx">     core-&gt;deref();
</span><del>-    free(item);
</del><ins>+    delete item;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ewk_history_item_free(Ewk_History_Item* item)
</span><span class="lines">@@ -399,14 +396,9 @@
</span><span class="cx">     EINA_SAFETY_ON_NULL_RETURN_VAL(core, 0);
</span><span class="cx">     DBG(&quot;core=%p&quot;, core);
</span><span class="cx"> 
</span><del>-    history = \
                static_cast&lt;Ewk_History*&gt;(malloc(sizeof(Ewk_History)));
-    if (!history) {
-        CRITICAL(&quot;Could not allocate history memory.&quot;);
-        return 0;
-    }
-
-    core-&gt;ref();
</del><ins>+    history = new Ewk_History;
</ins><span class="cx">     history-&gt;core = core;
</span><ins>+    core-&gt;ref();
</ins><span class="cx"> 
</span><span class="cx">     return history;
</span><span class="cx"> }
</span><span class="lines">@@ -423,7 +415,7 @@
</span><span class="cx"> {
</span><span class="cx">     DBG(&quot;history=%p&quot;, history);
</span><span class="cx">     history-&gt;core-&gt;deref();
</span><del>-    free(history);
</del><ins>+    delete history;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace EWKPrivate {
</span></span></pre></div>
<a id="trunkSourceWebKiteflewkewk_tiled_backing_storecpp"></a>
<div class="modfile"><h4>Modified: \
trunk/Source/WebKit/efl/ewk/ewk_tiled_backing_store.cpp (109204 => 109205)</h4> <pre \
class="diff"><span> <span class="info">--- \
trunk/Source/WebKit/efl/ewk/ewk_tiled_backing_store.cpp	2012-02-29 08:29:38 UTC (rev \
                109204)
+++ trunk/Source/WebKit/efl/ewk/ewk_tiled_backing_store.cpp	2012-02-29 08:58:22 UTC \
(rev 109205) </span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> #include &quot;ewk_tiled_private.h&quot;
</span><span class="cx"> #include &lt;Ecore.h&gt;
</span><span class="cx"> #include &lt;Eina.h&gt;
</span><ins>+#include &lt;OwnPtr.h&gt;
+#include &lt;PassOwnPtr.h&gt;
</ins><span class="cx"> #include &lt;algorithm&gt;
</span><span class="cx"> #include &lt;errno.h&gt;
</span><span class="cx"> #include &lt;math.h&gt;
</span><span class="lines">@@ -249,12 +251,8 @@
</span><span class="cx"> 
</span><span class="cx"> static inline Eina_Bool \
_ewk_tiled_backing_store_pre_render_request_add(Ewk_Tiled_Backing_Store_Data* priv, \
unsigned long column, unsigned long row, float zoom) </span><span class="cx"> {
</span><del>-    Ewk_Tiled_Backing_Store_Pre_Render_Request* request;
</del><ins>+    Ewk_Tiled_Backing_Store_Pre_Render_Request* request = new \
Ewk_Tiled_Backing_Store_Pre_Render_Request; </ins><span class="cx"> 
</span><del>-    request = \
static_cast&lt;Ewk_Tiled_Backing_Store_Pre_Render_Request*&gt;(malloc(sizeof(*request)));
                
-    if (!request)
-        return false;
-
</del><span class="cx">     priv-&gt;render.preRenderRequests = eina_inlist_append
</span><span class="cx">                                            \
(priv-&gt;render.preRenderRequests, EINA_INLIST_GET(request)); </span><span \
class="cx">  </span><span class="lines">@@ -269,7 +267,7 @@
</span><span class="cx"> {
</span><span class="cx">     priv-&gt;render.preRenderRequests = eina_inlist_remove
</span><span class="cx">                                            \
(priv-&gt;render.preRenderRequests, EINA_INLIST_GET(request)); </span><del>-    \
free(request); </del><ins>+    delete request;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static inline Ewk_Tiled_Backing_Store_Pre_Render_Request* \
_ewk_tiled_backing_store_pre_render_request_first(const Ewk_Tiled_Backing_Store_Data* \
priv) </span><span class="lines">@@ -286,7 +284,7 @@
</span><span class="cx">         Ewk_Tiled_Backing_Store_Pre_Render_Request* request;
</span><span class="cx">         request = \
_ewk_tiled_backing_store_pre_render_request_first(priv); </span><span class="cx">     \
*preRenderList = eina_inlist_remove(*preRenderList, *preRenderList); </span><del>-    \
free(request); </del><ins>+        delete request;
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -301,7 +299,7 @@
</span><span class="cx">         next = iter-&gt;next;
</span><span class="cx">         *preRenderList = eina_inlist_remove(*preRenderList, \
iter); </span><span class="cx">         iter = next;
</span><del>-        free(request);
</del><ins>+        delete request;
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -471,31 +469,25 @@
</span><span class="cx"> 
</span><span class="cx"> static Ewk_Tiled_Backing_Store_Item* \
_ewk_tiled_backing_store_item_add(Ewk_Tiled_Backing_Store_Data* priv, unsigned long \
column, unsigned long row) </span><span class="cx"> {
</span><del>-    Ewk_Tiled_Backing_Store_Item* item;
</del><span class="cx">     Evas_Coord x, y, tileWidth, tileHeight;
</span><span class="cx"> 
</span><span class="cx">     DBG(&quot;ewkBackingStore=%p&quot;, priv-&gt;self);
</span><span class="cx"> 
</span><del>-    item = \
                static_cast&lt;Ewk_Tiled_Backing_Store_Item*&gt;(malloc(sizeof(*item)));
                
-    if (!item)
-        return 0;
-
</del><span class="cx">     tileWidth = priv-&gt;view.tile.width;
</span><span class="cx">     tileHeight = priv-&gt;view.tile.height;
</span><span class="cx">     x = priv-&gt;view.offset.base.x + priv-&gt;view.x + \
tileWidth * column; </span><span class="cx">     y = priv-&gt;view.offset.base.y + \
priv-&gt;view.y + tileHeight * row; </span><span class="cx"> 
</span><ins>+    OwnPtr&lt;Ewk_Tiled_Backing_Store_Item&gt; item = adoptPtr(new \
Ewk_Tiled_Backing_Store_Item); </ins><span class="cx">     item-&gt;tile = 0;
</span><del>-
</del><span class="cx">     item-&gt;smoothScale = \
priv-&gt;view.tile.zoomWeakSmoothScale; </span><del>-    \
                _ewk_tiled_backing_store_item_move(item, x, y);
-    _ewk_tiled_backing_store_item_resize(item, tileWidth, tileHeight);
-    if (!_ewk_tiled_backing_store_item_fill(priv, item, column, row)) {
-        free(item);
</del><ins>+
+    _ewk_tiled_backing_store_item_move(item.get(), x, y);
+    _ewk_tiled_backing_store_item_resize(item.get(), tileWidth, tileHeight);
+    if (!_ewk_tiled_backing_store_item_fill(priv, item.get(), column, row))
</ins><span class="cx">         return 0;
</span><del>-    }
</del><span class="cx"> 
</span><del>-    return item;
</del><ins>+    return item.leakPtr();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void \
_ewk_tiled_backing_store_item_del(Ewk_Tiled_Backing_Store_Data* priv, \
Ewk_Tiled_Backing_Store_Item* item) </span><span class="lines">@@ -505,7 +497,7 @@
</span><span class="cx">         _ewk_tiled_backing_store_tile_dissociate(priv, item, \
last_used); </span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    free(item);
</del><ins>+    delete item;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void \
_ewk_tiled_backing_store_item_smooth_scale_set(Ewk_Tiled_Backing_Store_Item* item, \
Eina_Bool smoothScale) </span></span></pre></div>
<a id="trunkSourceWebKiteflewkewk_tiled_matrixcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/efl/ewk/ewk_tiled_matrix.cpp \
(109204 => 109205)</h4> <pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/efl/ewk/ewk_tiled_matrix.cpp	2012-02-29 \
                08:29:38 UTC (rev 109204)
+++ trunk/Source/WebKit/efl/ewk/ewk_tiled_matrix.cpp	2012-02-29 08:58:22 UTC (rev \
109205) </span><span class="lines">@@ -25,6 +25,8 @@
</span><span class="cx"> #include &quot;ewk_tiled_backing_store.h&quot;
</span><span class="cx"> #include &quot;ewk_tiled_private.h&quot;
</span><span class="cx"> #include &lt;Eina.h&gt;
</span><ins>+#include &lt;OwnPtr.h&gt;
+#include &lt;PassOwnPtr.h&gt;
</ins><span class="cx"> #include &lt;errno.h&gt;
</span><span class="cx"> #include &lt;inttypes.h&gt;
</span><span class="cx"> #include &lt;math.h&gt;
</span><span class="lines">@@ -170,7 +172,7 @@
</span><span class="cx">     if (!entry-&gt;count &amp;&amp; entry-&gt;matrix != \
tileMatrix-&gt;matrix) { </span><span class="cx">         \
eina_matrixsparse_free(entry-&gt;matrix); </span><span class="cx">         \
tileMatrix-&gt;matrices = eina_inlist_remove(tileMatrix-&gt;matrices, \
EINA_INLIST_GET(entry)); </span><del>-        free(entry);
</del><ins>+        delete entry;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ewk_tile_free(tile);
</span><span class="lines">@@ -197,18 +199,16 @@
</span><span class="cx">  */
</span><span class="cx"> Ewk_Tile_Matrix* ewk_tile_matrix_new(Ewk_Tile_Unused_Cache* \
tileUnusedCache, unsigned long columns, unsigned long rows, float zoomLevel, \
Evas_Colorspace colorSpace, void (*renderCallback)(void* data, Ewk_Tile* tile, const \
Eina_Rectangle* update), const void* renderData) </span><span class="cx"> {
</span><del>-    Ewk_Tile_Matrix* tileMatrix = \
                static_cast&lt;Ewk_Tile_Matrix*&gt;(calloc(1, \
                sizeof(Ewk_Tile_Matrix)));
-    if (!tileMatrix)
-        return 0;
</del><ins>+    OwnPtr&lt;Ewk_Tile_Matrix&gt; tileMatrix = adoptPtr(new \
Ewk_Tile_Matrix); </ins><span class="cx"> 
</span><del>-    tileMatrix-&gt;matrix = eina_matrixsparse_new(rows, columns, \
_ewk_tile_matrix_cell_free, tileMatrix); </del><ins>+    tileMatrix-&gt;matrix = \
eina_matrixsparse_new(rows, columns, _ewk_tile_matrix_cell_free, tileMatrix.get()); \
</ins><span class="cx">     if (!tileMatrix-&gt;matrix) { </span><span class="cx">    \
ERR(&quot;could not create sparse matrix.&quot;); </span><del>-        \
free(tileMatrix); </del><span class="cx">         return 0;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ewk_tile_matrix_zoom_level_set(tileMatrix, zoomLevel);
</del><ins>+    tileMatrix-&gt;matrices = 0;
+    ewk_tile_matrix_zoom_level_set(tileMatrix.get(), zoomLevel);
</ins><span class="cx"> 
</span><span class="cx">     if (tileUnusedCache)
</span><span class="cx">         tileMatrix-&gt;tileUnusedCache = \
ewk_tile_unused_cache_ref(tileUnusedCache); </span><span class="lines">@@ -217,7 \
+217,6 @@ </span><span class="cx">         if (!tileMatrix-&gt;tileUnusedCache) {
</span><span class="cx">             ERR(&quot;no cache of unused tile!&quot;);
</span><span class="cx">             eina_matrixsparse_free(tileMatrix-&gt;matrix);
</span><del>-            free(tileMatrix);
</del><span class="cx">             return 0;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -227,8 +226,16 @@
</span><span class="cx">     tileMatrix-&gt;render.data = (void*)renderData;
</span><span class="cx">     tileMatrix-&gt;tile.width = defaultTileWidth;
</span><span class="cx">     tileMatrix-&gt;tile.height = defaultTileHeigth;
</span><ins>+    tileMatrix-&gt;frozen = 0;
+    tileMatrix-&gt;updates = 0;
</ins><span class="cx"> 
</span><del>-    return tileMatrix;
</del><ins>+#ifdef DEBUG_MEM_LEAKS
+    tileMatrix-&gt;stats.tiles.allocated = 0;
+    tileMatrix-&gt;stats.tiles.freed = 0;
+    tileMatrix-&gt;stats.bytes.allocated = 0;
+    tileMatrix-&gt;stats.bytes.freed = 0;
+#endif
+    return tileMatrix.leakPtr();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ewk_tile_matrix_zoom_level_set(Ewk_Tile_Matrix* \
tileMatrix, float zoom) </span><span class="lines">@@ -249,12 +256,14 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!entry) {
</span><del>-        entry = static_cast&lt;Ewk_Tile_Matrix_Entry*&gt;(calloc(1, \
sizeof(Ewk_Tile_Matrix_Entry))); </del><ins>+        entry = new \
Ewk_Tile_Matrix_Entry; +        memset(entry, 0, sizeof(Ewk_Tile_Matrix_Entry));
+        entry-&gt;matrix = eina_matrixsparse_new(rows, columns, \
_ewk_tile_matrix_cell_free, tileMatrix); +        entry-&gt;count = 0;
</ins><span class="cx">         entry-&gt;zoom = zoom;
</span><del>-        entry-&gt;matrix = eina_matrixsparse_new(rows, columns, \
_ewk_tile_matrix_cell_free, tileMatrix); </del><span class="cx">         if \
(!entry-&gt;matrix) { </span><span class="cx">             ERR(&quot;could not create \
sparse matrix.&quot;); </span><del>-            free(entry);
</del><ins>+            delete entry;
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx">         tileMatrix-&gt;matrices = \
eina_inlist_prepend(tileMatrix-&gt;matrices, EINA_INLIST_GET(entry)); </span><span \
class="lines">@@ -277,7 +286,7 @@ </span><span class="cx">         if \
(iterator-&gt;matrix != tileMatrix-&gt;matrix) { </span><span class="cx">             \
eina_matrixsparse_free(iterator-&gt;matrix); </span><span class="cx">             \
tileMatrix-&gt;matrices = eina_inlist_remove(tileMatrix-&gt;matrices, matrixList); \
</span><del>-            free(iterator); </del><ins>+            delete iterator;
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         matrixList = next;
</span><span class="lines">@@ -303,8 +312,8 @@
</span><span class="cx">     entry = \
EINA_INLIST_CONTAINER_GET(tileMatrix-&gt;matrices, Ewk_Tile_Matrix_Entry); \
</span><span class="cx">     eina_matrixsparse_free(entry-&gt;matrix); </span><span \
class="cx">     tileMatrix-&gt;matrices = eina_inlist_remove(tileMatrix-&gt;matrices, \
reinterpret_cast&lt;Eina_Inlist*&gt;(entry)); </span><del>-    free(entry);
</del><span class="cx">     tileMatrix-&gt;matrices = 0;
</span><ins>+    delete entry;
</ins><span class="cx"> 
</span><span class="cx">     \
ewk_tile_unused_cache_thaw(tileMatrix-&gt;tileUnusedCache); </span><span class="cx">  \
ewk_tile_unused_cache_unref(tileMatrix-&gt;tileUnusedCache); </span><span \
class="lines">@@ -335,7 +344,7 @@ </span><span class="cx">             \
tileMatrix-&gt;stats.bytes.allocated, tileMatrix-&gt;stats.bytes.freed); </span><span \
class="cx"> #endif </span><span class="cx"> 
</span><del>-    free(tileMatrix);
</del><ins>+    delete tileMatrix;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span></span></pre></div>
<a id="trunkSourceWebKiteflewkewk_tiled_modelcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/efl/ewk/ewk_tiled_model.cpp \
(109204 => 109205)</h4> <pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/efl/ewk/ewk_tiled_model.cpp	2012-02-29 \
                08:29:38 UTC (rev 109204)
+++ trunk/Source/WebKit/efl/ewk/ewk_tiled_model.cpp	2012-02-29 08:58:22 UTC (rev \
109205) </span><span class="lines">@@ -439,9 +439,8 @@
</span><span class="cx"> {
</span><span class="cx">     Ewk_Tile_Unused_Cache* tileUnusedCache;
</span><span class="cx"> 
</span><del>-    tileUnusedCache = \
                static_cast&lt;Ewk_Tile_Unused_Cache*&gt;(calloc(1, \
                sizeof(Ewk_Tile_Unused_Cache)));
-    if (!tileUnusedCache)
-        return 0;
</del><ins>+    tileUnusedCache = new Ewk_Tile_Unused_Cache;
+    memset(tileUnusedCache, 0, sizeof(Ewk_Tile_Unused_Cache));
</ins><span class="cx"> 
</span><span class="cx">     DBG(&quot;tileUnusedCache=%p&quot;, tileUnusedCache);
</span><span class="cx">     tileUnusedCache-&gt;memory.max = max;
</span><span class="lines">@@ -491,7 +490,7 @@
</span><span class="cx">         tileUnusedCache-&gt;memory.max, \
tileUnusedCache-&gt;memory.used); </span><span class="cx"> 
</span><span class="cx">     ewk_tile_unused_cache_clear(tileUnusedCache);
</span><del>-    free(tileUnusedCache);
</del><ins>+    delete tileUnusedCache;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -511,7 +510,7 @@
</span><span class="cx">     EINA_LIST_FREE(tileUnusedCache-&gt;entries.list, item) {
</span><span class="cx">         Ewk_Tile_Unused_Cache_Entry* itr = \
static_cast&lt;Ewk_Tile_Unused_Cache_Entry*&gt;(item); </span><span class="cx">       \
itr-&gt;tile_free.callback(itr-&gt;tile_free.data, itr-&gt;tile); </span><del>-       \
free(itr); </del><ins>+        delete itr;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     tileUnusedCache-&gt;memory.used = 0;
</span><span class="lines">@@ -604,7 +603,7 @@
</span><span class="cx">         done += ewk_tile_memory_size_get(itr-&gt;tile);
</span><span class="cx">         itr-&gt;tile_free.callback(itr-&gt;tile_free.data, \
itr-&gt;tile); </span><span class="cx">         tileUnusedCache-&gt;entries.list = \
eina_list_remove_list(tileUnusedCache-&gt;entries.list, list); </span><del>-        \
free(itr); </del><ins>+        delete itr;
</ins><span class="cx">         count++;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -669,28 +668,23 @@
</span><span class="cx">  */
</span><span class="cx"> Eina_Bool \
ewk_tile_unused_cache_tile_get(Ewk_Tile_Unused_Cache* tileUnusedCache, Ewk_Tile* \
tile) </span><span class="cx"> {
</span><del>-    Eina_List* foundEntry, *iterateEntry;
-
</del><ins>+    Eina_List* iterateEntry;
</ins><span class="cx">     void* item;
</span><del>-    foundEntry = 0;
</del><ins>+
</ins><span class="cx">     EINA_LIST_FOREACH(tileUnusedCache-&gt;entries.list, \
iterateEntry, item) { </span><span class="cx">         Ewk_Tile_Unused_Cache_Entry* \
entry = static_cast&lt;Ewk_Tile_Unused_Cache_Entry*&gt;(item); </span><span \
class="cx">         if (entry-&gt;tile == tile) { </span><del>-            foundEntry \
                = iterateEntry;
-            break;
</del><ins>+            tileUnusedCache-&gt;entries.count--;
+            tileUnusedCache-&gt;memory.used -= ewk_tile_memory_size_get(tile);
+            tileUnusedCache-&gt;entries.list = \
eina_list_remove_list(tileUnusedCache-&gt;entries.list, iterateEntry); +            \
delete entry; +
+            return true;
</ins><span class="cx">         }
</span><span class="cx">     }
</span><del>-    if (!foundEntry) {
-        ERR(&quot;tile %p not found in cache %p&quot;, tile, tileUnusedCache);
-        return false;
-    }
</del><span class="cx"> 
</span><del>-    tileUnusedCache-&gt;entries.count--;
-    tileUnusedCache-&gt;memory.used -= ewk_tile_memory_size_get(tile);
-    tileUnusedCache-&gt;entries.list = \
                eina_list_remove_list(tileUnusedCache-&gt;entries.list, foundEntry);
-    free(item);
-
-    return true;
</del><ins>+    ERR(&quot;tile %p not found in cache %p&quot;, tile, \
tileUnusedCache); +    return false;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -724,9 +718,7 @@
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    unusedCacheEntry = \
static_cast&lt;Ewk_Tile_Unused_Cache_Entry*&gt;(malloc(sizeof(Ewk_Tile_Unused_Cache_Entry)));
                
-    if (!unusedCacheEntry)
-        return false;
</del><ins>+    unusedCacheEntry = new Ewk_Tile_Unused_Cache_Entry;
</ins><span class="cx"> 
</span><span class="cx">     tileUnusedCache-&gt;entries.list = \
eina_list_append(tileUnusedCache-&gt;entries.list, unusedCacheEntry); </span><span \
class="cx">     if (eina_error_get()) { </span></span></pre></div>
<a id="trunkSourceWebKiteflewkewk_tiled_privateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/efl/ewk/ewk_tiled_private.h \
(109204 => 109205)</h4> <pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/efl/ewk/ewk_tiled_private.h	2012-02-29 \
                08:29:38 UTC (rev 109204)
+++ trunk/Source/WebKit/efl/ewk/ewk_tiled_private.h	2012-02-29 08:58:22 UTC (rev \
109205) </span><span class="lines">@@ -29,34 +29,4 @@
</span><span class="cx"> #define WRN(...) EINA_LOG_DOM_WARN(_ewk_tiled_log_dom, \
__VA_ARGS__) </span><span class="cx"> #define INF(...) \
EINA_LOG_DOM_INFO(_ewk_tiled_log_dom, __VA_ARGS__) </span><span class="cx"> #define \
DBG(...) EINA_LOG_DOM_DBG(_ewk_tiled_log_dom, __VA_ARGS__) </span><del>-#define \
OOM(op, size) CRITICAL(&quot;could not %s %zd bytes: %s&quot;, op, size, \
                strerror(errno))
-#define MALLOC_OR_OOM_RET(ptr, size, ...)       \
-    do {                                        \
-        ptr = malloc(size);                     \
-        if (!ptr &amp;&amp; (size) &gt; 0) {               \
-            OOM(&quot;malloc&quot;, (size));              \
-            return __VA_ARGS__;                 \
-        }                                       \
-    } while (0)
-
-#define CALLOC_OR_OOM_RET(ptr, size, ...)       \
-    do {                                        \
-        ptr = calloc(1, size);                  \
-        if (!ptr &amp;&amp; (size) &gt; 0) {               \
-            OOM(&quot;calloc&quot;, (size));              \
-            return __VA_ARGS__;                 \
-        }                                       \
-    } while (0)
-
-#define REALLOC_OR_OOM_RET(ptr, size, ...)      \
-    do {                                        \
-        void* __tmp_ptr;                        \
-        __tmp_ptr = realloc(ptr, size);         \
-        if (!__tmp_ptr &amp;&amp; (size) &gt; 0) {         \
-            OOM(&quot;realloc&quot;, (size));             \
-            return __VA_ARGS__;                 \
-        }                                       \
-        ptr = __tmp_ptr;                        \
-    } while (0)
-
</del><span class="cx"> #endif // ewk_tiled_private_h
</span></span></pre></div>
<a id="trunkSourceWebKiteflewkewk_viewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/efl/ewk/ewk_view.cpp (109204 \
=> 109205)</h4> <pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/efl/ewk/ewk_view.cpp	2012-02-29 08:29:38 \
                UTC (rev 109204)
+++ trunk/Source/WebKit/efl/ewk/ewk_view.cpp	2012-02-29 08:58:22 UTC (rev 109205)
</span><span class="lines">@@ -133,7 +133,7 @@
</span><span class="cx">  * @internal
</span><span class="cx">  */
</span><span class="cx"> struct _Ewk_View_Private_Data {
</span><del>-    WebCore::Page* page;
</del><ins>+    OwnPtr&lt;WebCore::Page&gt; page;
</ins><span class="cx">     WebCore::Settings* pageSettings;
</span><span class="cx">     WebCore::Frame* mainFrame;
</span><span class="cx">     WebCore::ViewportArguments viewportArguments;
</span><span class="lines">@@ -589,47 +589,36 @@
</span><span class="cx">     }
</span><span class="cx">     \
frameLoaderClient-&gt;setCustomUserAgent(String::fromUTF8(priv-&gt;settings.userAgent));
 </span><span class="cx"> 
</span><del>-    return WebCore::Frame::create(priv-&gt;page, owner, \
frameLoaderClient); </del><ins>+    return \
WebCore::Frame::create(priv-&gt;page.get(), owner, frameLoaderClient); </ins><span \
class="cx"> } </span><span class="cx"> 
</span><span class="cx"> static Evas_Smart_Class _parent_sc = \
EVAS_SMART_CLASS_INIT_NULL; </span><span class="cx"> 
</span><span class="cx"> static Ewk_View_Private_Data* \
_ewk_view_priv_new(Ewk_View_Smart_Data* smartData) </span><span class="cx"> {
</span><del>-    Ewk_View_Private_Data* priv =
-        static_cast&lt;Ewk_View_Private_Data*&gt;(calloc(1, \
sizeof(Ewk_View_Private_Data))); </del><ins>+    Ewk_View_Private_Data* priv = new \
Ewk_View_Private_Data; +    memset(priv, 0, sizeof(Ewk_View_Private_Data));
</ins><span class="cx">     AtomicString string;
</span><span class="cx">     WebCore::KURL url;
</span><span class="cx"> 
</span><del>-    if (!priv) {
-        CRITICAL(&quot;could not allocate Ewk_View_Private_Data&quot;);
-        return 0;
-    }
-
</del><span class="cx">     WebCore::Page::PageClients pageClients;
</span><span class="cx">     pageClients.chromeClient = new \
WebCore::ChromeClientEfl(smartData-&gt;self); </span><span class="cx">     \
pageClients.editorClient = new WebCore::EditorClientEfl(smartData-&gt;self); \
</span><span class="cx">     pageClients.dragClient = new WebCore::DragClientEfl; \
</span><span class="cx">     pageClients.inspectorClient = new \
WebCore::InspectorClientEfl; </span><del>-    priv-&gt;page = new \
                WebCore::Page(pageClients);
-    if (!priv-&gt;page) {
-        CRITICAL(&quot;Could not create WebKit Page&quot;);
-        goto error_page;
-    }
</del><ins>+
+    priv-&gt;page = adoptPtr(new WebCore::Page(pageClients));
+
</ins><span class="cx"> #if ENABLE(DEVICE_ORIENTATION)
</span><del>-    WebCore::provideDeviceMotionTo(priv-&gt;page, new \
                WebCore::DeviceMotionClientEfl);
-    WebCore::provideDeviceOrientationTo(priv-&gt;page, new \
WebCore::DeviceOrientationClientEfl); </del><ins>+    \
WebCore::provideDeviceMotionTo(priv-&gt;page.get(), new \
WebCore::DeviceMotionClientEfl); +    \
WebCore::provideDeviceOrientationTo(priv-&gt;page.get(), new \
WebCore::DeviceOrientationClientEfl); </ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIBRATION)
</span><del>-    WebCore::provideVibrationTo(priv-&gt;page, new \
WebCore::VibrationClientEfl(smartData-&gt;self)); </del><ins>+    \
WebCore::provideVibrationTo(priv-&gt;page.get(), new \
WebCore::VibrationClientEfl(smartData-&gt;self)); </ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     priv-&gt;pageSettings = priv-&gt;page-&gt;settings();
</span><del>-    if (!priv-&gt;pageSettings) {
-        CRITICAL(&quot;Could not get page settings.&quot;);
-        goto error_settings;
-    }
</del><span class="cx"> 
</span><span class="cx">     priv-&gt;viewportArguments.width = \
WebCore::ViewportArguments::ValueAuto; </span><span class="cx">     \
priv-&gt;viewportArguments.height = WebCore::ViewportArguments::ValueAuto; \
</span><span class="lines">@@ -714,29 +703,12 @@ </span><span class="cx">     \
priv-&gt;settings.domTimerInterval = \
priv-&gt;pageSettings-&gt;defaultMinDOMTimerInterval(); </span><span class="cx"> 
</span><span class="cx">     priv-&gt;mainFrame = _ewk_view_core_frame_new(smartData, \
priv, 0).get(); </span><del>-    if (!priv-&gt;mainFrame) {
-        CRITICAL(&quot;Could not create main frame.&quot;);
-        goto error_main_frame;
-    }
</del><span class="cx"> 
</span><span class="cx">     priv-&gt;history = \
ewk_history_new(static_cast&lt;WebCore::BackForwardListImpl*&gt;(priv-&gt;page-&gt;backForwardList()));
 </span><del>-    if (!priv-&gt;history) {
-        CRITICAL(&quot;Could not create history instance for view.&quot;);
-        goto error_history;
-    }
</del><span class="cx"> 
</span><span class="cx">     priv-&gt;soupSession = \
WebCore::ResourceHandle::defaultSession(); </span><span class="cx"> 
</span><span class="cx">     return priv;
</span><del>-
-error_history:
-    // delete priv-&gt;main_frame; /* do not delete priv-&gt;main_frame */
-error_main_frame:
-error_settings:
-    delete priv-&gt;page;
-error_page:
-    free(priv);
-    return 0;
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void _ewk_view_priv_del(Ewk_View_Private_Data* priv)
</span><span class="lines">@@ -766,8 +738,7 @@
</span><span class="cx"> 
</span><span class="cx">     ewk_history_free(priv-&gt;history);
</span><span class="cx"> 
</span><del>-    delete priv-&gt;page;
-    free(priv);
</del><ins>+    delete priv;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void _ewk_view_smart_add(Evas_Object* ewkView)
</span><span class="lines">@@ -3395,7 +3366,7 @@
</span><span class="cx"> {
</span><span class="cx">     EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, 0);
</span><span class="cx">     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, 0);
</span><del>-    return priv-&gt;page;
</del><ins>+    return priv-&gt;page.get();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -3474,7 +3445,7 @@
</span><span class="cx">     // populate items
</span><span class="cx">     const int size = client-&gt;listSize();
</span><span class="cx">     for (int i = 0; i &lt; size; ++i) {
</span><del>-        Ewk_Menu_Item* item = \
static_cast&lt;Ewk_Menu_Item*&gt;(malloc(sizeof(*item))); </del><ins>+        \
Ewk_Menu_Item* item = new Ewk_Menu_Item; </ins><span class="cx">         if \
(client-&gt;itemIsSeparator(i)) </span><span class="cx">             item-&gt;type = \
EWK_MENU_SEPARATOR; </span><span class="cx">         else if \
(client-&gt;itemIsLabel(i)) </span><span class="lines">@@ -3508,7 +3479,7 @@
</span><span class="cx">     EINA_LIST_FREE(priv-&gt;popup.menu.items, itemv) {
</span><span class="cx">         Ewk_Menu_Item* item = \
static_cast&lt;Ewk_Menu_Item*&gt;(itemv); </span><span class="cx">         \
eina_stringshare_del(item-&gt;text); </span><del>-        free(item);
</del><ins>+        delete item;
</ins><span class="cx">     }
</span><span class="cx">     priv-&gt;popup.menuClient-&gt;popupDidHide();
</span><span class="cx">     priv-&gt;popup.menuClient = 0;
</span><span class="lines">@@ -3951,7 +3922,7 @@
</span><span class="cx"> {
</span><span class="cx">     EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, 0);
</span><span class="cx">     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, 0);
</span><del>-    return priv-&gt;page;
</del><ins>+    return priv-&gt;page.get();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace EWKPrivate
</span></span></pre></div>
<a id="trunkSourceWebKiteflewkewk_window_featurescpp"></a>
<div class="modfile"><h4>Modified: \
trunk/Source/WebKit/efl/ewk/ewk_window_features.cpp (109204 => 109205)</h4> <pre \
class="diff"><span> <span class="info">--- \
trunk/Source/WebKit/efl/ewk/ewk_window_features.cpp	2012-02-29 08:29:38 UTC (rev \
                109204)
+++ trunk/Source/WebKit/efl/ewk/ewk_window_features.cpp	2012-02-29 08:58:22 UTC (rev \
109205) </span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx"> 
</span><span class="cx">     delete windowFeatures-&gt;core;
</span><span class="cx">     windowFeatures-&gt;core = 0;
</span><del>-    free(windowFeatures);
</del><ins>+    delete windowFeatures;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ewk_window_features_ref(Ewk_Window_Features* \
windowFeatures) </span><span class="lines">@@ -109,11 +109,7 @@
</span><span class="cx">  */
</span><span class="cx"> Ewk_Window_Features* ewk_window_features_new_from_core(const \
WebCore::WindowFeatures* core) </span><span class="cx"> {
</span><del>-    Ewk_Window_Features* window_features = \
                static_cast&lt;Ewk_Window_Features*&gt;(malloc(sizeof(*window_features)));
                
-    if (!window_features) {
-        CRITICAL(&quot;Could not allocate Ewk_Window_Features.&quot;);
-        return 0;
-    }
</del><ins>+    Ewk_Window_Features* window_features = new Ewk_Window_Features;
</ins><span class="cx"> 
</span><span class="cx">     if (core)
</span><span class="cx">         window_features-&gt;core = new \
WebCore::WindowFeatures(*core); </span></span></pre>
</div>
</div>

</body>
</html>



_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic