Diff
Modified: trunk/Source/WebCore/ChangeLog (183171 => 183172)
--- trunk/Source/WebCore/ChangeLog 2015-04-23 05:56:28 UTC (rev 183171)
+++ trunk/Source/WebCore/ChangeLog 2015-04-23 06:02:14 UTC (rev 183172)
@@ -1,3 +1,34 @@
+2015-04-22 Darin Adler <[email protected]>
+
+ Remove OwnPtr and PassOwnPtr use from WebKit/cf, WebKit/mac, and WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=143943
+
+ Reviewed by Anders Carlsson.
+
+ * editing/Editor.cpp:
+ (WebCore::Editor::insertDictationPhrases): Changed this iOS-only
+ function to take a Vector<Vector<String>>&& and not involve PassOwnPtr.
+ (WebCore::Editor::setDictationPhrasesAsChildOfElement): Changed this iOS-only
+ function to take a Vector<Vector<String>> and not involve PassOwnPtr. Also made
+ it take a reference rather than a pointer to the element and simplify the code
+ a bit using modern for loops and auto.
+ * editing/Editor.h: Ditto.
+
+ * editing/ios/DictationCommandIOS.cpp:
+ (WebCore::DictationCommandIOS::DictationCommandIOS): Take
+ a Vector<Vector<String>>&& instead of a PassOwnPtr.
+ (WebCore::DictationCommandIOS::~DictationCommandIOS): Deleted. No need to
+ explicitly define this.
+ (WebCore::DictationCommandIOS::doApply): Updated to use modern for loop and
+ work with a Vector<Vector<String>> instead of an OwnPtr.
+ * editing/ios/DictationCommandIOS.h: Updated to not use PassOwnPtr and OwnPtr.
+ Also modernized a bit by using override.
+
+ * platform/network/ios/QuickLook.h: Return an NSURLRequest * instead of a
+ PassOwnPtr<ResourceRequest> from this iOS-specific function.
+ * platform/network/ios/QuickLook.mm:
+ (WebCore::registerQLPreviewConverterIfNeeded): Ditto.
+
2015-04-22 Jinwoo Song <[email protected]>
Convert OwnPtr to std::unique_ptr in GraphicsContextCairo.cpp
Modified: trunk/Source/WebCore/editing/Editor.cpp (183171 => 183172)
--- trunk/Source/WebCore/editing/Editor.cpp 2015-04-23 05:56:28 UTC (rev 183171)
+++ trunk/Source/WebCore/editing/Editor.cpp 2015-04-23 06:02:14 UTC (rev 183172)
@@ -388,18 +388,19 @@
}
#if PLATFORM(IOS)
-void Editor::insertDictationPhrases(PassOwnPtr<Vector<Vector<String> > > dictationPhrases, RetainPtr<id> metadata)
+
+void Editor::insertDictationPhrases(Vector<Vector<String>>&& dictationPhrases, RetainPtr<id> metadata)
{
if (m_frame.selection().isNone())
return;
-
- if (dictationPhrases->isEmpty())
+
+ if (dictationPhrases.isEmpty())
return;
-
- applyCommand(DictationCommandIOS::create(document(), dictationPhrases, metadata));
+
+ applyCommand(DictationCommandIOS::create(document(), WTF::move(dictationPhrases), WTF::move(metadata)));
}
-void Editor::setDictationPhrasesAsChildOfElement(PassOwnPtr<Vector<Vector<String> > > dictationPhrases, RetainPtr<id> metadata, Element* element)
+void Editor::setDictationPhrasesAsChildOfElement(const Vector<Vector<String>>& dictationPhrases, RetainPtr<id> metadata, Element& element)
{
// Clear the composition.
clear();
@@ -410,54 +411,50 @@
m_frame.selection().clear();
- element->removeChildren();
+ element.removeChildren();
- if (dictationPhrases->isEmpty()) {
+ if (dictationPhrases.isEmpty()) {
client()->respondToChangedContents();
return;
}
ExceptionCode ec;
RefPtr<Range> context = document().createRange();
- context->selectNodeContents(element, ec);
-
+ context->selectNodeContents(&element, ec);
+
StringBuilder dictationPhrasesBuilder;
- size_t dictationPhraseCount = dictationPhrases->size();
- for (size_t i = 0; i < dictationPhraseCount; i++) {
- const String& firstInterpretation = dictationPhrases->at(i)[0];
- dictationPhrasesBuilder.append(firstInterpretation);
- }
- String serializedDictationPhrases = dictationPhrasesBuilder.toString();
-
- element->appendChild(createFragmentFromText(*context.get(), serializedDictationPhrases), ec);
-
+ for (auto& interpretations : dictationPhrases)
+ dictationPhrasesBuilder.append(interpretations[0]);
+
+ element.appendChild(createFragmentFromText(*context, dictationPhrasesBuilder.toString()), ec);
+
// We need a layout in order to add markers below.
document().updateLayout();
-
- if (!element->firstChild()->isTextNode()) {
+
+ if (!element.firstChild()->isTextNode()) {
// Shouldn't happen.
- ASSERT(element->firstChild()->isTextNode());
+ ASSERT(element.firstChild()->isTextNode());
return;
}
-
- Text* textNode = static_cast<Text*>(element->firstChild());
+
+ Text& textNode = downcast<Text>(*element.firstChild());
int previousDictationPhraseStart = 0;
- for (size_t i = 0; i < dictationPhraseCount; i++) {
- const Vector<String>& interpretations = dictationPhrases->at(i);
+ for (auto& interpretations : dictationPhrases) {
int dictationPhraseLength = interpretations[0].length();
int dictationPhraseEnd = previousDictationPhraseStart + dictationPhraseLength;
if (interpretations.size() > 1) {
- RefPtr<Range> dictationPhraseRange = Range::create(document(), textNode, previousDictationPhraseStart, textNode, dictationPhraseEnd);
- document().markers().addDictationPhraseWithAlternativesMarker(dictationPhraseRange.get(), interpretations);
+ auto dictationPhraseRange = Range::create(document(), &textNode, previousDictationPhraseStart, &textNode, dictationPhraseEnd);
+ document().markers().addDictationPhraseWithAlternativesMarker(dictationPhraseRange.ptr(), interpretations);
}
previousDictationPhraseStart = dictationPhraseEnd;
}
-
- RefPtr<Range> resultRange = Range::create(document(), textNode, 0, textNode, textNode->length());
- document().markers().addDictationResultMarker(resultRange.get(), metadata);
-
+
+ auto resultRange = Range::create(document(), &textNode, 0, &textNode, textNode.length());
+ document().markers().addDictationResultMarker(resultRange.ptr(), metadata);
+
client()->respondToChangedContents();
}
+
#endif
void Editor::pasteAsPlainText(const String& pastingText, bool smartReplace)
Modified: trunk/Source/WebCore/editing/Editor.h (183171 => 183172)
--- trunk/Source/WebCore/editing/Editor.h 2015-04-23 05:56:28 UTC (rev 183171)
+++ trunk/Source/WebCore/editing/Editor.h 2015-04-23 06:02:14 UTC (rev 183172)
@@ -329,8 +329,8 @@
WEBCORE_EXPORT void confirmMarkedText();
WEBCORE_EXPORT void setTextAsChildOfElement(const String&, Element*);
WEBCORE_EXPORT void setTextAlignmentForChangedBaseWritingDirection(WritingDirection);
- WEBCORE_EXPORT void insertDictationPhrases(PassOwnPtr<Vector<Vector<String> > > dictationPhrases, RetainPtr<id> metadata);
- WEBCORE_EXPORT void setDictationPhrasesAsChildOfElement(PassOwnPtr<Vector<Vector<String> > > dictationPhrases, RetainPtr<id> metadata, Element* element);
+ WEBCORE_EXPORT void insertDictationPhrases(Vector<Vector<String>>&& dictationPhrases, RetainPtr<id> metadata);
+ WEBCORE_EXPORT void setDictationPhrasesAsChildOfElement(const Vector<Vector<String>>& dictationPhrases, RetainPtr<id> metadata, Element&);
#endif
void addToKillRing(Range*, bool prepend);
Modified: trunk/Source/WebCore/editing/ios/DictationCommandIOS.cpp (183171 => 183172)
--- trunk/Source/WebCore/editing/ios/DictationCommandIOS.cpp 2015-04-23 05:56:28 UTC (rev 183171)
+++ trunk/Source/WebCore/editing/ios/DictationCommandIOS.cpp 2015-04-23 06:02:14 UTC (rev 183172)
@@ -37,45 +37,38 @@
namespace WebCore {
-DictationCommandIOS::DictationCommandIOS(Document& document, PassOwnPtr<Vector<Vector<String> > > dictationPhrases, RetainPtr<id> metadata)
+DictationCommandIOS::DictationCommandIOS(Document& document, Vector<Vector<String>>&& dictationPhrases, RetainPtr<id> metadata)
: CompositeEditCommand(document)
- , m_dictationPhrases(dictationPhrases)
- , m_metadata(metadata)
+ , m_dictationPhrases(WTF::move(dictationPhrases))
+ , m_metadata(WTF::move(metadata))
{
}
-DictationCommandIOS::~DictationCommandIOS()
-{
-}
-
void DictationCommandIOS::doApply()
{
VisiblePosition insertionPosition(startingSelection().visibleStart());
-
+
unsigned resultLength = 0;
- size_t dictationPhraseCount = m_dictationPhrases->size();
- for (size_t i = 0; i < dictationPhraseCount; i++) {
-
- const String& firstInterpretation = m_dictationPhrases->at(i)[0];
+ for (auto& interpretations : m_dictationPhrases) {
+ const String& firstInterpretation = interpretations[0];
resultLength += firstInterpretation.length();
inputText(firstInterpretation, true);
-
- const Vector<String>& interpretations = m_dictationPhrases->at(i);
-
+
if (interpretations.size() > 1)
document().markers().addDictationPhraseWithAlternativesMarker(endingSelection().toNormalizedRange().get(), interpretations);
-
+
setEndingSelection(VisibleSelection(endingSelection().visibleEnd()));
}
-
+
VisiblePosition afterResults(endingSelection().visibleEnd());
-
+
Element* root = afterResults.rootEditableElement();
+
// FIXME: Add the result marker using a Position cached before results are inserted, instead of relying on TextIterators.
RefPtr<Range> rangeToEnd = Range::create(document(), createLegacyEditingPosition((Node *)root, 0), afterResults.deepEquivalent());
int endIndex = TextIterator::rangeLength(rangeToEnd.get(), true);
int startIndex = endIndex - resultLength;
-
+
if (startIndex >= 0) {
RefPtr<Range> resultRange = TextIterator::rangeFromLocationAndLength(document().documentElement(), startIndex, endIndex, true);
document().markers().addDictationResultMarker(resultRange.get(), m_metadata);
Modified: trunk/Source/WebCore/editing/ios/DictationCommandIOS.h (183171 => 183172)
--- trunk/Source/WebCore/editing/ios/DictationCommandIOS.h 2015-04-23 05:56:28 UTC (rev 183171)
+++ trunk/Source/WebCore/editing/ios/DictationCommandIOS.h 2015-04-23 06:02:14 UTC (rev 183172)
@@ -27,8 +27,6 @@
#define DictationCommandIOS_h
#import "CompositeEditCommand.h"
-#import <wtf/OwnPtr.h>
-#import <wtf/PassOwnPtr.h>
#import <wtf/RetainPtr.h>
typedef struct objc_object *id;
@@ -37,19 +35,18 @@
class DictationCommandIOS : public CompositeEditCommand {
public:
- static Ref<DictationCommandIOS> create(Document& document, PassOwnPtr<Vector<Vector<String> > > dictationPhrase, RetainPtr<id> metadata)
+ static Ref<DictationCommandIOS> create(Document& document, Vector<Vector<String>>&& dictationPhrases, RetainPtr<id> metadata)
{
- return adoptRef(*new DictationCommandIOS(document, dictationPhrase, metadata));
+ return adoptRef(*new DictationCommandIOS(document, WTF::move(dictationPhrases), WTF::move(metadata)));
}
-
- virtual ~DictationCommandIOS();
+
private:
- DictationCommandIOS(Document& document, PassOwnPtr<Vector<Vector<String> > > dictationPhrase, RetainPtr<id> metadata);
-
- virtual void doApply();
- virtual EditAction editingAction() const { return EditActionDictation; }
-
- OwnPtr<Vector<Vector<String> > > m_dictationPhrases;
+ DictationCommandIOS(Document&, Vector<Vector<String>>&& dictationPhrases, RetainPtr<id> metadata);
+
+ virtual void doApply() override;
+ virtual EditAction editingAction() const override { return EditActionDictation; }
+
+ Vector<Vector<String>> m_dictationPhrases;
RetainPtr<id> m_metadata;
};
Modified: trunk/Source/WebCore/platform/network/ios/QuickLook.h (183171 => 183172)
--- trunk/Source/WebCore/platform/network/ios/QuickLook.h 2015-04-23 05:56:28 UTC (rev 183171)
+++ trunk/Source/WebCore/platform/network/ios/QuickLook.h 2015-04-23 06:02:14 UTC (rev 183172)
@@ -31,7 +31,6 @@
#import "QuickLookHandleClient.h"
#import "ResourceRequest.h"
#import <objc/objc-runtime.h>
-#import <wtf/PassOwnPtr.h>
#import <wtf/RefPtr.h>
OBJC_CLASS NSData;
@@ -41,6 +40,7 @@
OBJC_CLASS NSString;
OBJC_CLASS NSURL;
OBJC_CLASS NSURLConnection;
+OBJC_CLASS NSURLRequest;
OBJC_CLASS NSURLResponse;
OBJC_CLASS QLPreviewConverter;
@@ -72,7 +72,7 @@
WEBCORE_EXPORT NSString *qlPreviewConverterUTIForURL(NSURL *);
WEBCORE_EXPORT void removeQLPreviewConverterForURL(NSURL *);
-WEBCORE_EXPORT PassOwnPtr<ResourceRequest> registerQLPreviewConverterIfNeeded(NSURL *, NSString *mimeType, NSData *);
+WEBCORE_EXPORT RetainPtr<NSURLRequest> registerQLPreviewConverterIfNeeded(NSURL *, NSString *mimeType, NSData *);
const URL safeQLURLForDocumentURLAndResourceURL(const URL& documentURL, const String& resourceURL);
Modified: trunk/Source/WebCore/platform/network/ios/QuickLook.mm (183171 => 183172)
--- trunk/Source/WebCore/platform/network/ios/QuickLook.mm 2015-04-23 05:56:28 UTC (rev 183171)
+++ trunk/Source/WebCore/platform/network/ios/QuickLook.mm 2015-04-23 06:02:14 UTC (rev 183172)
@@ -188,7 +188,7 @@
[QLContentDictionary() removeObjectForKey:url];
}
-PassOwnPtr<ResourceRequest> WebCore::registerQLPreviewConverterIfNeeded(NSURL *url, NSString *mimeType, NSData *data)
+RetainPtr<NSURLRequest> WebCore::registerQLPreviewConverterIfNeeded(NSURL *url, NSString *mimeType, NSData *data)
{
RetainPtr<NSString> updatedMIMEType = adoptNS(WebCore::QLTypeCopyBestMimeTypeForURLAndMimeType(url, mimeType));
@@ -202,10 +202,10 @@
// the URL that the WebDataSource will see during -dealloc.
addQLPreviewConverterWithFileForURL([request URL], converter.get(), nil);
- return adoptPtr(new ResourceRequest(request));
+ return request;
}
- return nullptr;
+ return nil;
}
const URL WebCore::safeQLURLForDocumentURLAndResourceURL(const URL& documentURL, const String& resourceURL)
Modified: trunk/Source/WebKit/cf/ChangeLog (183171 => 183172)
--- trunk/Source/WebKit/cf/ChangeLog 2015-04-23 05:56:28 UTC (rev 183171)
+++ trunk/Source/WebKit/cf/ChangeLog 2015-04-23 06:02:14 UTC (rev 183172)
@@ -1,3 +1,12 @@
+2015-04-22 Darin Adler <[email protected]>
+
+ Remove OwnPtr and PassOwnPtr use from WebKit/cf, WebKit/mac, and WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=143943
+
+ Reviewed by Anders Carlsson.
+
+ * WebCoreSupport/WebInspectorClientCF.cpp: Removed unneeded include.
+
2014-09-25 Csaba Osztrogonác <[email protected]>
Remove WinCE port from trunk
Modified: trunk/Source/WebKit/cf/WebCoreSupport/WebInspectorClientCF.cpp (183171 => 183172)
--- trunk/Source/WebKit/cf/WebCoreSupport/WebInspectorClientCF.cpp 2015-04-23 05:56:28 UTC (rev 183171)
+++ trunk/Source/WebKit/cf/WebCoreSupport/WebInspectorClientCF.cpp 2015-04-23 06:02:14 UTC (rev 183172)
@@ -54,7 +54,6 @@
#include <WebCore/InspectorFrontendClientLocal.h>
#include <WebCore/Page.h>
-#include <wtf/PassOwnPtr.h>
#include <wtf/RetainPtr.h>
#include <wtf/Vector.h>
#include <wtf/text/WTFString.h>
Modified: trunk/Source/WebKit/mac/ChangeLog (183171 => 183172)
--- trunk/Source/WebKit/mac/ChangeLog 2015-04-23 05:56:28 UTC (rev 183171)
+++ trunk/Source/WebKit/mac/ChangeLog 2015-04-23 06:02:14 UTC (rev 183172)
@@ -1,3 +1,49 @@
+2015-04-22 Darin Adler <[email protected]>
+
+ Remove OwnPtr and PassOwnPtr use from WebKit/cf, WebKit/mac, and WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=143943
+
+ Reviewed by Anders Carlsson.
+
+ * Plugins/Hosted/ProxyInstance.h: Removed unneeded include.
+ * Plugins/WebBaseNetscapePluginView.h: Ditto.
+
+ * Plugins/WebNetscapePluginEventHandler.h: Use unique_ptr instead of
+ PassOwnPtr for the create function. Also tweaked formatting and removed
+ unneeded forward declaration of CGRect.
+ * Plugins/WebNetscapePluginEventHandler.mm:
+ (WebNetscapePluginEventHandler::create): Changed to use unique_ptr and
+ make_unique.
+
+ * Plugins/WebNetscapePluginView.h: Use unique_ptr instead of OwnPtr for
+ the _eventHandler field.
+ * Plugins/WebNetscapePluginView.mm:
+ (-[WebNetscapePluginView destroyPlugin]): Changed code to work with unique_ptr.
+
+ * WebCoreSupport/WebUserMediaClient.mm: Removed unneeded include.
+
+ * WebView/WebDeviceOrientationProviderMock.mm: Changed to use make_unique.
+ * WebView/WebDeviceOrientationProviderMockInternal.h: Changed to use unique_ptr.
+
+ * WebView/WebFrame.mm:
+ (vectorForDictationPhrasesArray): Changed to return Vector<Vector<String>> and
+ not a PassOwnPtr. Also rewrote to be much simpler, although there is still a
+ pre-existing problem here where this could put empty vectors into the result,
+ and I'm pretty sure the client never expects any of the Vector<String> to be empty.
+ (-[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:]):
+ Rewrote logic to involve WebCore types a bit less; old code was round tripping
+ things through WebCore::URL for no obvious reason.
+
+ * WebView/WebFrameInternal.h: Changed vectorForDictationPhrasesArray to return
+ a Vector<Vector<String>> and not a PassOwnPtr.
+
+ * WebView/WebFullScreenController.h: Removed unneeded include.
+
+ * WebView/WebViewData.h: Changed m_alternativeTextUIController to be a
+ m_alternativeTextUIController.
+ * WebView/WebViewData.mm:
+ (-[WebViewPrivate init]): Use make_unique to initialize m_alternativeTextUIController.
+
2015-04-22 Brent Fulgham <[email protected]>
VisibleSelection should only accept Range by reference
Modified: trunk/Source/WebKit/mac/Plugins/Hosted/ProxyInstance.h (183171 => 183172)
--- trunk/Source/WebKit/mac/Plugins/Hosted/ProxyInstance.h 2015-04-23 05:56:28 UTC (rev 183171)
+++ trunk/Source/WebKit/mac/Plugins/Hosted/ProxyInstance.h 2015-04-23 06:02:14 UTC (rev 183172)
@@ -32,7 +32,6 @@
#import "WebKitPluginHostTypes.h"
#import <WebCore/BridgeJSC.h>
#import <WebCore/runtime_root.h>
-#import <wtf/OwnPtr.h>
namespace WebKit {
Modified: trunk/Source/WebKit/mac/Plugins/WebBaseNetscapePluginView.h (183171 => 183172)
--- trunk/Source/WebKit/mac/Plugins/WebBaseNetscapePluginView.h 2015-04-23 05:56:28 UTC (rev 183171)
+++ trunk/Source/WebKit/mac/Plugins/WebBaseNetscapePluginView.h 2015-04-23 06:02:14 UTC (rev 183172)
@@ -32,7 +32,6 @@
#import "WebNetscapePluginPackage.h"
#import "WebPluginContainerCheck.h"
#import <wtf/Forward.h>
-#import <wtf/OwnPtr.h>
#import <wtf/PassRefPtr.h>
#import <wtf/RefPtr.h>
#import <wtf/RetainPtr.h>
Modified: trunk/Source/WebKit/mac/Plugins/WebNetscapePluginEventHandler.h (183171 => 183172)
--- trunk/Source/WebKit/mac/Plugins/WebNetscapePluginEventHandler.h 2015-04-23 05:56:28 UTC (rev 183171)
+++ trunk/Source/WebKit/mac/Plugins/WebNetscapePluginEventHandler.h 2015-04-23 06:02:14 UTC (rev 183172)
@@ -33,26 +33,24 @@
@class NSEvent;
@class WebNetscapePluginView;
-struct CGRect;
-
class WebNetscapePluginEventHandler {
public:
- static PassOwnPtr<WebNetscapePluginEventHandler> create(WebNetscapePluginView*);
+ static std::unique_ptr<WebNetscapePluginEventHandler> create(WebNetscapePluginView *);
virtual ~WebNetscapePluginEventHandler() { }
virtual void drawRect(CGContextRef, const NSRect&) = 0;
- virtual void mouseDown(NSEvent*) = 0;
- virtual void mouseDragged(NSEvent*) = 0;
- virtual void mouseEntered(NSEvent*) = 0;
- virtual void mouseExited(NSEvent*) = 0;
- virtual void mouseMoved(NSEvent*) = 0;
- virtual void mouseUp(NSEvent*) = 0;
- virtual bool scrollWheel(NSEvent*) = 0;
+ virtual void mouseDown(NSEvent *) = 0;
+ virtual void mouseDragged(NSEvent *) = 0;
+ virtual void mouseEntered(NSEvent *) = 0;
+ virtual void mouseExited(NSEvent *) = 0;
+ virtual void mouseMoved(NSEvent *) = 0;
+ virtual void mouseUp(NSEvent *) = 0;
+ virtual bool scrollWheel(NSEvent *) = 0;
- virtual void keyDown(NSEvent*) = 0;
- virtual void keyUp(NSEvent*) = 0;
- virtual void flagsChanged(NSEvent*) = 0;
+ virtual void keyDown(NSEvent *) = 0;
+ virtual void keyUp(NSEvent *) = 0;
+ virtual void flagsChanged(NSEvent *) = 0;
virtual void syntheticKeyDownWithCommandModifier(int keyCode, char character) = 0;
virtual void focusChanged(bool hasFocus) = 0;
@@ -62,17 +60,18 @@
virtual void stopTimers() { }
// Returns the platform specific window used in NPP_SetWindow
- virtual void* platformWindow(NSWindow*) = 0;
+ virtual void* platformWindow(NSWindow *) = 0;
bool currentEventIsUserGesture() const { return m_currentEventIsUserGesture; }
+
protected:
- WebNetscapePluginEventHandler(WebNetscapePluginView* pluginView)
+ explicit WebNetscapePluginEventHandler(WebNetscapePluginView *pluginView)
: m_pluginView(pluginView)
, m_currentEventIsUserGesture(false)
{
}
- WebNetscapePluginView* m_pluginView;
+ WebNetscapePluginView *m_pluginView;
bool m_currentEventIsUserGesture;
};
Modified: trunk/Source/WebKit/mac/Plugins/WebNetscapePluginEventHandler.mm (183171 => 183172)
--- trunk/Source/WebKit/mac/Plugins/WebNetscapePluginEventHandler.mm 2015-04-23 05:56:28 UTC (rev 183171)
+++ trunk/Source/WebKit/mac/Plugins/WebNetscapePluginEventHandler.mm 2015-04-23 06:02:14 UTC (rev 183172)
@@ -28,20 +28,19 @@
#import "WebNetscapePluginEventHandler.h"
#import <wtf/Assertions.h>
-#import <wtf/PassOwnPtr.h>
#import "WebNetscapePluginView.h"
#import "WebNetscapePluginEventHandlerCarbon.h"
#import "WebNetscapePluginEventHandlerCocoa.h"
-PassOwnPtr<WebNetscapePluginEventHandler> WebNetscapePluginEventHandler::create(WebNetscapePluginView* pluginView)
+std::unique_ptr<WebNetscapePluginEventHandler> WebNetscapePluginEventHandler::create(WebNetscapePluginView *pluginView)
{
switch ([pluginView eventModel]) {
#ifndef NP_NO_CARBON
case NPEventModelCarbon:
- return adoptPtr(new WebNetscapePluginEventHandlerCarbon(pluginView));
-#endif // NP_NO_CARBON
+ return std::make_unique<WebNetscapePluginEventHandlerCarbon>(pluginView);
+#endif
case NPEventModelCocoa:
- return adoptPtr(new WebNetscapePluginEventHandlerCocoa(pluginView));
+ return std::make_unique<WebNetscapePluginEventHandlerCocoa>(pluginView);
default:
ASSERT_NOT_REACHED();
return nullptr;
Modified: trunk/Source/WebKit/mac/Plugins/WebNetscapePluginView.h (183171 => 183172)
--- trunk/Source/WebKit/mac/Plugins/WebNetscapePluginView.h 2015-04-23 05:56:28 UTC (rev 183171)
+++ trunk/Source/WebKit/mac/Plugins/WebNetscapePluginView.h 2015-04-23 06:02:14 UTC (rev 183172)
@@ -29,18 +29,13 @@
#if ENABLE(NETSCAPE_PLUGIN_API)
#import "WebBaseNetscapePluginView.h"
-
#import "WebNetscapeContainerCheckPrivate.h"
#import <WebKitLegacy/npfunctions.h>
#import <WebKitLegacy/npapi.h>
#import <wtf/HashMap.h>
#import <wtf/HashSet.h>
-#import <wtf/OwnPtr.h>
-@class WebDataSource;
-@class WebFrame;
@class WebNetscapePluginPackage;
-@class WebView;
class PluginTimer;
class WebNetscapePluginStream;
@@ -83,7 +78,7 @@
GWorldPtr offscreenGWorld;
#endif
- OwnPtr<WebNetscapePluginEventHandler> _eventHandler;
+ std::unique_ptr<WebNetscapePluginEventHandler> _eventHandler;
BOOL inSetWindow;
BOOL shouldStopSoon;
Modified: trunk/Source/WebKit/mac/Plugins/WebNetscapePluginView.mm (183171 => 183172)
--- trunk/Source/WebKit/mac/Plugins/WebNetscapePluginView.mm 2015-04-23 05:56:28 UTC (rev 183171)
+++ trunk/Source/WebKit/mac/Plugins/WebNetscapePluginView.mm 2015-04-23 06:02:14 UTC (rev 183172)
@@ -1187,12 +1187,12 @@
// Setting the window type to 0 ensures that NPP_SetWindow will be called if the plug-in is restarted.
lastSetWindow.type = (NPWindowType)0;
- _pluginLayer = 0;
+ _pluginLayer = nil;
[self _destroyPlugin];
[_pluginPackage.get() close];
- _eventHandler.clear();
+ _eventHandler = nullptr;
}
- (NPEventModel)eventModel
Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebUserMediaClient.mm (183171 => 183172)
--- trunk/Source/WebKit/mac/WebCoreSupport/WebUserMediaClient.mm 2015-04-23 05:56:28 UTC (rev 183171)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebUserMediaClient.mm 2015-04-23 06:02:14 UTC (rev 183172)
@@ -36,7 +36,6 @@
#import <WebCore/ScriptExecutionContext.h>
#import <WebCore/UserMediaRequest.h>
#import <wtf/HashMap.h>
-#import <wtf/PassOwnPtr.h>
#import <wtf/RefPtr.h>
#import <wtf/RetainPtr.h>
Modified: trunk/Source/WebKit/mac/WebView/WebDeviceOrientationProviderMock.mm (183171 => 183172)
--- trunk/Source/WebKit/mac/WebView/WebDeviceOrientationProviderMock.mm 2015-04-23 05:56:28 UTC (rev 183171)
+++ trunk/Source/WebKit/mac/WebView/WebDeviceOrientationProviderMock.mm 2015-04-23 06:02:14 UTC (rev 183172)
@@ -26,7 +26,6 @@
#import "WebDeviceOrientationProviderMockInternal.h"
#import "WebDeviceOrientationInternal.h"
-#import <wtf/PassOwnPtr.h>
using namespace WebCore;
@@ -37,7 +36,7 @@
self = [super init];
if (!self)
return nil;
- m_core = adoptPtr(new DeviceOrientationClientMock());
+ m_core = std::make_unique<DeviceOrientationClientMock>();
return self;
}
Modified: trunk/Source/WebKit/mac/WebView/WebDeviceOrientationProviderMockInternal.h (183171 => 183172)
--- trunk/Source/WebKit/mac/WebView/WebDeviceOrientationProviderMockInternal.h 2015-04-23 05:56:28 UTC (rev 183171)
+++ trunk/Source/WebKit/mac/WebView/WebDeviceOrientationProviderMockInternal.h 2015-04-23 06:02:14 UTC (rev 183172)
@@ -24,12 +24,10 @@
*/
#import "WebDeviceOrientationProviderMock.h"
-
#import <WebCore/DeviceOrientationClientMock.h>
-#import <wtf/OwnPtr.h>
@interface WebDeviceOrientationProviderMockInternal : NSObject {
- OwnPtr<WebCore::DeviceOrientationClientMock> m_core;
+ std::unique_ptr<WebCore::DeviceOrientationClientMock> m_core;
}
- (id)init;
Modified: trunk/Source/WebKit/mac/WebView/WebFrame.mm (183171 => 183172)
--- trunk/Source/WebKit/mac/WebView/WebFrame.mm 2015-04-23 05:56:28 UTC (rev 183171)
+++ trunk/Source/WebKit/mac/WebView/WebFrame.mm 2015-04-23 06:02:14 UTC (rev 183172)
@@ -240,37 +240,25 @@
}
#if PLATFORM(IOS)
-PassOwnPtr<Vector<Vector<String>>> vectorForDictationPhrasesArray(NSArray *dictationPhrases)
+
+Vector<Vector<String>> vectorForDictationPhrasesArray(NSArray *dictationPhrases)
{
- NSUInteger dictationPhrasesCount = [dictationPhrases count];
- if (!dictationPhrasesCount)
- return PassOwnPtr<Vector<Vector<String> > >();
-
- OwnPtr<Vector<Vector<String> > > dictationPhrasesVector = adoptPtr(new Vector<Vector<String> >(dictationPhrasesCount));
-
- for (NSUInteger i = 0; i < dictationPhrasesCount; i++) {
-
- id dictationPhrase = [dictationPhrases objectAtIndex:i];
+ Vector<Vector<String>> result;
+
+ for (id dictationPhrase in dictationPhrases) {
if (![dictationPhrase isKindOfClass:[NSArray class]])
continue;
-
- NSArray *interpretationsArray = (NSArray *)dictationPhrase;
- Vector<String>& interpretationsVector = dictationPhrasesVector->at(i);
-
- NSUInteger interpretationsCount = [interpretationsArray count];
-
- for (NSUInteger j = 0; j < interpretationsCount; j++) {
-
- id interpretation = [interpretationsArray objectAtIndex:j];
+ result.append(Vector<String>());
+ for (id interpretation : (NSArray *)dictationPhrase) {
if (![interpretation isKindOfClass:[NSString class]])
continue;
-
- interpretationsVector.append(String((NSString *)interpretation));
+ result.last().append((NSString *)interpretation);
}
}
- return dictationPhrasesVector.release();
+ return result;
}
+
#endif
@implementation WebFrame (WebInternal)
@@ -1704,11 +1692,11 @@
if (!element)
return;
- WebCore::Frame *frame = core(self);
+ auto* frame = core(self);
if (!frame)
return;
- frame->editor().setDictationPhrasesAsChildOfElement(vectorForDictationPhrasesArray(dictationPhrases), metadata, core(element));
+ frame->editor().setDictationPhrasesAsChildOfElement(vectorForDictationPhrasesArray(dictationPhrases), metadata, *core(element));
}
- (NSArray *)interpretationsForCurrentRoot
@@ -2507,33 +2495,32 @@
- (void)_loadData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)encodingName baseURL:(NSURL *)baseURL unreachableURL:(NSURL *)unreachableURL
{
-#if !PLATFORM(IOS)
+#if PLATFORM(MAC)
if (!pthread_main_np())
return [[self _webkit_invokeOnMainThread] _loadData:data MIMEType:MIMEType textEncodingName:encodingName baseURL:baseURL unreachableURL:unreachableURL];
#endif
-
- URL responseURL;
- if (!baseURL) {
+
+ NSURL *responseURL = nil;
+ if (baseURL)
+ baseURL = [baseURL absoluteURL];
+ else {
baseURL = blankURL();
responseURL = createUniqueWebDataURL();
}
#if USE(QUICK_LOOK)
if (shouldUseQuickLookForMIMEType(MIMEType)) {
- URL qlURL = responseURL;
- if (qlURL.isEmpty())
- qlURL = [baseURL absoluteURL];
- OwnPtr<ResourceRequest> qlRequest(registerQLPreviewConverterIfNeeded((NSURL *)qlURL, MIMEType, data));
- if (qlRequest) {
- _private->coreFrame->loader().load(FrameLoadRequest(_private->coreFrame, *qlRequest));
+ NSURL *quickLookURL = responseURL ? responseURL : baseURL;
+ if (auto request = registerQLPreviewConverterIfNeeded(quickLookURL, MIMEType, data)) {
+ _private->coreFrame->loader().load(FrameLoadRequest(_private->coreFrame, request.get()));
return;
}
}
-#endif // USE(QUICK_LOOK)
+#endif
- ResourceRequest request([baseURL absoluteURL]);
+ ResourceRequest request(baseURL);
-#if !PLATFORM(IOS)
+#if PLATFORM(MAC)
// hack because Mail checks for this property to detect data / archive loads
[NSURLProtocol setProperty:@"" forKey:@"WebDataRequest" inRequest:(NSMutableURLRequest *)request.nsURLRequest(UpdateHTTPBody)];
#endif
@@ -2543,7 +2530,6 @@
_private->coreFrame->loader().load(FrameLoadRequest(_private->coreFrame, request, substituteData));
}
-
- (void)loadData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)encodingName baseURL:(NSURL *)baseURL
{
WebCoreThreadViolationCheckRoundTwo();
Modified: trunk/Source/WebKit/mac/WebView/WebFrameInternal.h (183171 => 183172)
--- trunk/Source/WebKit/mac/WebView/WebFrameInternal.h 2015-04-23 05:56:28 UTC (rev 183171)
+++ trunk/Source/WebKit/mac/WebView/WebFrameInternal.h 2015-04-23 06:02:14 UTC (rev 183172)
@@ -73,7 +73,7 @@
WebCore::TextDirectionSubmenuInclusionBehavior core(WebTextDirectionSubmenuInclusionBehavior);
#if defined(__cplusplus) && PLATFORM(IOS)
-PassOwnPtr<Vector<Vector<String>>> vectorForDictationPhrasesArray(NSArray *);
+Vector<Vector<String>> vectorForDictationPhrasesArray(NSArray *);
#endif
WebView *getWebView(WebFrame *webFrame);
Modified: trunk/Source/WebKit/mac/WebView/WebFullScreenController.h (183171 => 183172)
--- trunk/Source/WebKit/mac/WebView/WebFullScreenController.h 2015-04-23 05:56:28 UTC (rev 183171)
+++ trunk/Source/WebKit/mac/WebView/WebFullScreenController.h 2015-04-23 06:02:14 UTC (rev 183172)
@@ -26,7 +26,6 @@
#if ENABLE(FULLSCREEN_API) && !PLATFORM(IOS)
#import <WebCore/IntPoint.h>
-#import <wtf/OwnPtr.h>
#import <wtf/RefPtr.h>
#import <wtf/RetainPtr.h>
Modified: trunk/Source/WebKit/mac/WebView/WebViewData.h (183171 => 183172)
--- trunk/Source/WebKit/mac/WebView/WebViewData.h 2015-04-23 05:56:28 UTC (rev 183171)
+++ trunk/Source/WebKit/mac/WebView/WebViewData.h 2015-04-23 06:02:14 UTC (rev 183172)
@@ -34,7 +34,6 @@
#import <WebCore/LayerFlushSchedulerClient.h>
#import <WebCore/WebCoreKeyboardUIMode.h>
#import <wtf/HashMap.h>
-#import <wtf/PassOwnPtr.h>
#import <wtf/RetainPtr.h>
#import <wtf/ThreadingPrimitives.h>
#import <wtf/text/WTFString.h>
@@ -318,7 +317,7 @@
#endif
#if USE(DICTATION_ALTERNATIVES)
- OwnPtr<WebCore::AlternativeTextUIController> m_alternativeTextUIController;
+ std::unique_ptr<WebCore::AlternativeTextUIController> m_alternativeTextUIController;
#endif
RetainPtr<NSData> sourceApplicationAuditData;
Modified: trunk/Source/WebKit/mac/WebView/WebViewData.mm (183171 => 183172)
--- trunk/Source/WebKit/mac/WebView/WebViewData.mm 2015-04-23 05:56:28 UTC (rev 183171)
+++ trunk/Source/WebKit/mac/WebView/WebViewData.mm 2015-04-23 06:02:14 UTC (rev 183172)
@@ -162,7 +162,7 @@
pluginDatabaseClientCount++;
#if USE(DICTATION_ALTERNATIVES)
- m_alternativeTextUIController = adoptPtr(new WebCore::AlternativeTextUIController);
+ m_alternativeTextUIController = std::make_unique<WebCore::AlternativeTextUIController>();
#endif
return self;
Modified: trunk/Source/WebKit2/ChangeLog (183171 => 183172)
--- trunk/Source/WebKit2/ChangeLog 2015-04-23 05:56:28 UTC (rev 183171)
+++ trunk/Source/WebKit2/ChangeLog 2015-04-23 06:02:14 UTC (rev 183172)
@@ -1,3 +1,13 @@
+2015-04-22 Darin Adler <[email protected]>
+
+ Remove OwnPtr and PassOwnPtr use from WebKit/cf, WebKit/mac, and WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=143943
+
+ Reviewed by Anders Carlsson.
+
+ * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
+ Removed unneeded include.
+
2015-04-22 Brent Fulgham <[email protected]>
VisibleSelection should only accept Range by reference
Modified: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h (183171 => 183172)
--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h 2015-04-23 05:56:28 UTC (rev 183171)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h 2015-04-23 06:02:14 UTC (rev 183172)
@@ -41,7 +41,6 @@
#include <WebCore/IntSize.h>
#include <WebCore/PageOverlay.h>
#include <WebCore/Timer.h>
-#include <wtf/OwnPtr.h>
#include <wtf/RunLoop.h>
#include <wtf/Threading.h>