Commit e927de08 authored by Ms2ger's avatar Ms2ger
Browse files

Bug 711240 - Part b: Expose xpc_qsStringToJsval publicly; r=bholley

parent 05eb777e
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -76,12 +76,12 @@
#include "nsIScriptObjectPrincipal.h"
#include "nsFileDataProtocolHandler.h"
#include "mozilla/Preferences.h"
#include "xpcprivate.h"
#include "xpcpublic.h"
#include "XPCQuickStubs.h"
#include "jstypedarray.h"
#include "nsIScriptSecurityManager.h"
#include "nsDOMJSUtils.h"

#include "jstypedarray.h"

using namespace mozilla;

#define LOAD_STR "load"
@@ -247,7 +247,7 @@ nsDOMFileReader::GetResult(JSContext* aCx, jsval* aResult)
  }
 
  nsString tmpResult = mResult;
  if (!xpc_qsStringToJsval(aCx, tmpResult, aResult)) {
  if (!xpc::StringToJsval(aCx, tmpResult, aResult)) {
    return NS_ERROR_FAILURE;
  }
  return NS_OK;
+4 −3
Original line number Diff line number Diff line
@@ -69,8 +69,9 @@
#include "nsIMIMEService.h"
#include "nsCExternalHandlerService.h"
#include "nsIVariant.h"
#include "xpcprivate.h"
#include "XPCQuickStubs.h"
#include "nsVariant.h"
#include "nsIScriptError.h"
#include "xpcpublic.h"
#include "nsStringStream.h"
#include "nsIStreamConverterService.h"
#include "nsICachingChannel.h"
@@ -1036,7 +1037,7 @@ NS_IMETHODIMP nsXMLHttpRequest::GetResponse(JSContext *aCx, jsval *aResult)
      nsString str;
      rv = GetResponseText(str);
      if (NS_FAILED(rv)) return rv;
      NS_ENSURE_TRUE(xpc_qsStringToJsval(aCx, str, aResult),
      NS_ENSURE_TRUE(xpc::StringToJsval(aCx, str, aResult),
                     NS_ERROR_OUT_OF_MEMORY);
    }
    break;
+1 −1
Original line number Diff line number Diff line
@@ -107,7 +107,7 @@ Canvas2D_GetStyleHelper(JSContext *cx, JSObject *obj, jsid id, jsval *vp,

    switch (resultType) {
    case nsIDOMCanvasRenderingContext2D::CMG_STYLE_STRING:
        return xpc_qsStringToJsval(cx, resultString, vp);
        return xpc::StringToJsval(cx, resultString, vp);

    case nsIDOMCanvasRenderingContext2D::CMG_STYLE_PATTERN:
    {
+3 −4
Original line number Diff line number Diff line
@@ -48,8 +48,7 @@
#include "nsEventDispatcher.h"
#include "nsThreadUtils.h"
#include "mozilla/storage.h"
#include "xpcprivate.h"
#include "XPCQuickStubs.h"
#include "xpcpublic.h"

#include "AsyncConnectionHelper.h"
#include "IDBCursor.h"
@@ -398,7 +397,7 @@ IDBIndex::GetKeyPath(JSContext* aCx,
    for (PRUint32 i = 0; i < mKeyPathArray.Length(); ++i) {
      jsval val;
      nsString tmp(mKeyPathArray[i]);
      if (!xpc_qsStringToJsval(aCx, tmp, &val)) {
      if (!xpc::StringToJsval(aCx, tmp, &val)) {
        return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
      }

@@ -411,7 +410,7 @@ IDBIndex::GetKeyPath(JSContext* aCx,
  }
  else {
    nsString tmp(mKeyPath);
    if (!xpc_qsStringToJsval(aCx, tmp, aVal)) {
    if (!xpc::StringToJsval(aCx, tmp, aVal)) {
      return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
    }
  }
+4 −5
Original line number Diff line number Diff line
@@ -55,8 +55,7 @@
#include "nsThreadUtils.h"
#include "snappy/snappy.h"
#include "test_quota.h"
#include "xpcprivate.h"
#include "XPCQuickStubs.h"
#include "xpcpublic.h"

#include "AsyncConnectionHelper.h"
#include "IDBCursor.h"
@@ -564,7 +563,7 @@ IDBObjectStore::IsValidKeyPath(JSContext* aCx,
    }

    jsval stringVal;
    if (!xpc_qsStringToJsval(aCx, token, &stringVal)) {
    if (!xpc::StringToJsval(aCx, token, &stringVal)) {
      return false;
    }

@@ -1429,7 +1428,7 @@ IDBObjectStore::GetKeyPath(JSContext* aCx,
    for (PRUint32 i = 0; i < mKeyPathArray.Length(); ++i) {
      jsval val;
      nsString tmp(mKeyPathArray[i]);
      if (!xpc_qsStringToJsval(aCx, tmp, &val)) {
      if (!xpc::StringToJsval(aCx, tmp, &val)) {
        return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
      }

@@ -1442,7 +1441,7 @@ IDBObjectStore::GetKeyPath(JSContext* aCx,
  }
  else {
    nsString tmp(mKeyPath);
    if (!xpc_qsStringToJsval(aCx, tmp, aVal)) {
    if (!xpc::StringToJsval(aCx, tmp, aVal)) {
      return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
    }
  }
Loading