Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce a NewWindowProxy API. #240

Merged
merged 1 commit into from Feb 9, 2016
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Introduce a NewWindowProxy API.

  • Loading branch information
Ms2ger committed Feb 9, 2016
commit 6b53c4937b67dc71414d37dd3f4ad5cf407b2c2b
@@ -208,6 +208,9 @@ extern "C" {
aHandler: *const ::libc::c_void, aClass: *const JSClass,
aSingleton: bool)
-> *mut JSObject;
pub fn NewWindowProxy(aCx: *mut JSContext, aObj: HandleObject,
aHandler: *const ::libc::c_void)
-> *mut JSObject;
pub fn GetProxyExtra(obj: *mut JSObject, slot: u32) -> Value;
pub fn GetProxyPrivate(obj: *mut JSObject) -> Value;
pub fn SetProxyExtra(obj: *mut JSObject, slot: u32, val: Value);
@@ -529,6 +529,28 @@ WrapperNew(JSContext* aCx, JS::HandleObject aObj, const void* aHandler,
return js::Wrapper::New(aCx, aObj, (const js::Wrapper*)aHandler, options);
}

void WindowProxyObjectMoved(JSObject*, const JSObject*)
{
abort();
}

const js::Class WindowProxyClass =
PROXY_CLASS_WITH_EXT(
"Proxy",
0, /* additional class flags */
PROXY_MAKE_EXT(
nullptr, /* outerObject */
js::proxy_innerObject,
false, /* isWrappedNative */
WindowProxyObjectMoved
));

JSObject*
NewWindowProxy(JSContext* aCx, JS::HandleObject aObj, const void* aHandler)
{
return WrapperNew(aCx, aObj, aHandler, Jsvalify(&WindowProxyClass), true);
}

jsval
GetProxyExtra(JSObject* obj, uint32_t slot)
{
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.