Bug 108476 - Cleanup: Use ScriptExecutionContext::topOrigin when relevant.
Summary: Cleanup: Use ScriptExecutionContext::topOrigin when relevant.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Trivial
Assignee: Mike West
URL:
Keywords:
Depends on: 94171
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-31 06:33 PST by Mike West
Modified: 2013-01-31 12:50 PST (History)
3 users (show)

See Also:


Attachments
Patch (7.28 KB, patch)
2013-01-31 07:09 PST, Mike West
no flags Details | Formatted Diff | Diff
Patch for landing. (7.58 KB, patch)
2013-01-31 08:34 PST, Mike West
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike West 2013-01-31 06:33:02 PST
http://wkbug.com/94171 introduced ScriptExecutionContext::topOrigin to avoid casting the execution context to either a WorkerContext or Document. We should use this new method rather than walking through the document's topDocument() directly.
Comment 1 Mike West 2013-01-31 07:09:51 PST
Created attachment 185775 [details]
Patch
Comment 2 WebKit Review Bot 2013-01-31 07:11:40 PST
Attachment 185775 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCore/Modules/webdatabase/DOMWindowWebDatabase.cpp', u'Source/WebCore/page/DOMWindow.cpp', u'Source/WebCore/workers/SharedWorker.cpp', u'Source/WebCore/workers/WorkerMessagingProxy.cpp', u'Source/WebKit2/ChangeLog', u'Source/WebKit2/WebProcess/Plugins/PluginView.cpp']" exit_code: 1
Source/WebCore/workers/WorkerMessagingProxy.cpp:285:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 1 in 7 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 jochen 2013-01-31 08:05:28 PST
Comment on attachment 185775 [details]
Patch

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

ok

you'll need somebody from WK2 approve this.

>> Source/WebCore/workers/WorkerMessagingProxy.cpp:285
>> +                                                                         document->topOrigin());
> 
> Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]

i would just put all arguments on one line to make the style queue happy
Comment 4 Anders Carlsson 2013-01-31 08:22:19 PST
Comment on attachment 185775 [details]
Patch

WK2 parts look fine!
Comment 5 jochen 2013-01-31 08:26:07 PST
Comment on attachment 185775 [details]
Patch

r=me
Comment 6 Mike West 2013-01-31 08:30:32 PST
(In reply to comment #3)
> (From update of attachment 185775 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=185775&action=review
> 
> ok
> 
> you'll need somebody from WK2 approve this.

Good eye, thank you.

I think it would be worthwhile to add a message noting that, similar to what we do for the Chromium API.

> >> Source/WebCore/workers/WorkerMessagingProxy.cpp:285
> >> +                                                                         document->topOrigin());
> > 
> > Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
> 
> i would just put all arguments on one line to make the style queue happy

A 280-character line is more or less like an 80-character line. *sigh*
Comment 7 Mike West 2013-01-31 08:34:36 PST
Created attachment 185789 [details]
Patch for landing.
Comment 8 Adam Barth 2013-01-31 10:52:43 PST
> Patch for landing.

Did you mean to mark this patch commit-queue? or commit-queue+     ?
Comment 9 Mike West 2013-01-31 11:50:19 PST
(In reply to comment #8)
> > Patch for landing.
> 
> Did you mean to mark this patch commit-queue? or commit-queue+     ?

Hrm. I thought I uploaded with land-safely. I'll flip the bit by hand. *sigh* SO MUCH WORK.
Comment 10 WebKit Review Bot 2013-01-31 12:50:22 PST
Comment on attachment 185789 [details]
Patch for landing.

Clearing flags on attachment: 185789

Committed r141466: <http://trac.webkit.org/changeset/141466>
Comment 11 WebKit Review Bot 2013-01-31 12:50:26 PST
All reviewed patches have been landed.  Closing bug.