Diff
Modified: trunk/Source/WebKit2/ChangeLog (128412 => 128413)
--- trunk/Source/WebKit2/ChangeLog 2012-09-13 07:19:47 UTC (rev 128412)
+++ trunk/Source/WebKit2/ChangeLog 2012-09-13 07:35:59 UTC (rev 128413)
@@ -1,3 +1,55 @@
+2012-09-13 Christophe Dumez <[email protected]>
+
+ [EFL][WK2] Make _ref() functions return the object
+ https://bugs.webkit.org/show_bug.cgi?id=96604
+
+ Reviewed by Gyuyoung Kim.
+
+ Make _ref() functions return the ref'd object to
+ make them more convenient to use. Also fix their
+ usage to make use of the newly returned value.
+
+ This change is consistent with eina_stringshare_ref()
+ in EFL and g_object_ref() in glib.
+
+ * UIProcess/API/efl/ewk_back_forward_list.cpp:
+ (createEinaList):
+ * UIProcess/API/efl/ewk_back_forward_list_item.cpp:
+ (ewk_back_forward_list_item_ref):
+ * UIProcess/API/efl/ewk_back_forward_list_item.h:
+ * UIProcess/API/efl/ewk_context.cpp:
+ (ewk_context_download_job_add):
+ * UIProcess/API/efl/ewk_download_job.cpp:
+ (ewk_download_job_ref):
+ (ewk_download_job_response_set):
+ * UIProcess/API/efl/ewk_download_job.h:
+ * UIProcess/API/efl/ewk_form_submission_request.cpp:
+ (ewk_form_submission_request_ref):
+ * UIProcess/API/efl/ewk_form_submission_request.h:
+ * UIProcess/API/efl/ewk_intent.cpp:
+ (ewk_intent_ref):
+ * UIProcess/API/efl/ewk_intent.h:
+ * UIProcess/API/efl/ewk_intent_service.cpp:
+ (ewk_intent_service_ref):
+ * UIProcess/API/efl/ewk_intent_service.h:
+ * UIProcess/API/efl/ewk_navigation_policy_decision.cpp:
+ (ewk_navigation_policy_decision_ref):
+ * UIProcess/API/efl/ewk_navigation_policy_decision.h:
+ * UIProcess/API/efl/ewk_url_request.cpp:
+ (ewk_url_request_ref):
+ * UIProcess/API/efl/ewk_url_request.h:
+ * UIProcess/API/efl/ewk_url_response.cpp:
+ (ewk_url_response_ref):
+ * UIProcess/API/efl/ewk_url_response.h:
+ * UIProcess/API/efl/ewk_url_scheme_request.cpp:
+ (ewk_url_scheme_request_ref):
+ * UIProcess/API/efl/ewk_url_scheme_request.h:
+ * UIProcess/API/efl/ewk_view.cpp:
+ (ewk_view_resource_load_initiated):
+ * UIProcess/API/efl/ewk_web_resource.cpp:
+ (ewk_web_resource_ref):
+ * UIProcess/API/efl/ewk_web_resource.h:
+
2012-09-12 Sheriff Bot <[email protected]>
Unreviewed, rolling out r127876.
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list.cpp (128412 => 128413)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list.cpp 2012-09-13 07:19:47 UTC (rev 128412)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list.cpp 2012-09-13 07:35:59 UTC (rev 128413)
@@ -95,8 +95,7 @@
for (size_t i = 0; i < count; ++i) {
WKBackForwardListItemRef wkItem = static_cast<WKBackForwardListItemRef>(WKArrayGetItemAtIndex(wkList, i));
Ewk_Back_Forward_List_Item* item = addItemToWrapperCache(list, wkItem);
- ewk_back_forward_list_item_ref(item);
- result = eina_list_append(result, item);
+ result = eina_list_append(result, ewk_back_forward_list_item_ref(item));
}
return result;
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item.cpp (128412 => 128413)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item.cpp 2012-09-13 07:19:47 UTC (rev 128412)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item.cpp 2012-09-13 07:35:59 UTC (rev 128413)
@@ -65,10 +65,12 @@
} \
WKBackForwardListItemRef wkItem_ = (item)->wkItem.get()
-void ewk_back_forward_list_item_ref(Ewk_Back_Forward_List_Item* item)
+Ewk_Back_Forward_List_Item* ewk_back_forward_list_item_ref(Ewk_Back_Forward_List_Item* item)
{
- EINA_SAFETY_ON_NULL_RETURN(item);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(item, 0);
++item->__ref;
+
+ return item;
}
void ewk_back_forward_list_item_unref(Ewk_Back_Forward_List_Item* item)
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item.h (128412 => 128413)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item.h 2012-09-13 07:19:47 UTC (rev 128412)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item.h 2012-09-13 07:35:59 UTC (rev 128413)
@@ -44,8 +44,10 @@
* Increases the reference count of the given object.
*
* @param item the back-forward list item instance to increase the reference count
+ *
+ * @return a pointer to the object on success, @c NULL otherwise.
*/
-EAPI void ewk_back_forward_list_item_ref(Ewk_Back_Forward_List_Item *item);
+EAPI Ewk_Back_Forward_List_Item *ewk_back_forward_list_item_ref(Ewk_Back_Forward_List_Item *item);
/**
* Decreases the reference count of the given object, possibly freeing it.
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp (128412 => 128413)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp 2012-09-13 07:19:47 UTC (rev 128412)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp 2012-09-13 07:35:59 UTC (rev 128413)
@@ -151,8 +151,7 @@
if (ewkContext->downloadJobs.contains(downloadId))
return;
- ewk_download_job_ref(ewkDownload);
- ewkContext->downloadJobs.add(downloadId, ewkDownload);
+ ewkContext->downloadJobs.add(downloadId, ewk_download_job_ref(ewkDownload));
}
/**
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_download_job.cpp (128412 => 128413)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_download_job.cpp 2012-09-13 07:19:47 UTC (rev 128412)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_download_job.cpp 2012-09-13 07:35:59 UTC (rev 128413)
@@ -76,11 +76,13 @@
}
};
-void ewk_download_job_ref(Ewk_Download_Job* download)
+Ewk_Download_Job* ewk_download_job_ref(Ewk_Download_Job* download)
{
- EINA_SAFETY_ON_NULL_RETURN(download);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(download, 0);
++download->__ref;
+
+ return download;
}
void ewk_download_job_unref(Ewk_Download_Job* download)
@@ -221,8 +223,7 @@
EINA_SAFETY_ON_NULL_RETURN(download);
EINA_SAFETY_ON_NULL_RETURN(response);
- ewk_url_response_ref(response);
- download->response = response;
+ download->response = ewk_url_response_ref(response);
}
/**
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_download_job.h (128412 => 128413)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_download_job.h 2012-09-13 07:19:47 UTC (rev 128412)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_download_job.h 2012-09-13 07:35:59 UTC (rev 128413)
@@ -70,8 +70,10 @@
* Increases the reference count of the given object.
*
* @param download the download object to increase the reference count
+ *
+ * @return a pointer to the object on success, @c NULL otherwise.
*/
-EAPI void ewk_download_job_ref(Ewk_Download_Job *download);
+EAPI Ewk_Download_Job *ewk_download_job_ref(Ewk_Download_Job *download);
/**
* Decreases the reference count of the given object, possibly freeing it.
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_form_submission_request.cpp (128412 => 128413)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_form_submission_request.cpp 2012-09-13 07:19:47 UTC (rev 128412)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_form_submission_request.cpp 2012-09-13 07:35:59 UTC (rev 128413)
@@ -65,10 +65,12 @@
}
};
-void ewk_form_submission_request_ref(Ewk_Form_Submission_Request* request)
+Ewk_Form_Submission_Request* ewk_form_submission_request_ref(Ewk_Form_Submission_Request* request)
{
- EINA_SAFETY_ON_NULL_RETURN(request);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(request, 0);
++request->__ref;
+
+ return request;
}
void ewk_form_submission_request_unref(Ewk_Form_Submission_Request* request)
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_form_submission_request.h (128412 => 128413)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_form_submission_request.h 2012-09-13 07:19:47 UTC (rev 128412)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_form_submission_request.h 2012-09-13 07:35:59 UTC (rev 128413)
@@ -47,8 +47,10 @@
* Increases the reference count of the given object.
*
* @param request the request object to increase the reference count
+ *
+ * @return a pointer to the object on success, @c NULL otherwise.
*/
-EAPI void ewk_form_submission_request_ref(Ewk_Form_Submission_Request *request);
+EAPI Ewk_Form_Submission_Request *ewk_form_submission_request_ref(Ewk_Form_Submission_Request *request);
/**
* Decreases the reference count of the given object, possibly freeing it.
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_intent.cpp (128412 => 128413)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_intent.cpp 2012-09-13 07:19:47 UTC (rev 128412)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_intent.cpp 2012-09-13 07:35:59 UTC (rev 128413)
@@ -79,12 +79,14 @@
} \
WKIntentDataRef wkIntent_ = (intent)->wkIntent.get()
-void ewk_intent_ref(Ewk_Intent* intent)
+Ewk_Intent* ewk_intent_ref(Ewk_Intent* intent)
{
#if ENABLE(WEB_INTENTS)
- EINA_SAFETY_ON_NULL_RETURN(intent);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(intent, 0);
++intent->__ref;
#endif
+
+ return intent;
}
void ewk_intent_unref(Ewk_Intent* intent)
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_intent.h (128412 => 128413)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_intent.h 2012-09-13 07:19:47 UTC (rev 128412)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_intent.h 2012-09-13 07:35:59 UTC (rev 128413)
@@ -44,8 +44,10 @@
* Increases the reference count of the given object.
*
* @param intent the intent object to increase the reference count
+ *
+ * @return a pointer to the object on success, @c NULL otherwise.
*/
-EAPI void ewk_intent_ref(Ewk_Intent *intent);
+EAPI Ewk_Intent *ewk_intent_ref(Ewk_Intent *intent);
/**
* Decreases the reference count of the given object, possibly freeing it.
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_intent_service.cpp (128412 => 128413)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_intent_service.cpp 2012-09-13 07:19:47 UTC (rev 128412)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_intent_service.cpp 2012-09-13 07:35:59 UTC (rev 128413)
@@ -67,12 +67,14 @@
}
};
-void ewk_intent_service_ref(Ewk_Intent_Service* service)
+Ewk_Intent_Service* ewk_intent_service_ref(Ewk_Intent_Service* service)
{
#if ENABLE(WEB_INTENTS_TAG)
- EINA_SAFETY_ON_NULL_RETURN(service);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(service, 0);
++service->__ref;
#endif
+
+ return service;
}
void ewk_intent_service_unref(Ewk_Intent_Service* service)
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_intent_service.h (128412 => 128413)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_intent_service.h 2012-09-13 07:19:47 UTC (rev 128412)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_intent_service.h 2012-09-13 07:35:59 UTC (rev 128413)
@@ -44,8 +44,10 @@
* Increases the reference count of the given object.
*
* @param service the intent service object to increase the reference count
+ *
+ * @return a pointer to the object on success, @c NULL otherwise.
*/
-EAPI void ewk_intent_service_ref(Ewk_Intent_Service *service);
+EAPI Ewk_Intent_Service *ewk_intent_service_ref(Ewk_Intent_Service *service);
/**
* Decreases the reference count of the given object, possibly freeing it.
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision.cpp (128412 => 128413)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision.cpp 2012-09-13 07:19:47 UTC (rev 128412)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision.cpp 2012-09-13 07:35:59 UTC (rev 128413)
@@ -73,11 +73,13 @@
}
};
-void ewk_navigation_policy_decision_ref(Ewk_Navigation_Policy_Decision* decision)
+Ewk_Navigation_Policy_Decision* ewk_navigation_policy_decision_ref(Ewk_Navigation_Policy_Decision* decision)
{
- EINA_SAFETY_ON_NULL_RETURN(decision);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(decision, 0);
++decision->__ref;
+
+ return decision;
}
void ewk_navigation_policy_decision_unref(Ewk_Navigation_Policy_Decision* decision)
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision.h (128412 => 128413)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision.h 2012-09-13 07:19:47 UTC (rev 128412)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision.h 2012-09-13 07:35:59 UTC (rev 128413)
@@ -70,8 +70,10 @@
* Increases the reference count of the given object.
*
* @param decision the policy decision object to increase the reference count
+ *
+ * @return a pointer to the object on success, @c NULL otherwise.
*/
-EAPI void ewk_navigation_policy_decision_ref(Ewk_Navigation_Policy_Decision *decision);
+EAPI Ewk_Navigation_Policy_Decision *ewk_navigation_policy_decision_ref(Ewk_Navigation_Policy_Decision *decision);
/**
* Decreases the reference count of the given object, possibly freeing it.
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_request.cpp (128412 => 128413)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_request.cpp 2012-09-13 07:19:47 UTC (rev 128412)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_request.cpp 2012-09-13 07:35:59 UTC (rev 128413)
@@ -60,10 +60,12 @@
}
};
-void ewk_url_request_ref(Ewk_Url_Request* request)
+Ewk_Url_Request* ewk_url_request_ref(Ewk_Url_Request* request)
{
- EINA_SAFETY_ON_NULL_RETURN(request);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(request, 0);
++request->__ref;
+
+ return request;
}
void ewk_url_request_unref(Ewk_Url_Request* request)
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_request.h (128412 => 128413)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_request.h 2012-09-13 07:19:47 UTC (rev 128412)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_request.h 2012-09-13 07:35:59 UTC (rev 128413)
@@ -44,8 +44,10 @@
* Increases the reference count of the given object.
*
* @param request the URL request object to increase the reference count
+ *
+ * @return a pointer to the object on success, @c NULL otherwise.
*/
-EAPI void ewk_url_request_ref(Ewk_Url_Request *request);
+EAPI Ewk_Url_Request *ewk_url_request_ref(Ewk_Url_Request *request);
/**
* Decreases the reference count of the given object, possibly freeing it.
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_response.cpp (128412 => 128413)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_response.cpp 2012-09-13 07:19:47 UTC (rev 128412)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_response.cpp 2012-09-13 07:35:59 UTC (rev 128413)
@@ -58,10 +58,12 @@
}
};
-void ewk_url_response_ref(Ewk_Url_Response* response)
+Ewk_Url_Response* ewk_url_response_ref(Ewk_Url_Response* response)
{
- EINA_SAFETY_ON_NULL_RETURN(response);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(response, 0);
++response->__ref;
+
+ return response;
}
void ewk_url_response_unref(Ewk_Url_Response* response)
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_response.h (128412 => 128413)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_response.h 2012-09-13 07:19:47 UTC (rev 128412)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_response.h 2012-09-13 07:35:59 UTC (rev 128413)
@@ -44,8 +44,10 @@
* Increases the reference count of the given object.
*
* @param response the URL response object to increase the reference count
+ *
+ * @return a pointer to the object on success, @c NULL otherwise.
*/
-EAPI void ewk_url_response_ref(Ewk_Url_Response *response);
+EAPI Ewk_Url_Response *ewk_url_response_ref(Ewk_Url_Response *response);
/**
* Decreases the reference count of the given object, possibly freeing it.
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.cpp (128412 => 128413)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.cpp 2012-09-13 07:19:47 UTC (rev 128412)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.cpp 2012-09-13 07:35:59 UTC (rev 128413)
@@ -67,10 +67,12 @@
}
};
-void ewk_url_scheme_request_ref(Ewk_Url_Scheme_Request* request)
+Ewk_Url_Scheme_Request* ewk_url_scheme_request_ref(Ewk_Url_Scheme_Request* request)
{
- EINA_SAFETY_ON_NULL_RETURN(request);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(request, 0);
++request->__ref;
+
+ return request;
}
void ewk_url_scheme_request_unref(Ewk_Url_Scheme_Request* request)
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.h (128412 => 128413)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.h 2012-09-13 07:19:47 UTC (rev 128412)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.h 2012-09-13 07:35:59 UTC (rev 128413)
@@ -44,8 +44,10 @@
* Increases the reference count of the given object.
*
* @param request the URL scheme request object to increase the reference count
+ *
+ * @return a pointer to the object on success, @c NULL otherwise.
*/
-EAPI void ewk_url_scheme_request_ref(Ewk_Url_Scheme_Request *request);
+EAPI Ewk_Url_Scheme_Request *ewk_url_scheme_request_ref(Ewk_Url_Scheme_Request *request);
/**
* Decreases the reference count of the given object, possibly freeing it.
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp (128412 => 128413)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp 2012-09-13 07:19:47 UTC (rev 128412)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp 2012-09-13 07:35:59 UTC (rev 128413)
@@ -889,8 +889,7 @@
Ewk_Web_Resource_Request resourceRequest = {resource, request, 0};
// Keep the resource internally to reuse it later.
- ewk_web_resource_ref(resource);
- priv->loadingResourcesMap.add(resourceIdentifier, resource);
+ priv->loadingResourcesMap.add(resourceIdentifier, ewk_web_resource_ref(resource));
evas_object_smart_callback_call(ewkView, "resource,request,new", &resourceRequest);
}
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_web_resource.cpp (128412 => 128413)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_web_resource.cpp 2012-09-13 07:19:47 UTC (rev 128412)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_web_resource.cpp 2012-09-13 07:35:59 UTC (rev 128413)
@@ -47,11 +47,13 @@
}
};
-void ewk_web_resource_ref(Ewk_Web_Resource* resource)
+Ewk_Web_Resource* ewk_web_resource_ref(Ewk_Web_Resource* resource)
{
- EINA_SAFETY_ON_NULL_RETURN(resource);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(resource, 0);
++resource->__ref;
+
+ return resource;
}
void ewk_web_resource_unref(Ewk_Web_Resource* resource)
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_web_resource.h (128412 => 128413)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_web_resource.h 2012-09-13 07:19:47 UTC (rev 128412)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_web_resource.h 2012-09-13 07:35:59 UTC (rev 128413)
@@ -44,8 +44,10 @@
* Increases the reference count of the given object.
*
* @param resource the resource object to increase the reference count
+ *
+ * @return a pointer to the object on success, @c NULL otherwise.
*/
-EAPI void ewk_web_resource_ref(Ewk_Web_Resource *resource);
+EAPI Ewk_Web_Resource *ewk_web_resource_ref(Ewk_Web_Resource *resource);
/**
* Decreases the reference count of the given object, possibly freeing it.