Changeset 154639 in webkit


Ignore:
Timestamp:
Aug 26, 2013 2:11:12 PM (11 years ago)
Author:
ap@apple.com
Message:

[Mac] can-read-in-dragstart-event.html and can-read-in-copy-and-cut-events.html fail
https://bugs.webkit.org/show_bug.cgi?id=113094

Reviewed by Darin Adler.

Mac platform implementation has checks for pasteboard change count, but it
didn't use to update the count when writing to pasteboad from JavaScript.

  • platform/PasteboardStrategy.h: Changed changeCount function to return a long instead of an int, as the underlying Mac type is NSInteger. Changed all methods that modify the pasteboard to return a new change count.
  • platform/PlatformPasteboard.h: Changed all methods that modify the pasteboard to return a new change count.
  • platform/mac/PasteboardMac.mm: (WebCore::Pasteboard::clear): Update m_changeCount. (WebCore::Pasteboard::writeSelectionForTypes): Ditto. (WebCore::Pasteboard::writePlainText): Ditto. (WebCore::writeURLForTypes): Ditto. (WebCore::Pasteboard::writeURL): Ditto. (WebCore::writeFileWrapperAsRTFDAttachment): Ditto. (WebCore::Pasteboard::writeImage): Ditto. (WebCore::Pasteboard::writePasteboard): Ditto. (WebCore::addHTMLClipboardTypesForCocoaType): Ditto. (WebCore::Pasteboard::writeString): Ditto.
  • platform/mac/PlatformPasteboardMac.mm: (WebCore::PlatformPasteboard::changeCount): Changed returned type to long to avoid data loss. (WebCore::PlatformPasteboard::copy): Return new change count. (WebCore::PlatformPasteboard::addTypes): Ditto. (WebCore::PlatformPasteboard::setTypes): Ditto. (WebCore::PlatformPasteboard::setBufferForType): Ditto. (WebCore::PlatformPasteboard::setPathnamesForType): Ditto. (WebCore::PlatformPasteboard::setStringForType): Ditto. Replaced -[NSURL writeToPasteboard:] with an equivalent implemnentation that tells use whether writing was successful. There is difference with invalid URL string handling - we used to silently ignore such requets, but set pasteboard content to empty URL now.
Location:
trunk/Source
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r154629 r154639  
     12013-08-26  Alexey Proskuryakov  <ap@apple.com>
     2
     3        [Mac] can-read-in-dragstart-event.html and can-read-in-copy-and-cut-events.html fail
     4        https://bugs.webkit.org/show_bug.cgi?id=113094
     5
     6        Reviewed by Darin Adler.
     7
     8        Mac platform implementation has checks for pasteboard change count, but it
     9        didn't use to update the count when writing to pasteboad from JavaScript.
     10
     11        * platform/PasteboardStrategy.h: Changed changeCount function to return a long
     12        instead of an int, as the underlying Mac type is NSInteger. Changed all methods
     13        that modify the pasteboard to return a new change count.
     14
     15        * platform/PlatformPasteboard.h: Changed all methods that modify the pasteboard
     16        to return a new change count.
     17
     18        * platform/mac/PasteboardMac.mm:
     19        (WebCore::Pasteboard::clear): Update m_changeCount.
     20        (WebCore::Pasteboard::writeSelectionForTypes): Ditto.
     21        (WebCore::Pasteboard::writePlainText): Ditto.
     22        (WebCore::writeURLForTypes): Ditto.
     23        (WebCore::Pasteboard::writeURL): Ditto.
     24        (WebCore::writeFileWrapperAsRTFDAttachment): Ditto.
     25        (WebCore::Pasteboard::writeImage): Ditto.
     26        (WebCore::Pasteboard::writePasteboard): Ditto.
     27        (WebCore::addHTMLClipboardTypesForCocoaType): Ditto.
     28        (WebCore::Pasteboard::writeString): Ditto.
     29
     30        * platform/mac/PlatformPasteboardMac.mm:
     31        (WebCore::PlatformPasteboard::changeCount): Changed returned type to long to avoid
     32        data loss.
     33        (WebCore::PlatformPasteboard::copy): Return new change count.
     34        (WebCore::PlatformPasteboard::addTypes): Ditto.
     35        (WebCore::PlatformPasteboard::setTypes): Ditto.
     36        (WebCore::PlatformPasteboard::setBufferForType): Ditto.
     37        (WebCore::PlatformPasteboard::setPathnamesForType): Ditto.
     38        (WebCore::PlatformPasteboard::setStringForType): Ditto. Replaced -[NSURL writeToPasteboard:]
     39        with an equivalent implemnentation that tells use whether writing was successful.
     40        There is difference with invalid URL string handling - we used to silently ignore
     41        such requets, but set pasteboard content to empty URL now.
     42
    1432013-08-24  Sam Weinig  <sam@webkit.org>
    244
  • trunk/Source/WebCore/platform/PasteboardStrategy.h

    r150104 r154639  
    4444    virtual void getPathnamesForType(Vector<String>& pathnames, const String& pasteboardType, const String& pasteboardName) = 0;
    4545    virtual String stringForType(const String& pasteboardType, const String& pasteboardName) = 0;
    46     virtual int changeCount(const String& pasteboardName) = 0;
     46    virtual long changeCount(const String& pasteboardName) = 0;
    4747    virtual String uniqueName() = 0;
    4848    virtual Color color(const String& pasteboardName) = 0;
    4949    virtual KURL url(const String& pasteboardName) = 0;
    5050   
    51     virtual void copy(const String& fromPasteboard, const String& toPasteboard) = 0;
    52     virtual void addTypes(const Vector<String>& pasteboardTypes, const String& pasteboardName) = 0;
    53     virtual void setTypes(const Vector<String>& pasteboardTypes, const String& pasteboardName) = 0;
    54     virtual void setBufferForType(PassRefPtr<SharedBuffer>, const String& pasteboardType, const String& pasteboardName) = 0;
    55     virtual void setPathnamesForType(const Vector<String>&, const String& pasteboardType, const String& pasteboardName) = 0;
    56     virtual void setStringForType(const String&, const String& pasteboardType, const String& pasteboardName) = 0;
     51    virtual long addTypes(const Vector<String>& pasteboardTypes, const String& pasteboardName) = 0;
     52    virtual long setTypes(const Vector<String>& pasteboardTypes, const String& pasteboardName) = 0;
     53    virtual long copy(const String& fromPasteboard, const String& toPasteboard) = 0;
     54    virtual long setBufferForType(PassRefPtr<SharedBuffer>, const String& pasteboardType, const String& pasteboardName) = 0;
     55    virtual long setPathnamesForType(const Vector<String>&, const String& pasteboardType, const String& pasteboardName) = 0;
     56    virtual long setStringForType(const String&, const String& pasteboardType, const String& pasteboardName) = 0;
    5757#endif
    5858protected:
  • trunk/Source/WebCore/platform/PlatformPasteboard.h

    r123716 r154639  
    5050    void getPathnamesForType(Vector<String>& pathnames, const String& pasteboardType);
    5151    String stringForType(const String& pasteboardType);
    52     int changeCount() const;
     52    long changeCount() const;
    5353    Color color();
    5454    KURL url();
    55    
    56     void copy(const String& fromPasteboard);
    57     void addTypes(const Vector<String>& pasteboardTypes);
    58     void setTypes(const Vector<String>& pasteboardTypes);
    59     void setBufferForType(PassRefPtr<SharedBuffer>, const String& pasteboardType);
    60     void setPathnamesForType(const Vector<String>& pathnames, const String& pasteboardType);
    61     void setStringForType(const String&, const String& pasteboardType);
     55
     56    // Take ownership of the pasteboard, and return new change count.
     57    long addTypes(const Vector<String>& pasteboardTypes);
     58    long setTypes(const Vector<String>& pasteboardTypes);
     59
     60    // These methods will return 0 if pasteboard ownership has been taken from us.
     61    long copy(const String& fromPasteboard);
     62    long setBufferForType(PassRefPtr<SharedBuffer>, const String& pasteboardType);
     63    long setPathnamesForType(const Vector<String>& pathnames, const String& pasteboardType);
     64    long setStringForType(const String&, const String& pasteboardType);
    6265
    6366private:
  • trunk/Source/WebCore/platform/mac/PasteboardMac.mm

    r154578 r154639  
    156156void Pasteboard::clear()
    157157{
    158     platformStrategies()->pasteboardStrategy()->setTypes(Vector<String>(), m_pasteboardName);
     158    m_changeCount = platformStrategies()->pasteboardStrategy()->setTypes(Vector<String>(), m_pasteboardName);
    159159}
    160160
     
    206206    types.appendVector(clientTypes);
    207207
    208     platformStrategies()->pasteboardStrategy()->setTypes(types, m_pasteboardName);
     208    m_changeCount = platformStrategies()->pasteboardStrategy()->setTypes(types, m_pasteboardName);
    209209    frame->editor().client()->didSetSelectionTypesForPasteboard();
    210210
    211211    for (size_t i = 0; i < clientTypes.size(); ++i)
    212         platformStrategies()->pasteboardStrategy()->setBufferForType(clientData[i], clientTypes[i], m_pasteboardName);
     212        m_changeCount = platformStrategies()->pasteboardStrategy()->setBufferForType(clientData[i], clientTypes[i], m_pasteboardName);
    213213
    214214    // Put HTML on the pasteboard.
    215215    if (types.contains(WebArchivePboardType))
    216         platformStrategies()->pasteboardStrategy()->setBufferForType(getDataSelection(frame, WebArchivePboardType), WebArchivePboardType, m_pasteboardName);
     216        m_changeCount = platformStrategies()->pasteboardStrategy()->setBufferForType(getDataSelection(frame, WebArchivePboardType), WebArchivePboardType, m_pasteboardName);
    217217   
    218218    // Put the attributed string on the pasteboard (RTF/RTFD format).
    219219    if (types.contains(String(NSRTFDPboardType)))
    220         platformStrategies()->pasteboardStrategy()->setBufferForType(getDataSelection(frame, NSRTFDPboardType), NSRTFDPboardType, m_pasteboardName);
     220        m_changeCount = platformStrategies()->pasteboardStrategy()->setBufferForType(getDataSelection(frame, NSRTFDPboardType), NSRTFDPboardType, m_pasteboardName);
    221221
    222222    if (types.contains(String(NSRTFPboardType)))
    223         platformStrategies()->pasteboardStrategy()->setBufferForType(getDataSelection(frame, NSRTFPboardType), NSRTFPboardType, m_pasteboardName);
     223        m_changeCount = platformStrategies()->pasteboardStrategy()->setBufferForType(getDataSelection(frame, NSRTFPboardType), NSRTFPboardType, m_pasteboardName);
    224224   
    225225    // Put plain string on the pasteboard.
     
    228228            ? frame->editor().stringSelectionForPasteboardWithImageAltText()
    229229            : frame->editor().stringSelectionForPasteboard();
    230         platformStrategies()->pasteboardStrategy()->setStringForType(text, NSStringPboardType, m_pasteboardName);
     230        m_changeCount = platformStrategies()->pasteboardStrategy()->setStringForType(text, NSStringPboardType, m_pasteboardName);
    231231    }
    232232   
    233233    if (types.contains(WebSmartPastePboardType))
    234         platformStrategies()->pasteboardStrategy()->setBufferForType(0, WebSmartPastePboardType, m_pasteboardName);
     234        m_changeCount = platformStrategies()->pasteboardStrategy()->setBufferForType(0, WebSmartPastePboardType, m_pasteboardName);
    235235}
    236236
     
    243243
    244244    platformStrategies()->pasteboardStrategy()->setTypes(types, m_pasteboardName);
    245     platformStrategies()->pasteboardStrategy()->setStringForType(text, NSStringPboardType, m_pasteboardName);
     245    m_changeCount = platformStrategies()->pasteboardStrategy()->setStringForType(text, NSStringPboardType, m_pasteboardName);
    246246    if (smartReplaceOption == CanSmartReplace)
    247         platformStrategies()->pasteboardStrategy()->setBufferForType(0, WebSmartPastePboardType, m_pasteboardName);
     247        m_changeCount = platformStrategies()->pasteboardStrategy()->setBufferForType(0, WebSmartPastePboardType, m_pasteboardName);
    248248}
    249249   
     
    253253}
    254254
    255 static void writeURLForTypes(const Vector<String>& types, const String& pasteboardName, const KURL& url, const String& titleStr, Frame* frame)
    256 {
    257     platformStrategies()->pasteboardStrategy()->setTypes(types, pasteboardName);
     255static long writeURLForTypes(const Vector<String>& types, const String& pasteboardName, const KURL& url, const String& titleStr, Frame* frame)
     256{
     257    long newChangeCount = platformStrategies()->pasteboardStrategy()->setTypes(types, pasteboardName);
    258258   
    259259    ASSERT(!url.isEmpty());
     
    272272        paths.append([cocoaURL absoluteString]);
    273273        paths.append(titleStr.stripWhiteSpace());
    274         platformStrategies()->pasteboardStrategy()->setPathnamesForType(paths, WebURLsWithTitlesPboardType, pasteboardName);
     274        newChangeCount = platformStrategies()->pasteboardStrategy()->setPathnamesForType(paths, WebURLsWithTitlesPboardType, pasteboardName);
    275275    }
    276276    if (types.contains(String(NSURLPboardType)))
    277         platformStrategies()->pasteboardStrategy()->setStringForType([cocoaURL absoluteString], NSURLPboardType, pasteboardName);
     277        newChangeCount = platformStrategies()->pasteboardStrategy()->setStringForType([cocoaURL absoluteString], NSURLPboardType, pasteboardName);
    278278    if (types.contains(WebURLPboardType))
    279         platformStrategies()->pasteboardStrategy()->setStringForType(userVisibleString, WebURLPboardType, pasteboardName);
     279        newChangeCount = platformStrategies()->pasteboardStrategy()->setStringForType(userVisibleString, WebURLPboardType, pasteboardName);
    280280    if (types.contains(WebURLNamePboardType))
    281         platformStrategies()->pasteboardStrategy()->setStringForType(title, WebURLNamePboardType, pasteboardName);
     281        newChangeCount = platformStrategies()->pasteboardStrategy()->setStringForType(title, WebURLNamePboardType, pasteboardName);
    282282    if (types.contains(String(NSStringPboardType)))
    283         platformStrategies()->pasteboardStrategy()->setStringForType(userVisibleString, NSStringPboardType, pasteboardName);
     283        newChangeCount = platformStrategies()->pasteboardStrategy()->setStringForType(userVisibleString, NSStringPboardType, pasteboardName);
     284
     285    return newChangeCount;
    284286}
    285287   
    286288void Pasteboard::writeURL(const KURL& url, const String& titleStr, Frame* frame)
    287289{
    288     writeURLForTypes(writableTypesForURL(), m_pasteboardName, url, titleStr, frame);
     290    m_changeCount = writeURLForTypes(writableTypesForURL(), m_pasteboardName, url, titleStr, frame);
    289291}
    290292
     
    302304}
    303305
    304 static void writeFileWrapperAsRTFDAttachment(NSFileWrapper* wrapper, const String& pasteboardName)
     306static void writeFileWrapperAsRTFDAttachment(NSFileWrapper* wrapper, const String& pasteboardName, long& newChangeCount)
    305307{
    306308    NSTextAttachment *attachment = [[NSTextAttachment alloc] initWithFileWrapper:wrapper];
     
    311313    NSData *RTFDData = [string RTFDFromRange:NSMakeRange(0, [string length]) documentAttributes:nil];
    312314    if (RTFDData)
    313         platformStrategies()->pasteboardStrategy()->setBufferForType(SharedBuffer::wrapNSData(RTFDData).get(), NSRTFDPboardType, pasteboardName);
     315        newChangeCount = platformStrategies()->pasteboardStrategy()->setBufferForType(SharedBuffer::wrapNSData(RTFDData).get(), NSRTFDPboardType, pasteboardName);
    314316}
    315317
     
    329331        return;
    330332
    331     writeURLForTypes(writableTypesForImage(), m_pasteboardName, cocoaURL, nsStringNilIfEmpty(title), node->document()->frame());
     333    m_changeCount = writeURLForTypes(writableTypesForImage(), m_pasteboardName, cocoaURL, nsStringNilIfEmpty(title), node->document()->frame());
    332334   
    333335    Image* image = cachedImage->imageForRenderer(renderer);
     
    337339    if (!imageData)
    338340        return;
    339     platformStrategies()->pasteboardStrategy()->setBufferForType(SharedBuffer::wrapNSData(imageData), NSTIFFPboardType, m_pasteboardName);
     341    m_changeCount = platformStrategies()->pasteboardStrategy()->setBufferForType(SharedBuffer::wrapNSData(imageData), NSTIFFPboardType, m_pasteboardName);
    340342
    341343    String MIMEType = cachedImage->response().mimeType();
    342344    ASSERT(MIMETypeRegistry::isSupportedImageResourceMIMEType(MIMEType));
    343345
    344     writeFileWrapperAsRTFDAttachment(fileWrapperForImage(cachedImage, cocoaURL), m_pasteboardName);
     346    writeFileWrapperAsRTFDAttachment(fileWrapperForImage(cachedImage, cocoaURL), m_pasteboardName, m_changeCount);
    345347}
    346348
    347349void Pasteboard::writePasteboard(const Pasteboard& pasteboard)
    348350{
    349     platformStrategies()->pasteboardStrategy()->copy(pasteboard.m_pasteboardName, m_pasteboardName);
     351    m_changeCount = platformStrategies()->pasteboardStrategy()->copy(pasteboard.m_pasteboardName, m_pasteboardName);
    350352}
    351353
     
    653655    if (cocoaType.isEmpty())
    654656        return;
    655     platformStrategies()->pasteboardStrategy()->setStringForType(emptyString(), cocoaType, m_pasteboardName);
     657    m_changeCount = platformStrategies()->pasteboardStrategy()->setStringForType(emptyString(), cocoaType, m_pasteboardName);
    656658}
    657659
     
    762764        return;
    763765    }
    764     // No mapping, just pass the whole string though
     766    // No mapping, just pass the whole string through.
    765767    resultTypes.add(cocoaType);
    766768}
     
    779781        types.append(cocoaType);
    780782        platformStrategies()->pasteboardStrategy()->setTypes(types, m_pasteboardName);
    781         platformStrategies()->pasteboardStrategy()->setStringForType(cocoaData, cocoaType, m_pasteboardName);
     783        m_changeCount = platformStrategies()->pasteboardStrategy()->setStringForType(cocoaData, cocoaType, m_pasteboardName);
    782784
    783785        return true;
     
    789791        types.append(cocoaType);
    790792        platformStrategies()->pasteboardStrategy()->addTypes(types, m_pasteboardName);
    791         platformStrategies()->pasteboardStrategy()->setStringForType(cocoaData, cocoaType, m_pasteboardName);
     793        m_changeCount = platformStrategies()->pasteboardStrategy()->setStringForType(cocoaData, cocoaType, m_pasteboardName);
    792794        return true;
    793795    }
  • trunk/Source/WebCore/platform/mac/PlatformPasteboardMac.mm

    r149255 r154639  
    7272}
    7373
    74 int PlatformPasteboard::changeCount() const
     74long PlatformPasteboard::changeCount() const
    7575{
    7676    return [m_pasteboard.get() changeCount];
     
    100100}
    101101
    102 void PlatformPasteboard::copy(const String& fromPasteboard)
     102long PlatformPasteboard::copy(const String& fromPasteboard)
    103103{
    104104    NSPasteboard* pasteboard = [NSPasteboard pasteboardWithName:fromPasteboard];
     
    108108    for (NSUInteger i = 0; i < [types count]; i++) {
    109109        NSString* type = [types objectAtIndex:i];
    110         [m_pasteboard.get() setData:[pasteboard dataForType:type] forType:type];
     110        if (![m_pasteboard.get() setData:[pasteboard dataForType:type] forType:type])
     111            return 0;
    111112    }   
     113    return changeCount();
    112114}
    113115
    114 void PlatformPasteboard::addTypes(const Vector<String>& pasteboardTypes)
     116long PlatformPasteboard::addTypes(const Vector<String>& pasteboardTypes)
    115117{
    116118    RetainPtr<NSMutableArray> types = adoptNS([[NSMutableArray alloc] init]);
     
    118120        [types.get() addObject:pasteboardTypes[i]];
    119121
    120     [m_pasteboard.get() addTypes:types.get() owner:nil];
     122    return [m_pasteboard.get() addTypes:types.get() owner:nil];
    121123}
    122124
    123 void PlatformPasteboard::setTypes(const Vector<String>& pasteboardTypes)
     125long PlatformPasteboard::setTypes(const Vector<String>& pasteboardTypes)
    124126{
    125     if (pasteboardTypes.isEmpty()) {
    126         [m_pasteboard.get() declareTypes:nil owner:nil];
    127         return;
    128     }
     127    if (pasteboardTypes.isEmpty())
     128        return [m_pasteboard.get() declareTypes:nil owner:nil];
    129129
    130130    RetainPtr<NSMutableArray> types = adoptNS([[NSMutableArray alloc] init]);
     
    132132        [types.get() addObject:pasteboardTypes[i]];
    133133
    134     [m_pasteboard.get() declareTypes:types.get() owner:nil];
     134    return [m_pasteboard.get() declareTypes:types.get() owner:nil];
    135135}
    136136
    137 void PlatformPasteboard::setBufferForType(PassRefPtr<SharedBuffer> buffer, const String& pasteboardType)
     137long PlatformPasteboard::setBufferForType(PassRefPtr<SharedBuffer> buffer, const String& pasteboardType)
    138138{
    139     [m_pasteboard.get() setData:buffer ? [buffer->createNSData() autorelease] : nil forType:pasteboardType];
     139    BOOL didWriteData = [m_pasteboard.get() setData:buffer ? [buffer->createNSData() autorelease] : nil forType:pasteboardType];
     140    if (!didWriteData)
     141        return 0;
     142    return changeCount();
    140143}
    141144
    142 void PlatformPasteboard::setPathnamesForType(const Vector<String>& pathnames, const String& pasteboardType)
     145long PlatformPasteboard::setPathnamesForType(const Vector<String>& pathnames, const String& pasteboardType)
    143146{
    144147    RetainPtr<NSMutableArray> paths = adoptNS([[NSMutableArray alloc] init]);   
    145148    for (size_t i = 0; i < pathnames.size(); ++i)
    146         [paths.get() addObject: [NSArray arrayWithObject:pathnames[i]]];
    147     [m_pasteboard.get() setPropertyList:paths.get() forType:pasteboardType];
     149        [paths.get() addObject:[NSArray arrayWithObject:pathnames[i]]];
     150    BOOL didWriteData = [m_pasteboard.get() setPropertyList:paths.get() forType:pasteboardType];
     151    if (!didWriteData)
     152        return 0;
     153    return changeCount();
    148154}
    149155
    150 void PlatformPasteboard::setStringForType(const String& string, const String& pasteboardType)
     156long PlatformPasteboard::setStringForType(const String& string, const String& pasteboardType)
    151157{
    152     if (pasteboardType == String(NSURLPboardType))
    153         [[NSURL URLWithString:string] writeToPasteboard:m_pasteboard.get()];
    154     else
    155         [m_pasteboard.get() setString:string forType:pasteboardType];
     158    BOOL didWriteData;
     159
     160    if (pasteboardType == String(NSURLPboardType)) {
     161        // We cannot just use -NSPasteboard writeObjects:], because -declareTypes has been already called, implicitly creating an item.
     162        NSURL *url = [NSURL URLWithString:string];
     163        if ([[m_pasteboard.get() types] containsObject:NSURLPboardType]) {
     164            NSURL *base = [url baseURL];
     165            if (base)
     166                didWriteData = [m_pasteboard.get() setPropertyList:@[[url relativeString], [base absoluteString]] forType:NSURLPboardType];
     167            else if (url)
     168                didWriteData = [m_pasteboard.get() setPropertyList:@[[url absoluteString], @""] forType:NSURLPboardType];
     169            else
     170                didWriteData = [m_pasteboard.get() setPropertyList:@[@"", @""] forType:NSURLPboardType];
     171
     172            if (!didWriteData)
     173                return 0;
     174        }
     175
     176        if ([[m_pasteboard.get() types] containsObject:(NSString *)kUTTypeURL]) {
     177            didWriteData = [m_pasteboard.get() setString:[url absoluteString] forType:(NSString *)kUTTypeURL];
     178            if (!didWriteData)
     179                return 0;
     180        }
     181
     182        if ([[m_pasteboard.get() types] containsObject:(NSString *)kUTTypeFileURL] && [url isFileURL]) {
     183            didWriteData = [m_pasteboard.get() setString:[url absoluteString] forType:(NSString *)kUTTypeFileURL];
     184            if (!didWriteData)
     185                return 0;
     186        }
     187
     188    } else {
     189        didWriteData = [m_pasteboard.get() setString:string forType:pasteboardType];
     190        if (!didWriteData)
     191            return 0;
     192    }
     193
     194    return changeCount();
    156195}
    157196
  • trunk/Source/WebKit/mac/ChangeLog

    r154620 r154639  
     12013-08-26  Alexey Proskuryakov  <ap@apple.com>
     2
     3        [Mac] can-read-in-dragstart-event.html and can-read-in-copy-and-cut-events.html fail
     4        https://bugs.webkit.org/show_bug.cgi?id=113094
     5
     6        Reviewed by Darin Adler.
     7
     8        Return new pasteboard change count from all functions that change it.
     9
     10        * WebCoreSupport/WebPlatformStrategies.h:
     11        * WebCoreSupport/WebPlatformStrategies.mm:
     12        (WebPlatformStrategies::copy):
     13        (WebPlatformStrategies::changeCount):
     14        (WebPlatformStrategies::addTypes):
     15        (WebPlatformStrategies::setTypes):
     16        (WebPlatformStrategies::setBufferForType):
     17        (WebPlatformStrategies::setPathnamesForType):
     18        (WebPlatformStrategies::setStringForType):
     19
    1202013-08-26  Andreas Kling  <akling@apple.com>
    221
  • trunk/Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h

    r149035 r154639  
    8484    virtual void getPathnamesForType(Vector<String>& pathnames, const String& pasteboardType, const String& pasteboardName) OVERRIDE;
    8585    virtual String stringForType(const String& pasteboardType, const String& pasteboardName) OVERRIDE;
    86     virtual int changeCount(const String& pasteboardName) OVERRIDE;
     86    virtual long changeCount(const String& pasteboardName) OVERRIDE;
    8787    virtual String uniqueName() OVERRIDE;
    8888    virtual WebCore::Color color(const String& pasteboardName) OVERRIDE;
    8989    virtual WebCore::KURL url(const String& pasteboardName) OVERRIDE;
    9090
    91     virtual void copy(const String& fromPasteboard, const String& toPasteboard) OVERRIDE;
    92     virtual void addTypes(const Vector<String>& pasteboardTypes, const String& pasteboardName) OVERRIDE;
    93     virtual void setTypes(const Vector<String>& pasteboardTypes, const String& pasteboardName) OVERRIDE;
    94     virtual void setBufferForType(PassRefPtr<WebCore::SharedBuffer>, const String& pasteboardType, const String& pasteboardName) OVERRIDE;
    95     virtual void setPathnamesForType(const Vector<String>&, const String& pasteboardType, const String& pasteboardName) OVERRIDE;
    96     virtual void setStringForType(const String&, const String& pasteboardType, const String& pasteboardName) OVERRIDE;
     91    virtual long addTypes(const Vector<String>& pasteboardTypes, const String& pasteboardName) OVERRIDE;
     92    virtual long setTypes(const Vector<String>& pasteboardTypes, const String& pasteboardName) OVERRIDE;
     93    virtual long copy(const String& fromPasteboard, const String& toPasteboard) OVERRIDE;
     94    virtual long setBufferForType(PassRefPtr<WebCore::SharedBuffer>, const String& pasteboardType, const String& pasteboardName) OVERRIDE;
     95    virtual long setPathnamesForType(const Vector<String>&, const String& pasteboardType, const String& pasteboardName) OVERRIDE;
     96    virtual long setStringForType(const String&, const String& pasteboardType, const String& pasteboardName) OVERRIDE;
    9797};
    9898
  • trunk/Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm

    r154142 r154639  
    175175}
    176176
    177 void WebPlatformStrategies::copy(const String& fromPasteboard, const String& toPasteboard)
    178 {
    179     PlatformPasteboard(toPasteboard).copy(fromPasteboard);
    180 }
    181 
    182 int WebPlatformStrategies::changeCount(const String &pasteboardName)
     177long WebPlatformStrategies::copy(const String& fromPasteboard, const String& toPasteboard)
     178{
     179    return PlatformPasteboard(toPasteboard).copy(fromPasteboard);
     180}
     181
     182long WebPlatformStrategies::changeCount(const String &pasteboardName)
    183183{
    184184    return PlatformPasteboard(pasteboardName).changeCount();
     
    200200}
    201201
    202 void WebPlatformStrategies::addTypes(const Vector<String>& pasteboardTypes, const String& pasteboardName)
    203 {
    204     PlatformPasteboard(pasteboardName).addTypes(pasteboardTypes);
    205 }
    206 
    207 void WebPlatformStrategies::setTypes(const Vector<String>& pasteboardTypes, const String& pasteboardName)
    208 {
    209     PlatformPasteboard(pasteboardName).setTypes(pasteboardTypes);
    210 }
    211 
    212 void WebPlatformStrategies::setBufferForType(PassRefPtr<SharedBuffer> buffer, const String& pasteboardType, const String& pasteboardName)
    213 {
    214     PlatformPasteboard(pasteboardName).setBufferForType(buffer, pasteboardType);
    215 }
    216 
    217 void WebPlatformStrategies::setPathnamesForType(const Vector<String>& pathnames, const String& pasteboardType, const String& pasteboardName)
    218 {
    219     PlatformPasteboard(pasteboardName).setPathnamesForType(pathnames, pasteboardType);
    220 }
    221 
    222 void WebPlatformStrategies::setStringForType(const String& string, const String& pasteboardType, const String& pasteboardName)
    223 {
    224     PlatformPasteboard(pasteboardName).setStringForType(string, pasteboardType);   
    225 }
     202long WebPlatformStrategies::addTypes(const Vector<String>& pasteboardTypes, const String& pasteboardName)
     203{
     204    return PlatformPasteboard(pasteboardName).addTypes(pasteboardTypes);
     205}
     206
     207long WebPlatformStrategies::setTypes(const Vector<String>& pasteboardTypes, const String& pasteboardName)
     208{
     209    return PlatformPasteboard(pasteboardName).setTypes(pasteboardTypes);
     210}
     211
     212long WebPlatformStrategies::setBufferForType(PassRefPtr<SharedBuffer> buffer, const String& pasteboardType, const String& pasteboardName)
     213{
     214    return PlatformPasteboard(pasteboardName).setBufferForType(buffer, pasteboardType);
     215}
     216
     217long WebPlatformStrategies::setPathnamesForType(const Vector<String>& pathnames, const String& pasteboardType, const String& pasteboardName)
     218{
     219    return PlatformPasteboard(pasteboardName).setPathnamesForType(pathnames, pasteboardType);
     220}
     221
     222long WebPlatformStrategies::setStringForType(const String& string, const String& pasteboardType, const String& pasteboardName)
     223{
     224    return PlatformPasteboard(pasteboardName).setStringForType(string, pasteboardType);
     225}
  • trunk/Source/WebKit2/ChangeLog

    r154620 r154639  
     12013-08-26  Alexey Proskuryakov  <ap@apple.com>
     2
     3        [Mac] can-read-in-dragstart-event.html and can-read-in-copy-and-cut-events.html fail
     4        https://bugs.webkit.org/show_bug.cgi?id=113094
     5
     6        Reviewed by Darin Adler.
     7
     8        Return new pasteboard change count from all functions that change it.
     9
     10        * UIProcess/WebContext.h:
     11        * UIProcess/WebContext.messages.in:
     12        * UIProcess/mac/WebContextMac.mm:
     13        (WebKit::WebContext::pasteboardCopy):
     14        (WebKit::WebContext::addPasteboardTypes):
     15        (WebKit::WebContext::setPasteboardTypes):
     16        (WebKit::WebContext::setPasteboardPathnamesForType):
     17        (WebKit::WebContext::setPasteboardStringForType):
     18        (WebKit::WebContext::setPasteboardBufferForType):
     19        * WebProcess/Plugins/PDF/PDFPlugin.mm:
     20        (WebKit::PDFPlugin::writeItemsToPasteboard):
     21        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
     22        (WebKit::WebPlatformStrategies::copy):
     23        (WebKit::WebPlatformStrategies::changeCount):
     24        (WebKit::WebPlatformStrategies::addTypes):
     25        (WebKit::WebPlatformStrategies::setTypes):
     26        (WebKit::WebPlatformStrategies::setBufferForType):
     27        (WebKit::WebPlatformStrategies::setPathnamesForType):
     28        (WebKit::WebPlatformStrategies::setStringForType):
     29        * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
     30
    1312013-08-26  Andreas Kling  <akling@apple.com>
    232
  • trunk/Source/WebKit2/UIProcess/WebContext.h

    r154144 r154639  
    324324    void getPasteboardStringForType(const String& pasteboardName, const String& pasteboardType, String&);
    325325    void getPasteboardBufferForType(const String& pasteboardName, const String& pasteboardType, SharedMemory::Handle&, uint64_t& size);
    326     void pasteboardCopy(const String& fromPasteboard, const String& toPasteboard);
     326    void pasteboardCopy(const String& fromPasteboard, const String& toPasteboard, uint64_t& newChangeCount);
    327327    void getPasteboardChangeCount(const String& pasteboardName, uint64_t& changeCount);
    328328    void getPasteboardUniqueName(String& pasteboardName);
    329329    void getPasteboardColor(const String& pasteboardName, WebCore::Color&);
    330330    void getPasteboardURL(const String& pasteboardName, WTF::String&);
    331     void addPasteboardTypes(const String& pasteboardName, const Vector<String>& pasteboardTypes);
    332     void setPasteboardTypes(const String& pasteboardName, const Vector<String>& pasteboardTypes);
    333     void setPasteboardPathnamesForType(const String& pasteboardName, const String& pasteboardType, const Vector<String>& pathnames);
    334     void setPasteboardStringForType(const String& pasteboardName, const String& pasteboardType, const String&);
    335     void setPasteboardBufferForType(const String& pasteboardName, const String& pasteboardType, const SharedMemory::Handle&, uint64_t size);
     331    void addPasteboardTypes(const String& pasteboardName, const Vector<String>& pasteboardTypes, uint64_t& newChangeCount);
     332    void setPasteboardTypes(const String& pasteboardName, const Vector<String>& pasteboardTypes, uint64_t& newChangeCount);
     333    void setPasteboardPathnamesForType(const String& pasteboardName, const String& pasteboardType, const Vector<String>& pathnames, uint64_t& newChangeCount);
     334    void setPasteboardStringForType(const String& pasteboardName, const String& pasteboardType, const String&, uint64_t& newChangeCount);
     335    void setPasteboardBufferForType(const String& pasteboardName, const String& pasteboardType, const SharedMemory::Handle&, uint64_t size, uint64_t& newChangeCount);
    336336#endif
    337337
  • trunk/Source/WebKit2/UIProcess/WebContext.messages.in

    r142651 r154639  
    3535    GetPasteboardStringForType(WTF::String pasteboardName, WTF::String pasteboardType) -> (WTF::String string)
    3636    GetPasteboardBufferForType(WTF::String pasteboardName, WTF::String pasteboardType) -> (WebKit::SharedMemory::Handle handle, uint64_t size)
    37     PasteboardCopy(WTF::String fromPasteboard, WTF::String toPasteboard)
     37    PasteboardCopy(WTF::String fromPasteboard, WTF::String toPasteboard) -> (uint64_t changeCount)
    3838    GetPasteboardChangeCount(WTF::String pasteboardName) -> (uint64_t changeCount)
    3939    GetPasteboardUniqueName() -> (WTF::String pasteboardName)
    4040    GetPasteboardColor(WTF::String pasteboardName) -> (WebCore::Color color)
    4141    GetPasteboardURL(WTF::String pasteboardName) -> (WTF::String urlString)
    42     AddPasteboardTypes(WTF::String pasteboardName, Vector<WTF::String> pasteboardTypes)
    43     SetPasteboardTypes(WTF::String pasteboardName, Vector<WTF::String> pasteboardTypes)
    44     SetPasteboardPathnamesForType(WTF::String pasteboardName, WTF::String pasteboardType, Vector<WTF::String> pathnames)
    45     SetPasteboardStringForType(WTF::String pasteboardName, WTF::String pasteboardType, WTF::String string)
    46     SetPasteboardBufferForType(WTF::String pasteboardName, WTF::String pasteboardType, WebKit::SharedMemory::Handle handle, uint64_t size)
     42    AddPasteboardTypes(WTF::String pasteboardName, Vector<WTF::String> pasteboardTypes) -> (uint64_t changeCount)
     43    SetPasteboardTypes(WTF::String pasteboardName, Vector<WTF::String> pasteboardTypes) -> (uint64_t changeCount)
     44    SetPasteboardPathnamesForType(WTF::String pasteboardName, WTF::String pasteboardType, Vector<WTF::String> pathnames) -> (uint64_t changeCount)
     45    SetPasteboardStringForType(WTF::String pasteboardName, WTF::String pasteboardType, WTF::String string) -> (uint64_t changeCount)
     46    SetPasteboardBufferForType(WTF::String pasteboardName, WTF::String pasteboardType, WebKit::SharedMemory::Handle handle, uint64_t size) -> (uint64_t changeCount)
    4747#endif
    4848
  • trunk/Source/WebKit2/UIProcess/mac/WebContextMac.mm

    r154302 r154639  
    404404}
    405405
    406 void WebContext::pasteboardCopy(const String& fromPasteboard, const String& toPasteboard)
    407 {
    408     PlatformPasteboard(toPasteboard).copy(fromPasteboard);
     406void WebContext::pasteboardCopy(const String& fromPasteboard, const String& toPasteboard, uint64_t& newChangeCount)
     407{
     408    newChangeCount = PlatformPasteboard(toPasteboard).copy(fromPasteboard);
    409409}
    410410
     
    429429}
    430430
    431 void WebContext::addPasteboardTypes(const String& pasteboardName, const Vector<String>& pasteboardTypes)
    432 {
    433     PlatformPasteboard(pasteboardName).addTypes(pasteboardTypes);
    434 }
    435 
    436 void WebContext::setPasteboardTypes(const String& pasteboardName, const Vector<String>& pasteboardTypes)
    437 {
    438     PlatformPasteboard(pasteboardName).setTypes(pasteboardTypes);
    439 }
    440 
    441 void WebContext::setPasteboardPathnamesForType(const String& pasteboardName, const String& pasteboardType, const Vector<String>& pathnames)
    442 {
    443     PlatformPasteboard(pasteboardName).setPathnamesForType(pathnames, pasteboardType);
    444 }
    445 
    446 void WebContext::setPasteboardStringForType(const String& pasteboardName, const String& pasteboardType, const String& string)
    447 {
    448     PlatformPasteboard(pasteboardName).setStringForType(string, pasteboardType);   
    449 }
    450 
    451 void WebContext::setPasteboardBufferForType(const String& pasteboardName, const String& pasteboardType, const SharedMemory::Handle& handle, uint64_t size)
     431void WebContext::addPasteboardTypes(const String& pasteboardName, const Vector<String>& pasteboardTypes, uint64_t& newChangeCount)
     432{
     433    newChangeCount = PlatformPasteboard(pasteboardName).addTypes(pasteboardTypes);
     434}
     435
     436void WebContext::setPasteboardTypes(const String& pasteboardName, const Vector<String>& pasteboardTypes, uint64_t& newChangeCount)
     437{
     438    newChangeCount = PlatformPasteboard(pasteboardName).setTypes(pasteboardTypes);
     439}
     440
     441void WebContext::setPasteboardPathnamesForType(const String& pasteboardName, const String& pasteboardType, const Vector<String>& pathnames, uint64_t& newChangeCount)
     442{
     443    newChangeCount = PlatformPasteboard(pasteboardName).setPathnamesForType(pathnames, pasteboardType);
     444}
     445
     446void WebContext::setPasteboardStringForType(const String& pasteboardName, const String& pasteboardType, const String& string, uint64_t& newChangeCount)
     447{
     448    newChangeCount = PlatformPasteboard(pasteboardName).setStringForType(string, pasteboardType);
     449}
     450
     451void WebContext::setPasteboardBufferForType(const String& pasteboardName, const String& pasteboardType, const SharedMemory::Handle& handle, uint64_t size, uint64_t& newChangeCount)
    452452{
    453453    if (handle.isNull()) {
    454         PlatformPasteboard(pasteboardName).setBufferForType(0, pasteboardType);
     454        newChangeCount = PlatformPasteboard(pasteboardName).setBufferForType(0, pasteboardType);
    455455        return;
    456456    }
    457457    RefPtr<SharedMemory> sharedMemoryBuffer = SharedMemory::create(handle, SharedMemory::ReadOnly);
    458458    RefPtr<SharedBuffer> buffer = SharedBuffer::create(static_cast<unsigned char *>(sharedMemoryBuffer->data()), size);
    459     PlatformPasteboard(pasteboardName).setBufferForType(buffer, pasteboardType);
     459    newChangeCount = PlatformPasteboard(pasteboardName).setBufferForType(buffer, pasteboardType);
    460460}
    461461
  • trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm

    r154142 r154639  
    16421642        pasteboardTypes.append(type);
    16431643
    1644     WebProcess::shared().parentProcessConnection()->send(Messages::WebContext::SetPasteboardTypes(NSGeneralPboard, pasteboardTypes), 0);
     1644    uint64_t newChangeCount;
     1645    WebProcess::shared().parentProcessConnection()->sendSync(Messages::WebContext::SetPasteboardTypes(NSGeneralPboard, pasteboardTypes),
     1646        Messages::WebContext::SetPasteboardTypes::Reply(newChangeCount), 0);
    16451647
    16461648    for (NSUInteger i = 0, count = items.count; i < count; ++i) {
     
    16561658        if ([type isEqualToString:NSStringPboardType] || [type isEqualToString:NSPasteboardTypeString]) {
    16571659            RetainPtr<NSString> plainTextString = adoptNS([[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]);
    1658             WebProcess::shared().parentProcessConnection()->send(Messages::WebContext::SetPasteboardStringForType(NSGeneralPboard, type, plainTextString.get()), 0);
     1660            WebProcess::shared().parentProcessConnection()->sendSync(Messages::WebContext::SetPasteboardStringForType(NSGeneralPboard, type, plainTextString.get()),
     1661                Messages::WebContext::SetPasteboardStringForType::Reply(newChangeCount), 0);
    16591662        } else {
    16601663            RefPtr<SharedBuffer> buffer = SharedBuffer::wrapNSData(data);
     
    16671670            memcpy(sharedMemory->data(), buffer->data(), buffer->size());
    16681671            sharedMemory->createHandle(handle, SharedMemory::ReadOnly);
    1669             WebProcess::shared().parentProcessConnection()->send(Messages::WebContext::SetPasteboardBufferForType(NSGeneralPboard, type, handle, buffer->size()), 0);
     1672            WebProcess::shared().parentProcessConnection()->sendSync(Messages::WebContext::SetPasteboardBufferForType(NSGeneralPboard, type, handle, buffer->size()),
     1673                Messages::WebContext::SetPasteboardBufferForType::Reply(newChangeCount), 0);
    16701674        }
    16711675    }
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp

    r154490 r154639  
    410410}
    411411
    412 void WebPlatformStrategies::copy(const String& fromPasteboard, const String& toPasteboard)
    413 {
    414     WebProcess::shared().parentProcessConnection()->send(Messages::WebContext::PasteboardCopy(fromPasteboard, toPasteboard), 0);
    415 }
    416 
    417 int WebPlatformStrategies::changeCount(const WTF::String &pasteboardName)
     412long WebPlatformStrategies::copy(const String& fromPasteboard, const String& toPasteboard)
     413{
     414    uint64_t newChangeCount;
     415    WebProcess::shared().parentProcessConnection()->sendSync(Messages::WebContext::PasteboardCopy(fromPasteboard, toPasteboard),
     416        Messages::WebContext::PasteboardCopy::Reply(newChangeCount), 0);
     417    return newChangeCount;
     418}
     419
     420long WebPlatformStrategies::changeCount(const WTF::String &pasteboardName)
    418421{
    419422    uint64_t changeCount;
     
    447450}
    448451
    449 void WebPlatformStrategies::addTypes(const Vector<String>& pasteboardTypes, const String& pasteboardName)
    450 {
    451     WebProcess::shared().parentProcessConnection()->send(Messages::WebContext::AddPasteboardTypes(pasteboardName, pasteboardTypes), 0);
    452 }
    453 
    454 void WebPlatformStrategies::setTypes(const Vector<String>& pasteboardTypes, const String& pasteboardName)
    455 {
    456     WebProcess::shared().parentProcessConnection()->send(Messages::WebContext::SetPasteboardTypes(pasteboardName, pasteboardTypes), 0);
    457 }
    458 
    459 void WebPlatformStrategies::setBufferForType(PassRefPtr<SharedBuffer> buffer, const String& pasteboardType, const String& pasteboardName)
     452long WebPlatformStrategies::addTypes(const Vector<String>& pasteboardTypes, const String& pasteboardName)
     453{
     454    uint64_t newChangeCount;
     455    WebProcess::shared().parentProcessConnection()->sendSync(Messages::WebContext::AddPasteboardTypes(pasteboardName, pasteboardTypes),
     456        Messages::WebContext::AddPasteboardTypes::Reply(newChangeCount), 0);
     457    return newChangeCount;
     458}
     459
     460long WebPlatformStrategies::setTypes(const Vector<String>& pasteboardTypes, const String& pasteboardName)
     461{
     462    uint64_t newChangeCount;
     463    WebProcess::shared().parentProcessConnection()->sendSync(Messages::WebContext::SetPasteboardTypes(pasteboardName, pasteboardTypes),
     464        Messages::WebContext::SetPasteboardTypes::Reply(newChangeCount), 0);
     465    return newChangeCount;
     466}
     467
     468long WebPlatformStrategies::setBufferForType(PassRefPtr<SharedBuffer> buffer, const String& pasteboardType, const String& pasteboardName)
    460469{
    461470    SharedMemory::Handle handle;
     
    465474        sharedMemoryBuffer->createHandle(handle, SharedMemory::ReadOnly);
    466475    }
    467     WebProcess::shared().parentProcessConnection()->send(Messages::WebContext::SetPasteboardBufferForType(pasteboardName, pasteboardType, handle, buffer ? buffer->size() : 0), 0);
    468 }
    469 
    470 void WebPlatformStrategies::setPathnamesForType(const Vector<String>& pathnames, const String& pasteboardType, const String& pasteboardName)
    471 {
    472     WebProcess::shared().parentProcessConnection()->send(Messages::WebContext::SetPasteboardPathnamesForType(pasteboardName, pasteboardType, pathnames), 0);
    473 }
    474 
    475 void WebPlatformStrategies::setStringForType(const String& string, const String& pasteboardType, const String& pasteboardName)
    476 {
    477     WebProcess::shared().parentProcessConnection()->send(Messages::WebContext::SetPasteboardStringForType(pasteboardName, pasteboardType, string), 0);
     476    uint64_t newChangeCount;
     477    WebProcess::shared().parentProcessConnection()->sendSync(Messages::WebContext::SetPasteboardBufferForType(pasteboardName, pasteboardType, handle, buffer ? buffer->size() : 0),
     478        Messages::WebContext::SetPasteboardBufferForType::Reply(newChangeCount), 0);
     479    return newChangeCount;
     480}
     481
     482long WebPlatformStrategies::setPathnamesForType(const Vector<String>& pathnames, const String& pasteboardType, const String& pasteboardName)
     483{
     484    uint64_t newChangeCount;
     485    WebProcess::shared().parentProcessConnection()->sendSync(Messages::WebContext::SetPasteboardPathnamesForType(pasteboardName, pasteboardType, pathnames),
     486        Messages::WebContext::SetPasteboardPathnamesForType::Reply(newChangeCount), 0);
     487    return newChangeCount;
     488}
     489
     490long WebPlatformStrategies::setStringForType(const String& string, const String& pasteboardType, const String& pasteboardName)
     491{
     492    uint64_t newChangeCount;
     493    WebProcess::shared().parentProcessConnection()->sendSync(Messages::WebContext::SetPasteboardStringForType(pasteboardName, pasteboardType, string),
     494        Messages::WebContext::SetPasteboardStringForType::Reply(newChangeCount), 0);
     495    return newChangeCount;
    478496}
    479497#endif
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h

    r153877 r154639  
    100100    virtual void getPathnamesForType(Vector<String>& pathnames, const String& pasteboardType, const String& pasteboardName) OVERRIDE;
    101101    virtual String stringForType(const String& pasteboardType, const String& pasteboardName) OVERRIDE;
    102     virtual int changeCount(const String& pasteboardName) OVERRIDE;
     102    virtual long changeCount(const String& pasteboardName) OVERRIDE;
    103103    virtual String uniqueName() OVERRIDE;
    104104    virtual WebCore::Color color(const String& pasteboardName) OVERRIDE;
    105105    virtual WebCore::KURL url(const String& pasteboardName) OVERRIDE;
    106106
    107     virtual void copy(const String& fromPasteboard, const String& toPasteboard) OVERRIDE;
    108     virtual void addTypes(const Vector<String>& pasteboardTypes, const String& pasteboardName) OVERRIDE;
    109     virtual void setTypes(const Vector<String>& pasteboardTypes, const String& pasteboardName) OVERRIDE;
    110     virtual void setBufferForType(PassRefPtr<WebCore::SharedBuffer>, const String& pasteboardType, const String& pasteboardName) OVERRIDE;
    111     virtual void setPathnamesForType(const Vector<String>&, const String& pasteboardType, const String& pasteboardName) OVERRIDE;
    112     virtual void setStringForType(const String&, const String& pasteboardType, const String& pasteboardName) OVERRIDE;
     107    virtual long addTypes(const Vector<String>& pasteboardTypes, const String& pasteboardName) OVERRIDE;
     108    virtual long setTypes(const Vector<String>& pasteboardTypes, const String& pasteboardName) OVERRIDE;
     109    virtual long copy(const String& fromPasteboard, const String& toPasteboard) OVERRIDE;
     110    virtual long setBufferForType(PassRefPtr<WebCore::SharedBuffer>, const String& pasteboardType, const String& pasteboardName) OVERRIDE;
     111    virtual long setPathnamesForType(const Vector<String>&, const String& pasteboardType, const String& pasteboardName) OVERRIDE;
     112    virtual long setStringForType(const String&, const String& pasteboardType, const String& pasteboardName) OVERRIDE;
    113113#endif
    114114
Note: See TracChangeset for help on using the changeset viewer.