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

Unified Diff: Source/core/clipboard/DataTransferItemList.cpp

Issue 169323002: Oilpan: Move core/clipboard/ to oilpan's heap (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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
« no previous file with comments | « Source/core/clipboard/DataTransferItemList.h ('k') | Source/core/clipboard/DataTransferItemList.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/clipboard/DataTransferItemList.cpp
diff --git a/Source/core/clipboard/DataTransferItemList.cpp b/Source/core/clipboard/DataTransferItemList.cpp
index b88ae428f58c5235d414e656d9a699df434dcef0..5ca82e7794a4d0602ea25594506e835a8bbd1e42 100644
--- a/Source/core/clipboard/DataTransferItemList.cpp
+++ b/Source/core/clipboard/DataTransferItemList.cpp
@@ -35,9 +35,11 @@
namespace WebCore {
-PassRefPtr<DataTransferItemList> DataTransferItemList::create(PassRefPtr<Clipboard> clipboard, PassRefPtr<DataObject> list)
+DEFINE_GC_INFO(DataTransferItemList);
+
+PassRefPtrWillBeRawPtr<DataTransferItemList> DataTransferItemList::create(PassRefPtrWillBeRawPtr<Clipboard> clipboard, PassRefPtrWillBeRawPtr<DataObject> list)
{
- return adoptRef(new DataTransferItemList(clipboard, list));
+ return adoptRefWillBeNoop(new DataTransferItemList(clipboard, list));
}
DataTransferItemList::~DataTransferItemList()
@@ -51,11 +53,11 @@ size_t DataTransferItemList::length() const
return m_dataObject->length();
}
-PassRefPtr<DataTransferItem> DataTransferItemList::item(unsigned long index)
+PassRefPtrWillBeRawPtr<DataTransferItem> DataTransferItemList::item(unsigned long index)
{
if (!m_clipboard->canReadTypes())
return nullptr;
- RefPtr<DataObjectItem> item = m_dataObject->item(index);
+ RefPtrWillBeRawPtr<DataObjectItem> item = m_dataObject->item(index);
if (!item)
return nullptr;
@@ -78,11 +80,11 @@ void DataTransferItemList::clear()
m_dataObject->clearAll();
}
-PassRefPtr<DataTransferItem> DataTransferItemList::add(const String& data, const String& type, ExceptionState& exceptionState)
+PassRefPtrWillBeRawPtr<DataTransferItem> DataTransferItemList::add(const String& data, const String& type, ExceptionState& exceptionState)
{
if (!m_clipboard->canWriteData())
return nullptr;
- RefPtr<DataObjectItem> item = m_dataObject->add(data, type);
+ RefPtrWillBeRawPtr<DataObjectItem> item = m_dataObject->add(data, type);
if (!item) {
exceptionState.throwDOMException(NotSupportedError, "An item already exists for type '" + type + "'.");
return nullptr;
@@ -90,21 +92,27 @@ PassRefPtr<DataTransferItem> DataTransferItemList::add(const String& data, const
return DataTransferItem::create(m_clipboard, item);
}
-PassRefPtr<DataTransferItem> DataTransferItemList::add(PassRefPtr<File> file)
+PassRefPtrWillBeRawPtr<DataTransferItem> DataTransferItemList::add(PassRefPtr<File> file)
{
if (!m_clipboard->canWriteData())
return nullptr;
- RefPtr<DataObjectItem> item = m_dataObject->add(file);
+ RefPtrWillBeRawPtr<DataObjectItem> item = m_dataObject->add(file);
if (!item)
return nullptr;
return DataTransferItem::create(m_clipboard, item);
}
-DataTransferItemList::DataTransferItemList(PassRefPtr<Clipboard> clipboard, PassRefPtr<DataObject> dataObject)
+DataTransferItemList::DataTransferItemList(PassRefPtrWillBeRawPtr<Clipboard> clipboard, PassRefPtrWillBeRawPtr<DataObject> dataObject)
: m_clipboard(clipboard)
, m_dataObject(dataObject)
{
ScriptWrappable::init(this);
}
+void DataTransferItemList::trace(Visitor* visitor)
+{
+ visitor->trace(m_clipboard);
+ visitor->trace(m_dataObject);
+}
+
} // namespace WebCore
« no previous file with comments | « Source/core/clipboard/DataTransferItemList.h ('k') | Source/core/clipboard/DataTransferItemList.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698