Bug 37578 - [Chromium] Consider implementing addOriginAccessWhitelistEntry method
Summary: [Chromium] Consider implementing addOriginAccessWhitelistEntry method
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-14 09:03 PDT by anton muhin
Modified: 2010-05-24 07:54 PDT (History)
7 users (show)

See Also:


Attachments
Patch (2.73 KB, patch)
2010-04-28 08:15 PDT, anton muhin
no flags Details | Formatted Diff | Diff
Patch (4.25 KB, patch)
2010-04-29 07:49 PDT, anton muhin
no flags Details | Formatted Diff | Diff
Adding DEPRECATED tags (4.46 KB, patch)
2010-04-29 08:51 PDT, anton muhin
no flags Details | Formatted Diff | Diff
Same as previous, to bypass r+ (4.46 KB, patch)
2010-04-29 09:25 PDT, anton muhin
no flags Details | Formatted Diff | Diff
Now with correct Reviewed by (4.46 KB, patch)
2010-04-29 09:29 PDT, anton muhin
no flags Details | Formatted Diff | Diff
Remove deprecated methods (2.75 KB, patch)
2010-05-06 08:57 PDT, anton muhin
no flags Details | Formatted Diff | Diff
Adding DRT files (7.27 KB, patch)
2010-05-06 09:20 PDT, anton muhin
no flags Details | Formatted Diff | Diff
Resolve a conflict (4.57 KB, patch)
2010-05-14 04:28 PDT, anton muhin
no flags Details | Formatted Diff | Diff
Patch (1.94 KB, patch)
2010-05-21 05:17 PDT, anton muhin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description anton muhin 2010-04-14 09:03:01 PDT
http://trac.webkit.org/changeset/57535/ brought this into Safari.

For now those layout tests:

http/tests/xmlhttprequest/origin-whitelisting-all.html
http/tests/xmlhttprequest/origin-whitelisting-exact-match.html
http/tests/xmlhttprequest/origin-whitelisting-https.html
http/tests/xmlhttprequest/origin-whitelisting-ip-addresses-with-
subdomains.html
http/tests/xmlhttprequest/origin-whitelisting-ip-addresses.html
http/tests/xmlhttprequest/origin-whitelisting-subdomains.html
http/tests/security/local-image-from-remote-whitelisted.html
http/tests/xmlhttprequest/origin-whitelisting-removal.html

are skipped for Chromium.
Comment 1 anton muhin 2010-04-14 09:11:07 PDT
https://bugs.webkit.org/show_bug.cgi?id=37577 modified Chromium's test_expectations to skip the tests.
Comment 2 David Levin 2010-04-15 10:32:42 PDT
This simply looks like a work item for Chromium's DRT/test_shell.

The work involved would be to expose this through the Chromium WebKit API and then use it in test_shell. Similar to what was done for Windows and OSX in https://bugs.webkit.org/attachment.cgi?id=53259&action=prettypatch

Anton, perhaps you could tackle this as a clean up task?
Comment 3 anton muhin 2010-04-16 11:39:17 PDT
(In reply to comment #2)
> This simply looks like a work item for Chromium's DRT/test_shell.
> 
> The work involved would be to expose this through the Chromium WebKit API and
> then use it in test_shell. Similar to what was done for Windows and OSX in
> https://bugs.webkit.org/attachment.cgi?id=53259&action=prettypatch
> 
> Anton, perhaps you could tackle this as a clean up task?

David, I'll try to implement it, but probably somewhat later.  Or you think this is urgent?
Comment 4 David Levin 2010-04-16 11:43:18 PDT
(In reply to comment #3)
> David, I'll try to implement it, but probably somewhat later.  Or you think
> this is urgent?

Not urgent.
Comment 5 anton muhin 2010-04-28 08:07:55 PDT
Some more updates.

There were two relevant changes:

http://trac.webkit.org/changeset/57535 renamed two methods and
http://trac.webkit.org/changeset/57537 which added another one.

My current plan would be to add new method into 
WebKit/WebKit/chromium and then submit a change to Chromium's test_shell which would both add new method and rename two renamed ones.

After that we probably need two-sided patch to rename methods in Chromium's bridge API.

Does it sound sane?
Comment 6 anton muhin 2010-04-28 08:15:14 PDT
Created attachment 54566 [details]
Patch
Comment 7 anton muhin 2010-04-28 08:16:17 PDT
(In reply to comment #6)
> Created an attachment (id=54566) [details]
> Patch

Name---unwhitelist....---is rather poor, but ideally we should move to add/remove as in SecurityPolicy.
Comment 8 David Levin 2010-04-28 12:49:47 PDT
Adding Darin since this is a public api change.
Comment 9 Darin Fisher (:fishd, Google) 2010-04-28 13:31:11 PDT
Comment on attachment 54566 [details]
Patch

WebKit/chromium/src/WebSecurityPolicy.cpp:69
 +  void WebSecurityPolicy::unwhiteListAccessFromOrigin(const WebURL& sourceOrigin,
Why not use the same name as the method on SecurityOrigin?  I have the same question about whiteListAccessFromOrigin.

Oh, I see... in r57535, SecurityOrigin::whiteListAccessFromOrigin was renamed addOriginAccessWhitelistEntry :-(

How about writing a patch that switches us over to the same method names as SecurityOrigin so that we can avoid the awkward sounding "unwhiteListFoo" method name?
Comment 10 Darin Fisher (:fishd, Google) 2010-04-28 13:33:06 PDT
I recommend doing two WebKit patches here: first patch adds the new method names, and the second patch removes the old method name.  The chromium patch that you need to do to call the newly added "remove" function can also include a change to call the new form of the "add" function.  Do that step before you submit the second WebKit patch.
Comment 11 anton muhin 2010-04-29 07:49:54 PDT
Created attachment 54707 [details]
Patch
Comment 12 anton muhin 2010-04-29 07:52:10 PDT
(In reply to comment #10)
> I recommend doing two WebKit patches here: first patch adds the new method
> names, and the second patch removes the old method name.  The chromium patch
> that you need to do to call the newly added "remove" function can also include
> a change to call the new form of the "add" function.  Do that step before you
> submit the second WebKit patch.

Sure, Darin, and thanks a lot for comments.

Please notice that there is almost invisible change in resetOriginAccessWhiteLists name: White<L>ists -> White<l>ists.

May you have another look?
Comment 13 Darin Fisher (:fishd, Google) 2010-04-29 08:16:57 PDT
Comment on attachment 54707 [details]
Patch

> +// To be removed when Chromium's test_shell has proper references.
> +void WebSecurityPolicy::whiteListAccessFromOrigin(

Please add DEPRECATED to comments like the above, so that 
it is easier to grep for these dead bits.

Otherwise R=me
Comment 14 anton muhin 2010-04-29 08:51:43 PDT
Created attachment 54712 [details]
Adding DEPRECATED tags
Comment 15 anton muhin 2010-04-29 08:52:52 PDT
(In reply to comment #13)
> (From update of attachment 54707 [details])
> > +// To be removed when Chromium's test_shell has proper references.
> > +void WebSecurityPolicy::whiteListAccessFromOrigin(
> 
> Please add DEPRECATED to comments like the above, so that 
> it is easier to grep for these dead bits.
> 
> Otherwise R=me

Thanks, Darin.  Could you r+ new patch if it's fine---I'd rather to use commit-queue as this patch is not urgent.
Comment 16 David Levin 2010-04-29 09:14:22 PDT
Rather than make Darin re-review it if this is something you would submit given Darin's r+, then you should upload the patch with the reviewed lines fixed as if you were about to check it in and then just mark the patch as cq+ (and no r? or r+, etc. -- just leave that blank).  The commit queue should handle that then.
Comment 17 David Levin 2010-04-29 09:14:46 PDT
Comment on attachment 54712 [details]
Adding DEPRECATED tags

See comment above.
Comment 18 anton muhin 2010-04-29 09:25:17 PDT
Created attachment 54714 [details]
Same as previous, to bypass r+
Comment 19 anton muhin 2010-04-29 09:26:12 PDT
(In reply to comment #17)
> (From update of attachment 54712 [details])
> See comment above.

Thanks a lot, David.  Trying this approach.  Sorry for noise.
Comment 20 anton muhin 2010-04-29 09:29:12 PDT
Created attachment 54715 [details]
Now with correct Reviewed by
Comment 21 WebKit Commit Bot 2010-04-29 12:15:03 PDT
Comment on attachment 54715 [details]
Now with correct Reviewed by

Clearing flags on attachment: 54715

Committed r58530: <http://trac.webkit.org/changeset/58530>
Comment 22 WebKit Commit Bot 2010-04-29 12:15:11 PDT
All reviewed patches have been landed.  Closing bug.
Comment 23 anton muhin 2010-05-06 08:57:39 PDT
Created attachment 55247 [details]
Remove deprecated methods
Comment 24 WebKit Review Bot 2010-05-06 09:12:14 PDT
Attachment 55247 [details] did not build on chromium:
Build output: http://webkit-commit-queue.appspot.com/results/2231020
Comment 25 anton muhin 2010-05-06 09:20:13 PDT
Created attachment 55248 [details]
Adding DRT files
Comment 26 anton muhin 2010-05-06 10:20:10 PDT
Thanks a lot, Darin.
Comment 27 Eric Seidel (no email) 2010-05-12 11:28:36 PDT
I think this patch i supposed to be landed.  So reopening the bug so the commit-queue will see it.
Comment 28 WebKit Commit Bot 2010-05-14 04:07:44 PDT
Comment on attachment 55248 [details]
Adding DRT files

Rejecting patch 55248 from commit-queue.

Failed to run "[u'/Users/eseidel/Projects/CommitQueue/WebKitTools/Scripts/svn-apply', u'--reviewer', u'Darin Fisher', u'--force']" exit_code: 1
Last 500 characters of output:
atching file WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
Hunk #1 FAILED at 113.
Hunk #2 FAILED at 469.
Hunk #3 succeeded at 1109 with fuzz 1 (offset 56 lines).
2 out of 3 hunks FAILED -- saving rejects to file WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp.rej
patching file WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
Hunk #1 FAILED at 230.
1 out of 1 hunk FAILED -- saving rejects to file WebKitTools/DumpRenderTree/chromium/LayoutTestController.h.rej

Full output: http://webkit-commit-queue.appspot.com/results/2281052
Comment 29 anton muhin 2010-05-14 04:28:37 PDT
Created attachment 56063 [details]
Resolve a conflict
Comment 30 anton muhin 2010-05-14 04:29:47 PDT
Comment on attachment 56063 [details]
Resolve a conflict

as cq got stuck, someone else partially fixed the issue this patch was supposed to fix.  Merge was needed. cq+ it again.
Comment 31 WebKit Commit Bot 2010-05-14 19:54:38 PDT
Comment on attachment 56063 [details]
Resolve a conflict

Clearing flags on attachment: 56063

Committed r59512: <http://trac.webkit.org/changeset/59512>
Comment 32 WebKit Commit Bot 2010-05-14 19:54:46 PDT
All reviewed patches have been landed.  Closing bug.
Comment 33 anton muhin 2010-05-21 05:17:42 PDT
Created attachment 56698 [details]
Patch
Comment 34 anton muhin 2010-05-21 05:19:14 PDT
And the last patch, hopefully.

Try bot results: http://codereview.chromium.org/2104016
Comment 35 WebKit Commit Bot 2010-05-23 02:19:06 PDT
Comment on attachment 56698 [details]
Patch

Clearing flags on attachment: 56698

Committed r60033: <http://trac.webkit.org/changeset/60033>
Comment 36 WebKit Commit Bot 2010-05-23 02:19:14 PDT
All reviewed patches have been landed.  Closing bug.
Comment 37 anton muhin 2010-05-24 07:54:48 PDT
Thanks a lot, Darin.  Now that should be closed for the last time.