Bug 1356666, part 2 - Fix some style issues in mozJSSubScriptLoader. r=mrbkap
mSystemPrincipal is an nsCOMPtr so it does not need to be explicitly
initialized.
Fields don't have to be lined up.
Empty function bodies don't need to be commented as such.
The blank line at the start of mozJSComponentLoader.cpp prevents Emacs
from using the mode line.
MozReview-Commit-ID: 7Az1x8jmxTI
--- a/js/xpconnect/loader/mozJSComponentLoader.cpp
+++ b/js/xpconnect/loader/mozJSComponentLoader.cpp
@@ -1,9 +1,8 @@
-
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set ts=8 sts=4 et sw=4 tw=99: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/Attributes.h"
--- a/js/xpconnect/loader/mozJSSubScriptLoader.cpp
+++ b/js/xpconnect/loader/mozJSSubScriptLoader.cpp
@@ -75,23 +75,22 @@ public:
#define LOAD_ERROR_NOCONTENT "ContentLength not available (not a local URL?)"
#define LOAD_ERROR_BADCHARSET "Error converting to specified charset"
#define LOAD_ERROR_BADREAD "File Read Error."
#define LOAD_ERROR_READUNDERFLOW "File Read Error (underflow.)"
#define LOAD_ERROR_NOPRINCIPALS "Failed to get principals."
#define LOAD_ERROR_NOSPEC "Failed to get URI spec. This is bad."
#define LOAD_ERROR_CONTENTTOOBIG "ContentLength is too large"
-mozJSSubScriptLoader::mozJSSubScriptLoader() : mSystemPrincipal(nullptr)
+mozJSSubScriptLoader::mozJSSubScriptLoader()
{
}
mozJSSubScriptLoader::~mozJSSubScriptLoader()
{
- /* empty */
}
NS_IMPL_ISUPPORTS(mozJSSubScriptLoader, mozIJSSubScriptLoader)
static void
ReportError(JSContext* cx, const nsACString& msg)
{
NS_ConvertUTF8toUTF16 ucMsg(msg);
@@ -270,22 +269,22 @@ public:
mozilla::HoldJSObjects(this);
}
private:
virtual ~AsyncScriptLoader() {
mozilla::DropJSObjects(this);
}
- RefPtr<nsIChannel> mChannel;
- Heap<JSObject*> mTargetObj;
- RefPtr<Promise> mPromise;
- nsString mCharset;
- bool mReuseGlobal;
- bool mCache;
+ RefPtr<nsIChannel> mChannel;
+ Heap<JSObject*> mTargetObj;
+ RefPtr<Promise> mPromise;
+ nsString mCharset;
+ bool mReuseGlobal;
+ bool mCache;
};
NS_IMPL_CYCLE_COLLECTION_CLASS(AsyncScriptLoader)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(AsyncScriptLoader)
NS_INTERFACE_MAP_ENTRY(nsIIncrementalStreamLoaderObserver)
NS_INTERFACE_MAP_END
@@ -327,18 +326,18 @@ public:
}
void ResolvePromise(HandleValue aResolveValue) {
mPromise->MaybeResolve(aResolveValue);
mPromise = nullptr;
}
private:
- AutoEntryScript& mAutoEntryScript;
- RefPtr<Promise> mPromise;
+ AutoEntryScript& mAutoEntryScript;
+ RefPtr<Promise> mPromise;
nsCOMPtr<nsIGlobalObject> mGlobalObject;
};
NS_IMETHODIMP
AsyncScriptLoader::OnIncrementalData(nsIIncrementalStreamLoader* aLoader,
nsISupports* aContext,
uint32_t aDataLength,
const uint8_t* aData,