Bug 79253 - WebKit2: implement platform strategy to access Pasteboard in the UI process.
Summary: WebKit2: implement platform strategy to access Pasteboard in the UI process.
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-22 10:04 PST by Enrica Casucci
Modified: 2012-03-06 19:56 PST (History)
5 users (show)

See Also:


Attachments
Patch (16.89 KB, patch)
2012-02-22 10:12 PST, Enrica Casucci
ap: 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-22 10:04:01 PST
This bugs tracks the work required to implement the message exchanging with the UIProcess to move the access to NSPasteboard out of the WebProcess.
Comment 1 Enrica Casucci 2012-02-22 10:12:22 PST
Created attachment 128238 [details]
Patch
Comment 2 Alexey Proskuryakov 2012-02-23 11:00:24 PST
Comment on attachment 128238 [details]
Patch

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

Can sandbox profile be updated now, blocking pasteboard access?

> Source/WebKit2/UIProcess/WebContext.cpp:625
> +#if PLATFORM(MAC)
> +void WebContext::getPasteboardTypes(const String& pasteboardName, Vector<String>& pasteboardTypes)

Can this code go to WebContextMac.mm instead?

> Source/WebKit2/UIProcess/WebContext.cpp:642
> +    RefPtr<WebCore::SharedBuffer> buffer = PlatformPasteboard(pasteboardName).bufferForType(pasteboardType);

Is this WebCore:: prefix needed?
Comment 3 WebKit Commit Bot 2012-02-24 01:04:24 PST
Attachment 128238 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Source/WebKit2/UIProcess/WebContext.h:232:  The parameter name "handle" adds no information, so it should be removed.  [readability/parameter_name] [5]
Source/WebKit2/UIProcess/WebContext.h:236:  The parameter name "color" adds no information, so it should be removed.  [readability/parameter_name] [5]
Source/WebKit2/UIProcess/WebContext.h:240:  The parameter name "handle" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 3 in 7 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Enrica Casucci 2012-02-27 13:27:57 PST
(In reply to comment #2)
> (From update of attachment 128238 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=128238&action=review
> 
> Can sandbox profile be updated now, blocking pasteboard access?
> 
> > Source/WebKit2/UIProcess/WebContext.cpp:625
> > +#if PLATFORM(MAC)
> > +void WebContext::getPasteboardTypes(const String& pasteboardName, Vector<String>& pasteboardTypes)
> 
> Can this code go to WebContextMac.mm instead?
>
Yes, I'll move it. 
> > Source/WebKit2/UIProcess/WebContext.cpp:642
> > +    RefPtr<WebCore::SharedBuffer> buffer = PlatformPasteboard(pasteboardName).bufferForType(pasteboardType);
> 
> Is this WebCore:: prefix needed?
No, I'll remove it.
Comment 5 Enrica Casucci 2012-02-27 13:29:11 PST
(In reply to comment #2)
> (From update of attachment 128238 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=128238&action=review
> 
> Can sandbox profile be updated now, blocking pasteboard access?
> 
Not yet, there is still one patch I'm working on to remove the access performed in WebDragClient.cpp.
I need to move to the UI process all the code that deals with the NSPromisedFile stuff.
Comment 6 Enrica Casucci 2012-02-27 13:29:31 PST
(In reply to comment #3)
> Attachment 128238 [details] did not pass style-queue:
> 
> Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
> Source/WebKit2/UIProcess/WebContext.h:232:  The parameter name "handle" adds no information, so it should be removed.  [readability/parameter_name] [5]
> Source/WebKit2/UIProcess/WebContext.h:236:  The parameter name "color" adds no information, so it should be removed.  [readability/parameter_name] [5]
> Source/WebKit2/UIProcess/WebContext.h:240:  The parameter name "handle" adds no information, so it should be removed.  [readability/parameter_name] [5]
> Total errors found: 3 in 7 files
> 
> 
> If any of these errors are false positives, please file a bug against check-webkit-style.

Will fix style issues before landing.
Comment 7 Enrica Casucci 2012-02-27 14:05:11 PST
http://trac.webkit.org/changeset/109022
Comment 8 Andy Estes 2012-03-06 19:56:10 PST
It looks like this broke file uploads to icloud.com. I filed <https://bugs.webkit.org/show_bug.cgi?id=80475>.