Title: [133587] trunk/Source/WebKit2
Revision
133587
Author
commit-qu...@webkit.org
Date
2012-11-06 04:35:19 -0800 (Tue, 06 Nov 2012)

Log Message

[EFL][WK2] Make Ewk_Context Ewk_Object
https://bugs.webkit.org/show_bug.cgi?id=101322

Patch by Mikhail Pozdnyakov <mikhail.pozdnya...@intel.com> on 2012-11-06
Reviewed by Kenneth Rohde Christiansen.

Ewk_Context is Ewk_Object now and using common ref/unref API.

* UIProcess/API/efl/EwkViewImpl.cpp:
(EwkViewImpl::EwkViewImpl):
* UIProcess/API/efl/EwkViewImpl.h:
(EwkViewImpl::ewkContext):
(EwkViewImpl):
* UIProcess/API/efl/ewk_context.cpp:
(EwkContext::EwkContext):
(EwkContext::~EwkContext):
(EwkContext::create):
(EwkContext::defaultContext):
(EwkContext::cookieManager):
(EwkContext::ensureFaviconDatabase):
(EwkContext::setFaviconDatabaseDirectoryPath):
(EwkContext::faviconDatabase):
(EwkContext::storageManager):
(EwkContext::requestManager):
(EwkContext::vibrationProvider):
(EwkContext::addVisitedLink):
(EwkContext::setCacheModel):
(EwkContext::cacheModel):
(ewk_context_cookie_manager_get):
(ewk_context_favicon_database_directory_set):
(ewk_context_favicon_database_get):
(ewk_context_storage_manager_get):
(EwkContext::wkContext):
(EwkContext::downloadManager):
(EwkContext::historyClient):
(ewk_context_default_get):
(ewk_context_new):
(ewk_context_new_with_injected_bundle_path):
(ewk_context_url_scheme_register):
(ewk_context_vibration_client_callbacks_set):
(ewk_context_history_callbacks_set):
(ewk_context_visited_link_add):
(ewk_context_cache_model_set):
(ewk_context_cache_model_get):
* UIProcess/API/efl/ewk_context.h:
* UIProcess/API/efl/ewk_context_private.h:
(EwkContext):
* UIProcess/API/efl/ewk_view.cpp:
(createEwkView):
(ewk_view_base_add):
(ewk_view_smart_add):
(ewk_view_add_with_context):
* UIProcess/API/efl/tests/test_ewk2_context.cpp:
(TEST_F):
* UIProcess/efl/DownloadManagerEfl.cpp:
(WebKit::DownloadManagerEfl::DownloadManagerEfl):
* UIProcess/efl/DownloadManagerEfl.h:
(WebKit::DownloadManagerEfl::create):
(DownloadManagerEfl):
* UIProcess/efl/PageClientBase.cpp:
(WebKit::PageClientBase::handleDownloadRequest):
* UIProcess/efl/RequestManagerClientEfl.cpp:
(WebKit::RequestManagerClientEfl::RequestManagerClientEfl):
* UIProcess/efl/RequestManagerClientEfl.h:
(WebKit::RequestManagerClientEfl::create):
(RequestManagerClientEfl):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (133586 => 133587)


--- trunk/Source/WebKit2/ChangeLog	2012-11-06 12:33:50 UTC (rev 133586)
+++ trunk/Source/WebKit2/ChangeLog	2012-11-06 12:35:19 UTC (rev 133587)
@@ -1,3 +1,71 @@
+2012-11-06  Mikhail Pozdnyakov  <mikhail.pozdnya...@intel.com>
+
+        [EFL][WK2] Make Ewk_Context Ewk_Object
+        https://bugs.webkit.org/show_bug.cgi?id=101322
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Ewk_Context is Ewk_Object now and using common ref/unref API.
+
+        * UIProcess/API/efl/EwkViewImpl.cpp:
+        (EwkViewImpl::EwkViewImpl):
+        * UIProcess/API/efl/EwkViewImpl.h:
+        (EwkViewImpl::ewkContext):
+        (EwkViewImpl):
+        * UIProcess/API/efl/ewk_context.cpp:
+        (EwkContext::EwkContext):
+        (EwkContext::~EwkContext):
+        (EwkContext::create):
+        (EwkContext::defaultContext):
+        (EwkContext::cookieManager):
+        (EwkContext::ensureFaviconDatabase):
+        (EwkContext::setFaviconDatabaseDirectoryPath):
+        (EwkContext::faviconDatabase):
+        (EwkContext::storageManager):
+        (EwkContext::requestManager):
+        (EwkContext::vibrationProvider):
+        (EwkContext::addVisitedLink):
+        (EwkContext::setCacheModel):
+        (EwkContext::cacheModel):
+        (ewk_context_cookie_manager_get):
+        (ewk_context_favicon_database_directory_set):
+        (ewk_context_favicon_database_get):
+        (ewk_context_storage_manager_get):
+        (EwkContext::wkContext):
+        (EwkContext::downloadManager):
+        (EwkContext::historyClient):
+        (ewk_context_default_get):
+        (ewk_context_new):
+        (ewk_context_new_with_injected_bundle_path):
+        (ewk_context_url_scheme_register):
+        (ewk_context_vibration_client_callbacks_set):
+        (ewk_context_history_callbacks_set):
+        (ewk_context_visited_link_add):
+        (ewk_context_cache_model_set):
+        (ewk_context_cache_model_get):
+        * UIProcess/API/efl/ewk_context.h:
+        * UIProcess/API/efl/ewk_context_private.h:
+        (EwkContext):
+        * UIProcess/API/efl/ewk_view.cpp:
+        (createEwkView):
+        (ewk_view_base_add):
+        (ewk_view_smart_add):
+        (ewk_view_add_with_context):
+        * UIProcess/API/efl/tests/test_ewk2_context.cpp:
+        (TEST_F):
+        * UIProcess/efl/DownloadManagerEfl.cpp:
+        (WebKit::DownloadManagerEfl::DownloadManagerEfl):
+        * UIProcess/efl/DownloadManagerEfl.h:
+        (WebKit::DownloadManagerEfl::create):
+        (DownloadManagerEfl):
+        * UIProcess/efl/PageClientBase.cpp:
+        (WebKit::PageClientBase::handleDownloadRequest):
+        * UIProcess/efl/RequestManagerClientEfl.cpp:
+        (WebKit::RequestManagerClientEfl::RequestManagerClientEfl):
+        * UIProcess/efl/RequestManagerClientEfl.h:
+        (WebKit::RequestManagerClientEfl::create):
+        (RequestManagerClientEfl):
+
 2012-11-06  Balazs Kelemen  <kbal...@webkit.org>
 
         [CoordinatedGraphics] compositing/iframes/connect-compositing-iframe.html crashes

Modified: trunk/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp (133586 => 133587)


--- trunk/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp	2012-11-06 12:33:50 UTC (rev 133586)
+++ trunk/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp	2012-11-06 12:35:19 UTC (rev 133587)
@@ -96,7 +96,7 @@
     return pageViewMap().get(page);
 }
 
-EwkViewImpl::EwkViewImpl(Evas_Object* view, PassRefPtr<Ewk_Context> context, PassRefPtr<WebPageGroup> pageGroup, ViewBehavior behavior)
+EwkViewImpl::EwkViewImpl(Evas_Object* view, PassRefPtr<EwkContext> context, PassRefPtr<WebPageGroup> pageGroup, ViewBehavior behavior)
     : m_view(view)
     , m_context(context)
     , m_pageClient(behavior == DefaultBehavior ? PageClientDefaultImpl::create(this) : PageClientLegacyImpl::create(this))

Modified: trunk/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.h (133586 => 133587)


--- trunk/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.h	2012-11-06 12:33:50 UTC (rev 133586)
+++ trunk/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.h	2012-11-06 12:35:19 UTC (rev 133587)
@@ -66,9 +66,10 @@
 class IntSize;
 }
 
+class EwkContext;
+
 class Ewk_Back_Forward_List;
 class Ewk_Color_Picker;
-class Ewk_Context;
 class Ewk_Download_Job;
 class Ewk_Error;
 class Ewk_Form_Submission_Request;
@@ -93,7 +94,7 @@
         LegacyBehavior,
         DefaultBehavior
     };
-    EwkViewImpl(Evas_Object* view, PassRefPtr<Ewk_Context> context, PassRefPtr<WebKit::WebPageGroup> pageGroup, ViewBehavior);
+    EwkViewImpl(Evas_Object* view, PassRefPtr<EwkContext> context, PassRefPtr<WebKit::WebPageGroup> pageGroup, ViewBehavior);
     ~EwkViewImpl();
 
     static EwkViewImpl* fromEvasObject(const Evas_Object* view);
@@ -101,7 +102,7 @@
     Evas_Object* view() { return m_view; }
     WKPageRef wkPage();
     WebKit::WebPageProxy* page() { return m_pageProxy.get(); }
-    Ewk_Context* ewkContext() { return m_context.get(); }
+    EwkContext* ewkContext() { return m_context.get(); }
     Ewk_Settings* settings() { return m_settings.get(); }
     Ewk_Back_Forward_List* backForwardList() { return m_backForwardList.get(); }
 
@@ -217,7 +218,7 @@
 
     // Note, initialization matters.
     Evas_Object* m_view;
-    RefPtr<Ewk_Context> m_context;
+    RefPtr<EwkContext> m_context;
 #if USE(ACCELERATED_COMPOSITING)
     OwnPtr<Evas_GL> m_evasGL;
     OwnPtr<WebKit::EvasGLContext> m_evasGLContext;

Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp (133586 => 133587)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp	2012-11-06 12:33:50 UTC (rev 133586)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp	2012-11-06 12:35:19 UTC (rev 133587)
@@ -53,7 +53,7 @@
 using namespace WebCore;
 using namespace WebKit;
 
-typedef HashMap<WKContextRef, Ewk_Context*> ContextMap;
+typedef HashMap<WKContextRef, EwkContext*> ContextMap;
 
 static inline ContextMap& contextMap()
 {
@@ -61,7 +61,7 @@
     return map;
 }
 
-Ewk_Context::Ewk_Context(WKContextRef context)
+EwkContext::EwkContext(WKContextRef context)
     : m_context(context)
     , m_storageManager(Ewk_Storage_Manager::create(WKContextGetKeyValueStorageManager(m_context.get())))
 #if ENABLE(BATTERY_STATUS)
@@ -100,26 +100,26 @@
 #endif
 }
 
-Ewk_Context::~Ewk_Context()
+EwkContext::~EwkContext()
 {
     ASSERT(contextMap().get(m_context.get()) == this);
     contextMap().remove(m_context.get());
 }
 
-PassRefPtr<Ewk_Context> Ewk_Context::create(WKContextRef context)
+PassRefPtr<EwkContext> EwkContext::create(WKContextRef context)
 {
     if (contextMap().contains(context))
         return contextMap().get(context); // Will be ref-ed automatically.
 
-    return adoptRef(new Ewk_Context(context));
+    return adoptRef(new EwkContext(context));
 }
 
-PassRefPtr<Ewk_Context> Ewk_Context::create()
+PassRefPtr<EwkContext> EwkContext::create()
 {
     return create(adoptWK(WKContextCreate()).get());
 }
 
-PassRefPtr<Ewk_Context> Ewk_Context::create(const String& injectedBundlePath)
+PassRefPtr<EwkContext> EwkContext::create(const String& injectedBundlePath)
 {   
     if (!fileExists(injectedBundlePath))
         return 0;
@@ -130,14 +130,14 @@
     return create(contextWK.get());
 }
 
-PassRefPtr<Ewk_Context> Ewk_Context::defaultContext()
+PassRefPtr<EwkContext> EwkContext::defaultContext()
 {
-    static RefPtr<Ewk_Context> defaultInstance = create(adoptWK(WKContextCreate()).get());
+    static RefPtr<EwkContext> defaultInstance = create(adoptWK(WKContextCreate()).get());
 
     return defaultInstance;
 }
 
-Ewk_Cookie_Manager* Ewk_Context::cookieManager()
+Ewk_Cookie_Manager* EwkContext::cookieManager()
 {
     if (!m_cookieManager)
         m_cookieManager = Ewk_Cookie_Manager::create(WKContextGetCookieManager(m_context.get()));
@@ -145,7 +145,7 @@
     return m_cookieManager.get();
 }
 
-void Ewk_Context::ensureFaviconDatabase()
+void EwkContext::ensureFaviconDatabase()
 {
     if (m_faviconDatabase)
         return;
@@ -153,7 +153,7 @@
     m_faviconDatabase = Ewk_Favicon_Database::create(toImpl(m_context.get())->iconDatabase());
 }
 
-bool Ewk_Context::setFaviconDatabaseDirectoryPath(const String& databaseDirectory)
+bool EwkContext::setFaviconDatabaseDirectoryPath(const String& databaseDirectory)
 {
     ensureFaviconDatabase();
 
@@ -171,7 +171,7 @@
     return true;
 }
 
-Ewk_Favicon_Database* Ewk_Context::faviconDatabase()
+Ewk_Favicon_Database* EwkContext::faviconDatabase()
 {
     ensureFaviconDatabase();
     ASSERT(m_faviconDatabase);
@@ -179,147 +179,131 @@
     return m_faviconDatabase.get();
 }
 
-Ewk_Storage_Manager* Ewk_Context::storageManager() const
+Ewk_Storage_Manager* EwkContext::storageManager() const
 {
     return m_storageManager.get();
 }
 
-RequestManagerClientEfl* Ewk_Context::requestManager()
+RequestManagerClientEfl* EwkContext::requestManager()
 {
     return m_requestManagerClient.get();
 }
 
 #if ENABLE(VIBRATION)
-PassRefPtr<VibrationProvider> Ewk_Context::vibrationProvider()
+PassRefPtr<VibrationProvider> EwkContext::vibrationProvider()
 {
     return m_vibrationProvider;
 }
 #endif
 
-void Ewk_Context::addVisitedLink(const String& visitedURL)
+void EwkContext::addVisitedLink(const String& visitedURL)
 {
     toImpl(m_context.get())->addVisitedLink(visitedURL);
 }
 
-void Ewk_Context::setCacheModel(Ewk_Cache_Model cacheModel)
+void EwkContext::setCacheModel(Ewk_Cache_Model cacheModel)
 {
     WKContextSetCacheModel(m_context.get(), static_cast<Ewk_Cache_Model>(cacheModel));
 }
 
-Ewk_Cache_Model Ewk_Context::cacheModel() const
+Ewk_Cache_Model EwkContext::cacheModel() const
 {
     return static_cast<Ewk_Cache_Model>(WKContextGetCacheModel(m_context.get()));
 }
 
-Ewk_Context* ewk_context_ref(Ewk_Context* ewkContext)
-{
-    EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, 0);
-
-    ewkContext->ref();
-
-    return ewkContext;
-}
-
-void ewk_context_unref(Ewk_Context* ewkContext)
-{
-    EINA_SAFETY_ON_NULL_RETURN(ewkContext);
-
-    ewkContext->deref();
-}
-
 Ewk_Cookie_Manager* ewk_context_cookie_manager_get(const Ewk_Context* ewkContext)
 {
-    EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, 0);
+    EWK_OBJ_GET_IMPL_OR_RETURN(const EwkContext, ewkContext, impl, 0);
 
-    return const_cast<Ewk_Context*>(ewkContext)->cookieManager();
+    return const_cast<EwkContext*>(impl)->cookieManager();
 }
 
 Eina_Bool ewk_context_favicon_database_directory_set(Ewk_Context* ewkContext, const char* directoryPath)
 {
-    EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
+    EWK_OBJ_GET_IMPL_OR_RETURN(EwkContext, ewkContext, impl, false);
 
-    return ewkContext->setFaviconDatabaseDirectoryPath(String::fromUTF8(directoryPath));
+    return impl->setFaviconDatabaseDirectoryPath(String::fromUTF8(directoryPath));
 }
 
 Ewk_Favicon_Database* ewk_context_favicon_database_get(const Ewk_Context* ewkContext)
 {
-    EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, 0);
+    EWK_OBJ_GET_IMPL_OR_RETURN(const EwkContext, ewkContext, impl, 0);
 
-    return const_cast<Ewk_Context*>(ewkContext)->faviconDatabase();
+    return const_cast<EwkContext*>(impl)->faviconDatabase();
 }
 
 Ewk_Storage_Manager* ewk_context_storage_manager_get(const Ewk_Context* ewkContext)
 {
-    EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, 0);
+    EWK_OBJ_GET_IMPL_OR_RETURN(const EwkContext, ewkContext, impl, 0);
 
-    return ewkContext->storageManager();
+    return impl->storageManager();
 }
 
-WKContextRef Ewk_Context::wkContext()
+WKContextRef EwkContext::wkContext()
 {
     return m_context.get();
 }
 
-DownloadManagerEfl* Ewk_Context::downloadManager() const
+DownloadManagerEfl* EwkContext::downloadManager() const
 {
     return m_downloadManager.get();
 }
 
-ContextHistoryClientEfl* Ewk_Context::historyClient()
+ContextHistoryClientEfl* EwkContext::historyClient()
 {
     return m_historyClient.get();
 }
 
 Ewk_Context* ewk_context_default_get()
 {
-    return Ewk_Context::defaultContext().get();
+    return EwkContext::defaultContext().get();
 }
 
 Ewk_Context* ewk_context_new()
 {
-    return Ewk_Context::create().leakRef();
+    return EwkContext::create().leakRef();
 }
 
 Ewk_Context* ewk_context_new_with_injected_bundle_path(const char* path)
 {
     EINA_SAFETY_ON_NULL_RETURN_VAL(path, 0);
 
-    return Ewk_Context::create(String::fromUTF8(path)).leakRef();
+    return EwkContext::create(String::fromUTF8(path)).leakRef();
 }
 
 Eina_Bool ewk_context_url_scheme_register(Ewk_Context* ewkContext, const char* scheme, Ewk_Url_Scheme_Request_Cb callback, void* userData)
 {
-    EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
+    EWK_OBJ_GET_IMPL_OR_RETURN(EwkContext, ewkContext, impl, false);
     EINA_SAFETY_ON_NULL_RETURN_VAL(scheme, false);
     EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
 
-    ewkContext->requestManager()->registerURLSchemeHandler(String::fromUTF8(scheme), callback, userData);
+    impl->requestManager()->registerURLSchemeHandler(String::fromUTF8(scheme), callback, userData);
 
     return true;
 }
 
 void ewk_context_vibration_client_callbacks_set(Ewk_Context* ewkContext, Ewk_Vibration_Client_Vibrate_Cb vibrate, Ewk_Vibration_Client_Vibration_Cancel_Cb cancel, void* data)
 {
-    EINA_SAFETY_ON_NULL_RETURN(ewkContext);
+    EWK_OBJ_GET_IMPL_OR_RETURN(EwkContext, ewkContext, impl);
 
 #if ENABLE(VIBRATION)
-    ewkContext->vibrationProvider()->setVibrationClientCallbacks(vibrate, cancel, data);
+    impl->vibrationProvider()->setVibrationClientCallbacks(vibrate, cancel, data);
 #endif
 }
 
 void ewk_context_history_callbacks_set(Ewk_Context* ewkContext, Ewk_History_Navigation_Cb navigate, Ewk_History_Client_Redirection_Cb clientRedirect, Ewk_History_Server_Redirection_Cb serverRedirect, Ewk_History_Title_Update_Cb titleUpdate, Ewk_History_Populate_Visited_Links_Cb populateVisitedLinks, void* data)
 {
-    EINA_SAFETY_ON_NULL_RETURN(ewkContext);
+    EWK_OBJ_GET_IMPL_OR_RETURN(EwkContext, ewkContext, impl);
 
-    ewkContext->historyClient()->setCallbacks(navigate, clientRedirect, serverRedirect, titleUpdate, populateVisitedLinks, data);
+    impl->historyClient()->setCallbacks(navigate, clientRedirect, serverRedirect, titleUpdate, populateVisitedLinks, data);
 }
 
 void ewk_context_visited_link_add(Ewk_Context* ewkContext, const char* visitedURL)
 {
-    EINA_SAFETY_ON_NULL_RETURN(ewkContext);
+    EWK_OBJ_GET_IMPL_OR_RETURN(EwkContext, ewkContext, impl);
     EINA_SAFETY_ON_NULL_RETURN(visitedURL);
 
-    ewkContext->addVisitedLink(visitedURL);
+    impl->addVisitedLink(visitedURL);
 }
 
 // Ewk_Cache_Model enum validation
@@ -329,17 +313,17 @@
 
 Eina_Bool ewk_context_cache_model_set(Ewk_Context* ewkContext, Ewk_Cache_Model cacheModel)
 {
-    EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
+    EWK_OBJ_GET_IMPL_OR_RETURN(EwkContext, ewkContext, impl, false);
 
-    ewkContext->setCacheModel(cacheModel);
+    impl->setCacheModel(cacheModel);
 
     return true;
 }
 
 Ewk_Cache_Model ewk_context_cache_model_get(const Ewk_Context* ewkContext)
 {
-    EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, EWK_CACHE_MODEL_DOCUMENT_VIEWER);
+    EWK_OBJ_GET_IMPL_OR_RETURN(const EwkContext, ewkContext, impl, EWK_CACHE_MODEL_DOCUMENT_VIEWER);
 
-    return ewkContext->cacheModel();
+    return impl->cacheModel();
 }
 

Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_context.h (133586 => 133587)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_context.h	2012-11-06 12:33:50 UTC (rev 133586)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_context.h	2012-11-06 12:35:19 UTC (rev 133587)
@@ -48,8 +48,12 @@
 extern "C" {
 #endif
 
-/** Creates a type name for @a Ewk_Context. */
-typedef struct Ewk_Context Ewk_Context;
+/**
+ * Declare Ewk_Context as Ewk_Object.
+ *
+ * @see Ewk_Object
+ */
+typedef struct Ewk_Object Ewk_Context;
 
 /**
  * \enum    Ewk_Cache_Model
@@ -121,24 +125,6 @@
 typedef void (*Ewk_History_Populate_Visited_Links_Cb)(void *user_data);
 
 /**
- * Increases the reference count of the given object.
- *
- * @param context context object to increase the reference count
- *
- * @return Ewk_Context object on success or @c NULL on failure
- */
-EAPI Ewk_Context *ewk_context_ref(Ewk_Context *context);
-
-/**
- * Decreases the reference count of the given object, possibly freeing it.
- *
- * When the reference count it's reached 0, the Ewk_Context is freed.
- *
- * @param context context object to decrease the reference count
- */
-EAPI void ewk_context_unref(Ewk_Context *context);
-
-/**
  * Gets default Ewk_Context instance.
  *
  * The returned Ewk_Context object @b should not be unref'ed if application

Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_context_private.h (133586 => 133587)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_context_private.h	2012-11-06 12:33:50 UTC (rev 133586)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_context_private.h	2012-11-06 12:35:19 UTC (rev 133587)
@@ -24,6 +24,7 @@
 #include "WKAPICast.h"
 #include "WKRetainPtr.h"
 #include "ewk_context.h"
+#include "ewk_object_private.h"
 
 class Ewk_Url_Scheme_Request;
 class Ewk_Cookie_Manager;
@@ -43,16 +44,18 @@
 #endif
 }
 
-class Ewk_Context : public RefCounted<Ewk_Context> {
+class EwkContext : public Ewk_Object {
 public:
-    static PassRefPtr<Ewk_Context> create(WKContextRef context);
-    static PassRefPtr<Ewk_Context> create();
-    static PassRefPtr<Ewk_Context> create(const String& injectedBundlePath);
+    EWK_OBJECT_DECLARE(EwkContext)
 
-    static PassRefPtr<Ewk_Context> defaultContext();
+    static PassRefPtr<EwkContext> create(WKContextRef context);
+    static PassRefPtr<EwkContext> create();
+    static PassRefPtr<EwkContext> create(const String& injectedBundlePath);
 
-    ~Ewk_Context();
+    static PassRefPtr<EwkContext> defaultContext();
 
+    ~EwkContext();
+
     Ewk_Cookie_Manager* cookieManager();
 
     bool setFaviconDatabaseDirectoryPath(const String& databaseDirectory);
@@ -81,7 +84,7 @@
     WebKit::ContextHistoryClientEfl* historyClient();
 
 private:
-    explicit Ewk_Context(WKContextRef);
+    explicit EwkContext(WKContextRef);
 
     void ensureFaviconDatabase();
 

Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp (133586 => 133587)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp	2012-11-06 12:33:50 UTC (rev 133586)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp	2012-11-06 12:35:19 UTC (rev 133587)
@@ -494,7 +494,7 @@
     return smart;
 }
 
-static inline Evas_Object* createEwkView(Evas* canvas, Evas_Smart* smart, PassRefPtr<Ewk_Context> context, WKPageGroupRef pageGroupRef = 0, EwkViewImpl::ViewBehavior behavior = EwkViewImpl::DefaultBehavior)
+static inline Evas_Object* createEwkView(Evas* canvas, Evas_Smart* smart, PassRefPtr<EwkContext> context, WKPageGroupRef pageGroupRef = 0, EwkViewImpl::ViewBehavior behavior = EwkViewImpl::DefaultBehavior)
 {
     EINA_SAFETY_ON_NULL_RETURN_VAL(canvas, 0);
     EINA_SAFETY_ON_NULL_RETURN_VAL(smart, 0);
@@ -521,17 +521,17 @@
  */
 Evas_Object* ewk_view_base_add(Evas* canvas, WKContextRef contextRef, WKPageGroupRef pageGroupRef)
 {
-    return createEwkView(canvas, createEwkViewSmartClass(), Ewk_Context::create(contextRef), pageGroupRef, EwkViewImpl::LegacyBehavior);
+    return createEwkView(canvas, createEwkViewSmartClass(), EwkContext::create(contextRef), pageGroupRef, EwkViewImpl::LegacyBehavior);
 }
 
 Evas_Object* ewk_view_smart_add(Evas* canvas, Evas_Smart* smart, Ewk_Context* context)
 {
-    return createEwkView(canvas, smart, context);
+    return createEwkView(canvas, smart, ewk_object_cast<EwkContext*>(context));
 }
 
 Evas_Object* ewk_view_add_with_context(Evas* canvas, Ewk_Context* context)
 {
-    return ewk_view_smart_add(canvas, createEwkViewSmartClass(), context);
+    return ewk_view_smart_add(canvas, createEwkViewSmartClass(), ewk_object_cast<EwkContext*>(context));
 }
 
 Evas_Object* ewk_view_add(Evas* canvas)

Modified: trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp (133586 => 133587)


--- trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp	2012-11-06 12:33:50 UTC (rev 133586)
+++ trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp	2012-11-06 12:35:19 UTC (rev 133587)
@@ -187,21 +187,12 @@
 {
     Ewk_Context* context = ewk_context_new();
     ASSERT_TRUE(context);
-    ewk_context_unref(context);
+    ewk_object_unref(context);
 }
 
 TEST_F(EWK2UnitTestBase, ewk_context_new_with_injected_bundle_path)
 {
     Ewk_Context* context = ewk_context_new_with_injected_bundle_path(environment->injectedBundleSample());
     ASSERT_TRUE(context);
-    ewk_context_unref(context);
+    ewk_object_unref(context);
 }
-
-TEST_F(EWK2UnitTestBase, ewk_context_ref)
-{
-    Ewk_Context* context = ewk_context_new();
-    ASSERT_EQ(context, ewk_context_ref(context));
-    ewk_context_unref(context);
-    ewk_context_unref(context);
-}
-

Modified: trunk/Source/WebKit2/UIProcess/efl/DownloadManagerEfl.cpp (133586 => 133587)


--- trunk/Source/WebKit2/UIProcess/efl/DownloadManagerEfl.cpp	2012-11-06 12:33:50 UTC (rev 133586)
+++ trunk/Source/WebKit2/UIProcess/efl/DownloadManagerEfl.cpp	2012-11-06 12:35:19 UTC (rev 133587)
@@ -120,7 +120,7 @@
     downloadManager->unregisterDownloadJob(downloadId);
 }
 
-DownloadManagerEfl::DownloadManagerEfl(Ewk_Context* context)
+DownloadManagerEfl::DownloadManagerEfl(EwkContext* context)
     : m_context(context)
 {
     WKContextDownloadClient wkDownloadClient;

Modified: trunk/Source/WebKit2/UIProcess/efl/DownloadManagerEfl.h (133586 => 133587)


--- trunk/Source/WebKit2/UIProcess/efl/DownloadManagerEfl.h	2012-11-06 12:33:50 UTC (rev 133586)
+++ trunk/Source/WebKit2/UIProcess/efl/DownloadManagerEfl.h	2012-11-06 12:35:19 UTC (rev 133587)
@@ -31,14 +31,14 @@
 #include <wtf/PassOwnPtr.h>
 #include <wtf/RefPtr.h>
 
-class Ewk_Context;
+class EwkContext;
 class Ewk_Download_Job;
 
 namespace WebKit {
 
 class DownloadManagerEfl {
 public:
-    static PassOwnPtr<DownloadManagerEfl> create(Ewk_Context* context)
+    static PassOwnPtr<DownloadManagerEfl> create(EwkContext* context)
     {
         return adoptPtr(new DownloadManagerEfl(context));
     }
@@ -46,7 +46,7 @@
     void registerDownload(DownloadProxy*, EwkViewImpl*);
 
 private:
-    DownloadManagerEfl(Ewk_Context*);
+    DownloadManagerEfl(EwkContext*);
 
     Ewk_Download_Job* downloadJob(uint64_t id) const;
     void unregisterDownloadJob(uint64_t id);
@@ -59,7 +59,7 @@
     static void didCancel(WKContextRef, WKDownloadRef, const void* clientInfo);
     static void didFinish(WKContextRef, WKDownloadRef, const void* clientInfo);
 
-    Ewk_Context* m_context;
+    EwkContext* m_context;
     HashMap<uint64_t, RefPtr<Ewk_Download_Job> > m_downloadJobs;
 };
 

Modified: trunk/Source/WebKit2/UIProcess/efl/PageClientBase.cpp (133586 => 133587)


--- trunk/Source/WebKit2/UIProcess/efl/PageClientBase.cpp	2012-11-06 12:33:50 UTC (rev 133586)
+++ trunk/Source/WebKit2/UIProcess/efl/PageClientBase.cpp	2012-11-06 12:35:19 UTC (rev 133587)
@@ -309,7 +309,7 @@
 
 void PageClientBase::handleDownloadRequest(DownloadProxy* download)
 {
-    Ewk_Context* context = m_viewImpl->ewkContext();
+    EwkContext* context = m_viewImpl->ewkContext();
     context->downloadManager()->registerDownload(download, m_viewImpl);
 }
 

Modified: trunk/Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.cpp (133586 => 133587)


--- trunk/Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.cpp	2012-11-06 12:33:50 UTC (rev 133586)
+++ trunk/Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.cpp	2012-11-06 12:35:19 UTC (rev 133587)
@@ -66,7 +66,7 @@
     handler.callback(schemeRequest.get(), handler.userData);
 }
 
-RequestManagerClientEfl::RequestManagerClientEfl(Ewk_Context* context)
+RequestManagerClientEfl::RequestManagerClientEfl(EwkContext* context)
     : m_soupRequestManager(WKContextGetSoupRequestManager(context->wkContext()))
 {
     ASSERT(context);

Modified: trunk/Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.h (133586 => 133587)


--- trunk/Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.h	2012-11-06 12:33:50 UTC (rev 133586)
+++ trunk/Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.h	2012-11-06 12:35:19 UTC (rev 133587)
@@ -27,7 +27,7 @@
 #define RequestManagerClientEfl_h
 
 #include "WKRetainPtr.h"
-#include "ewk_context.h"
+#include "ewk_context_private.h"
 #include <WebKit2/WKBase.h>
 #include <wtf/HashMap.h>
 #include <wtf/PassOwnPtr.h>
@@ -38,7 +38,7 @@
 class RequestManagerClientEfl {
 public:
     ~RequestManagerClientEfl();
-    static PassOwnPtr<RequestManagerClientEfl> create(Ewk_Context* context)
+    static PassOwnPtr<RequestManagerClientEfl> create(EwkContext* context)
     {
         return adoptPtr(new RequestManagerClientEfl(context));
     }
@@ -46,7 +46,7 @@
     void registerURLSchemeHandler(const String& scheme, Ewk_Url_Scheme_Request_Cb callback, void* userData);
 
 private:
-    explicit RequestManagerClientEfl(Ewk_Context*);
+    explicit RequestManagerClientEfl(EwkContext*);
 
     static void didReceiveURIRequest(WKSoupRequestManagerRef, WKURLRef, WKPageRef, uint64_t requestID, const void* clientInfo);
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to