Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(776)

Unified Diff: third_party/WebKit/Source/core/page/DragController.cpp

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/page/DragController.cpp
diff --git a/third_party/WebKit/Source/core/page/DragController.cpp b/third_party/WebKit/Source/core/page/DragController.cpp
index 9ec2a23d4e78f18e2f18b2c44c30986ec29c2e5d..e7b95fa747315141fc1ec2727edeec7a0ed0218d 100644
--- a/third_party/WebKit/Source/core/page/DragController.cpp
+++ b/third_party/WebKit/Source/core/page/DragController.cpp
@@ -141,26 +141,26 @@ DragController::~DragController()
{
}
-PassOwnPtrWillBeRawPtr<DragController> DragController::create(Page* page, DragClient* client)
+RawPtr<DragController> DragController::create(Page* page, DragClient* client)
{
- return adoptPtrWillBeNoop(new DragController(page, client));
+ return new DragController(page, client);
}
-static PassRefPtrWillBeRawPtr<DocumentFragment> documentFragmentFromDragData(DragData* dragData, LocalFrame* frame, RefPtrWillBeRawPtr<Range> context, bool allowPlainText, bool& chosePlainText)
+static RawPtr<DocumentFragment> documentFragmentFromDragData(DragData* dragData, LocalFrame* frame, RawPtr<Range> context, bool allowPlainText, bool& chosePlainText)
{
ASSERT(dragData);
chosePlainText = false;
Document& document = context->ownerDocument();
if (dragData->containsCompatibleContent()) {
- if (PassRefPtrWillBeRawPtr<DocumentFragment> fragment = dragData->asFragment(frame))
+ if (RawPtr<DocumentFragment> fragment = dragData->asFragment(frame))
return fragment;
if (dragData->containsURL(DragData::DoNotConvertFilenames)) {
String title;
String url = dragData->asURL(DragData::DoNotConvertFilenames, &title);
if (!url.isEmpty()) {
- RefPtrWillBeRawPtr<HTMLAnchorElement> anchor = HTMLAnchorElement::create(document);
+ RawPtr<HTMLAnchorElement> anchor = HTMLAnchorElement::create(document);
anchor->setHref(AtomicString(url));
if (title.isEmpty()) {
// Try the plain text first because the url might be normalized or escaped.
@@ -169,9 +169,9 @@ static PassRefPtrWillBeRawPtr<DocumentFragment> documentFragmentFromDragData(Dra
if (title.isEmpty())
title = url;
}
- RefPtrWillBeRawPtr<Node> anchorText = document.createTextNode(title);
+ RawPtr<Node> anchorText = document.createTextNode(title);
anchor->appendChild(anchorText);
- RefPtrWillBeRawPtr<DocumentFragment> fragment = document.createDocumentFragment();
+ RawPtr<DocumentFragment> fragment = document.createDocumentFragment();
fragment->appendChild(anchor);
return fragment.release();
}
@@ -213,7 +213,7 @@ void DragController::dragExited(DragData* dragData)
ASSERT(dragData);
LocalFrame* mainFrame = m_page->deprecatedLocalMainFrame();
- RefPtrWillBeRawPtr<FrameView> frameView(mainFrame->view());
+ RawPtr<FrameView> frameView(mainFrame->view());
if (frameView) {
DataTransferAccessPolicy policy = (!m_documentUnderMouse || m_documentUnderMouse->getSecurityOrigin()->isLocal()) ? DataTransferReadable : DataTransferTypesReadable;
DataTransfer* dataTransfer = createDraggingDataTransfer(policy, dragData);
@@ -237,7 +237,7 @@ bool DragController::performDrag(DragData* dragData)
ASSERT(dragData);
m_documentUnderMouse = m_page->deprecatedLocalMainFrame()->documentAtPoint(dragData->clientPosition());
if ((m_dragDestinationAction & DragDestinationActionDHTML) && m_documentIsHandlingDrag) {
- RefPtrWillBeRawPtr<LocalFrame> mainFrame = m_page->deprecatedLocalMainFrame();
+ RawPtr<LocalFrame> mainFrame = m_page->deprecatedLocalMainFrame();
bool preventedDefault = false;
if (mainFrame->view()) {
// Sending an event can result in the destruction of the view and part.
@@ -348,7 +348,7 @@ bool DragController::tryDocumentDrag(DragData* dragData, DragDestinationAction a
// It's unclear why this check is after tryDHTMLDrag.
// We send drag events in tryDHTMLDrag and that may be the reason.
- RefPtrWillBeRawPtr<FrameView> frameView = m_documentUnderMouse->view();
+ RawPtr<FrameView> frameView = m_documentUnderMouse->view();
if (!frameView)
return false;
@@ -421,7 +421,7 @@ DragOperation DragController::operationForLoad(DragData* dragData)
return dragOperation(dragData);
}
-static bool setSelectionToDragCaret(LocalFrame* frame, VisibleSelection& dragCaret, RefPtrWillBeRawPtr<Range>& range, const IntPoint& point)
+static bool setSelectionToDragCaret(LocalFrame* frame, VisibleSelection& dragCaret, RawPtr<Range>& range, const IntPoint& point)
{
frame->selection().setSelection(dragCaret);
if (frame->selection().isNone()) {
@@ -444,7 +444,7 @@ bool DragController::concludeEditDrag(DragData* dragData)
{
ASSERT(dragData);
- RefPtrWillBeRawPtr<HTMLInputElement> fileInput = m_fileInputElementUnderMouse;
+ RawPtr<HTMLInputElement> fileInput = m_fileInputElementUnderMouse;
if (m_fileInputElementUnderMouse) {
m_fileInputElementUnderMouse->setCanReceiveDroppedFiles(false);
m_fileInputElementUnderMouse = nullptr;
@@ -457,7 +457,7 @@ bool DragController::concludeEditDrag(DragData* dragData)
Element* element = elementUnderMouse(m_documentUnderMouse.get(), point);
if (!element)
return false;
- RefPtrWillBeRawPtr<LocalFrame> innerFrame = element->ownerDocument()->frame();
+ RawPtr<LocalFrame> innerFrame = element->ownerDocument()->frame();
ASSERT(innerFrame);
if (m_page->dragCaretController().hasCaret() && dispatchTextInputEventFor(innerFrame.get(), dragData) != DispatchEventResult::NotCanceled)
@@ -480,8 +480,8 @@ bool DragController::concludeEditDrag(DragData* dragData)
VisibleSelection dragCaret(m_page->dragCaretController().caretPosition());
m_page->dragCaretController().clear();
- RefPtrWillBeRawPtr<Range> range = createRange(dragCaret.toNormalizedEphemeralRange());
- RefPtrWillBeRawPtr<Element> rootEditableElement = innerFrame->selection().rootEditableElement();
+ RawPtr<Range> range = createRange(dragCaret.toNormalizedEphemeralRange());
+ RawPtr<Element> rootEditableElement = innerFrame->selection().rootEditableElement();
// For range to be null a WebKit client must have done something bad while
// manually controlling drag behaviour
@@ -491,7 +491,7 @@ bool DragController::concludeEditDrag(DragData* dragData)
ResourceCacheValidationSuppressor validationSuppressor(fetcher);
if (dragIsMove(innerFrame->selection(), dragData) || dragCaret.isContentRichlyEditable()) {
bool chosePlainText = false;
- RefPtrWillBeRawPtr<DocumentFragment> fragment = documentFragmentFromDragData(dragData, innerFrame.get(), range, true, chosePlainText);
+ RawPtr<DocumentFragment> fragment = documentFragmentFromDragData(dragData, innerFrame.get(), range, true, chosePlainText);
if (!fragment)
return false;
@@ -584,11 +584,11 @@ bool DragController::tryDHTMLDrag(DragData* dragData, DragOperation& operation)
{
ASSERT(dragData);
ASSERT(m_documentUnderMouse);
- RefPtrWillBeRawPtr<LocalFrame> mainFrame = m_page->deprecatedLocalMainFrame();
+ RawPtr<LocalFrame> mainFrame = m_page->deprecatedLocalMainFrame();
if (!mainFrame->view())
return false;
- RefPtrWillBeRawPtr<FrameView> viewProtector(mainFrame->view());
+ RawPtr<FrameView> viewProtector(mainFrame->view());
DataTransferAccessPolicy policy = m_documentUnderMouse->getSecurityOrigin()->isLocal() ? DataTransferReadable : DataTransferTypesReadable;
DataTransfer* dataTransfer = createDraggingDataTransfer(policy, dragData);
DragOperation srcOpMask = dragData->draggingSourceOperationMask();
@@ -705,7 +705,7 @@ static Image* getImage(Element* element)
static void prepareDataTransferForImageDrag(LocalFrame* source, DataTransfer* dataTransfer, Element* node, const KURL& linkURL, const KURL& imageURL, const String& label)
{
if (node->isContentRichlyEditable()) {
- RefPtrWillBeRawPtr<Range> range = source->document()->createRange();
+ RawPtr<Range> range = source->document()->createRange();
range->selectNode(node, ASSERT_NO_EXCEPTION);
source->selection().setSelection(VisibleSelection(EphemeralRange(range.get())));
}
@@ -934,8 +934,8 @@ void DragController::doSystemDrag(DragImage* image, const IntPoint& dragLocation
m_didInitiateDrag = true;
m_dragInitiator = frame->document();
// Protect this frame and view, as a load may occur mid drag and attempt to unload this frame
- RefPtrWillBeRawPtr<LocalFrame> mainFrame = m_page->deprecatedLocalMainFrame();
- RefPtrWillBeRawPtr<FrameView> mainFrameView = mainFrame->view();
+ RawPtr<LocalFrame> mainFrame = m_page->deprecatedLocalMainFrame();
+ RawPtr<FrameView> mainFrameView = mainFrame->view();
m_client->startDrag(image, mainFrameView->rootFrameToContents(frame->view()->contentsToRootFrame(dragLocation)),
mainFrameView->rootFrameToContents(frame->view()->contentsToRootFrame(eventPos)), dataTransfer, frame, forLink);
« no previous file with comments | « third_party/WebKit/Source/core/page/DragController.h ('k') | third_party/WebKit/Source/core/page/DragData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698