[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 <t.morawski@samsung.com> 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 <t.morawski@samsung.com>
+
+ [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 <jungjik.lee@samsung.com>
</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<Ewk_Auth_Data*>(calloc(1, \
sizeof(Ewk_Auth_Data)));
-
- if (!authenticationData) {
- CRITICAL("could not allocate Ewk_Auth_Data");
- 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->message = message;
</span><span class="cx"> authenticationData->auth = auth;
</span><span class="cx"> authenticationData->session = session;
</span><span class="lines">@@ -122,7 +116,7 @@
</span><span class="cx"> g_object_unref(authData->message);
</span><span class="cx"> g_object_unref(authData->session);
</span><span class="cx"> g_object_unref(authData->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->items, item)
</span><span class="cx"> \
ewk_context_menu_item_free(static_cast<Ewk_Context_Menu_Item*>(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<Ewk_Context_Menu_Item*>(malloc(sizeof(*item)));
- if (!item)
- return 0;
-
</del><ins>+ Ewk_Context_Menu_Item* item = new Ewk_Context_Menu_Item;
</ins><span class="cx"> item->type = type;
</span><span class="cx"> item->action = action;
</span><span class="cx"> item->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->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<Ewk_Context_Menu*>(malloc(sizeof(*menu)));
- if (!menu) {
- CRITICAL("Could not allocate context menu memory.");
- return 0;
- }
</del><ins>+ menu = new Ewk_Context_Menu;
</ins><span class="cx">
</span><span class="cx"> menu->__ref = 1;
</span><span class="cx"> menu->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->next) {
</span><span class="cx"> SoupCookie* cookie = \
static_cast<SoupCookie*>(p->data); </span><del>- Ewk_Cookie* \
ewkCookie = static_cast<Ewk_Cookie*>(malloc(sizeof(*ewkCookie))); </del><ins>+ \
Ewk_Cookie* ewkCookie = new Ewk_Cookie; </ins><span class="cx"> \
ewkCookie->name = strdup(cookie->name); </span><span class="cx"> \
ewkCookie->value = strdup(cookie->value); </span><span class="cx"> \
ewkCookie->domain = strdup(cookie->domain); </span><span class="lines">@@ \
-121,7 +121,7 @@ </span><span class="cx"> free(cookie->value);
</span><span class="cx"> free(cookie->domain);
</span><span class="cx"> free(cookie->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->link.title);
</span><span class="cx"> eina_stringshare_del(hitTest->image_uri);
</span><span class="cx"> eina_stringshare_del(hitTest->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<Ewk_Hit_Test*>(calloc(1, \
sizeof(Ewk_Hit_Test)));
- if (!hitTest) {
- CRITICAL("Could not allocate memory for hit test.");
- return 0;
- }
-
</del><ins>+ Ewk_Hit_Test* hitTest = new Ewk_Hit_Test;
</ins><span class="cx"> hitTest->x = result.point().x();
</span><span class="cx"> hitTest->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("Could not allocate item memory.");
- return 0;
- }
-
</del><span class="cx"> core->ref();
</span><ins>+
+ item = new Ewk_History_Item;
+ memset(item, 0, sizeof(*item));
</ins><span class="cx"> item->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->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("core=%p", core);
</span><span class="cx">
</span><del>- history = \
static_cast<Ewk_History*>(malloc(sizeof(Ewk_History)));
- if (!history) {
- CRITICAL("Could not allocate history memory.");
- return 0;
- }
-
- core->ref();
</del><ins>+ history = new Ewk_History;
</ins><span class="cx"> history->core = core;
</span><ins>+ core->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("history=%p", history);
</span><span class="cx"> history->core->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 "ewk_tiled_private.h"
</span><span class="cx"> #include <Ecore.h>
</span><span class="cx"> #include <Eina.h>
</span><ins>+#include <OwnPtr.h>
+#include <PassOwnPtr.h>
</ins><span class="cx"> #include <algorithm>
</span><span class="cx"> #include <errno.h>
</span><span class="cx"> #include <math.h>
</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<Ewk_Tiled_Backing_Store_Pre_Render_Request*>(malloc(sizeof(*request)));
- if (!request)
- return false;
-
</del><span class="cx"> priv->render.preRenderRequests = eina_inlist_append
</span><span class="cx"> \
(priv->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->render.preRenderRequests = eina_inlist_remove
</span><span class="cx"> \
(priv->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->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("ewkBackingStore=%p", priv->self);
</span><span class="cx">
</span><del>- item = \
static_cast<Ewk_Tiled_Backing_Store_Item*>(malloc(sizeof(*item)));
- if (!item)
- return 0;
-
</del><span class="cx"> tileWidth = priv->view.tile.width;
</span><span class="cx"> tileHeight = priv->view.tile.height;
</span><span class="cx"> x = priv->view.offset.base.x + priv->view.x + \
tileWidth * column; </span><span class="cx"> y = priv->view.offset.base.y + \
priv->view.y + tileHeight * row; </span><span class="cx">
</span><ins>+ OwnPtr<Ewk_Tiled_Backing_Store_Item> item = adoptPtr(new \
Ewk_Tiled_Backing_Store_Item); </ins><span class="cx"> item->tile = 0;
</span><del>-
</del><span class="cx"> item->smoothScale = \
priv->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 "ewk_tiled_backing_store.h"
</span><span class="cx"> #include "ewk_tiled_private.h"
</span><span class="cx"> #include <Eina.h>
</span><ins>+#include <OwnPtr.h>
+#include <PassOwnPtr.h>
</ins><span class="cx"> #include <errno.h>
</span><span class="cx"> #include <inttypes.h>
</span><span class="cx"> #include <math.h>
</span><span class="lines">@@ -170,7 +172,7 @@
</span><span class="cx"> if (!entry->count && entry->matrix != \
tileMatrix->matrix) { </span><span class="cx"> \
eina_matrixsparse_free(entry->matrix); </span><span class="cx"> \
tileMatrix->matrices = eina_inlist_remove(tileMatrix->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<Ewk_Tile_Matrix*>(calloc(1, \
sizeof(Ewk_Tile_Matrix)));
- if (!tileMatrix)
- return 0;
</del><ins>+ OwnPtr<Ewk_Tile_Matrix> tileMatrix = adoptPtr(new \
Ewk_Tile_Matrix); </ins><span class="cx">
</span><del>- tileMatrix->matrix = eina_matrixsparse_new(rows, columns, \
_ewk_tile_matrix_cell_free, tileMatrix); </del><ins>+ tileMatrix->matrix = \
eina_matrixsparse_new(rows, columns, _ewk_tile_matrix_cell_free, tileMatrix.get()); \
</ins><span class="cx"> if (!tileMatrix->matrix) { </span><span class="cx"> \
ERR("could not create sparse matrix."); </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->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->tileUnusedCache = \
ewk_tile_unused_cache_ref(tileUnusedCache); </span><span class="lines">@@ -217,7 \
+217,6 @@ </span><span class="cx"> if (!tileMatrix->tileUnusedCache) {
</span><span class="cx"> ERR("no cache of unused tile!");
</span><span class="cx"> eina_matrixsparse_free(tileMatrix->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->render.data = (void*)renderData;
</span><span class="cx"> tileMatrix->tile.width = defaultTileWidth;
</span><span class="cx"> tileMatrix->tile.height = defaultTileHeigth;
</span><ins>+ tileMatrix->frozen = 0;
+ tileMatrix->updates = 0;
</ins><span class="cx">
</span><del>- return tileMatrix;
</del><ins>+#ifdef DEBUG_MEM_LEAKS
+ tileMatrix->stats.tiles.allocated = 0;
+ tileMatrix->stats.tiles.freed = 0;
+ tileMatrix->stats.bytes.allocated = 0;
+ tileMatrix->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<Ewk_Tile_Matrix_Entry*>(calloc(1, \
sizeof(Ewk_Tile_Matrix_Entry))); </del><ins>+ entry = new \
Ewk_Tile_Matrix_Entry; + memset(entry, 0, sizeof(Ewk_Tile_Matrix_Entry));
+ entry->matrix = eina_matrixsparse_new(rows, columns, \
_ewk_tile_matrix_cell_free, tileMatrix); + entry->count = 0;
</ins><span class="cx"> entry->zoom = zoom;
</span><del>- entry->matrix = eina_matrixsparse_new(rows, columns, \
_ewk_tile_matrix_cell_free, tileMatrix); </del><span class="cx"> if \
(!entry->matrix) { </span><span class="cx"> ERR("could not create \
sparse matrix."); </span><del>- free(entry);
</del><ins>+ delete entry;
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> tileMatrix->matrices = \
eina_inlist_prepend(tileMatrix->matrices, EINA_INLIST_GET(entry)); </span><span \
class="lines">@@ -277,7 +286,7 @@ </span><span class="cx"> if \
(iterator->matrix != tileMatrix->matrix) { </span><span class="cx"> \
eina_matrixsparse_free(iterator->matrix); </span><span class="cx"> \
tileMatrix->matrices = eina_inlist_remove(tileMatrix->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->matrices, Ewk_Tile_Matrix_Entry); \
</span><span class="cx"> eina_matrixsparse_free(entry->matrix); </span><span \
class="cx"> tileMatrix->matrices = eina_inlist_remove(tileMatrix->matrices, \
reinterpret_cast<Eina_Inlist*>(entry)); </span><del>- free(entry);
</del><span class="cx"> tileMatrix->matrices = 0;
</span><ins>+ delete entry;
</ins><span class="cx">
</span><span class="cx"> \
ewk_tile_unused_cache_thaw(tileMatrix->tileUnusedCache); </span><span class="cx"> \
ewk_tile_unused_cache_unref(tileMatrix->tileUnusedCache); </span><span \
class="lines">@@ -335,7 +344,7 @@ </span><span class="cx"> \
tileMatrix->stats.bytes.allocated, tileMatrix->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<Ewk_Tile_Unused_Cache*>(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("tileUnusedCache=%p", tileUnusedCache);
</span><span class="cx"> tileUnusedCache->memory.max = max;
</span><span class="lines">@@ -491,7 +490,7 @@
</span><span class="cx"> tileUnusedCache->memory.max, \
tileUnusedCache->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->entries.list, item) {
</span><span class="cx"> Ewk_Tile_Unused_Cache_Entry* itr = \
static_cast<Ewk_Tile_Unused_Cache_Entry*>(item); </span><span class="cx"> \
itr->tile_free.callback(itr->tile_free.data, itr->tile); </span><del>- \
free(itr); </del><ins>+ delete itr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> tileUnusedCache->memory.used = 0;
</span><span class="lines">@@ -604,7 +603,7 @@
</span><span class="cx"> done += ewk_tile_memory_size_get(itr->tile);
</span><span class="cx"> itr->tile_free.callback(itr->tile_free.data, \
itr->tile); </span><span class="cx"> tileUnusedCache->entries.list = \
eina_list_remove_list(tileUnusedCache->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->entries.list, \
iterateEntry, item) { </span><span class="cx"> Ewk_Tile_Unused_Cache_Entry* \
entry = static_cast<Ewk_Tile_Unused_Cache_Entry*>(item); </span><span \
class="cx"> if (entry->tile == tile) { </span><del>- foundEntry \
= iterateEntry;
- break;
</del><ins>+ tileUnusedCache->entries.count--;
+ tileUnusedCache->memory.used -= ewk_tile_memory_size_get(tile);
+ tileUnusedCache->entries.list = \
eina_list_remove_list(tileUnusedCache->entries.list, iterateEntry); + \
delete entry; +
+ return true;
</ins><span class="cx"> }
</span><span class="cx"> }
</span><del>- if (!foundEntry) {
- ERR("tile %p not found in cache %p", tile, tileUnusedCache);
- return false;
- }
</del><span class="cx">
</span><del>- tileUnusedCache->entries.count--;
- tileUnusedCache->memory.used -= ewk_tile_memory_size_get(tile);
- tileUnusedCache->entries.list = \
eina_list_remove_list(tileUnusedCache->entries.list, foundEntry);
- free(item);
-
- return true;
</del><ins>+ ERR("tile %p not found in cache %p", 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<Ewk_Tile_Unused_Cache_Entry*>(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->entries.list = \
eina_list_append(tileUnusedCache->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("could not %s %zd bytes: %s", op, size, \
strerror(errno))
-#define MALLOC_OR_OOM_RET(ptr, size, ...) \
- do { \
- ptr = malloc(size); \
- if (!ptr && (size) > 0) { \
- OOM("malloc", (size)); \
- return __VA_ARGS__; \
- } \
- } while (0)
-
-#define CALLOC_OR_OOM_RET(ptr, size, ...) \
- do { \
- ptr = calloc(1, size); \
- if (!ptr && (size) > 0) { \
- OOM("calloc", (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 && (size) > 0) { \
- OOM("realloc", (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<WebCore::Page> 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->setCustomUserAgent(String::fromUTF8(priv->settings.userAgent));
</span><span class="cx">
</span><del>- return WebCore::Frame::create(priv->page, owner, \
frameLoaderClient); </del><ins>+ return \
WebCore::Frame::create(priv->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<Ewk_View_Private_Data*>(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("could not allocate Ewk_View_Private_Data");
- return 0;
- }
-
</del><span class="cx"> WebCore::Page::PageClients pageClients;
</span><span class="cx"> pageClients.chromeClient = new \
WebCore::ChromeClientEfl(smartData->self); </span><span class="cx"> \
pageClients.editorClient = new WebCore::EditorClientEfl(smartData->self); \
</span><span class="cx"> pageClients.dragClient = new WebCore::DragClientEfl; \
</span><span class="cx"> pageClients.inspectorClient = new \
WebCore::InspectorClientEfl; </span><del>- priv->page = new \
WebCore::Page(pageClients);
- if (!priv->page) {
- CRITICAL("Could not create WebKit Page");
- goto error_page;
- }
</del><ins>+
+ priv->page = adoptPtr(new WebCore::Page(pageClients));
+
</ins><span class="cx"> #if ENABLE(DEVICE_ORIENTATION)
</span><del>- WebCore::provideDeviceMotionTo(priv->page, new \
WebCore::DeviceMotionClientEfl);
- WebCore::provideDeviceOrientationTo(priv->page, new \
WebCore::DeviceOrientationClientEfl); </del><ins>+ \
WebCore::provideDeviceMotionTo(priv->page.get(), new \
WebCore::DeviceMotionClientEfl); + \
WebCore::provideDeviceOrientationTo(priv->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->page, new \
WebCore::VibrationClientEfl(smartData->self)); </del><ins>+ \
WebCore::provideVibrationTo(priv->page.get(), new \
WebCore::VibrationClientEfl(smartData->self)); </ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> priv->pageSettings = priv->page->settings();
</span><del>- if (!priv->pageSettings) {
- CRITICAL("Could not get page settings.");
- goto error_settings;
- }
</del><span class="cx">
</span><span class="cx"> priv->viewportArguments.width = \
WebCore::ViewportArguments::ValueAuto; </span><span class="cx"> \
priv->viewportArguments.height = WebCore::ViewportArguments::ValueAuto; \
</span><span class="lines">@@ -714,29 +703,12 @@ </span><span class="cx"> \
priv->settings.domTimerInterval = \
priv->pageSettings->defaultMinDOMTimerInterval(); </span><span class="cx">
</span><span class="cx"> priv->mainFrame = _ewk_view_core_frame_new(smartData, \
priv, 0).get(); </span><del>- if (!priv->mainFrame) {
- CRITICAL("Could not create main frame.");
- goto error_main_frame;
- }
</del><span class="cx">
</span><span class="cx"> priv->history = \
ewk_history_new(static_cast<WebCore::BackForwardListImpl*>(priv->page->backForwardList()));
</span><del>- if (!priv->history) {
- CRITICAL("Could not create history instance for view.");
- goto error_history;
- }
</del><span class="cx">
</span><span class="cx"> priv->soupSession = \
WebCore::ResourceHandle::defaultSession(); </span><span class="cx">
</span><span class="cx"> return priv;
</span><del>-
-error_history:
- // delete priv->main_frame; /* do not delete priv->main_frame */
-error_main_frame:
-error_settings:
- delete priv->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->history);
</span><span class="cx">
</span><del>- delete priv->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->page;
</del><ins>+ return priv->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->listSize();
</span><span class="cx"> for (int i = 0; i < size; ++i) {
</span><del>- Ewk_Menu_Item* item = \
static_cast<Ewk_Menu_Item*>(malloc(sizeof(*item))); </del><ins>+ \
Ewk_Menu_Item* item = new Ewk_Menu_Item; </ins><span class="cx"> if \
(client->itemIsSeparator(i)) </span><span class="cx"> item->type = \
EWK_MENU_SEPARATOR; </span><span class="cx"> else if \
(client->itemIsLabel(i)) </span><span class="lines">@@ -3508,7 +3479,7 @@
</span><span class="cx"> EINA_LIST_FREE(priv->popup.menu.items, itemv) {
</span><span class="cx"> Ewk_Menu_Item* item = \
static_cast<Ewk_Menu_Item*>(itemv); </span><span class="cx"> \
eina_stringshare_del(item->text); </span><del>- free(item);
</del><ins>+ delete item;
</ins><span class="cx"> }
</span><span class="cx"> priv->popup.menuClient->popupDidHide();
</span><span class="cx"> priv->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->page;
</del><ins>+ return priv->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->core;
</span><span class="cx"> windowFeatures->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<Ewk_Window_Features*>(malloc(sizeof(*window_features)));
- if (!window_features) {
- CRITICAL("Could not allocate Ewk_Window_Features.");
- 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->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