Bug 677079 - Part f: Expose structuredCloneCallbacks in jsfriendapi.h; r=jorendorff

This commit is contained in:
Ms2ger 2012-01-15 09:13:08 +01:00
Родитель 439df931d4
Коммит 0571299493
4 изменённых файлов: 13 добавлений и 7 удалений

Просмотреть файл

@ -257,8 +257,6 @@
#include <android/log.h>
#endif
#include "jscntxt.h" // cx->runtime->structuredCloneCallbacks
#ifdef PR_LOGGING
static PRLogModuleInfo* gDOMLeakPRLog;
#endif
@ -6031,7 +6029,7 @@ PostMessageReadStructuredClone(JSContext* cx,
}
const JSStructuredCloneCallbacks* runtimeCallbacks =
cx->runtime->structuredCloneCallbacks;
js::GetContextStructuredCloneCallbacks(cx);
if (runtimeCallbacks) {
return runtimeCallbacks->read(cx, reader, tag, data, nsnull);
@ -6071,7 +6069,7 @@ PostMessageWriteStructuredClone(JSContext* cx,
}
const JSStructuredCloneCallbacks* runtimeCallbacks =
cx->runtime->structuredCloneCallbacks;
js::GetContextStructuredCloneCallbacks(cx);
if (runtimeCallbacks) {
return runtimeCallbacks->write(cx, writer, obj, nsnull);

Просмотреть файл

@ -41,7 +41,6 @@
#include "nsIJSContextStack.h"
#include "jscntxt.h" // structuredCloneCallbacks
#include "jsfriendapi.h"
#include "mozilla/dom/StructuredCloneTags.h"
#include "mozilla/storage.h"
@ -1024,7 +1023,7 @@ IDBObjectStore::StructuredCloneReadCallback(JSContext* aCx,
}
const JSStructuredCloneCallbacks* runtimeCallbacks =
aCx->runtime->structuredCloneCallbacks;
js::GetContextStructuredCloneCallbacks(aCx);
if (runtimeCallbacks) {
return runtimeCallbacks->read(aCx, aReader, aTag, aData, nsnull);
@ -1105,7 +1104,7 @@ IDBObjectStore::StructuredCloneWriteCallback(JSContext* aCx,
// try using the runtime callbacks
const JSStructuredCloneCallbacks* runtimeCallbacks =
aCx->runtime->structuredCloneCallbacks;
js::GetContextStructuredCloneCallbacks(aCx);
if (runtimeCallbacks) {
return runtimeCallbacks->write(aCx, aWriter, aObj, nsnull);
}

Просмотреть файл

@ -492,6 +492,12 @@ AutoLockGC::lock(JSRuntime *rt)
JS_LOCK_GC(rt);
}
JS_FRIEND_API(const JSStructuredCloneCallbacks *)
GetContextStructuredCloneCallbacks(JSContext *cx)
{
return cx->runtime->structuredCloneCallbacks;
}
#ifdef JS_THREADSAFE
JSThread *
GetContextThread(const JSContext *cx)

Просмотреть файл

@ -486,6 +486,9 @@ class JS_FRIEND_API(AutoLockGC)
MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
};
extern JS_FRIEND_API(const JSStructuredCloneCallbacks *)
GetContextStructuredCloneCallbacks(JSContext *cx);
} /* namespace js */
/*