Bug 1356666, part 2 - Fix some style issues in mozJSSubScriptLoader. r=mrbkap draft
authorAndrew McCreight <continuation@gmail.com>
Fri, 14 Apr 2017 14:13:19 -0700
changeset 563010 d83d2688391d7a53535f1d995490f971f1572777
parent 563009 de2c5ad10beb09a5c3de0d0b94e958a49db3b97c
child 563033 42b76c50c817cedc5dfce79c66f3cac9999c1858
push id54184
push userbmo:continuation@gmail.com
push dateFri, 14 Apr 2017 21:26:28 +0000
reviewersmrbkap
bugs1356666
milestone55.0a1
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
js/xpconnect/loader/mozJSComponentLoader.cpp
js/xpconnect/loader/mozJSSubScriptLoader.cpp
--- 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,