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

Unified Diff: Source/core/clipboard/DataObject.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/DataObject.h ('k') | Source/core/clipboard/DataObjectItem.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/clipboard/DataObject.cpp
diff --git a/Source/core/clipboard/DataObject.cpp b/Source/core/clipboard/DataObject.cpp
index 8ae94f4b2b58b6433e973e2a5cb3c8376c526f42..6e22de00c33fca4eb3d6c573c8352700fb751e17 100644
--- a/Source/core/clipboard/DataObject.cpp
+++ b/Source/core/clipboard/DataObject.cpp
@@ -39,9 +39,11 @@
namespace WebCore {
-PassRefPtr<DataObject> DataObject::createFromPasteboard(PasteMode pasteMode)
+DEFINE_GC_INFO(DataObject);
+
+PassRefPtrWillBeRawPtr<DataObject> DataObject::createFromPasteboard(PasteMode pasteMode)
{
- RefPtr<DataObject> dataObject = create();
+ RefPtrWillBeRawPtr<DataObject> dataObject = create();
blink::WebClipboard::Buffer buffer = Pasteboard::generalPasteboard()->buffer();
uint64_t sequenceNumber = blink::Platform::current()->clipboard()->sequenceNumber(buffer);
bool ignored;
@@ -57,14 +59,14 @@ PassRefPtr<DataObject> DataObject::createFromPasteboard(PasteMode pasteMode)
return dataObject.release();
}
-PassRefPtr<DataObject> DataObject::create()
+PassRefPtrWillBeRawPtr<DataObject> DataObject::create()
{
- return adoptRef(new DataObject());
+ return adoptRefWillBeNoop(new DataObject());
}
-PassRefPtr<DataObject> DataObject::copy() const
+PassRefPtrWillBeRawPtr<DataObject> DataObject::copy() const
{
- return adoptRef(new DataObject(*this));
+ return adoptRefWillBeNoop(new DataObject(*this));
}
size_t DataObject::length() const
@@ -72,7 +74,7 @@ size_t DataObject::length() const
return m_itemList.size();
}
-PassRefPtr<DataObjectItem> DataObject::item(unsigned long index)
+PassRefPtrWillBeRawPtr<DataObjectItem> DataObject::item(unsigned long index)
{
if (index >= length())
return nullptr;
@@ -91,20 +93,20 @@ void DataObject::clearAll()
m_itemList.clear();
}
-PassRefPtr<DataObjectItem> DataObject::add(const String& data, const String& type)
+PassRefPtrWillBeRawPtr<DataObjectItem> DataObject::add(const String& data, const String& type)
{
- RefPtr<DataObjectItem> item = DataObjectItem::createFromString(type, data);
+ RefPtrWillBeRawPtr<DataObjectItem> item = DataObjectItem::createFromString(type, data);
if (!internalAddStringItem(item))
return nullptr;
return item;
}
-PassRefPtr<DataObjectItem> DataObject::add(PassRefPtr<File> file)
+PassRefPtrWillBeRawPtr<DataObjectItem> DataObject::add(PassRefPtr<File> file)
{
if (!file)
return nullptr;
- RefPtr<DataObjectItem> item = DataObjectItem::createFromFile(file);
+ RefPtrWillBeRawPtr<DataObjectItem> item = DataObjectItem::createFromFile(file);
m_itemList.append(item);
return item;
}
@@ -169,7 +171,7 @@ bool DataObject::setData(const String& type, const String& data)
void DataObject::urlAndTitle(String& url, String* title) const
{
- RefPtr<DataObjectItem> item = findStringItem(mimeTypeTextURIList);
+ RefPtrWillBeRawPtr<DataObjectItem> item = findStringItem(mimeTypeTextURIList);
if (!item)
return;
url = convertURIListToURL(item->getAsString());
@@ -185,7 +187,7 @@ void DataObject::setURLAndTitle(const String& url, const String& title)
void DataObject::htmlAndBaseURL(String& html, KURL& baseURL) const
{
- RefPtr<DataObjectItem> item = findStringItem(mimeTypeTextHTML);
+ RefPtrWillBeRawPtr<DataObjectItem> item = findStringItem(mimeTypeTextHTML);
if (!item)
return;
html = item->getAsString();
@@ -233,13 +235,12 @@ DataObject::DataObject()
}
DataObject::DataObject(const DataObject& other)
- : RefCounted<DataObject>()
- , m_itemList(other.m_itemList)
+ : m_itemList(other.m_itemList)
, m_modifierKeyState(0)
{
}
-PassRefPtr<DataObjectItem> DataObject::findStringItem(const String& type) const
+PassRefPtrWillBeRawPtr<DataObjectItem> DataObject::findStringItem(const String& type) const
{
for (size_t i = 0; i < m_itemList.size(); ++i) {
if (m_itemList[i]->kind() == DataObjectItem::StringKind && m_itemList[i]->type() == type)
@@ -248,7 +249,7 @@ PassRefPtr<DataObjectItem> DataObject::findStringItem(const String& type) const
return nullptr;
}
-bool DataObject::internalAddStringItem(PassRefPtr<DataObjectItem> item)
+bool DataObject::internalAddStringItem(PassRefPtrWillBeRawPtr<DataObjectItem> item)
{
ASSERT(item->kind() == DataObjectItem::StringKind);
for (size_t i = 0; i < m_itemList.size(); ++i) {
@@ -260,10 +261,15 @@ bool DataObject::internalAddStringItem(PassRefPtr<DataObjectItem> item)
return true;
}
-void DataObject::internalAddFileItem(PassRefPtr<DataObjectItem> item)
+void DataObject::internalAddFileItem(PassRefPtrWillBeRawPtr<DataObjectItem> item)
{
ASSERT(item->kind() == DataObjectItem::FileKind);
m_itemList.append(item);
}
+void DataObject::trace(Visitor* visitor)
+{
+ visitor->trace(m_itemList);
+}
+
} // namespace WebCore
« no previous file with comments | « Source/core/clipboard/DataObject.h ('k') | Source/core/clipboard/DataObjectItem.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698