Bug 78554 - Refactor ClipboardMac class to use PlatformStrategies
Summary: Refactor ClipboardMac class to use PlatformStrategies
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac Unspecified
: P2 Normal
Assignee: Enrica Casucci
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-13 16:58 PST by Enrica Casucci
Modified: 2012-02-15 15:09 PST (History)
2 users (show)

See Also:


Attachments
Patch (41.53 KB, patch)
2012-02-13 17:14 PST, Enrica Casucci
andersca: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Enrica Casucci 2012-02-13 16:58:56 PST
This bug track another step in the direction of removing access to NSPasteboard from the WebProcess.
The Mac implementation of the Clipboard class needs to be redesigned to use a platform strategy that can provide different implementations for WebKit and WebKit2.
Comment 1 Enrica Casucci 2012-02-13 17:14:57 PST
Created attachment 126872 [details]
Patch
Comment 2 Anders Carlsson 2012-02-15 14:19:33 PST
Comment on attachment 126872 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=126872&action=review

> Source/WebCore/platform/PasteboardStrategy.h:46
> +    virtual const String uniqueName() = 0;

This doesn't need to return a const String.

> Source/WebCore/platform/PlatformPasteboard.h:43
> +    static const String uniqueName();

Ditto.

> Source/WebCore/platform/PlatformPasteboard.h:49
> +    int changeCount();

Can this member function be const?

> Source/WebCore/platform/mac/ClipboardMac.mm:73
> +static const String cocoaTypeFromHTMLClipboardType(const String& type)

No need for const.
Comment 3 Enrica Casucci 2012-02-15 14:36:39 PST
(In reply to comment #2)
> (From update of attachment 126872 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=126872&action=review
> 
> > Source/WebCore/platform/PasteboardStrategy.h:46
> > +    virtual const String uniqueName() = 0;
> 
> This doesn't need to return a const String.
> 
> > Source/WebCore/platform/PlatformPasteboard.h:43
> > +    static const String uniqueName();
> 
> Ditto.
> 
> > Source/WebCore/platform/PlatformPasteboard.h:49
> > +    int changeCount();
> 
> Can this member function be const?
> 
> > Source/WebCore/platform/mac/ClipboardMac.mm:73
> > +static const String cocoaTypeFromHTMLClipboardType(const String& type)
> 
> No need for const.

Thanks for the review! I'll address your comments.
Comment 4 Enrica Casucci 2012-02-15 15:09:21 PST
http://trac.webkit.org/changeset/107844