| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 void DataTransferItem::getAsString(ExecutionContext* context, PassOwnPtr<StringC
allback> callback) const | 76 void DataTransferItem::getAsString(ExecutionContext* context, PassOwnPtr<StringC
allback> callback) const |
| 77 { | 77 { |
| 78 if (!m_clipboard->canReadData()) | 78 if (!m_clipboard->canReadData()) |
| 79 return; | 79 return; |
| 80 if (!callback || m_item->kind() != DataObjectItem::StringKind) | 80 if (!callback || m_item->kind() != DataObjectItem::StringKind) |
| 81 return; | 81 return; |
| 82 | 82 |
| 83 StringCallback::scheduleCallback(callback, context, m_item->getAsString()); | 83 StringCallback::scheduleCallback(callback, context, m_item->getAsString()); |
| 84 } | 84 } |
| 85 | 85 |
| 86 PassRefPtr<Blob> DataTransferItem::getAsFile() const | 86 PassRefPtrWillBeRawPtr<Blob> DataTransferItem::getAsFile() const |
| 87 { | 87 { |
| 88 if (!m_clipboard->canReadData()) | 88 if (!m_clipboard->canReadData()) |
| 89 return nullptr; | 89 return nullptr; |
| 90 | 90 |
| 91 return m_item->getAsFile(); | 91 return m_item->getAsFile(); |
| 92 } | 92 } |
| 93 | 93 |
| 94 DataTransferItem::DataTransferItem(PassRefPtrWillBeRawPtr<Clipboard> clipboard,
PassRefPtrWillBeRawPtr<DataObjectItem> item) | 94 DataTransferItem::DataTransferItem(PassRefPtrWillBeRawPtr<Clipboard> clipboard,
PassRefPtrWillBeRawPtr<DataObjectItem> item) |
| 95 : m_clipboard(clipboard) | 95 : m_clipboard(clipboard) |
| 96 , m_item(item) | 96 , m_item(item) |
| 97 { | 97 { |
| 98 ScriptWrappable::init(this); | 98 ScriptWrappable::init(this); |
| 99 } | 99 } |
| 100 | 100 |
| 101 void DataTransferItem::trace(Visitor* visitor) | 101 void DataTransferItem::trace(Visitor* visitor) |
| 102 { | 102 { |
| 103 visitor->trace(m_clipboard); | 103 visitor->trace(m_clipboard); |
| 104 visitor->trace(m_item); | 104 visitor->trace(m_item); |
| 105 } | 105 } |
| 106 | 106 |
| 107 } // namespace WebCore | 107 } // namespace WebCore |
| 108 | 108 |
| OLD | NEW |