[EFL][WK2] Convert some more OwnPtr/PassOwnPtr to std::unique_ptr
authorryuan.choi@samsung.com <ryuan.choi@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Mar 2014 09:21:24 +0000 (09:21 +0000)
committerryuan.choi@samsung.com <ryuan.choi@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Mar 2014 09:21:24 +0000 (09:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=130662

Reviewed by Gyuyoung Kim.

Replace uses of PassOwnPtr/OwnPtr with std::unique_ptr in remained WebKit2/Efl specific code.

* UIProcess/API/efl/EwkView.h:
* UIProcess/API/efl/ewk_cookie_manager.cpp:
* UIProcess/API/efl/ewk_database_manager.cpp:
(getDatabaseOriginsCallback):
* UIProcess/API/efl/ewk_error_private.h:
* UIProcess/efl/DownloadManagerEfl.cpp:
(WebKit::DownloadManagerEfl::didFail):
* UIProcess/efl/InputMethodContextEfl.h:
(WebKit::InputMethodContextEfl::create):
* UIProcess/efl/PageLoadClientEfl.cpp:
(WebKit::PageLoadClientEfl::didFailLoadWithErrorForFrame):
(WebKit::PageLoadClientEfl::didFailProvisionalLoadWithErrorForFrame):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166155 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/efl/EwkView.h
Source/WebKit2/UIProcess/API/efl/ewk_cookie_manager.cpp
Source/WebKit2/UIProcess/API/efl/ewk_database_manager.cpp
Source/WebKit2/UIProcess/API/efl/ewk_error_private.h
Source/WebKit2/UIProcess/efl/DownloadManagerEfl.cpp
Source/WebKit2/UIProcess/efl/InputMethodContextEfl.h
Source/WebKit2/UIProcess/efl/PageLoadClientEfl.cpp

index 845ca4b..c5ce357 100644 (file)
@@ -1,3 +1,25 @@
+2014-03-24  Ryuan Choi  <ryuan.choi@samsung.com>
+
+        [EFL][WK2] Convert some more OwnPtr/PassOwnPtr to std::unique_ptr
+        https://bugs.webkit.org/show_bug.cgi?id=130662
+
+        Reviewed by Gyuyoung Kim.
+
+        Replace uses of PassOwnPtr/OwnPtr with std::unique_ptr in remained WebKit2/Efl specific code.
+
+        * UIProcess/API/efl/EwkView.h:
+        * UIProcess/API/efl/ewk_cookie_manager.cpp:
+        * UIProcess/API/efl/ewk_database_manager.cpp:
+        (getDatabaseOriginsCallback):
+        * UIProcess/API/efl/ewk_error_private.h:
+        * UIProcess/efl/DownloadManagerEfl.cpp:
+        (WebKit::DownloadManagerEfl::didFail):
+        * UIProcess/efl/InputMethodContextEfl.h:
+        (WebKit::InputMethodContextEfl::create):
+        * UIProcess/efl/PageLoadClientEfl.cpp:
+        (WebKit::PageLoadClientEfl::didFailLoadWithErrorForFrame):
+        (WebKit::PageLoadClientEfl::didFailProvisionalLoadWithErrorForFrame):
+
 2014-03-23  Hyowon Kim  <hw1008.kim@samsung.com>
 
         Move all EFL typedefs into EflTypedefs.h.
index 7743357..0289eee 100644 (file)
@@ -43,7 +43,6 @@
 #include <WebCore/Timer.h>
 #include <WebKit2/WKBase.h>
 #include <wtf/HashMap.h>
-#include <wtf/OwnPtr.h>
 #include <wtf/RefPtr.h>
 #include <wtf/text/WTFString.h>
 
@@ -290,7 +289,7 @@ private:
     WebCore::Timer<EwkView> m_displayTimer;
     RefPtr<EwkContextMenu> m_contextMenu;
     std::unique_ptr<EwkPopupMenu> m_popupMenu;
-    OwnPtr<WebKit::InputMethodContextEfl> m_inputMethodContext;
+    std::unique_ptr<WebKit::InputMethodContextEfl> m_inputMethodContext;
 #if ENABLE(INPUT_TYPE_COLOR)
     std::unique_ptr<EwkColorPicker> m_colorPicker;
 #endif
index 81c4b5f..c439718 100644 (file)
@@ -34,7 +34,6 @@
 #include "ewk_cookie_manager_private.h"
 #include "ewk_private.h"
 #include <wtf/Assertions.h>
-#include <wtf/OwnPtr.h>
 
 using namespace WebKit;
 
index f5fc14b..4fdbe65 100644 (file)
@@ -76,7 +76,7 @@ struct EwkDatabaseOriginsAsyncData {
 
 static void getDatabaseOriginsCallback(WKArrayRef origins, WKErrorRef, void* context)
 {
-    OwnPtr<EwkDatabaseOriginsAsyncData> webDatabaseContext = adoptPtr(static_cast<EwkDatabaseOriginsAsyncData*>(context));
+    auto webDatabaseContext = std::unique_ptr<EwkDatabaseOriginsAsyncData>(static_cast<EwkDatabaseOriginsAsyncData*>(context));
     Eina_List* originList = webDatabaseContext->manager->createOriginList(origins);
     webDatabaseContext->callback(originList, webDatabaseContext->userData);
 }
index 54682f0..37ed869 100644 (file)
 #include "WKEinaSharedString.h"
 #include <WKRetainPtr.h>
 #include <WebKit2/WKBase.h>
-#include <wtf/PassOwnPtr.h>
 
 class EwkError {
 public:
-    static PassOwnPtr<EwkError> create(WKErrorRef errorRef)
-    {
-        if (!errorRef)
-            return nullptr;
-
-        return adoptPtr(new EwkError(errorRef));
-    }
+    explicit EwkError(WKErrorRef errorRef);
 
     const char* url() const;
     const char* description() const;
@@ -48,8 +41,6 @@ public:
     bool isCancellation() const;
 
 private:
-    explicit EwkError(WKErrorRef errorRef);
-
     WKRetainPtr<WKErrorRef> m_wkError;
     WKEinaSharedString m_url;
     WKEinaSharedString m_description;
index 3ee05cb..97ec11e 100644 (file)
@@ -88,7 +88,7 @@ void DownloadManagerEfl::didFail(WKContextRef, WKDownloadRef wkDownload, WKError
     EwkDownloadJob* download = downloadManager->ewkDownloadJob(wkDownload);
     ASSERT(download);
 
-    OwnPtr<EwkError> ewkError = EwkError::create(error);
+    auto ewkError = std::make_unique<EwkError>(error);
     download->setState(EWK_DOWNLOAD_JOB_STATE_FAILED);
     Ewk_Download_Job_Error downloadError = { download, ewkError.get() };
     download->view()->smartCallback<DownloadJobFailed>().call(&downloadError);
index 75f0b6d..03dbf78 100644 (file)
 
 #include <Ecore_IMF.h>
 #include <Evas.h>
-#include <wtf/OwnPtr.h>
-#include <wtf/PassOwnPtr.h>
 #include <wtf/efl/UniquePtrEfl.h>
 
 class EwkView;
 
 namespace WebKit {
 
-class WebPageProxy;
-
 class InputMethodContextEfl {
 public:
-    static PassOwnPtr<InputMethodContextEfl> create(EwkView* viewImpl, Evas* canvas)
+    static std::unique_ptr<InputMethodContextEfl> create(EwkView* viewImpl, Evas* canvas)
     {
         EflUniquePtr<Ecore_IMF_Context> context = createIMFContext(canvas);
         if (!context)
             return nullptr;
 
-        return adoptPtr(new InputMethodContextEfl(viewImpl, std::move(context)));
+        return std::make_unique<InputMethodContextEfl>(viewImpl, std::move(context));
     }
+    InputMethodContextEfl(EwkView*, EflUniquePtr<Ecore_IMF_Context>);
     ~InputMethodContextEfl();
 
     void handleMouseUpEvent(const Evas_Event_Mouse_Up* upEvent);
@@ -50,8 +47,6 @@ public:
     void updateTextInputState();
 
 private:
-    InputMethodContextEfl(EwkView*, EflUniquePtr<Ecore_IMF_Context>);
-
     static EflUniquePtr<Ecore_IMF_Context> createIMFContext(Evas* canvas);
     static void onIMFInputSequenceComplete(void* data, Ecore_IMF_Context*, void* eventInfo);
     static void onIMFPreeditSequenceChanged(void* data, Ecore_IMF_Context*, void* eventInfo);
index 3dbd8fc..5537e4c 100644 (file)
@@ -76,7 +76,7 @@ void PageLoadClientEfl::didFailLoadWithErrorForFrame(WKPageRef, WKFrameRef frame
         return;
 
     EwkView* view = toPageLoadClientEfl(clientInfo)->view();
-    OwnPtr<EwkError> ewkError = EwkError::create(error);
+    auto ewkError = std::make_unique<EwkError>(error);
     view->smartCallback<LoadError>().call(ewkError.get());
     view->smartCallback<LoadFinished>().call();
 }
@@ -107,7 +107,7 @@ void PageLoadClientEfl::didFailProvisionalLoadWithErrorForFrame(WKPageRef, WKFra
         return;
 
     EwkView* view = toPageLoadClientEfl(clientInfo)->view();
-    OwnPtr<EwkError> ewkError = EwkError::create(error);
+    auto ewkError = std::make_unique<EwkError>(error);
     view->smartCallback<ProvisionalLoadFailed>().call(ewkError.get());
 }