Changeset 166915 in webkit


Ignore:
Timestamp:
Apr 8, 2014 12:14:20 AM (10 years ago)
Author:
gyuyoung.kim@samsung.com
Message:

Change NavigatorContentUtils client ownership from port side to NavigatorContentUtils
https://bugs.webkit.org/show_bug.cgi?id=131299

Reviewed by Darin Adler.

EFL and GTK ports have managed own client of NavigatorContentUtils though it is only passed to
NavigatorContentUtils. The NavigatorContentUtils has used the client to call port functions. So,
there is no reason port implementation needs to manage the ownership. To manage the client is
unnecessary work in current implementation.

Source/WebCore:

No new tests, no behavior changes.

  • Modules/navigatorcontentutils/NavigatorContentUtils.cpp:

(WebCore::NavigatorContentUtils::create):
(WebCore::provideNavigatorContentUtilsTo):

  • Modules/navigatorcontentutils/NavigatorContentUtils.h:
  • Modules/navigatorcontentutils/NavigatorContentUtilsClient.h:

Source/WebKit/efl:

  • ewk/ewk_view.cpp:

(_ewk_view_priv_new):

Source/WebKit/gtk:

  • webkit/webkitwebview.cpp:

(webkit_web_view_init):

  • webkit/webkitwebviewprivate.h:
Location:
trunk/Source
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r166909 r166915  
     12014-04-08  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
     2
     3        Change NavigatorContentUtils client ownership from port side to NavigatorContentUtils
     4        https://bugs.webkit.org/show_bug.cgi?id=131299
     5
     6        Reviewed by Darin Adler.
     7
     8        EFL and GTK ports have managed own client of NavigatorContentUtils though it is only passed to
     9        NavigatorContentUtils. The NavigatorContentUtils has used the client to call port functions. So,
     10        there is no reason port implementation needs to manage the ownership. To manage the client is
     11        unnecessary work in current implementation.
     12
     13        No new tests, no behavior changes.
     14
     15        * Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
     16        (WebCore::NavigatorContentUtils::create):
     17        (WebCore::provideNavigatorContentUtilsTo):
     18        * Modules/navigatorcontentutils/NavigatorContentUtils.h:
     19        * Modules/navigatorcontentutils/NavigatorContentUtilsClient.h:
     20
    1212014-04-07  Zoltan Horvath  <zoltan@webkit.org>
    222
  • trunk/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.cpp

    r165723 r166915  
    127127}
    128128
    129 PassRef<NavigatorContentUtils> NavigatorContentUtils::create(NavigatorContentUtilsClient* client)
    130 {
    131     return adoptRef(*new NavigatorContentUtils(client));
     129PassRef<NavigatorContentUtils> NavigatorContentUtils::create(std::unique_ptr<NavigatorContentUtilsClient> client)
     130{
     131    return adoptRef(*new NavigatorContentUtils(std::move(client)));
    132132}
    133133
     
    220220}
    221221
    222 void provideNavigatorContentUtilsTo(Page* page, NavigatorContentUtilsClient* client)
    223 {
    224     RefCountedSupplement<Page, NavigatorContentUtils>::provideTo(page, NavigatorContentUtils::supplementName(), NavigatorContentUtils::create(client));
     222void provideNavigatorContentUtilsTo(Page* page, std::unique_ptr<NavigatorContentUtilsClient> client)
     223{
     224    RefCountedSupplement<Page, NavigatorContentUtils>::provideTo(page, NavigatorContentUtils::supplementName(), NavigatorContentUtils::create(std::move(client)));
    225225}
    226226
  • trunk/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.h

    r166130 r166915  
    5656#endif
    5757
    58     static PassRef<NavigatorContentUtils> create(NavigatorContentUtilsClient*);
     58    static PassRef<NavigatorContentUtils> create(std::unique_ptr<NavigatorContentUtilsClient>);
    5959
    6060private:
    61     explicit NavigatorContentUtils(NavigatorContentUtilsClient* client)
    62         : m_client(client)
     61    explicit NavigatorContentUtils(std::unique_ptr<NavigatorContentUtilsClient> client)
     62        : m_client(std::move(client))
    6363    { }
    6464
    65     NavigatorContentUtilsClient* client() { return m_client; }
     65    NavigatorContentUtilsClient* client() { return m_client.get(); }
    6666
    67     NavigatorContentUtilsClient* m_client;
     67    std::unique_ptr<NavigatorContentUtilsClient> m_client;
    6868};
    6969
  • trunk/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtilsClient.h

    r164568 r166915  
    5353};
    5454
    55 void provideNavigatorContentUtilsTo(Page*, NavigatorContentUtilsClient*);
     55void provideNavigatorContentUtilsTo(Page*, std::unique_ptr<NavigatorContentUtilsClient>);
    5656
    5757}
  • trunk/Source/WebKit/efl/ChangeLog

    r166889 r166915  
     12014-04-08  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
     2
     3        Change NavigatorContentUtils client ownership from port side to NavigatorContentUtils
     4        https://bugs.webkit.org/show_bug.cgi?id=131299
     5
     6        Reviewed by Darin Adler.
     7
     8        EFL and GTK ports have managed own client of NavigatorContentUtils though it is only passed to
     9        NavigatorContentUtils. The NavigatorContentUtils has used the client to call port functions. So,
     10        there is no reason port implementation needs to manage the ownership. To manage the client is
     11        unnecessary work in current implementation.
     12
     13        * ewk/ewk_view.cpp:
     14        (_ewk_view_priv_new):
     15
    1162014-04-07  Hyowon Kim  <hw1008.kim@samsung.com>
    217
  • trunk/Source/WebKit/efl/ewk/ewk_view.cpp

    r166866 r166915  
    260260    WebCore::ColorChooserClient* colorChooserClient;
    261261#endif
    262 #if ENABLE(NAVIGATOR_CONTENT_UTILS) || ENABLE(CUSTOM_SCHEME_HANDLER)
    263     std::unique_ptr<WebCore::NavigatorContentUtilsClientEfl> navigatorContentUtilsClient;
    264 #endif
    265262    struct {
    266263        Ewk_Menu menu;
     
    688685
    689686#if ENABLE(NAVIGATOR_CONTENT_UTILS)
    690     priv->navigatorContentUtilsClient = std::make_unique<WebCore::NavigatorContentUtilsClientEfl>(smartData->self);
    691     WebCore::provideNavigatorContentUtilsTo(priv->page.get(), priv->navigatorContentUtilsClient.get());
     687    WebCore::provideNavigatorContentUtilsTo(priv->page.get(), std::make_unique<WebCore::NavigatorContentUtilsClientEfl>(smartData->self));
    692688#endif
    693689
  • trunk/Source/WebKit/gtk/ChangeLog

    r166889 r166915  
     12014-04-08  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
     2
     3        Change NavigatorContentUtils client ownership from port side to NavigatorContentUtils
     4        https://bugs.webkit.org/show_bug.cgi?id=131299
     5
     6        Reviewed by Darin Adler.
     7
     8        EFL and GTK ports have managed own client of NavigatorContentUtils though it is only passed to
     9        NavigatorContentUtils. The NavigatorContentUtils has used the client to call port functions. So,
     10        there is no reason port implementation needs to manage the ownership. To manage the client is
     11        unnecessary work in current implementation.
     12
     13        * webkit/webkitwebview.cpp:
     14        (webkit_web_view_init):
     15        * webkit/webkitwebviewprivate.h:
     16
    1172014-04-07  Hyowon Kim  <hw1008.kim@samsung.com>
    218
  • trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp

    r166661 r166915  
    38713871
    38723872#if ENABLE(NAVIGATOR_CONTENT_UTILS)
    3873     priv->navigatorContentUtilsClient = std::make_unique<WebKit::NavigatorContentUtilsClient>();
    3874     WebCore::provideNavigatorContentUtilsTo(priv->corePage, priv->navigatorContentUtilsClient.get());
     3873    WebCore::provideNavigatorContentUtilsTo(priv->corePage, std::make_unique<WebKit::NavigatorContentUtilsClient>());
    38753874#endif
    38763875
  • trunk/Source/WebKit/gtk/webkit/webkitwebviewprivate.h

    r165253 r166915  
    117117    std::unique_ptr<WebCore::GeolocationClientMock> geolocationClientMock;
    118118#endif
    119 
    120 #if ENABLE(NAVIGATOR_CONTENT_UTILS)
    121     std::unique_ptr<WebKit::NavigatorContentUtilsClient> navigatorContentUtilsClient;
    122 #endif
    123119};
    124120
Note: See TracChangeset for help on using the changeset viewer.