mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 20:35:50 +00:00
Bug 667652: Add a JS_FRIEND_API to get at the current offset in a structured clone buffer. r=jorendorff.
This commit is contained in:
parent
9a5c874715
commit
99aa56bee4
@ -46,6 +46,13 @@
|
||||
|
||||
using namespace js;
|
||||
|
||||
JS_FRIEND_API(uint64_t)
|
||||
js_GetSCOffset(JSStructuredCloneWriter* writer)
|
||||
{
|
||||
JS_ASSERT(writer);
|
||||
return writer->output().count() * sizeof(uint64_t);
|
||||
}
|
||||
|
||||
namespace js
|
||||
{
|
||||
|
||||
|
@ -46,6 +46,9 @@
|
||||
#include "jsvector.h"
|
||||
#include "jsvalue.h"
|
||||
|
||||
JS_FRIEND_API(uint64_t)
|
||||
js_GetSCOffset(JSStructuredCloneWriter* writer);
|
||||
|
||||
namespace js {
|
||||
|
||||
bool
|
||||
@ -73,6 +76,8 @@ struct SCOutput {
|
||||
|
||||
bool extractBuffer(uint64_t **datap, size_t *sizep);
|
||||
|
||||
uint64_t count() { return buf.length(); }
|
||||
|
||||
private:
|
||||
JSContext *cx;
|
||||
js::Vector<uint64_t> buf;
|
||||
|
Loading…
Reference in New Issue
Block a user