Changeset 128413 in webkit


Ignore:
Timestamp:
Sep 13, 2012 12:35:59 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[EFL][WK2] Make _ref() functions return the object
https://bugs.webkit.org/show_bug.cgi?id=96604

Patch by Christophe Dumez <Christophe Dumez> on 2012-09-13
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:
Location:
trunk/Source/WebKit2
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r128403 r128413  
     12012-09-13  Christophe Dumez  <christophe.dumez@intel.com>
     2
     3        [EFL][WK2] Make _ref() functions return the object
     4        https://bugs.webkit.org/show_bug.cgi?id=96604
     5
     6        Reviewed by Gyuyoung Kim.
     7
     8        Make _ref() functions return the ref'd object to
     9        make them more convenient to use. Also fix their
     10        usage to make use of the newly returned value.
     11
     12        This change is consistent with eina_stringshare_ref()
     13        in EFL and g_object_ref() in glib.
     14
     15        * UIProcess/API/efl/ewk_back_forward_list.cpp:
     16        (createEinaList):
     17        * UIProcess/API/efl/ewk_back_forward_list_item.cpp:
     18        (ewk_back_forward_list_item_ref):
     19        * UIProcess/API/efl/ewk_back_forward_list_item.h:
     20        * UIProcess/API/efl/ewk_context.cpp:
     21        (ewk_context_download_job_add):
     22        * UIProcess/API/efl/ewk_download_job.cpp:
     23        (ewk_download_job_ref):
     24        (ewk_download_job_response_set):
     25        * UIProcess/API/efl/ewk_download_job.h:
     26        * UIProcess/API/efl/ewk_form_submission_request.cpp:
     27        (ewk_form_submission_request_ref):
     28        * UIProcess/API/efl/ewk_form_submission_request.h:
     29        * UIProcess/API/efl/ewk_intent.cpp:
     30        (ewk_intent_ref):
     31        * UIProcess/API/efl/ewk_intent.h:
     32        * UIProcess/API/efl/ewk_intent_service.cpp:
     33        (ewk_intent_service_ref):
     34        * UIProcess/API/efl/ewk_intent_service.h:
     35        * UIProcess/API/efl/ewk_navigation_policy_decision.cpp:
     36        (ewk_navigation_policy_decision_ref):
     37        * UIProcess/API/efl/ewk_navigation_policy_decision.h:
     38        * UIProcess/API/efl/ewk_url_request.cpp:
     39        (ewk_url_request_ref):
     40        * UIProcess/API/efl/ewk_url_request.h:
     41        * UIProcess/API/efl/ewk_url_response.cpp:
     42        (ewk_url_response_ref):
     43        * UIProcess/API/efl/ewk_url_response.h:
     44        * UIProcess/API/efl/ewk_url_scheme_request.cpp:
     45        (ewk_url_scheme_request_ref):
     46        * UIProcess/API/efl/ewk_url_scheme_request.h:
     47        * UIProcess/API/efl/ewk_view.cpp:
     48        (ewk_view_resource_load_initiated):
     49        * UIProcess/API/efl/ewk_web_resource.cpp:
     50        (ewk_web_resource_ref):
     51        * UIProcess/API/efl/ewk_web_resource.h:
     52
    1532012-09-12  Sheriff Bot  <webkit.review.bot@gmail.com>
    254
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list.cpp

    r126926 r128413  
    9696        WKBackForwardListItemRef wkItem = static_cast<WKBackForwardListItemRef>(WKArrayGetItemAtIndex(wkList, i));
    9797        Ewk_Back_Forward_List_Item* item = addItemToWrapperCache(list, wkItem);
    98         ewk_back_forward_list_item_ref(item);
    99         result = eina_list_append(result, item);
     98        result = eina_list_append(result, ewk_back_forward_list_item_ref(item));
    10099    }
    101100
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item.cpp

    r125969 r128413  
    6666    WKBackForwardListItemRef wkItem_ = (item)->wkItem.get()
    6767
    68 void ewk_back_forward_list_item_ref(Ewk_Back_Forward_List_Item* item)
     68Ewk_Back_Forward_List_Item* ewk_back_forward_list_item_ref(Ewk_Back_Forward_List_Item* item)
    6969{
    70     EINA_SAFETY_ON_NULL_RETURN(item);
     70    EINA_SAFETY_ON_NULL_RETURN_VAL(item, 0);
    7171    ++item->__ref;
     72
     73    return item;
    7274}
    7375
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item.h

    r124875 r128413  
    4545 *
    4646 * @param item the back-forward list item instance to increase the reference count
     47 *
     48 * @return a pointer to the object on success, @c NULL otherwise.
    4749 */
    48 EAPI void ewk_back_forward_list_item_ref(Ewk_Back_Forward_List_Item *item);
     50EAPI Ewk_Back_Forward_List_Item *ewk_back_forward_list_item_ref(Ewk_Back_Forward_List_Item *item);
    4951
    5052/**
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp

    r127195 r128413  
    152152        return;
    153153
    154     ewk_download_job_ref(ewkDownload);
    155     ewkContext->downloadJobs.add(downloadId, ewkDownload);
     154    ewkContext->downloadJobs.add(downloadId, ewk_download_job_ref(ewkDownload));
    156155}
    157156
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_download_job.cpp

    r125671 r128413  
    7777};
    7878
    79 void ewk_download_job_ref(Ewk_Download_Job* download)
    80 {
    81     EINA_SAFETY_ON_NULL_RETURN(download);
     79Ewk_Download_Job* ewk_download_job_ref(Ewk_Download_Job* download)
     80{
     81    EINA_SAFETY_ON_NULL_RETURN_VAL(download, 0);
    8282
    8383    ++download->__ref;
     84
     85    return download;
    8486}
    8587
     
    222224    EINA_SAFETY_ON_NULL_RETURN(response);
    223225
    224     ewk_url_response_ref(response);
    225     download->response = response;
     226    download->response = ewk_url_response_ref(response);
    226227}
    227228
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_download_job.h

    r123882 r128413  
    7171 *
    7272 * @param download the download object to increase the reference count
    73  */
    74 EAPI void ewk_download_job_ref(Ewk_Download_Job *download);
     73 *
     74 * @return a pointer to the object on success, @c NULL otherwise.
     75 */
     76EAPI Ewk_Download_Job *ewk_download_job_ref(Ewk_Download_Job *download);
    7577
    7678/**
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_form_submission_request.cpp

    r123742 r128413  
    6666};
    6767
    68 void ewk_form_submission_request_ref(Ewk_Form_Submission_Request* request)
     68Ewk_Form_Submission_Request* ewk_form_submission_request_ref(Ewk_Form_Submission_Request* request)
    6969{
    70     EINA_SAFETY_ON_NULL_RETURN(request);
     70    EINA_SAFETY_ON_NULL_RETURN_VAL(request, 0);
    7171    ++request->__ref;
     72
     73    return request;
    7274}
    7375
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_form_submission_request.h

    r123742 r128413  
    4848 *
    4949 * @param request the request object to increase the reference count
     50 *
     51 * @return a pointer to the object on success, @c NULL otherwise.
    5052 */
    51 EAPI void ewk_form_submission_request_ref(Ewk_Form_Submission_Request *request);
     53EAPI Ewk_Form_Submission_Request *ewk_form_submission_request_ref(Ewk_Form_Submission_Request *request);
    5254
    5355/**
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_intent.cpp

    r125671 r128413  
    8080    WKIntentDataRef wkIntent_ = (intent)->wkIntent.get()
    8181
    82 void ewk_intent_ref(Ewk_Intent* intent)
     82Ewk_Intent* ewk_intent_ref(Ewk_Intent* intent)
    8383{
    8484#if ENABLE(WEB_INTENTS)
    85     EINA_SAFETY_ON_NULL_RETURN(intent);
     85    EINA_SAFETY_ON_NULL_RETURN_VAL(intent, 0);
    8686    ++intent->__ref;
    8787#endif
     88
     89    return intent;
    8890}
    8991
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_intent.h

    r123604 r128413  
    4545 *
    4646 * @param intent the intent object to increase the reference count
     47 *
     48 * @return a pointer to the object on success, @c NULL otherwise.
    4749 */
    48 EAPI void ewk_intent_ref(Ewk_Intent *intent);
     50EAPI Ewk_Intent *ewk_intent_ref(Ewk_Intent *intent);
    4951
    5052/**
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_intent_service.cpp

    r125671 r128413  
    6868};
    6969
    70 void ewk_intent_service_ref(Ewk_Intent_Service* service)
     70Ewk_Intent_Service* ewk_intent_service_ref(Ewk_Intent_Service* service)
    7171{
    7272#if ENABLE(WEB_INTENTS_TAG)
    73     EINA_SAFETY_ON_NULL_RETURN(service);
     73    EINA_SAFETY_ON_NULL_RETURN_VAL(service, 0);
    7474    ++service->__ref;
    7575#endif
     76
     77    return service;
    7678}
    7779
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_intent_service.h

    r122868 r128413  
    4545 *
    4646 * @param service the intent service object to increase the reference count
     47 *
     48 * @return a pointer to the object on success, @c NULL otherwise.
    4749 */
    48 EAPI void ewk_intent_service_ref(Ewk_Intent_Service *service);
     50EAPI Ewk_Intent_Service *ewk_intent_service_ref(Ewk_Intent_Service *service);
    4951
    5052/**
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision.cpp

    r125671 r128413  
    7474};
    7575
    76 void ewk_navigation_policy_decision_ref(Ewk_Navigation_Policy_Decision* decision)
     76Ewk_Navigation_Policy_Decision* ewk_navigation_policy_decision_ref(Ewk_Navigation_Policy_Decision* decision)
    7777{
    78     EINA_SAFETY_ON_NULL_RETURN(decision);
     78    EINA_SAFETY_ON_NULL_RETURN_VAL(decision, 0);
    7979
    8080    ++decision->__ref;
     81
     82    return decision;
    8183}
    8284
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision.h

    r122742 r128413  
    7171 *
    7272 * @param decision the policy decision object to increase the reference count
     73 *
     74 * @return a pointer to the object on success, @c NULL otherwise.
    7375 */
    74 EAPI void ewk_navigation_policy_decision_ref(Ewk_Navigation_Policy_Decision *decision);
     76EAPI Ewk_Navigation_Policy_Decision *ewk_navigation_policy_decision_ref(Ewk_Navigation_Policy_Decision *decision);
    7577
    7678/**
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_request.cpp

    r125671 r128413  
    6161};
    6262
    63 void ewk_url_request_ref(Ewk_Url_Request* request)
     63Ewk_Url_Request* ewk_url_request_ref(Ewk_Url_Request* request)
    6464{
    65     EINA_SAFETY_ON_NULL_RETURN(request);
     65    EINA_SAFETY_ON_NULL_RETURN_VAL(request, 0);
    6666    ++request->__ref;
     67
     68    return request;
    6769}
    6870
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_request.h

    r122868 r128413  
    4545 *
    4646 * @param request the URL request object to increase the reference count
     47 *
     48 * @return a pointer to the object on success, @c NULL otherwise.
    4749 */
    48 EAPI void ewk_url_request_ref(Ewk_Url_Request *request);
     50EAPI Ewk_Url_Request *ewk_url_request_ref(Ewk_Url_Request *request);
    4951
    5052/**
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_response.cpp

    r125671 r128413  
    5959};
    6060
    61 void ewk_url_response_ref(Ewk_Url_Response* response)
     61Ewk_Url_Response* ewk_url_response_ref(Ewk_Url_Response* response)
    6262{
    63     EINA_SAFETY_ON_NULL_RETURN(response);
     63    EINA_SAFETY_ON_NULL_RETURN_VAL(response, 0);
    6464    ++response->__ref;
     65
     66    return response;
    6567}
    6668
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_response.h

    r123882 r128413  
    4545 *
    4646 * @param response the URL response object to increase the reference count
     47 *
     48 * @return a pointer to the object on success, @c NULL otherwise.
    4749 */
    48 EAPI void ewk_url_response_ref(Ewk_Url_Response *response);
     50EAPI Ewk_Url_Response *ewk_url_response_ref(Ewk_Url_Response *response);
    4951
    5052/**
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.cpp

    r123752 r128413  
    6868};
    6969
    70 void ewk_url_scheme_request_ref(Ewk_Url_Scheme_Request* request)
     70Ewk_Url_Scheme_Request* ewk_url_scheme_request_ref(Ewk_Url_Scheme_Request* request)
    7171{
    72     EINA_SAFETY_ON_NULL_RETURN(request);
     72    EINA_SAFETY_ON_NULL_RETURN_VAL(request, 0);
    7373    ++request->__ref;
     74
     75    return request;
    7476}
    7577
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.h

    r123752 r128413  
    4545 *
    4646 * @param request the URL scheme request object to increase the reference count
     47 *
     48 * @return a pointer to the object on success, @c NULL otherwise.
    4749 */
    48 EAPI void ewk_url_scheme_request_ref(Ewk_Url_Scheme_Request *request);
     50EAPI Ewk_Url_Scheme_Request *ewk_url_scheme_request_ref(Ewk_Url_Scheme_Request *request);
    4951
    5052/**
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp

    r128163 r128413  
    890890
    891891    // Keep the resource internally to reuse it later.
    892     ewk_web_resource_ref(resource);
    893     priv->loadingResourcesMap.add(resourceIdentifier, resource);
     892    priv->loadingResourcesMap.add(resourceIdentifier, ewk_web_resource_ref(resource));
    894893
    895894    evas_object_smart_callback_call(ewkView, "resource,request,new", &resourceRequest);
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_web_resource.cpp

    r125671 r128413  
    4848};
    4949
    50 void ewk_web_resource_ref(Ewk_Web_Resource* resource)
     50Ewk_Web_Resource* ewk_web_resource_ref(Ewk_Web_Resource* resource)
    5151{
    52     EINA_SAFETY_ON_NULL_RETURN(resource);
     52    EINA_SAFETY_ON_NULL_RETURN_VAL(resource, 0);
    5353
    5454    ++resource->__ref;
     55
     56    return resource;
    5557}
    5658
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_web_resource.h

    r122868 r128413  
    4545 *
    4646 * @param resource the resource object to increase the reference count
     47 *
     48 * @return a pointer to the object on success, @c NULL otherwise.
    4749 */
    48 EAPI void ewk_web_resource_ref(Ewk_Web_Resource *resource);
     50EAPI Ewk_Web_Resource *ewk_web_resource_ref(Ewk_Web_Resource *resource);
    4951
    5052/**
Note: See TracChangeset for help on using the changeset viewer.