Expose security origin to BundleFrame
authorJon Lee <jonlee@apple.com>
Sun, 4 Nov 2012 22:26:02 +0000 (22:26 +0000)
committerJon Lee <jonlee@apple.com>
Sun, 4 Nov 2012 22:26:02 +0000 (22:26 +0000)
commitfe0bd58255798b4c60e161334242b720ef0005dc
tree0091ca7de8c6b91137468cc38137d8d0817192f8
parentaff334ebd93a27ba31a38370712f35b72f0e76e1
Expose security origin to BundleFrame
https://bugs.webkit.org/show_bug.cgi?id=101139
<rdar://problem/12629900>

Reviewed by Darin Adler.

Create a WebSecurityOrigin instance, sharing the security origin instance
that comes directly from the frame's document. We can do this because the
WK2 API only retrieves information about the origin, and because those
results are returned as copies. The security origin holds no references
that could lead to a retain cycle, avoiding the possibility that the
injected bundle accidentally keeps something alive.

* Shared/API/c/WKSharedAPICast.h:
(WebKit::toCopiedAPI): Create copied API for WebCore::SecurityOrigin
instances.
* Shared/WebSecurityOrigin.h:
(WebKit::WebSecurityOrigin::create): Add a new create() function that
takes a PassRefPtr to a WebCore SecurityOrigin instance.
(WebKit::WebSecurityOrigin::createFromString): Refactor to use new create()
function.
(WebKit::WebSecurityOrigin::createFromDatabaseIdentifier): Refactor to
use new create() function.
(WebKit::WebSecurityOrigin::create): Refactor to use new create()
function.
* WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
(WKBundleFrameCopySecurityOrigin): Add function to retrieve the security
origin as a WK2 API object.
* WebProcess/InjectedBundle/API/c/WKBundleFrame.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133425 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/API/c/WKSharedAPICast.h
Source/WebKit2/Shared/WebSecurityOrigin.h
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.h