Bug 78316

Summary: Disable IndexedDB permissions check from shared workers
Product: WebKit Reporter: David Grogan <dgrogan>
Component: New BugsAssignee: David Grogan <dgrogan>
Status: RESOLVED FIXED    
Severity: Normal CC: jsbell, michaeln, tony, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch for landing none

Description David Grogan 2012-02-09 19:12:51 PST
Disable IndexedDB permissions check from workers
Comment 1 David Grogan 2012-02-09 19:14:20 PST
Created attachment 126434 [details]
Patch
Comment 2 David Grogan 2012-02-09 19:17:42 PST
I left the rest of the code for 2 reasons:
1) To prevent it from not compiling.
2) To preserve the diff when I update it.

I foresee a quite skeptical webkit reviewer.
Comment 3 Michael Nordman 2012-02-09 19:41:29 PST
Comment on attachment 126434 [details]
Patch

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

> Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp:165
>      WebWorkerClientImpl* webWorkerClientImpl = static_cast<WebWorkerClientImpl*>(&workerContext->thread()->workerLoaderProxy());

david, you had mentioned an invalid cast in the shared worker case... is this it on line 165?
Comment 4 Michael Nordman 2012-02-09 19:44:59 PST
maybe test if isSharedWorkerContext() and only short circuit that case to not regress for dedicated workers
Comment 5 David Grogan 2012-02-10 10:25:28 PST
Created attachment 126533 [details]
Patch
Comment 6 David Grogan 2012-02-10 10:27:09 PST
Comment on attachment 126533 [details]
Patch

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

Changed to only disable the test for shared workers.

> Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp:166
>      WebWorkerClientImpl* webWorkerClientImpl = static_cast<WebWorkerClientImpl*>(&workerContext->thread()->workerLoaderProxy());

Yes, this is the cast that needs to be changed to a WebWorkerBase.
Comment 7 David Grogan 2012-02-10 13:42:31 PST
Tony, could you review this?
Comment 8 Tony Chang 2012-02-10 14:06:05 PST
Comment on attachment 126533 [details]
Patch

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

Can you write a LayoutTest for this?

> Source/WebKit/chromium/ChangeLog:6
> +
> +        Reviewed by NOBODY (OOPS!).

Please put include some of the comment here to explain why you're making this change.
Comment 9 David Grogan 2012-02-10 14:40:39 PST
Comment on attachment 126533 [details]
Patch

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

The behavior that's changing here (for shared workers) can't be tested with the current DRT because it doesn't run multiple processes.  I think a layout test for the dedicated worker case is possible, though it would involve changing layoutTestController.  Which I don't want to do right now on account of expediency.  (The only reason we're adding this bypass is to get the feature in front of developers ASAP.)

Though I've been meaning to add a permissions test for a while.  Bug filed at http://crbug.com/113738.  Is that ok?

>> Source/WebKit/chromium/ChangeLog:6
>> +        Reviewed by NOBODY (OOPS!).
> 
> Please put include some of the comment here to explain why you're making this change.

Done.
Comment 10 David Grogan 2012-02-10 14:42:07 PST
Created attachment 126586 [details]
Patch
Comment 11 Tony Chang 2012-02-10 14:58:39 PST
(In reply to comment #9)
> The behavior that's changing here (for shared workers) can't be tested with the current DRT because it doesn't run multiple processes.

Please mention this in the ChangeLog (e.g., No new tests because ....).

> I think a layout test for the dedicated worker case is possible, though it would involve changing layoutTestController.  Which I don't want to do right now on account of expediency.  (The only reason we're adding this bypass is to get the feature in front of developers ASAP.)
> Though I've been meaning to add a permissions test for a while.  Bug filed at http://crbug.com/113738.  Is that ok?

Having a bug for this is fine for now.  I would have filed it in webkit, but whatever works for you.
Comment 12 David Grogan 2012-02-10 15:12:20 PST
Created attachment 126591 [details]
Patch for landing
Comment 13 WebKit Review Bot 2012-02-10 17:20:51 PST
Comment on attachment 126591 [details]
Patch for landing

Clearing flags on attachment: 126591

Committed r107463: <http://trac.webkit.org/changeset/107463>
Comment 14 WebKit Review Bot 2012-02-10 17:20:58 PST
All reviewed patches have been landed.  Closing bug.