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

Side by Side Diff: Source/core/platform/chromium/ChromiumDataObjectItem.cpp

Issue 85263006: Make IDL Callbacks non-refcounted by default (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Refinements Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 } 97 }
98 98
99 ChromiumDataObjectItem::ChromiumDataObjectItem(const String& kind, const String& type, uint64_t sequenceNumber) 99 ChromiumDataObjectItem::ChromiumDataObjectItem(const String& kind, const String& type, uint64_t sequenceNumber)
100 : m_source(PasteboardSource) 100 : m_source(PasteboardSource)
101 , m_kind(kind) 101 , m_kind(kind)
102 , m_type(type) 102 , m_type(type)
103 , m_sequenceNumber(sequenceNumber) 103 , m_sequenceNumber(sequenceNumber)
104 { 104 {
105 } 105 }
106 106
107 void ChromiumDataObjectItem::getAsString(PassRefPtr<StringCallback> callback, Ex ecutionContext* context) const 107 void ChromiumDataObjectItem::getAsString(PassOwnPtr<StringCallback> callback, Ex ecutionContext* context) const
108 { 108 {
109 if (!callback || kind() != DataTransferItem::kindString) 109 if (!callback || kind() != DataTransferItem::kindString)
110 return; 110 return;
111 111
112 callback->scheduleCallback(context, internalGetAsString()); 112 StringCallback::scheduleCallback(callback, context, internalGetAsString());
113 } 113 }
114 114
115 PassRefPtr<Blob> ChromiumDataObjectItem::getAsFile() const 115 PassRefPtr<Blob> ChromiumDataObjectItem::getAsFile() const
116 { 116 {
117 if (kind() != DataTransferItem::kindFile) 117 if (kind() != DataTransferItem::kindFile)
118 return 0; 118 return 0;
119 119
120 if (m_source == InternalSource) { 120 if (m_source == InternalSource) {
121 if (m_file) 121 if (m_file)
122 return m_file; 122 return m_file;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 176
177 bool ChromiumDataObjectItem::isFilename() const 177 bool ChromiumDataObjectItem::isFilename() const
178 { 178 {
179 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=81261: When we properly su pport File dragout, 179 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=81261: When we properly su pport File dragout,
180 // we'll need to make sure this works as expected for DragDataChromium. 180 // we'll need to make sure this works as expected for DragDataChromium.
181 return m_kind == DataTransferItem::kindFile && m_file; 181 return m_kind == DataTransferItem::kindFile && m_file;
182 } 182 }
183 183
184 } // namespace WebCore 184 } // namespace WebCore
185 185
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698