Changeset 180921 in webkit


Ignore:
Timestamp:
Mar 2, 2015 10:55:37 PM (9 years ago)
Author:
gyuyoung.kim@samsung.com
Message:

[WK2] Remove unnecessary create() factory functions.
https://bugs.webkit.org/show_bug.cgi?id=142161

Reviewed by Chris Dumez.

We can replace some create() factory functions with std::make_unique(). Because
it just returns new instance. Even some of those functions have used std::unique_ptr<>
instead of std::make_unique<>. Fixed all.

Source/WebKit2:

  • DatabaseProcess/IndexedDB/sqlite/SQLiteIDBTransaction.h:

(WebKit::SQLiteIDBTransaction::create): Deleted.

  • DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:

(WebKit::UniqueIDBDatabaseBackingStoreSQLite::establishTransaction):

  • Platform/efl/DispatchQueueWorkItemEfl.h:

(WorkItem::dispatch):
(WorkItem::create): Deleted.

  • UIProcess/API/gtk/PageClientImpl.h:

(WebKit::PageClientImpl::create): Deleted.

  • UIProcess/API/gtk/WebKitTextChecker.h:

(WebKitTextChecker::create): Deleted.

  • UIProcess/API/gtk/WebKitWebContext.cpp:

(webkitWebContextConstructed):

  • UIProcess/API/gtk/WebKitWebViewBase.cpp:

(webkitWebViewBaseConstructed):

Source/WTF:

  • wtf/efl/WorkQueueEfl.cpp:

(WorkQueue::dispatch):

Location:
trunk/Source
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r180919 r180921  
     12015-03-02  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
     2
     3        [WK2] Remove unnecessary create() factory functions.
     4        https://bugs.webkit.org/show_bug.cgi?id=142161
     5
     6        Reviewed by Chris Dumez.
     7
     8        We can replace some create() factory functions with std::make_unique(). Because
     9        it just returns new instance. Even some of those functions have used std::unique_ptr<>
     10        instead of std::make_unique<>. Fixed all.
     11
     12        * wtf/efl/WorkQueueEfl.cpp:
     13        (WorkQueue::dispatch):
     14
    1152015-03-02  Filip Pizlo  <fpizlo@apple.com>
    216
  • trunk/Source/WTF/wtf/efl/WorkQueueEfl.cpp

    r180410 r180921  
    5858        return;
    5959
    60     m_dispatchQueue->dispatch(WorkItem::create(this, WTF::move(function)));
     60    m_dispatchQueue->dispatch(std::make_unique<WorkItem>(this, WTF::move(function)));
    6161}
    6262
  • trunk/Source/WebKit2/ChangeLog

    r180912 r180921  
     12015-03-02  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
     2
     3        [WK2] Remove unnecessary create() factory functions.
     4        https://bugs.webkit.org/show_bug.cgi?id=142161
     5
     6        Reviewed by Chris Dumez.
     7
     8        We can replace some create() factory functions with std::make_unique(). Because
     9        it just returns new instance. Even some of those functions have used std::unique_ptr<>
     10        instead of std::make_unique<>. Fixed all.
     11
     12        * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBTransaction.h:
     13        (WebKit::SQLiteIDBTransaction::create): Deleted.
     14        * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
     15        (WebKit::UniqueIDBDatabaseBackingStoreSQLite::establishTransaction):
     16        * Platform/efl/DispatchQueueWorkItemEfl.h:
     17        (WorkItem::dispatch):
     18        (WorkItem::create): Deleted.
     19        * UIProcess/API/gtk/PageClientImpl.h:
     20        (WebKit::PageClientImpl::create): Deleted.
     21        * UIProcess/API/gtk/WebKitTextChecker.h:
     22        (WebKitTextChecker::create): Deleted.
     23        * UIProcess/API/gtk/WebKitWebContext.cpp:
     24        (webkitWebContextConstructed):
     25        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
     26        (webkitWebViewBaseConstructed):
     27
    1282015-03-02  Brady Eidson  <beidson@apple.com>
    229
  • trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/SQLiteIDBTransaction.h

    r163662 r180921  
    5757    WTF_MAKE_NONCOPYABLE(SQLiteIDBTransaction);
    5858public:
    59     static std::unique_ptr<SQLiteIDBTransaction> create(UniqueIDBDatabaseBackingStoreSQLite& backingStore, const IDBIdentifier& transactionIdentifier, WebCore::IndexedDB::TransactionMode mode)
    60     {
    61         return std::unique_ptr<SQLiteIDBTransaction>(new SQLiteIDBTransaction(backingStore, transactionIdentifier, mode));
    62     }
    63 
     59    SQLiteIDBTransaction(UniqueIDBDatabaseBackingStoreSQLite&, const IDBIdentifier& transactionIdentifier, WebCore::IndexedDB::TransactionMode);
    6460    ~SQLiteIDBTransaction();
    6561
     
    8278
    8379private:
    84     SQLiteIDBTransaction(UniqueIDBDatabaseBackingStoreSQLite&, const IDBIdentifier& transactionIdentifier, WebCore::IndexedDB::TransactionMode);
    85 
    8680    void clearCursors();
    8781
  • trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp

    r175378 r180921  
    451451    ASSERT(!RunLoop::isMain());
    452452
    453     if (!m_transactions.add(transactionIdentifier, SQLiteIDBTransaction::create(*this, transactionIdentifier, mode)).isNewEntry) {
     453    if (!m_transactions.add(transactionIdentifier, std::make_unique<SQLiteIDBTransaction>(*this, transactionIdentifier, mode)).isNewEntry) {
    454454        LOG_ERROR("Attempt to establish transaction identifier that already exists");
    455455        return false;
  • trunk/Source/WebKit2/Platform/efl/DispatchQueueWorkItemEfl.h

    r180433 r180921  
    3535class WorkItem {
    3636public:
    37     static std::unique_ptr<WorkItem> create(PassRefPtr<WorkQueue> workQueue, std::function<void ()> function)
    38     {
    39         return std::unique_ptr<WorkItem>(new WorkItem(workQueue, WTF::move(function)));
    40     }
    41     void dispatch() { m_function(); }
    42 
    43 protected:
    4437    WorkItem(PassRefPtr<WorkQueue> workQueue, std::function<void ()> function)
    4538        : m_workQueue(workQueue)
     
    4740    {
    4841    }
     42
     43    void dispatch() { m_function(); }
    4944
    5045private:
  • trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h

    r177440 r180921  
    5050{
    5151public:
    52     static std::unique_ptr<PageClientImpl> create(GtkWidget* viewWidget)
    53     {
    54         return std::unique_ptr<PageClientImpl>(new PageClientImpl(viewWidget));
    55     }
     52    explicit PageClientImpl(GtkWidget*);
    5653
    5754    GtkWidget* viewWidget() { return m_viewWidget; }
    5855
    5956private:
    60     explicit PageClientImpl(GtkWidget*);
    61 
    6257    // PageClient
    6358    virtual std::unique_ptr<DrawingAreaProxy> createDrawingAreaProxy() override;
  • trunk/Source/WebKit2/UIProcess/API/gtk/WebKitTextChecker.h

    r175070 r180921  
    3333
    3434public:
    35     static std::unique_ptr<WebKitTextChecker> create()
    36     {
    37         return std::unique_ptr<WebKitTextChecker>(new WebKitTextChecker);
    38     }
     35    WebKitTextChecker();
    3936    ~WebKitTextChecker();
    4037
     
    5249
    5350private:
    54     WebKitTextChecker();
    55 
    5651    std::unique_ptr<WebCore::TextCheckerEnchant> m_textChecker;
    5752    GRefPtr<GPtrArray> m_spellCheckingLanguages;
  • trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp

    r178685 r180921  
    290290#endif
    291291#if ENABLE(SPELLCHECK)
    292     priv->textChecker = WebKitTextChecker::create();
     292    priv->textChecker = std::make_unique<WebKitTextChecker>();
    293293#endif
    294294}
  • trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp

    r179705 r180921  
    502502
    503503    WebKitWebViewBasePrivate* priv = WEBKIT_WEB_VIEW_BASE(object)->priv;
    504     priv->pageClient = PageClientImpl::create(viewWidget);
     504    priv->pageClient = std::make_unique<PageClientImpl>(viewWidget);
    505505    priv->authenticationDialog = 0;
    506506}
Note: See TracChangeset for help on using the changeset viewer.