Bug 1290337 - Part 16: Replace Value parameter to const Value& in dom. r=smaug

This commit is contained in:
Tooru Fujisawa
2016-09-11 18:15:24 +09:00
parent ba8b6965af
commit 11c4b51a67
6 changed files with 6 additions and 6 deletions

View File

@@ -112,7 +112,7 @@ DoDrawImageSecurityCheck(dom::HTMLCanvasElement *aCanvasElement,
} }
bool bool
CoerceDouble(JS::Value v, double* d) CoerceDouble(const JS::Value& v, double* d)
{ {
if (v.isDouble()) { if (v.isDouble()) {
*d = v.toDouble(); *d = v.toDouble();

View File

@@ -49,7 +49,7 @@ void DoDrawImageSecurityCheck(dom::HTMLCanvasElement *aCanvasElement,
// Make a double out of |v|, treating undefined values as 0.0 (for // Make a double out of |v|, treating undefined values as 0.0 (for
// the sake of sparse arrays). Return true iff coercion // the sake of sparse arrays). Return true iff coercion
// succeeded. // succeeded.
bool CoerceDouble(JS::Value v, double* d); bool CoerceDouble(const JS::Value& v, double* d);
/* Float validation stuff */ /* Float validation stuff */
#define VALIDATE(_f) if (!IsFinite(_f)) return false #define VALIDATE(_f) if (!IsFinite(_f)) return false

View File

@@ -539,7 +539,7 @@ NPVariantToJSVal(NPP npp, JSContext *cx, const NPVariant *variant)
} }
bool bool
JSValToNPVariant(NPP npp, JSContext *cx, JS::Value val, NPVariant *variant) JSValToNPVariant(NPP npp, JSContext *cx, const JS::Value& val, NPVariant *variant)
{ {
NS_ASSERTION(npp, "Must have an NPP to wrap a jsval!"); NS_ASSERTION(npp, "Must have an NPP to wrap a jsval!");

View File

@@ -102,7 +102,7 @@ public:
}; };
bool bool
JSValToNPVariant(NPP npp, JSContext *cx, JS::Value val, NPVariant *variant); JSValToNPVariant(NPP npp, JSContext *cx, const JS::Value& val, NPVariant *variant);
#endif // nsJSNPRuntime_h_ #endif // nsJSNPRuntime_h_

View File

@@ -6655,7 +6655,7 @@ EventTarget::IsOnCurrentThread(bool* aIsOnCurrentThread)
BEGIN_WORKERS_NAMESPACE BEGIN_WORKERS_NAMESPACE
WorkerCrossThreadDispatcher* WorkerCrossThreadDispatcher*
GetWorkerCrossThreadDispatcher(JSContext* aCx, JS::Value aWorker) GetWorkerCrossThreadDispatcher(JSContext* aCx, const JS::Value& aWorker)
{ {
if (!aWorker.isObject()) { if (!aWorker.isObject()) {
return nullptr; return nullptr;

View File

@@ -348,7 +348,7 @@ public:
}; };
WorkerCrossThreadDispatcher* WorkerCrossThreadDispatcher*
GetWorkerCrossThreadDispatcher(JSContext* aCx, JS::Value aWorker); GetWorkerCrossThreadDispatcher(JSContext* aCx, const JS::Value& aWorker);
// Random unique constant to facilitate JSPrincipal debugging // Random unique constant to facilitate JSPrincipal debugging
const uint32_t kJSPrincipalsDebugToken = 0x7e2df9d2; const uint32_t kJSPrincipalsDebugToken = 0x7e2df9d2;