Diff
Modified: trunk/Source/WebKit/gtk/ChangeLog (165252 => 165253)
--- trunk/Source/WebKit/gtk/ChangeLog 2014-03-07 07:20:51 UTC (rev 165252)
+++ trunk/Source/WebKit/gtk/ChangeLog 2014-03-07 10:00:48 UTC (rev 165253)
@@ -1,3 +1,22 @@
+2014-03-07 Zan Dobersek <[email protected]>
+
+ Move GTK WebKit1 code to std::unique_ptr
+ https://bugs.webkit.org/show_bug.cgi?id=129675
+
+ Reviewed by Anders Carlsson.
+
+ Replace uses of OwnPtr and PassOwnPtr in GTK-specific WebKit1 code with std::unique_ptr.
+
+ * WebCoreSupport/AcceleratedCompositingContext.h:
+ * WebCoreSupport/NavigatorContentUtilsClientGtk.cpp:
+ * WebCoreSupport/NavigatorContentUtilsClientGtk.h:
+ * webkit/webkitfavicondatabase.cpp:
+ (getIconPixbufCancelled):
+ (webkit_favicon_database_get_favicon_pixbuf):
+ * webkit/webkitwebview.cpp:
+ (webkit_web_view_init):
+ * webkit/webkitwebviewprivate.h:
+
2014-03-06 Joseph Pecoraro <[email protected]>
Web Inspector: Expose the console object in JSContexts to interact with Web Inspector
Modified: trunk/Source/WebKit/gtk/WebCoreSupport/AcceleratedCompositingContext.h (165252 => 165253)
--- trunk/Source/WebKit/gtk/WebCoreSupport/AcceleratedCompositingContext.h 2014-03-07 07:20:51 UTC (rev 165252)
+++ trunk/Source/WebKit/gtk/WebCoreSupport/AcceleratedCompositingContext.h 2014-03-07 10:00:48 UTC (rev 165253)
@@ -43,12 +43,9 @@
class AcceleratedCompositingContext : public WebCore::GraphicsLayerClient {
WTF_MAKE_NONCOPYABLE(AcceleratedCompositingContext);
public:
- static PassOwnPtr<AcceleratedCompositingContext> create(WebKitWebView* webView)
- {
- return adoptPtr(new AcceleratedCompositingContext(webView));
- }
-
+ explicit AcceleratedCompositingContext(WebKitWebView*);
virtual ~AcceleratedCompositingContext();
+
void setRootCompositingLayer(WebCore::GraphicsLayer*);
void setNonCompositedContentsNeedDisplay(const WebCore::IntRect&);
void scheduleLayerFlush();
@@ -94,8 +91,6 @@
std::unique_ptr<WebCore::GraphicsLayer> m_rootGraphicsLayer;
OwnPtr<WebCore::TextureMapper> m_textureMapper;
#endif
-
- AcceleratedCompositingContext(WebKitWebView*);
};
} // namespace WebKit
Modified: trunk/Source/WebKit/gtk/WebCoreSupport/NavigatorContentUtilsClientGtk.cpp (165252 => 165253)
--- trunk/Source/WebKit/gtk/WebCoreSupport/NavigatorContentUtilsClientGtk.cpp 2014-03-07 07:20:51 UTC (rev 165252)
+++ trunk/Source/WebKit/gtk/WebCoreSupport/NavigatorContentUtilsClientGtk.cpp 2014-03-07 10:00:48 UTC (rev 165253)
@@ -26,15 +26,6 @@
namespace WebKit {
-PassOwnPtr<NavigatorContentUtilsClient> NavigatorContentUtilsClient::create()
-{
- return adoptPtr(new NavigatorContentUtilsClient);
-}
-
-NavigatorContentUtilsClient::NavigatorContentUtilsClient()
-{
-}
-
void NavigatorContentUtilsClient::registerProtocolHandler(const String& scheme, const URL& baseURL, const URL& url, const String& title)
{
notImplemented();
Modified: trunk/Source/WebKit/gtk/WebCoreSupport/NavigatorContentUtilsClientGtk.h (165252 => 165253)
--- trunk/Source/WebKit/gtk/WebCoreSupport/NavigatorContentUtilsClientGtk.h 2014-03-07 07:20:51 UTC (rev 165252)
+++ trunk/Source/WebKit/gtk/WebCoreSupport/NavigatorContentUtilsClientGtk.h 2014-03-07 10:00:48 UTC (rev 165253)
@@ -28,14 +28,7 @@
class NavigatorContentUtilsClient : public WebCore::NavigatorContentUtilsClient {
public:
- static PassOwnPtr<NavigatorContentUtilsClient> create();
-
- ~NavigatorContentUtilsClient() { }
-
virtual void registerProtocolHandler(const String& scheme, const URL& baseURL, const URL&, const String& title);
-
-private:
- NavigatorContentUtilsClient();
};
}
Modified: trunk/Source/WebKit/gtk/webkit/webkitfavicondatabase.cpp (165252 => 165253)
--- trunk/Source/WebKit/gtk/webkit/webkitfavicondatabase.cpp 2014-03-07 07:20:51 UTC (rev 165252)
+++ trunk/Source/WebKit/gtk/webkit/webkitfavicondatabase.cpp 2014-03-07 10:00:48 UTC (rev 165253)
@@ -184,7 +184,7 @@
G_DEFINE_TYPE(WebKitFaviconDatabase, webkit_favicon_database, G_TYPE_OBJECT)
-typedef Vector<OwnPtr<PendingIconRequest> > PendingIconRequestVector;
+typedef Vector<std::unique_ptr<PendingIconRequest>> PendingIconRequestVector;
typedef HashMap<String, PendingIconRequestVector*> PendingIconRequestMap;
struct _WebKitFaviconDatabasePrivate {
@@ -470,9 +470,16 @@
if (!icons)
return;
- size_t itemIndex = icons->find(request);
- if (itemIndex != notFound)
- icons->remove(itemIndex);
+ size_t itemIndex = 0;
+ for (auto& item : *icons) {
+ if (item.get() == request) {
+ icons->remove(itemIndex);
+ break;
+ }
+
+ itemIndex++;
+ }
+
if (icons->isEmpty())
webkitfavicondatabaseDeleteRequests(database, icons, pageURL);
}
@@ -536,7 +543,7 @@
// Register icon request before asking for the icon to avoid race conditions.
PendingIconRequestVector* icons = webkitFaviconDatabaseGetOrCreateRequests(database, pageURL);
ASSERT(icons);
- icons->append(adoptPtr(request));
+ icons->append(std::unique_ptr<PendingIconRequest>(request));
// We ask for the icon directly. If we don't get the icon data now,
// we'll be notified later (even if the database is still importing icons).
Modified: trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp (165252 => 165253)
--- trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp 2014-03-07 07:20:51 UTC (rev 165252)
+++ trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp 2014-03-07 10:00:48 UTC (rev 165253)
@@ -3853,7 +3853,7 @@
#if ENABLE(GEOLOCATION)
if (DumpRenderTreeSupportGtk::dumpRenderTreeModeEnabled()) {
- priv->geolocationClientMock = adoptPtr(new GeolocationClientMock);
+ priv->geolocationClientMock = std::make_unique<GeolocationClientMock>();
WebCore::provideGeolocationTo(priv->corePage, priv->geolocationClientMock.get());
priv->geolocationClientMock.get()->setController(GeolocationController::from(priv->corePage));
} else
@@ -3865,12 +3865,12 @@
#endif
#if ENABLE(MEDIA_STREAM)
- priv->userMediaClient = adoptPtr(new UserMediaClientGtk);
+ priv->userMediaClient = std::make_unique<UserMediaClientGtk>();
WebCore::provideUserMediaTo(priv->corePage, priv->userMediaClient.get());
#endif
#if ENABLE(NAVIGATOR_CONTENT_UTILS)
- priv->navigatorContentUtilsClient = WebKit::NavigatorContentUtilsClient::create();
+ priv->navigatorContentUtilsClient = std::make_unique<WebKit::NavigatorContentUtilsClient>();
WebCore::provideNavigatorContentUtilsTo(priv->corePage, priv->navigatorContentUtilsClient.get());
#endif
@@ -3925,7 +3925,7 @@
#endif
priv->selfScrolling = false;
- priv->acceleratedCompositingContext = AcceleratedCompositingContext::create(webView);
+ priv->acceleratedCompositingContext = std::make_unique<AcceleratedCompositingContext>(webView);
g_signal_connect(webView, "direction-changed", G_CALLBACK(webkitWebViewDirectionChanged), 0);
}
Modified: trunk/Source/WebKit/gtk/webkit/webkitwebviewprivate.h (165252 => 165253)
--- trunk/Source/WebKit/gtk/webkit/webkitwebviewprivate.h 2014-03-07 07:20:51 UTC (rev 165252)
+++ trunk/Source/WebKit/gtk/webkit/webkitwebviewprivate.h 2014-03-07 10:00:48 UTC (rev 165253)
@@ -32,6 +32,7 @@
#include "ResourceResponse.h"
#include "WebViewInputMethodFilter.h"
#include "WidgetBackingStore.h"
+#include <memory>
#include <webkit/webkitwebview.h>
#if ENABLE(MEDIA_STREAM)
@@ -102,22 +103,22 @@
bool selfScrolling;
GRefPtr<GtkTargetList> targetList;
- OwnPtr<WebKit::AcceleratedCompositingContext> acceleratedCompositingContext;
+ std::unique_ptr<WebKit::AcceleratedCompositingContext> acceleratedCompositingContext;
#if ENABLE(ICONDATABASE)
gulong iconLoadedHandler;
#endif
#if ENABLE(MEDIA_STREAM)
- OwnPtr<WebKit::UserMediaClientGtk> userMediaClient;
+ std::unique_ptr<WebKit::UserMediaClientGtk> userMediaClient;
#endif
#if ENABLE(GEOLOCATION)
- OwnPtr<WebCore::GeolocationClientMock> geolocationClientMock;
+ std::unique_ptr<WebCore::GeolocationClientMock> geolocationClientMock;
#endif
#if ENABLE(NAVIGATOR_CONTENT_UTILS)
- OwnPtr<WebKit::NavigatorContentUtilsClient> navigatorContentUtilsClient;
+ std::unique_ptr<WebKit::NavigatorContentUtilsClient> navigatorContentUtilsClient;
#endif
};