Bug 22776 - Add ScriptController::updateSecurityOrigin
Summary: Add ScriptController::updateSecurityOrigin
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Adam Barth
Depends on:
Reported: 2008-12-09 21:35 PST by Adam Barth
Modified: 2008-12-10 09:56 PST (History)
2 users (show)

See Also:

patch (3.92 KB, patch)
2008-12-09 21:35 PST, Adam Barth
sam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Barth 2008-12-09 21:35:01 PST
We should call a method on ScriptController when we update a document's securityOrigin.  V8 uses this method to update the security context it uses in its fast-path security check.  Currently, the JavaScriptCore bindings don't have use for this method, but it might in the future.

Patch forthcoming.
Comment 1 Adam Barth 2008-12-09 21:35:28 PST
Created attachment 25912 [details]
Comment 2 Adam Barth 2008-12-09 21:41:36 PST
For those keeping score at home, this method corresponds to / replaces SecriptController::setDomain in http://src.chromium.org/viewvc/chrome/trunk/src/webkit/port/bindings/v8/ScriptController.h?view=markup
Comment 3 Sam Weinig 2008-12-09 21:44:16 PST
Comment on attachment 25912 [details]

>          securityOrigin()->setDomainFromDOM(newDomain);
> +        if (m_frame)
> +             m_frame->script()->updateSecurityOrigin();

The indentation looks odd here.

>      securityOrigin()->setDomainFromDOM(newDomain);
> +    if (m_frame)
> +         m_frame->script()->updateSecurityOrigin();

And here.

Comment 4 Adam Barth 2008-12-09 22:49:57 PST
Fixed in r39163.  Thanks for the quick review!
Comment 5 Darin Fisher (:fishd, Google) 2008-12-10 08:43:33 PST
Comment on attachment 25912 [details]

>diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp
>+        if (m_frame)
>+             m_frame->script()->updateSecurityOrigin();
>         return;
>+    if (m_frame)
>+         m_frame->script()->updateSecurityOrigin();
> }

FYI: indentation looks to be off by one space.
Comment 6 Adam Barth 2008-12-10 09:56:51 PST
> FYI: indentation looks to be off by one space.

Thanks.  I think I fixed this before landing.