Diff
Modified: trunk/Source/WebKit2/ChangeLog (216809 => 216810)
--- trunk/Source/WebKit2/ChangeLog 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/ChangeLog 2017-05-13 01:55:14 UTC (rev 216810)
@@ -1,3 +1,83 @@
+2017-05-12 Chris Dumez <[email protected]>
+
+ Drop remaining uses of PassRefPtr in WebKit2/WebProcess
+ https://bugs.webkit.org/show_bug.cgi?id=172055
+
+ Reviewed by Alex Christensen.
+
+ * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.mm:
+ (+[WKWebProcessPlugInScriptWorld normalWorld]):
+ * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
+ (contextMenuItems):
+ * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp:
+ (WKBundleScriptWorldNormalWorld):
+ * WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.cpp:
+ (webkitScriptWorldCreate):
+ * WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.cpp:
+ (WebKit::InjectedBundleCSSStyleDeclarationHandle::getOrCreate):
+ * WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.h:
+ * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
+ (WebKit::InjectedBundleRangeHandle::getOrCreate):
+ (WebKit::InjectedBundleRangeHandle::create):
+ (WebKit::InjectedBundleRangeHandle::coreRange):
+ (WebKit::InjectedBundleRangeHandle::renderedImage):
+ * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h:
+ * WebProcess/InjectedBundle/InjectedBundle.cpp:
+ (WebKit::InjectedBundle::create):
+ (WebKit::InjectedBundle::createWebDataFromUint8Array):
+ * WebProcess/InjectedBundle/InjectedBundle.h:
+ * WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp:
+ (WebKit::InjectedBundleBackForwardList::itemAtIndex):
+ * WebProcess/InjectedBundle/InjectedBundleBackForwardList.h:
+ (WebKit::InjectedBundleBackForwardList::detach):
+ * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.h:
+ (WebKit::InjectedBundleBackForwardListItem::create):
+ (WebKit::InjectedBundleBackForwardListItem::InjectedBundleBackForwardListItem):
+ * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
+ (WebKit::InjectedBundleHitTestResult::nodeHandle):
+ (WebKit::InjectedBundleHitTestResult::urlElementHandle):
+ * WebProcess/InjectedBundle/InjectedBundleHitTestResult.h:
+ * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
+ (WebKit::InjectedBundleNavigationAction::create):
+ (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
+ * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
+ * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
+ (WebKit::InjectedBundleScriptWorld::getOrCreate):
+ (WebKit::InjectedBundleScriptWorld::normalWorld):
+ * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h:
+ * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
+ (WebKit::NetscapePlugin::create):
+ (WebKit::NetscapePlugin::NetscapePlugin):
+ (WebKit::NetscapePlugin::supportsSnapshotting):
+ * WebProcess/Plugins/Netscape/NetscapePlugin.h:
+ * WebProcess/Plugins/PDF/PDFPluginAnnotation.h:
+ * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm:
+ (WebKit::PDFPluginAnnotation::create):
+ * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.h:
+ * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm:
+ (WebKit::PDFPluginChoiceAnnotation::createAnnotationElement):
+ * WebProcess/Plugins/PDF/PDFPluginPasswordField.h:
+ * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm:
+ (WebKit::PDFPluginPasswordField::createAnnotationElement):
+ * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.h:
+ * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
+ (WebKit::PDFPluginTextAnnotation::createAnnotationElement):
+ * WebProcess/UserContent/WebUserContentController.cpp:
+ (WebKit::worldMap):
+ (WebKit::WebUserMessageHandlerDescriptorProxy::create):
+ * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
+ (WebKit::convertImageToBitmap):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::addUserScript):
+ (WebKit::WebPage::addUserStyleSheet):
+ * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
+ (WebKit::WebPrintOperationGtk::create):
+ * WebProcess/WebPage/gtk/WebPrintOperationGtk.h:
+ * WebProcess/WebPage/ios/WebPageIOS.mm:
+ (WebKit::rangeForPosition):
+ (WebKit::rangeAtWordBoundaryForPosition):
+ * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h:
+
2017-05-12 Alex Christensen <[email protected]>
Rename WKContentExtension to WKContentRuleList
Modified: trunk/Source/WebKit2/Shared/APIWebArchive.h (216809 => 216810)
--- trunk/Source/WebKit2/Shared/APIWebArchive.h 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/Shared/APIWebArchive.h 2017-05-13 01:55:14 UTC (rev 216810)
@@ -52,7 +52,7 @@
static Ref<WebArchive> create(WebArchiveResource* mainResource, RefPtr<API::Array>&& subresources, RefPtr<API::Array>&& subframeArchives);
static Ref<WebArchive> create(API::Data*);
static Ref<WebArchive> create(RefPtr<WebCore::LegacyWebArchive>&&);
- static Ref<WebArchive> create(WebCore::Range*);
+ static Ref<WebArchive> create(WebCore::Range&);
WebArchiveResource* mainResource();
API::Array* subresources();
Modified: trunk/Source/WebKit2/Shared/APIWebArchive.mm (216809 => 216810)
--- trunk/Source/WebKit2/Shared/APIWebArchive.mm 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/Shared/APIWebArchive.mm 2017-05-13 01:55:14 UTC (rev 216810)
@@ -53,9 +53,9 @@
return adoptRef(*new WebArchive(legacyWebArchive.releaseNonNull()));
}
-Ref<WebArchive> WebArchive::create(Range* range)
+Ref<WebArchive> WebArchive::create(Range& range)
{
- return adoptRef(*new WebArchive(LegacyWebArchive::create(range)));
+ return adoptRef(*new WebArchive(LegacyWebArchive::create(&range)));
}
WebArchive::WebArchive(WebArchiveResource* mainResource, RefPtr<API::Array>&& subresources, RefPtr<API::Array>&& subframeArchives)
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.mm (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.mm 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.mm 2017-05-13 01:55:14 UTC (rev 216810)
@@ -70,7 +70,7 @@
#if TARGET_OS_IPHONE
- (NSArray *)detectDataWithTypes:(WKDataDetectorTypes)types context:(NSDictionary *)context WK_API_AVAILABLE(ios(WK_IOS_TBA))
{
- RefPtr<WebCore::Range> coreRange = _rangeHandle->coreRange();
+ RefPtr<WebCore::Range> coreRange = &_rangeHandle->coreRange();
return WebCore::DataDetection::detectContentInRange(coreRange, fromWKDataDetectorTypes(types), context);
}
#endif
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.mm (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.mm 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.mm 2017-05-13 01:55:14 UTC (rev 216810)
@@ -42,7 +42,7 @@
+ (WKWebProcessPlugInScriptWorld *)normalWorld
{
- return wrapper(*InjectedBundleScriptWorld::normalWorld());
+ return wrapper(InjectedBundleScriptWorld::normalWorld());
}
- (void)dealloc
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp 2017-05-13 01:55:14 UTC (rev 216810)
@@ -218,7 +218,7 @@
WKDataRef WKBundleCreateWKDataFromUInt8Array(WKBundleRef bundle, JSContextRef context, JSValueRef data)
{
- return toAPI(toImpl(bundle)->createWebDataFromUint8Array(context, data).leakRef());
+ return toAPI(&toImpl(bundle)->createWebDataFromUint8Array(context, data).leakRef());
}
int WKBundleNumberOfPages(WKBundleRef bundleRef, WKBundleFrameRef frameRef, double pageWidthInPixels, double pageHeightInPixels)
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp 2017-05-13 01:55:14 UTC (rev 216810)
@@ -179,7 +179,7 @@
}
#if ENABLE(CONTEXT_MENUS)
-static PassRefPtr<API::Array> contextMenuItems(const WebContextMenu& contextMenu)
+static Ref<API::Array> contextMenuItems(const WebContextMenu& contextMenu)
{
auto items = contextMenu.items();
@@ -198,7 +198,7 @@
#if ENABLE(CONTEXT_MENUS)
WebContextMenu* contextMenu = toImpl(pageRef)->contextMenu();
- return toAPI(contextMenuItems(*contextMenu).leakRef());
+ return toAPI(&contextMenuItems(*contextMenu).leakRef());
#else
UNUSED_PARAM(pageRef);
return nullptr;
@@ -212,7 +212,7 @@
if (!contextMenu)
return nullptr;
- return toAPI(contextMenuItems(*contextMenu).leakRef());
+ return toAPI(&contextMenuItems(*contextMenu).leakRef());
#else
UNUSED_PARAM(pageRef);
UNUSED_PARAM(point);
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp 2017-05-13 01:55:14 UTC (rev 216810)
@@ -137,7 +137,7 @@
DDActionContext *actionContext = (DDActionContext *)m_client.actionContextForResultAtPoint(toAPI(&pageOverlay), WKPointMake(location.x(), location.y()), &apiRange, m_client.base.clientInfo);
if (apiRange)
- rangeHandle = toImpl(apiRange)->coreRange();
+ rangeHandle = &toImpl(apiRange)->coreRange();
return actionContext;
}
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp 2017-05-13 01:55:14 UTC (rev 216810)
@@ -45,7 +45,7 @@
WKBundleScriptWorldRef WKBundleScriptWorldNormalWorld()
{
- return toAPI(InjectedBundleScriptWorld::normalWorld());
+ return toAPI(&InjectedBundleScriptWorld::normalWorld());
}
void WKBundleScriptWorldClearWrappers(WKBundleScriptWorldRef scriptWorldRef)
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.cpp (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.cpp 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.cpp 2017-05-13 01:55:14 UTC (rev 216810)
@@ -99,10 +99,10 @@
g_signal_emit(world, signals[WINDOW_OBJECT_CLEARED], 0, page, frame);
}
-static WebKitScriptWorld* webkitScriptWorldCreate(PassRefPtr<InjectedBundleScriptWorld> scriptWorld)
+static WebKitScriptWorld* webkitScriptWorldCreate(Ref<InjectedBundleScriptWorld>&& scriptWorld)
{
WebKitScriptWorld* world = WEBKIT_SCRIPT_WORLD(g_object_new(WEBKIT_TYPE_SCRIPT_WORLD, NULL));
- world->priv->scriptWorld = scriptWorld;
+ world->priv->scriptWorld = WTFMove(scriptWorld);
ASSERT(!scriptWorlds().contains(world->priv->scriptWorld.get()));
scriptWorlds().add(world->priv->scriptWorld.get(), world);
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.cpp (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.cpp 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.cpp 2017-05-13 01:55:14 UTC (rev 216810)
@@ -42,7 +42,7 @@
return cache;
}
-PassRefPtr<InjectedBundleCSSStyleDeclarationHandle> InjectedBundleCSSStyleDeclarationHandle::getOrCreate(CSSStyleDeclaration* styleDeclaration)
+RefPtr<InjectedBundleCSSStyleDeclarationHandle> InjectedBundleCSSStyleDeclarationHandle::getOrCreate(CSSStyleDeclaration* styleDeclaration)
{
if (!styleDeclaration)
return nullptr;
@@ -49,7 +49,7 @@
DOMHandleCache::AddResult result = domHandleCache().add(styleDeclaration, nullptr);
if (!result.isNewEntry)
- return PassRefPtr<InjectedBundleCSSStyleDeclarationHandle>(result.iterator->value);
+ return result.iterator->value;
auto styleDeclarationHandle = adoptRef(*new InjectedBundleCSSStyleDeclarationHandle(*styleDeclaration));
result.iterator->value = styleDeclarationHandle.ptr();
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.h (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.h 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.h 2017-05-13 01:55:14 UTC (rev 216810)
@@ -27,8 +27,8 @@
#define InjectedBundleCSSStyleDeclarationHandle_h
#include "APIObject.h"
-#include <wtf/PassRefPtr.h>
#include <wtf/Ref.h>
+#include <wtf/RefPtr.h>
namespace WebCore {
class CSSStyleDeclaration;
@@ -38,7 +38,7 @@
class InjectedBundleCSSStyleDeclarationHandle : public API::ObjectImpl<API::Object::Type::BundleCSSStyleDeclarationHandle> {
public:
- static PassRefPtr<InjectedBundleCSSStyleDeclarationHandle> getOrCreate(WebCore::CSSStyleDeclaration*);
+ static RefPtr<InjectedBundleCSSStyleDeclarationHandle> getOrCreate(WebCore::CSSStyleDeclaration*);
virtual ~InjectedBundleCSSStyleDeclarationHandle();
private:
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp 2017-05-13 01:55:14 UTC (rev 216810)
@@ -57,32 +57,32 @@
return cache;
}
-PassRefPtr<InjectedBundleRangeHandle> InjectedBundleRangeHandle::getOrCreate(JSContextRef context, JSObjectRef object)
+RefPtr<InjectedBundleRangeHandle> InjectedBundleRangeHandle::getOrCreate(JSContextRef context, JSObjectRef object)
{
Range* range = JSRange::toWrapped(toJS(context)->vm(), toJS(object));
return getOrCreate(range);
}
-PassRefPtr<InjectedBundleRangeHandle> InjectedBundleRangeHandle::getOrCreate(Range* range)
+RefPtr<InjectedBundleRangeHandle> InjectedBundleRangeHandle::getOrCreate(Range* range)
{
if (!range)
- return 0;
+ return nullptr;
DOMHandleCache::AddResult result = domHandleCache().add(range, nullptr);
if (!result.isNewEntry)
- return PassRefPtr<InjectedBundleRangeHandle>(result.iterator->value);
+ return result.iterator->value;
- auto rangeHandle = InjectedBundleRangeHandle::create(range);
+ auto rangeHandle = InjectedBundleRangeHandle::create(*range);
result.iterator->value = rangeHandle.ptr();
return WTFMove(rangeHandle);
}
-Ref<InjectedBundleRangeHandle> InjectedBundleRangeHandle::create(Range* range)
+Ref<InjectedBundleRangeHandle> InjectedBundleRangeHandle::create(Range& range)
{
return adoptRef(*new InjectedBundleRangeHandle(range));
}
-InjectedBundleRangeHandle::InjectedBundleRangeHandle(Range* range)
+InjectedBundleRangeHandle::InjectedBundleRangeHandle(Range& range)
: m_range(range)
{
}
@@ -89,10 +89,10 @@
InjectedBundleRangeHandle::~InjectedBundleRangeHandle()
{
- domHandleCache().remove(m_range.get());
+ domHandleCache().remove(m_range.ptr());
}
-Range* InjectedBundleRangeHandle::coreRange() const
+Range& InjectedBundleRangeHandle::coreRange() const
{
return m_range.get();
}
@@ -109,7 +109,7 @@
return frame->view()->contentsToWindow(enclosingIntRect(boundingRect));
}
-PassRefPtr<WebImage> InjectedBundleRangeHandle::renderedImage(SnapshotOptions options)
+RefPtr<WebImage> InjectedBundleRangeHandle::renderedImage(SnapshotOptions options)
{
Document& ownerDocument = m_range->ownerDocument();
Frame* frame = ownerDocument.frame();
@@ -123,7 +123,7 @@
Ref<Frame> protector(*frame);
VisibleSelection oldSelection = frame->selection().selection();
- frame->selection().setSelection(VisibleSelection(*m_range));
+ frame->selection().setSelection(VisibleSelection(m_range));
float scaleFactor = (options & SnapshotOptionsExcludeDeviceScaleFactor) ? 1 : frame->page()->deviceScaleFactor();
IntRect paintRect = enclosingIntRect(m_range->absoluteBoundingRect());
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h 2017-05-13 01:55:14 UTC (rev 216810)
@@ -30,7 +30,6 @@
#include "ImageOptions.h"
#include <_javascript_Core/JSBase.h>
#include <wtf/Forward.h>
-#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
namespace WebCore {
@@ -46,8 +45,8 @@
class InjectedBundleRangeHandle : public API::ObjectImpl<API::Object::Type::BundleRangeHandle> {
public:
- static PassRefPtr<InjectedBundleRangeHandle> getOrCreate(JSContextRef, JSObjectRef);
- static PassRefPtr<InjectedBundleRangeHandle> getOrCreate(WebCore::Range*);
+ static RefPtr<InjectedBundleRangeHandle> getOrCreate(JSContextRef, JSObjectRef);
+ static RefPtr<InjectedBundleRangeHandle> getOrCreate(WebCore::Range*);
virtual ~InjectedBundleRangeHandle();
@@ -54,16 +53,16 @@
Ref<InjectedBundleNodeHandle> document();
WebCore::IntRect boundingRectInWindowCoordinates() const;
- PassRefPtr<WebImage> renderedImage(SnapshotOptions);
+ RefPtr<WebImage> renderedImage(SnapshotOptions);
String text() const;
- WebCore::Range* coreRange() const;
+ WebCore::Range& coreRange() const;
private:
- static Ref<InjectedBundleRangeHandle> create(WebCore::Range*);
- InjectedBundleRangeHandle(WebCore::Range*);
+ static Ref<InjectedBundleRangeHandle> create(WebCore::Range&);
+ InjectedBundleRangeHandle(WebCore::Range&);
- RefPtr<WebCore::Range> m_range;
+ Ref<WebCore::Range> m_range;
};
} // namespace WebKit
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp 2017-05-13 01:55:14 UTC (rev 216810)
@@ -88,7 +88,7 @@
namespace WebKit {
-PassRefPtr<InjectedBundle> InjectedBundle::create(const WebProcessCreationParameters& parameters, API::Object* initializationUserData)
+RefPtr<InjectedBundle> InjectedBundle::create(const WebProcessCreationParameters& parameters, API::Object* initializationUserData)
{
auto bundle = adoptRef(*new InjectedBundle(parameters));
@@ -572,7 +572,7 @@
}
// FIXME Get rid of this function and move it into WKBundle.cpp.
-PassRefPtr<API::Data> InjectedBundle::createWebDataFromUint8Array(JSContextRef context, JSValueRef data)
+Ref<API::Data> InjectedBundle::createWebDataFromUint8Array(JSContextRef context, JSValueRef data)
{
JSC::ExecState* execState = toJS(context);
RefPtr<Uint8Array> arrayData = WebCore::toUnsharedUint8Array(execState->vm(), toJS(execState, data));
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h 2017-05-13 01:55:14 UTC (rev 216810)
@@ -32,7 +32,7 @@
#include "WKBundle.h"
#include <WebCore/UserContentTypes.h>
#include <WebCore/UserScriptTypes.h>
-#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
#include <wtf/RetainPtr.h>
#include <wtf/text/WTFString.h>
@@ -75,7 +75,7 @@
class InjectedBundle : public API::ObjectImpl<API::Object::Type::Bundle> {
public:
- static PassRefPtr<InjectedBundle> create(const WebProcessCreationParameters&, API::Object* initializationUserData);
+ static RefPtr<InjectedBundle> create(const WebProcessCreationParameters&, API::Object* initializationUserData);
~InjectedBundle();
@@ -117,7 +117,7 @@
void setWebNotificationPermission(WebPage*, const String& originString, bool allowed);
void removeAllWebNotificationPermissions(WebPage*);
uint64_t webNotificationID(JSContextRef, JSValueRef);
- PassRefPtr<API::Data> createWebDataFromUint8Array(JSContextRef, JSValueRef);
+ Ref<API::Data> createWebDataFromUint8Array(JSContextRef, JSValueRef);
// UserContent API
void addUserScript(WebPageGroupProxy*, InjectedBundleScriptWorld*, const String& source, const String& url, API::Array* whitelist, API::Array* blacklist, WebCore::UserScriptInjectionTime, WebCore::UserContentInjectedFrames);
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp 2017-05-13 01:55:14 UTC (rev 216810)
@@ -36,13 +36,13 @@
namespace WebKit {
-PassRefPtr<InjectedBundleBackForwardListItem> InjectedBundleBackForwardList::itemAtIndex(int index) const
+RefPtr<InjectedBundleBackForwardListItem> InjectedBundleBackForwardList::itemAtIndex(int index) const
{
if (!m_page)
- return 0;
+ return nullptr;
Page* page = m_page->corePage();
if (!page)
- return 0;
+ return nullptr;
return InjectedBundleBackForwardListItem::create(page->backForward().itemAtIndex(index));
}
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardList.h (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardList.h 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardList.h 2017-05-13 01:55:14 UTC (rev 216810)
@@ -27,7 +27,7 @@
#define InjectedBundleBackForwardList_h
#include "APIObject.h"
-#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
namespace WebKit {
@@ -42,11 +42,11 @@
return adoptRef(*new InjectedBundleBackForwardList(page));
}
- void detach() { m_page = 0; }
+ void detach() { m_page = nullptr; }
void clear();
- PassRefPtr<InjectedBundleBackForwardListItem> itemAtIndex(int) const;
+ RefPtr<InjectedBundleBackForwardListItem> itemAtIndex(int) const;
int backListCount() const;
int forwardListCount() const;
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.h (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.h 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.h 2017-05-13 01:55:14 UTC (rev 216810)
@@ -39,11 +39,11 @@
class InjectedBundleBackForwardListItem : public API::ObjectImpl<API::Object::Type::BundleBackForwardListItem> {
public:
- static PassRefPtr<InjectedBundleBackForwardListItem> create(PassRefPtr<WebCore::HistoryItem> item)
+ static RefPtr<InjectedBundleBackForwardListItem> create(RefPtr<WebCore::HistoryItem>&& item)
{
if (!item)
- return 0;
- return adoptRef(new InjectedBundleBackForwardListItem(item));
+ return nullptr;
+ return adoptRef(new InjectedBundleBackForwardListItem(WTFMove(item)));
}
WebCore::HistoryItem* item() const { return m_item.get(); }
@@ -60,7 +60,9 @@
Ref<API::Array> children() const;
private:
- InjectedBundleBackForwardListItem(PassRefPtr<WebCore::HistoryItem> item) : m_item(item) { }
+ explicit InjectedBundleBackForwardListItem(RefPtr<WebCore::HistoryItem>&& item)
+ : m_item(WTFMove(item))
+ { }
RefPtr<WebCore::HistoryItem> m_item;
};
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp 2017-05-13 01:55:14 UTC (rev 216810)
@@ -46,12 +46,12 @@
return adoptRef(*new InjectedBundleHitTestResult(hitTestResult));
}
-PassRefPtr<InjectedBundleNodeHandle> InjectedBundleHitTestResult::nodeHandle() const
+RefPtr<InjectedBundleNodeHandle> InjectedBundleHitTestResult::nodeHandle() const
{
return InjectedBundleNodeHandle::getOrCreate(m_hitTestResult.innerNonSharedNode());
}
-PassRefPtr<InjectedBundleNodeHandle> InjectedBundleHitTestResult::urlElementHandle() const
+RefPtr<InjectedBundleNodeHandle> InjectedBundleHitTestResult::urlElementHandle() const
{
return InjectedBundleNodeHandle::getOrCreate(m_hitTestResult.URLElement());
}
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleHitTestResult.h (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleHitTestResult.h 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleHitTestResult.h 2017-05-13 01:55:14 UTC (rev 216810)
@@ -30,7 +30,7 @@
#include "InjectedBundleHitTestResultMediaType.h"
#include <WebCore/HitTestResult.h>
#include <wtf/Forward.h>
-#include <wtf/PassRefPtr.h>
+#include <wtf/Ref.h>
#include <wtf/RefPtr.h>
namespace WebKit {
@@ -44,8 +44,8 @@
const WebCore::HitTestResult& coreHitTestResult() const { return m_hitTestResult; }
- PassRefPtr<InjectedBundleNodeHandle> nodeHandle() const;
- PassRefPtr<InjectedBundleNodeHandle> urlElementHandle() const;
+ RefPtr<InjectedBundleNodeHandle> nodeHandle() const;
+ RefPtr<InjectedBundleNodeHandle> urlElementHandle() const;
WebFrame* frame() const;
WebFrame* targetFrame() const;
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp 2017-05-13 01:55:14 UTC (rev 216810)
@@ -97,12 +97,12 @@
return syntheticClickTypeForMouseEvent(mouseEventForNavigationAction(navigationAction));
}
-Ref<InjectedBundleNavigationAction> InjectedBundleNavigationAction::create(WebFrame* frame, const NavigationAction& action, PassRefPtr<FormState> formState)
+Ref<InjectedBundleNavigationAction> InjectedBundleNavigationAction::create(WebFrame* frame, const NavigationAction& action, RefPtr<FormState>&& formState)
{
- return adoptRef(*new InjectedBundleNavigationAction(frame, action, formState));
+ return adoptRef(*new InjectedBundleNavigationAction(frame, action, WTFMove(formState)));
}
-InjectedBundleNavigationAction::InjectedBundleNavigationAction(WebFrame* frame, const NavigationAction& navigationAction, PassRefPtr<FormState> formState)
+InjectedBundleNavigationAction::InjectedBundleNavigationAction(WebFrame* frame, const NavigationAction& navigationAction, RefPtr<FormState>&& formState)
: m_navigationType(navigationAction.type())
, m_modifiers(modifiersForNavigationAction(navigationAction))
, m_mouseButton(WebMouseEvent::NoButton)
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleNavigationAction.h (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleNavigationAction.h 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleNavigationAction.h 2017-05-13 01:55:14 UTC (rev 216810)
@@ -31,7 +31,7 @@
#include "InjectedBundleNodeHandle.h"
#include "WebEvent.h"
#include <WebCore/FrameLoaderTypes.h>
-#include <wtf/PassRefPtr.h>
+#include <wtf/Ref.h>
#include <wtf/RefPtr.h>
namespace WebCore {
@@ -45,7 +45,7 @@
class InjectedBundleNavigationAction : public API::ObjectImpl<API::Object::Type::BundleNavigationAction> {
public:
- static Ref<InjectedBundleNavigationAction> create(WebFrame*, const WebCore::NavigationAction&, PassRefPtr<WebCore::FormState>);
+ static Ref<InjectedBundleNavigationAction> create(WebFrame*, const WebCore::NavigationAction&, RefPtr<WebCore::FormState>&&);
static WebEvent::Modifiers modifiersForNavigationAction(const WebCore::NavigationAction&);
static WebMouseEvent::Button mouseButtonForNavigationAction(const WebCore::NavigationAction&);
@@ -63,7 +63,7 @@
AtomicString downloadAttribute() const { return m_downloadAttribute; }
private:
- InjectedBundleNavigationAction(WebFrame*, const WebCore::NavigationAction&, PassRefPtr<WebCore::FormState>);
+ InjectedBundleNavigationAction(WebFrame*, const WebCore::NavigationAction&, RefPtr<WebCore::FormState>&&);
WebCore::NavigationType m_navigationType;
WebEvent::Modifiers m_modifiers;
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp 2017-05-13 01:55:14 UTC (rev 216810)
@@ -267,7 +267,7 @@
if (!m_client.didClearWindowObjectForFrame)
return;
- m_client.didClearWindowObjectForFrame(toAPI(page), toAPI(frame), toAPI(InjectedBundleScriptWorld::getOrCreate(world).get()), m_client.base.clientInfo);
+ m_client.didClearWindowObjectForFrame(toAPI(page), toAPI(frame), toAPI(InjectedBundleScriptWorld::getOrCreate(world).ptr()), m_client.base.clientInfo);
}
void InjectedBundlePageLoaderClient::didCancelClientRedirectForFrame(WebPage* page, WebFrame* frame)
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp 2017-05-13 01:55:14 UTC (rev 216810)
@@ -61,20 +61,20 @@
return adoptRef(*new InjectedBundleScriptWorld(ScriptController::createWorld(), name));
}
-PassRefPtr<InjectedBundleScriptWorld> InjectedBundleScriptWorld::getOrCreate(DOMWrapperWorld& world)
+Ref<InjectedBundleScriptWorld> InjectedBundleScriptWorld::getOrCreate(DOMWrapperWorld& world)
{
if (&world == &mainThreadNormalWorld())
return normalWorld();
if (InjectedBundleScriptWorld* existingWorld = allWorlds().get(&world))
- return existingWorld;
+ return *existingWorld;
- return adoptRef(new InjectedBundleScriptWorld(world, uniqueWorldName()));
+ return adoptRef(*new InjectedBundleScriptWorld(world, uniqueWorldName()));
}
-InjectedBundleScriptWorld* InjectedBundleScriptWorld::normalWorld()
+InjectedBundleScriptWorld& InjectedBundleScriptWorld::normalWorld()
{
- static InjectedBundleScriptWorld* world = adoptRef(new InjectedBundleScriptWorld(mainThreadNormalWorld(), String())).leakRef();
+ static InjectedBundleScriptWorld& world = adoptRef(*new InjectedBundleScriptWorld(mainThreadNormalWorld(), String())).leakRef();
return world;
}
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleScriptWorld.h (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleScriptWorld.h 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleScriptWorld.h 2017-05-13 01:55:14 UTC (rev 216810)
@@ -27,7 +27,7 @@
#define InjectedBundleScriptWorld_h
#include "APIObject.h"
-#include <wtf/PassRefPtr.h>
+#include <wtf/Ref.h>
#include <wtf/RefPtr.h>
#include <wtf/text/WTFString.h>
@@ -41,8 +41,8 @@
public:
static Ref<InjectedBundleScriptWorld> create();
static Ref<InjectedBundleScriptWorld> create(const String&);
- static PassRefPtr<InjectedBundleScriptWorld> getOrCreate(WebCore::DOMWrapperWorld&);
- static InjectedBundleScriptWorld* normalWorld();
+ static Ref<InjectedBundleScriptWorld> getOrCreate(WebCore::DOMWrapperWorld&);
+ static InjectedBundleScriptWorld& normalWorld();
virtual ~InjectedBundleScriptWorld();
Modified: trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp 2017-05-13 01:55:14 UTC (rev 216810)
@@ -53,18 +53,18 @@
// The plug-in that we're currently calling NPP_New for.
static NetscapePlugin* currentNPPNewPlugin;
-RefPtr<NetscapePlugin> NetscapePlugin::create(PassRefPtr<NetscapePluginModule> pluginModule)
+RefPtr<NetscapePlugin> NetscapePlugin::create(RefPtr<NetscapePluginModule>&& pluginModule)
{
if (!pluginModule)
return nullptr;
- return adoptRef(*new NetscapePlugin(pluginModule));
+ return adoptRef(*new NetscapePlugin(pluginModule.releaseNonNull()));
}
-NetscapePlugin::NetscapePlugin(PassRefPtr<NetscapePluginModule> pluginModule)
+NetscapePlugin::NetscapePlugin(Ref<NetscapePluginModule>&& pluginModule)
: Plugin(NetscapePluginType)
, m_nextRequestID(0)
- , m_pluginModule(pluginModule)
+ , m_pluginModule(WTFMove(pluginModule))
, m_npWindow()
, m_isStarted(false)
#if PLATFORM(COCOA)
@@ -1102,7 +1102,7 @@
bool NetscapePlugin::supportsSnapshotting() const
{
#if PLATFORM(COCOA)
- return m_pluginModule && m_pluginModule->pluginQuirks().contains(PluginQuirks::SupportsSnapshotting);
+ return m_pluginModule->pluginQuirks().contains(PluginQuirks::SupportsSnapshotting);
#endif
return false;
}
Modified: trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h 2017-05-13 01:55:14 UTC (rev 216810)
@@ -52,7 +52,7 @@
class NetscapePlugin : public Plugin {
public:
- static RefPtr<NetscapePlugin> create(PassRefPtr<NetscapePluginModule>);
+ static RefPtr<NetscapePlugin> create(RefPtr<NetscapePluginModule>&&);
virtual ~NetscapePlugin();
static RefPtr<NetscapePlugin> fromNPP(NPP);
@@ -159,7 +159,7 @@
WebCore::IntPoint convertToRootView(const WebCore::IntPoint&) const override;
private:
- NetscapePlugin(PassRefPtr<NetscapePluginModule> pluginModule);
+ explicit NetscapePlugin(Ref<NetscapePluginModule>&&);
void callSetWindow();
void callSetWindowInvisible();
@@ -286,7 +286,7 @@
StreamsMap m_streams;
HashMap<void*, std::pair<RefPtr<NetscapePluginStream>, String>> m_redirects;
- RefPtr<NetscapePluginModule> m_pluginModule;
+ Ref<NetscapePluginModule> m_pluginModule;
NPP_t m_npp;
NPWindow m_npWindow;
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPluginAnnotation.h (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPluginAnnotation.h 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPluginAnnotation.h 2017-05-13 01:55:14 UTC (rev 216810)
@@ -46,7 +46,7 @@
class PDFPluginAnnotation : public RefCounted<PDFPluginAnnotation> {
public:
- static PassRefPtr<PDFPluginAnnotation> create(PDFAnnotation *, PDFLayerController *, PDFPlugin*);
+ static RefPtr<PDFPluginAnnotation> create(PDFAnnotation *, PDFLayerController *, PDFPlugin*);
virtual ~PDFPluginAnnotation();
WebCore::Element* element() const { return m_element.get(); }
@@ -75,7 +75,7 @@
virtual bool handleEvent(WebCore::Event*);
private:
- virtual PassRefPtr<WebCore::Element> createAnnotationElement() = 0;
+ virtual Ref<WebCore::Element> createAnnotationElement() = 0;
class PDFPluginAnnotationEventListener : public WebCore::EventListener {
public:
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPluginAnnotation.mm (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPluginAnnotation.mm 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPluginAnnotation.mm 2017-05-13 01:55:14 UTC (rev 216810)
@@ -52,7 +52,7 @@
using namespace HTMLNames;
-PassRefPtr<PDFPluginAnnotation> PDFPluginAnnotation::create(PDFAnnotation *annotation, PDFLayerController *pdfLayerController, PDFPlugin* plugin)
+RefPtr<PDFPluginAnnotation> PDFPluginAnnotation::create(PDFAnnotation *annotation, PDFLayerController *pdfLayerController, PDFPlugin* plugin)
{
if ([annotation isKindOfClass:pdfAnnotationTextWidgetClass()])
return PDFPluginTextAnnotation::create(annotation, pdfLayerController, plugin);
@@ -59,7 +59,7 @@
if ([annotation isKindOfClass:pdfAnnotationChoiceWidgetClass()])
return PDFPluginChoiceAnnotation::create(annotation, pdfLayerController, plugin);
- return 0;
+ return nullptr;
}
void PDFPluginAnnotation::attach(Element* parent)
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.h (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.h 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.h 2017-05-13 01:55:14 UTC (rev 216810)
@@ -51,7 +51,7 @@
{
}
- PassRefPtr<WebCore::Element> createAnnotationElement() override;
+ Ref<WebCore::Element> createAnnotationElement() override;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm 2017-05-13 01:55:14 UTC (rev 216810)
@@ -66,7 +66,7 @@
PDFPluginAnnotation::commit();
}
-PassRefPtr<Element> PDFPluginChoiceAnnotation::createAnnotationElement()
+Ref<Element> PDFPluginChoiceAnnotation::createAnnotationElement()
{
Document& document = parent()->document();
#pragma clang diagnostic push
@@ -74,13 +74,13 @@
PDFAnnotationChoiceWidget *choiceAnnotation = this->choiceAnnotation();
#pragma clang diagnostic pop
- RefPtr<Element> element = document.createElement(selectTag, false);
+ auto element = document.createElement(selectTag, false);
- StyledElement* styledElement = static_cast<StyledElement*>(element.get());
+ auto& styledElement = downcast<StyledElement>(element.get());
// FIXME: Match font weight and style as well?
- styledElement->setInlineStyleProperty(CSSPropertyColor, colorFromNSColor(choiceAnnotation.fontColor).serialized());
- styledElement->setInlineStyleProperty(CSSPropertyFontFamily, choiceAnnotation.font.familyName);
+ styledElement.setInlineStyleProperty(CSSPropertyColor, colorFromNSColor(choiceAnnotation.fontColor).serialized());
+ styledElement.setInlineStyleProperty(CSSPropertyFontFamily, choiceAnnotation.font.familyName);
NSArray *choices = choiceAnnotation.choices;
NSString *selectedChoice = choiceAnnotation.stringValue;
@@ -93,7 +93,7 @@
if (choice == selectedChoice)
choiceOption->setAttributeWithoutSynchronization(selectedAttr, AtomicString("selected", AtomicString::ConstructFromLiteral));
- styledElement->appendChild(choiceOption);
+ styledElement.appendChild(choiceOption);
}
return element;
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPluginPasswordField.h (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPluginPasswordField.h 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPluginPasswordField.h 2017-05-13 01:55:14 UTC (rev 216810)
@@ -45,7 +45,7 @@
{
}
- PassRefPtr<WebCore::Element> createAnnotationElement() override;
+ Ref<WebCore::Element> createAnnotationElement() override;
bool handleEvent(WebCore::Event*) override;
};
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPluginPasswordField.mm (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPluginPasswordField.mm 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPluginPasswordField.mm 2017-05-13 01:55:14 UTC (rev 216810)
@@ -53,9 +53,9 @@
element()->removeEventListener(eventNames().keyupEvent, *eventListener(), false);
}
-PassRefPtr<Element> PDFPluginPasswordField::createAnnotationElement()
+Ref<Element> PDFPluginPasswordField::createAnnotationElement()
{
- RefPtr<Element> element = PDFPluginTextAnnotation::createAnnotationElement();
+ auto element = PDFPluginTextAnnotation::createAnnotationElement();
element->setAttribute(typeAttr, "password");
element->addEventListener(eventNames().keyupEvent, *eventListener(), false);
return element;
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPluginTextAnnotation.h (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPluginTextAnnotation.h 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPluginTextAnnotation.h 2017-05-13 01:55:14 UTC (rev 216810)
@@ -54,7 +54,7 @@
{
}
- PassRefPtr<WebCore::Element> createAnnotationElement() override;
+ Ref<WebCore::Element> createAnnotationElement() override;
String value() const;
private:
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm 2017-05-13 01:55:14 UTC (rev 216810)
@@ -79,10 +79,8 @@
element()->removeEventListener(eventNames().keydownEvent, *eventListener(), false);
}
-PassRefPtr<Element> PDFPluginTextAnnotation::createAnnotationElement()
+Ref<Element> PDFPluginTextAnnotation::createAnnotationElement()
{
- RefPtr<Element> element;
-
Document& document = parent()->document();
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
@@ -90,27 +88,23 @@
#pragma clang diagnostic pop
bool isMultiline = textAnnotation.isMultiline;
- if (isMultiline)
- element = document.createElement(textareaTag, false);
- else
- element = document.createElement(inputTag, false);
-
+ auto element = document.createElement(isMultiline ? textareaTag : inputTag, false);
element->addEventListener(eventNames().keydownEvent, *eventListener(), false);
- StyledElement* styledElement = static_cast<StyledElement*>(element.get());
+ auto& styledElement = downcast<StyledElement>(element.get());
if (!textAnnotation)
return element;
// FIXME: Match font weight and style as well?
- styledElement->setInlineStyleProperty(CSSPropertyColor, colorFromNSColor(textAnnotation.fontColor).serialized());
- styledElement->setInlineStyleProperty(CSSPropertyFontFamily, textAnnotation.font.familyName);
- styledElement->setInlineStyleProperty(CSSPropertyTextAlign, cssAlignmentValueForNSTextAlignment(textAnnotation.alignment));
+ styledElement.setInlineStyleProperty(CSSPropertyColor, colorFromNSColor(textAnnotation.fontColor).serialized());
+ styledElement.setInlineStyleProperty(CSSPropertyFontFamily, textAnnotation.font.familyName);
+ styledElement.setInlineStyleProperty(CSSPropertyTextAlign, cssAlignmentValueForNSTextAlignment(textAnnotation.alignment));
if (isMultiline)
- downcast<HTMLTextAreaElement>(styledElement)->setValue(textAnnotation.stringValue);
+ downcast<HTMLTextAreaElement>(styledElement).setValue(textAnnotation.stringValue);
else
- downcast<HTMLInputElement>(styledElement)->setValue(textAnnotation.stringValue);
+ downcast<HTMLInputElement>(styledElement).setValue(textAnnotation.stringValue);
return element;
}
Modified: trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.cpp (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.cpp 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.cpp 2017-05-13 01:55:14 UTC (rev 216810)
@@ -61,7 +61,7 @@
static WorldMap& worldMap()
{
- static NeverDestroyed<WorldMap> map(std::initializer_list<WorldMap::KeyValuePairType> { { 1, std::make_pair(InjectedBundleScriptWorld::normalWorld(), 1) } });
+ static NeverDestroyed<WorldMap> map(std::initializer_list<WorldMap::KeyValuePairType> { { 1, std::make_pair(&InjectedBundleScriptWorld::normalWorld(), 1) } });
return map;
}
@@ -208,9 +208,9 @@
#if ENABLE(USER_MESSAGE_HANDLERS)
class WebUserMessageHandlerDescriptorProxy : public WebCore::UserMessageHandlerDescriptor {
public:
- static PassRefPtr<WebUserMessageHandlerDescriptorProxy> create(WebUserContentController* controller, const String& name, InjectedBundleScriptWorld& world, uint64_t identifier)
+ static Ref<WebUserMessageHandlerDescriptorProxy> create(WebUserContentController* controller, const String& name, InjectedBundleScriptWorld& world, uint64_t identifier)
{
- return adoptRef(new WebUserMessageHandlerDescriptorProxy(controller, name, world, identifier));
+ return adoptRef(*new WebUserMessageHandlerDescriptorProxy(controller, name, world, identifier));
}
virtual ~WebUserMessageHandlerDescriptorProxy()
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm 2017-05-13 01:55:14 UTC (rev 216810)
@@ -59,7 +59,7 @@
namespace WebKit {
-static PassRefPtr<ShareableBitmap> convertImageToBitmap(NSImage *image, const IntSize& size, Frame& frame)
+static RefPtr<ShareableBitmap> convertImageToBitmap(NSImage *image, const IntSize& size, Frame& frame)
{
ShareableBitmap::Flags flags = ShareableBitmap::SupportsAlpha;
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
@@ -79,7 +79,7 @@
[NSGraphicsContext setCurrentContext:savedContext.get()];
- return WTFMove(bitmap);
+ return bitmap;
}
void WebDragClient::didConcludeEditDrag()
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2017-05-13 01:55:14 UTC (rev 216810)
@@ -5793,7 +5793,7 @@
{
WebCore::UserScript userScript{ source, WebCore::blankURL(), Vector<String>(), Vector<String>(), injectionTime, injectedFrames };
- m_userContentController->addUserScript(*InjectedBundleScriptWorld::normalWorld(), WTFMove(userScript));
+ m_userContentController->addUserScript(InjectedBundleScriptWorld::normalWorld(), WTFMove(userScript));
}
void WebPage::addUserStyleSheet(const String& source, WebCore::UserContentInjectedFrames injectedFrames)
@@ -5800,7 +5800,7 @@
{
WebCore::UserStyleSheet userStyleSheet{ source, WebCore::blankURL(), Vector<String>(), Vector<String>(), injectedFrames, UserStyleUserLevel };
- m_userContentController->addUserStyleSheet(*InjectedBundleScriptWorld::normalWorld(), WTFMove(userStyleSheet));
+ m_userContentController->addUserStyleSheet(InjectedBundleScriptWorld::normalWorld(), WTFMove(userStyleSheet));
}
void WebPage::removeAllUserContent()
Modified: trunk/Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp 2017-05-13 01:55:14 UTC (rev 216810)
@@ -379,7 +379,7 @@
bool isValid : 1;
};
-PassRefPtr<WebPrintOperationGtk> WebPrintOperationGtk::create(WebPage* page, const PrintInfo& printInfo)
+RefPtr<WebPrintOperationGtk> WebPrintOperationGtk::create(WebPage* page, const PrintInfo& printInfo)
{
#if HAVE(GTK_UNIX_PRINTING)
return adoptRef(new WebPrintOperationGtkUnix(page, printInfo));
@@ -388,7 +388,7 @@
#else
UNUSED_PARAM(page);
UNUSED_PARAM(printInfo);
- return 0;
+ return nullptr;
#endif
}
Modified: trunk/Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.h (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.h 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.h 2017-05-13 01:55:14 UTC (rev 216810)
@@ -28,8 +28,8 @@
#include "PrintInfo.h"
#include <WebCore/RefPtrCairo.h>
-#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
#include <wtf/glib/GRefPtr.h>
typedef struct _GtkPrintSettings GtkPrintSettings;
@@ -48,7 +48,7 @@
class WebPrintOperationGtk : public RefCounted<WebPrintOperationGtk> {
public:
- static PassRefPtr<WebPrintOperationGtk> create(WebPage*, const PrintInfo&);
+ static RefPtr<WebPrintOperationGtk> create(WebPage*, const PrintInfo&);
virtual ~WebPrintOperationGtk();
WebCore::PrintContext* printContext() const { return m_printContext; }
Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm 2017-05-13 01:55:14 UTC (rev 216810)
@@ -1178,7 +1178,7 @@
send(Messages::WebPageProxy::GestureCallback(point, gestureType, gestureState, static_cast<uint32_t>(flags), callbackID));
}
-static PassRefPtr<Range> rangeForPosition(Frame* frame, const VisiblePosition& position, bool baseIsStart)
+static RefPtr<Range> rangeForPosition(Frame* frame, const VisiblePosition& position, bool baseIsStart)
{
RefPtr<Range> range;
VisiblePosition result = position;
@@ -1203,10 +1203,10 @@
range = Range::create(*frame->document(), result, selectionEnd);
}
- return range.release();
+ return range;
}
-static PassRefPtr<Range> rangeAtWordBoundaryForPosition(Frame* frame, const VisiblePosition& position, bool baseIsStart, SelectionDirection direction)
+static RefPtr<Range> rangeAtWordBoundaryForPosition(Frame* frame, const VisiblePosition& position, bool baseIsStart, SelectionDirection direction)
{
SelectionDirection sameDirection = baseIsStart ? DirectionForward : DirectionBackward;
SelectionDirection oppositeDirection = baseIsStart ? DirectionBackward : DirectionForward;
@@ -1216,7 +1216,7 @@
if (atBoundaryOfGranularity(extent, WordGranularity, sameDirection)) {
// This is a word boundary. Leave selection where it is.
- return 0;
+ return nullptr;
}
if (atBoundaryOfGranularity(extent, WordGranularity, oppositeDirection)) {
@@ -1251,7 +1251,7 @@
if (extent.isNull() || extent == base)
extent = wordBoundary;
if (extent.isNull())
- return 0;
+ return nullptr;
return (base < extent) ? Range::create(*frame->document(), base, extent) : Range::create(*frame->document(), extent, base);
}
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.h (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.h 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.h 2017-05-13 01:55:14 UTC (rev 216810)
@@ -163,9 +163,9 @@
{
}
- KeyframeValue(PassRefPtr<WebCore::FilterOperation> value)
+ KeyframeValue(RefPtr<WebCore::FilterOperation>&& value)
: keyType(FilterKeyType)
- , filter(value)
+ , filter(WTFMove(value))
{
}
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm (216809 => 216810)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm 2017-05-13 01:33:13 UTC (rev 216809)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm 2017-05-13 01:55:14 UTC (rev 216810)
@@ -650,8 +650,8 @@
Vector<KeyframeValue> keyframes;
keyframes.reserveInitialCapacity(values.size());
- for (size_t i = 0; i < values.size(); ++i)
- keyframes.uncheckedAppend(KeyframeValue(values[i]));
+ for (auto& value : values)
+ keyframes.uncheckedAppend(KeyframeValue { value.copyRef() });
m_properties.keyValues = WTFMove(keyframes);
}