Commit bb679fa4 authored by Kagami Sascha Rosylight's avatar Kagami Sascha Rosylight
Browse files

Bug 1769290 - Part 24: Apply mozilla-js-handle-rooted-typedef against...

Bug 1769290 - Part 24: Apply mozilla-js-handle-rooted-typedef against layout,security,storage,tools r=andi

Differential Revision: https://phabricator.services.mozilla.com/D151791
parent 8e178acc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -267,7 +267,7 @@ nsStyleSheetService::PreloadSheet(nsIURI* aSheetURI, uint32_t aSheetType,
NS_IMETHODIMP
nsStyleSheetService::PreloadSheetAsync(nsIURI* aSheetURI, uint32_t aSheetType,
                                       JSContext* aCx,
                                       JS::MutableHandleValue aRval) {
                                       JS::MutableHandle<JS::Value> aRval) {
  NS_ENSURE_ARG_POINTER(aSheetURI);

  css::SheetParsingMode parsingMode;
+5 −6
Original line number Diff line number Diff line
@@ -353,7 +353,7 @@ nsresult nsSiteSecurityService::MarkHostAsNotHSTS(

NS_IMETHODIMP
nsSiteSecurityService::ResetState(nsIURI* aURI,
                                  JS::HandleValue aOriginAttributes,
                                  JS::Handle<JS::Value> aOriginAttributes,
                                  JSContext* aCx, uint8_t aArgc) {
  if (!aURI) {
    return NS_ERROR_INVALID_ARG;
@@ -406,7 +406,7 @@ bool nsSiteSecurityService::HostIsIPAddress(const nsCString& hostname) {
NS_IMETHODIMP
nsSiteSecurityService::ProcessHeaderScriptable(
    nsIURI* aSourceURI, const nsACString& aHeader,
    nsITransportSecurityInfo* aSecInfo, JS::HandleValue aOriginAttributes,
    nsITransportSecurityInfo* aSecInfo, JS::Handle<JS::Value> aOriginAttributes,
    uint64_t* aMaxAge, bool* aIncludeSubdomains, uint32_t* aFailureResult,
    JSContext* aCx, uint8_t aArgc) {
  OriginAttributes originAttributes;
@@ -636,10 +636,9 @@ nsresult nsSiteSecurityService::ProcessSTSHeader(
}

NS_IMETHODIMP
nsSiteSecurityService::IsSecureURIScriptable(nsIURI* aURI,
                                             JS::HandleValue aOriginAttributes,
                                             JSContext* aCx, uint8_t aArgc,
                                             bool* aResult) {
nsSiteSecurityService::IsSecureURIScriptable(
    nsIURI* aURI, JS::Handle<JS::Value> aOriginAttributes, JSContext* aCx,
    uint8_t aArgc, bool* aResult) {
  OriginAttributes originAttributes;
  if (aArgc > 0) {
    if (!aOriginAttributes.isObject() ||
+4 −4
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ nsresult AsyncStatementJSHelper::getParams(AsyncStatement* aStatement,
               "Invalid state to get the params object - all calls will fail!");
#endif

  JS::RootedObject scope(aCtx, aScopeObj);
  JS::Rooted<JSObject*> scope(aCtx, aScopeObj);

  if (!aStatement->mStatementParamsHolder) {
    dom::GlobalObject global(aCtx, scope);
@@ -101,8 +101,8 @@ AsyncStatementJSHelper::Resolve(nsIXPConnectWrappedNative* aWrapper,
  if (!aId.isString()) return NS_OK;

  // Cast to async via mozI* since direct from nsISupports is ambiguous.
  JS::RootedObject scope(aCtx, aScopeObj);
  JS::RootedId id(aCtx, aId);
  JS::Rooted<JSObject*> scope(aCtx, aScopeObj);
  JS::Rooted<JS::PropertyKey> id(aCtx, aId);
  mozIStorageAsyncStatement* iAsyncStmt =
      static_cast<mozIStorageAsyncStatement*>(aWrapper->Native());
  AsyncStatement* stmt = static_cast<AsyncStatement*>(iAsyncStmt);
@@ -116,7 +116,7 @@ AsyncStatementJSHelper::Resolve(nsIXPConnectWrappedNative* aWrapper,
#endif

  if (::JS_LinearStringEqualsLiteral(id.toLinearString(), "params")) {
    JS::RootedValue val(aCtx);
    JS::Rooted<JS::Value> val(aCtx);
    nsresult rv = getParams(stmt, aCtx, scope, val.address());
    NS_ENSURE_SUCCESS(rv, rv);
    *_retval = ::JS_DefinePropertyById(aCtx, scope, id, val, JSPROP_RESOLVING);
+4 −4
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ static bool stepFunc(JSContext* aCtx, uint32_t argc, JS::Value* _vp) {
    return false;
  }

  JS::RootedObject obj(aCtx, &args.thisv().toObject());
  JS::Rooted<JSObject*> obj(aCtx, &args.thisv().toObject());
  nsresult rv =
      xpc->GetWrappedNativeOfJSObject(aCtx, obj, getter_AddRefs(wrapper));
  if (NS_FAILED(rv)) {
@@ -92,7 +92,7 @@ nsresult StatementJSHelper::getRow(Statement* aStatement, JSContext* aCtx,
               "Invalid state to get the row object - all calls will fail!");
#endif

  JS::RootedObject scope(aCtx, aScopeObj);
  JS::Rooted<JSObject*> scope(aCtx, aScopeObj);

  if (!aStatement->mStatementRowHolder) {
    dom::GlobalObject global(aCtx, scope);
@@ -135,7 +135,7 @@ nsresult StatementJSHelper::getParams(Statement* aStatement, JSContext* aCtx,
               "Invalid state to get the params object - all calls will fail!");
#endif

  JS::RootedObject scope(aCtx, aScopeObj);
  JS::Rooted<JSObject*> scope(aCtx, aScopeObj);

  if (!aStatement->mStatementParamsHolder) {
    dom::GlobalObject global(aCtx, scope);
@@ -216,7 +216,7 @@ StatementJSHelper::Resolve(nsIXPConnectWrappedNative* aWrapper, JSContext* aCtx,
    return NS_OK;
  }

  JS::RootedValue val(aCtx);
  JS::Rooted<JS::Value> val(aCtx);

  if (::JS_LinearStringEqualsLiteral(str, "row")) {
    nsresult rv = getRow(stmt, aCtx, scope, val.address());
+5 −5
Original line number Diff line number Diff line
@@ -278,7 +278,7 @@ struct StringWriteFunc : public JSONWriteFunc {
NS_IMETHODIMP
nsProfiler::GetSharedLibraries(JSContext* aCx,
                               JS::MutableHandle<JS::Value> aResult) {
  JS::RootedValue val(aCx);
  JS::Rooted<JS::Value> val(aCx);
  {
    nsString buffer;
    JSONWriter w(MakeUnique<StringWriteFunc>(buffer));
@@ -289,7 +289,7 @@ nsProfiler::GetSharedLibraries(JSContext* aCx,
                                 static_cast<const char16_t*>(buffer.get()),
                                 buffer.Length(), &val));
  }
  JS::RootedObject obj(aCx, &val.toObject());
  JS::Rooted<JSObject*> obj(aCx, &val.toObject());
  if (!obj) {
    return NS_ERROR_FAILURE;
  }
@@ -300,7 +300,7 @@ nsProfiler::GetSharedLibraries(JSContext* aCx,
NS_IMETHODIMP
nsProfiler::GetActiveConfiguration(JSContext* aCx,
                                   JS::MutableHandle<JS::Value> aResult) {
  JS::RootedValue jsValue(aCx);
  JS::Rooted<JS::Value> jsValue(aCx);
  {
    nsString buffer;
    JSONWriter writer(MakeUnique<StringWriteFunc>(buffer));
@@ -312,7 +312,7 @@ nsProfiler::GetActiveConfiguration(JSContext* aCx,
  if (jsValue.isNull()) {
    aResult.setNull();
  } else {
    JS::RootedObject obj(aCx, &jsValue.toObject());
    JS::Rooted<JSObject*> obj(aCx, &jsValue.toObject());
    if (!obj) {
      return NS_ERROR_FAILURE;
    }
@@ -338,7 +338,7 @@ nsProfiler::GetProfileData(double aSinceTime, JSContext* aCx,
  NS_ConvertUTF8toUTF16 js_string(nsDependentCString(profile.get()));
  auto profile16 = static_cast<const char16_t*>(js_string.get());

  JS::RootedValue val(aCx);
  JS::Rooted<JS::Value> val(aCx);
  MOZ_ALWAYS_TRUE(JS_ParseJSON(aCx, profile16, js_string.Length(), &val));

  aResult.set(val);