Bug 1144366 - Switch SpiderMonkey and XPConnect style from |T *t| to |T* t|. r=jorendorff

This commit is contained in:
Jan de Mooij
2015-03-28 12:08:37 +01:00
parent ec84d22cf9
commit 369ef1b850
759 changed files with 50565 additions and 50565 deletions

View File

@@ -36,7 +36,7 @@ class ObjectId {
MOZ_CRASH("Bad CPOW Id");
}
bool operator==(const ObjectId &other) const {
bool operator==(const ObjectId& other) const {
bool equal = serialNumber() == other.serialNumber();
MOZ_ASSERT_IF(equal, hasXrayWaiver() == other.hasXrayWaiver());
return equal;
@@ -71,13 +71,13 @@ class JavaScriptShared;
struct ObjectIdHasher
{
typedef ObjectId Lookup;
static js::HashNumber hash(const Lookup &l) {
static js::HashNumber hash(const Lookup& l) {
return l.serialize();
}
static bool match(const ObjectId &k, const ObjectId &l) {
static bool match(const ObjectId& k, const ObjectId& l) {
return k == l;
}
static void rekey(ObjectId &k, const ObjectId& newKey) {
static void rekey(ObjectId& k, const ObjectId& newKey) {
k = newKey;
}
};
@@ -85,17 +85,17 @@ struct ObjectIdHasher
// Map ids -> JSObjects
class IdToObjectMap
{
typedef js::HashMap<ObjectId, JS::Heap<JSObject *>, ObjectIdHasher, js::SystemAllocPolicy> Table;
typedef js::HashMap<ObjectId, JS::Heap<JSObject*>, ObjectIdHasher, js::SystemAllocPolicy> Table;
public:
IdToObjectMap();
bool init();
void trace(JSTracer *trc);
void trace(JSTracer* trc);
void sweep();
bool add(ObjectId id, JSObject *obj);
JSObject *find(ObjectId id);
bool add(ObjectId id, JSObject* obj);
JSObject* find(ObjectId id);
void remove(ObjectId id);
void clear();
@@ -108,26 +108,26 @@ class IdToObjectMap
// Map JSObjects -> ids
class ObjectToIdMap
{
typedef js::PointerHasher<JSObject *, 3> Hasher;
typedef js::HashMap<JSObject *, ObjectId, Hasher, js::SystemAllocPolicy> Table;
typedef js::PointerHasher<JSObject*, 3> Hasher;
typedef js::HashMap<JSObject*, ObjectId, Hasher, js::SystemAllocPolicy> Table;
public:
ObjectToIdMap();
~ObjectToIdMap();
bool init();
void trace(JSTracer *trc);
void trace(JSTracer* trc);
void sweep();
bool add(JSContext *cx, JSObject *obj, ObjectId id);
ObjectId find(JSObject *obj);
void remove(JSObject *obj);
bool add(JSContext* cx, JSObject* obj, ObjectId id);
ObjectId find(JSObject* obj);
void remove(JSObject* obj);
void clear();
private:
static void keyMarkCallback(JSTracer *trc, JSObject *key, void *data);
static void keyMarkCallback(JSTracer* trc, JSObject* key, void* data);
Table *table_;
Table* table_;
};
class Logging;
@@ -135,7 +135,7 @@ class Logging;
class JavaScriptShared : public CPOWManager
{
public:
explicit JavaScriptShared(JSRuntime *rt);
explicit JavaScriptShared(JSRuntime* rt);
virtual ~JavaScriptShared();
bool init();
@@ -143,40 +143,40 @@ class JavaScriptShared : public CPOWManager
void decref();
void incref();
bool Unwrap(JSContext *cx, const InfallibleTArray<CpowEntry> &aCpows, JS::MutableHandleObject objp);
bool Wrap(JSContext *cx, JS::HandleObject aObj, InfallibleTArray<CpowEntry> *outCpows);
bool Unwrap(JSContext* cx, const InfallibleTArray<CpowEntry>& aCpows, JS::MutableHandleObject objp);
bool Wrap(JSContext* cx, JS::HandleObject aObj, InfallibleTArray<CpowEntry>* outCpows);
protected:
bool toVariant(JSContext *cx, JS::HandleValue from, JSVariant *to);
bool fromVariant(JSContext *cx, const JSVariant &from, JS::MutableHandleValue to);
bool toVariant(JSContext* cx, JS::HandleValue from, JSVariant* to);
bool fromVariant(JSContext* cx, const JSVariant& from, JS::MutableHandleValue to);
bool toJSIDVariant(JSContext *cx, JS::HandleId from, JSIDVariant *to);
bool fromJSIDVariant(JSContext *cx, const JSIDVariant &from, JS::MutableHandleId to);
bool toJSIDVariant(JSContext* cx, JS::HandleId from, JSIDVariant* to);
bool fromJSIDVariant(JSContext* cx, const JSIDVariant& from, JS::MutableHandleId to);
bool toSymbolVariant(JSContext *cx, JS::Symbol *sym, SymbolVariant *symVarp);
JS::Symbol *fromSymbolVariant(JSContext *cx, SymbolVariant symVar);
bool toSymbolVariant(JSContext* cx, JS::Symbol* sym, SymbolVariant* symVarp);
JS::Symbol* fromSymbolVariant(JSContext* cx, SymbolVariant symVar);
bool fromDescriptor(JSContext *cx, JS::Handle<JSPropertyDescriptor> desc,
PPropertyDescriptor *out);
bool toDescriptor(JSContext *cx, const PPropertyDescriptor &in,
bool fromDescriptor(JSContext* cx, JS::Handle<JSPropertyDescriptor> desc,
PPropertyDescriptor* out);
bool toDescriptor(JSContext* cx, const PPropertyDescriptor& in,
JS::MutableHandle<JSPropertyDescriptor> out);
bool toObjectOrNullVariant(JSContext *cx, JSObject *obj, ObjectOrNullVariant *objVarp);
JSObject *fromObjectOrNullVariant(JSContext *cx, ObjectOrNullVariant objVar);
bool toObjectOrNullVariant(JSContext* cx, JSObject* obj, ObjectOrNullVariant* objVarp);
JSObject* fromObjectOrNullVariant(JSContext* cx, ObjectOrNullVariant objVar);
bool convertIdToGeckoString(JSContext *cx, JS::HandleId id, nsString *to);
bool convertGeckoStringToId(JSContext *cx, const nsString &from, JS::MutableHandleId id);
bool convertIdToGeckoString(JSContext* cx, JS::HandleId id, nsString* to);
bool convertGeckoStringToId(JSContext* cx, const nsString& from, JS::MutableHandleId id);
virtual bool toObjectVariant(JSContext *cx, JSObject *obj, ObjectVariant *objVarp) = 0;
virtual JSObject *fromObjectVariant(JSContext *cx, ObjectVariant objVar) = 0;
virtual bool toObjectVariant(JSContext* cx, JSObject* obj, ObjectVariant* objVarp) = 0;
virtual JSObject* fromObjectVariant(JSContext* cx, ObjectVariant objVar) = 0;
static void ConvertID(const nsID &from, JSIID *to);
static void ConvertID(const JSIID &from, nsID *to);
static void ConvertID(const nsID& from, JSIID* to);
static void ConvertID(const JSIID& from, nsID* to);
JSObject *findCPOWById(const ObjectId &objId) {
JSObject* findCPOWById(const ObjectId& objId) {
return cpows_.find(objId);
}
JSObject *findObjectById(JSContext *cx, const ObjectId &objId);
JSObject* findObjectById(JSContext* cx, const ObjectId& objId);
static bool LoggingEnabled() { return sLoggingEnabled; }
static bool StackLoggingEnabled() { return sStackLoggingEnabled; }
@@ -185,10 +185,10 @@ class JavaScriptShared : public CPOWManager
virtual bool isParent() = 0;
virtual JSObject *scopeForTargetObjects() = 0;
virtual JSObject* scopeForTargetObjects() = 0;
protected:
JSRuntime *rt_;
JSRuntime* rt_;
uintptr_t refcount_;
IdToObjectMap objects_;
@@ -213,7 +213,7 @@ class JavaScriptShared : public CPOWManager
// For the object-to-id map, we just keep two maps, one for each type.
ObjectToIdMap unwaivedObjectIds_;
ObjectToIdMap waivedObjectIds_;
ObjectToIdMap &objectIdMap(bool waiver) {
ObjectToIdMap& objectIdMap(bool waiver) {
return waiver ? waivedObjectIds_ : unwaivedObjectIds_;
}