| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2008, 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (c) 2008, 2009, 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 dataObject->m_itemList.append(DataObjectItem::createFromPasteboard(type,
sequenceNumber)); | 55 dataObject->m_itemList.append(DataObjectItem::createFromPasteboard(type,
sequenceNumber)); |
| 56 } | 56 } |
| 57 return dataObject.release(); | 57 return dataObject.release(); |
| 58 } | 58 } |
| 59 | 59 |
| 60 PassRefPtrWillBeRawPtr<DataObject> DataObject::create() | 60 PassRefPtrWillBeRawPtr<DataObject> DataObject::create() |
| 61 { | 61 { |
| 62 return adoptRefWillBeNoop(new DataObject()); | 62 return adoptRefWillBeNoop(new DataObject()); |
| 63 } | 63 } |
| 64 | 64 |
| 65 PassRefPtrWillBeRawPtr<DataObject> DataObject::copy() const | |
| 66 { | |
| 67 return adoptRefWillBeNoop(new DataObject(*this)); | |
| 68 } | |
| 69 | |
| 70 DataObject::~DataObject() | 65 DataObject::~DataObject() |
| 71 { | 66 { |
| 72 } | 67 } |
| 73 | 68 |
| 74 size_t DataObject::length() const | 69 size_t DataObject::length() const |
| 75 { | 70 { |
| 76 return m_itemList.size(); | 71 return m_itemList.size(); |
| 77 } | 72 } |
| 78 | 73 |
| 79 PassRefPtrWillBeRawPtr<DataObjectItem> DataObject::item(unsigned long index) | 74 PassRefPtrWillBeRawPtr<DataObjectItem> DataObject::item(unsigned long index) |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 void DataObject::addSharedBuffer(const String& name, PassRefPtr<SharedBuffer> bu
ffer) | 212 void DataObject::addSharedBuffer(const String& name, PassRefPtr<SharedBuffer> bu
ffer) |
| 218 { | 213 { |
| 219 internalAddFileItem(DataObjectItem::createFromSharedBuffer(name, buffer)); | 214 internalAddFileItem(DataObjectItem::createFromSharedBuffer(name, buffer)); |
| 220 } | 215 } |
| 221 | 216 |
| 222 DataObject::DataObject() | 217 DataObject::DataObject() |
| 223 : m_modifierKeyState(0) | 218 : m_modifierKeyState(0) |
| 224 { | 219 { |
| 225 } | 220 } |
| 226 | 221 |
| 227 DataObject::DataObject(const DataObject& other) | |
| 228 : m_itemList(other.m_itemList) | |
| 229 , m_modifierKeyState(0) | |
| 230 { | |
| 231 } | |
| 232 | |
| 233 PassRefPtrWillBeRawPtr<DataObjectItem> DataObject::findStringItem(const String&
type) const | 222 PassRefPtrWillBeRawPtr<DataObjectItem> DataObject::findStringItem(const String&
type) const |
| 234 { | 223 { |
| 235 for (size_t i = 0; i < m_itemList.size(); ++i) { | 224 for (size_t i = 0; i < m_itemList.size(); ++i) { |
| 236 if (m_itemList[i]->kind() == DataObjectItem::StringKind && m_itemList[i]
->type() == type) | 225 if (m_itemList[i]->kind() == DataObjectItem::StringKind && m_itemList[i]
->type() == type) |
| 237 return m_itemList[i]; | 226 return m_itemList[i]; |
| 238 } | 227 } |
| 239 return nullptr; | 228 return nullptr; |
| 240 } | 229 } |
| 241 | 230 |
| 242 bool DataObject::internalAddStringItem(PassRefPtrWillBeRawPtr<DataObjectItem> it
em) | 231 bool DataObject::internalAddStringItem(PassRefPtrWillBeRawPtr<DataObjectItem> it
em) |
| (...skipping 16 matching lines...) Expand all Loading... |
| 259 | 248 |
| 260 void DataObject::trace(Visitor* visitor) | 249 void DataObject::trace(Visitor* visitor) |
| 261 { | 250 { |
| 262 #if ENABLE(OILPAN) | 251 #if ENABLE(OILPAN) |
| 263 visitor->trace(m_itemList); | 252 visitor->trace(m_itemList); |
| 264 HeapSupplementable<DataObject>::trace(visitor); | 253 HeapSupplementable<DataObject>::trace(visitor); |
| 265 #endif | 254 #endif |
| 266 } | 255 } |
| 267 | 256 |
| 268 } // namespace blink | 257 } // namespace blink |
| OLD | NEW |