Bug 1513205 - Ride along, update some code to match the Google coding style r=Ehsan
authorSylvestre Ledru <sledru@mozilla.com>
Fri, 14 Dec 2018 18:10:08 +0000
changeset 450572 039a7c0c18fb28371d0ee7b2b673b8dd605f24b7
parent 450571 09c71a7cf75aeaf2963050e315276fb9a866fd62
child 450573 817f3f5892beed92f0e9cd80716cbf7006e4fed4
push id74727
push usersledru@mozilla.com
push dateFri, 14 Dec 2018 18:13:03 +0000
treeherderautoland@039a7c0c18fb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersEhsan
bugs1513205
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1513205 - Ride along, update some code to match the Google coding style r=Ehsan # ignore-this-changeset Depends on D14595 Differential Revision: https://phabricator.services.mozilla.com/D14597
gfx/layers/Layers.cpp
gfx/layers/apz/src/AsyncPanZoomController.cpp
js/src/gc/GC.cpp
js/src/gc/Verifier.cpp
layout/base/PresShell.h
toolkit/recordreplay/ProcessRedirectDarwin.cpp
widget/gtk/mozcontainer.cpp
--- a/gfx/layers/Layers.cpp
+++ b/gfx/layers/Layers.cpp
@@ -1949,18 +1949,17 @@ void ContainerLayer::PrintInfo(std::stri
   Layer::PrintInfo(aStream, aPrefix);
   if (UseIntermediateSurface()) {
     aStream << " [usesTmpSurf]";
   }
   if (1.0 != mPreXScale || 1.0 != mPreYScale) {
     aStream
         << nsPrintfCString(" [preScale=%g, %g]", mPreXScale, mPreYScale).get();
   }
-  aStream << nsPrintfCString(" [presShellResolution=%g]",
-                             mPresShellResolution)
+  aStream << nsPrintfCString(" [presShellResolution=%g]", mPresShellResolution)
                  .get();
 }
 
 void ContainerLayer::DumpPacket(layerscope::LayersPacket* aPacket,
                                 const void* aParent) {
   Layer::DumpPacket(aPacket, aParent);
   // Get this layer data
   using namespace layerscope;
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -3973,18 +3973,18 @@ AsyncTransform AsyncPanZoomController::G
     }
   }
 
   // Unlike the visual viewport, the layout viewport does not change size
   // (in the sense of "number of CSS pixels of page content it covers")
   // when zooming, so the async transform of the layout viewport does not
   // have an async zoom component. (The translation still needs to be
   // multiplied by the non-async zoom, to get it into the correct coordinates.)
-  CSSToParentLayerScale2D effectiveZoom = Metrics().LayersPixelsPerCSSPixel()
-      * LayerToParentLayerScale(1.0f);
+  CSSToParentLayerScale2D effectiveZoom =
+      Metrics().LayersPixelsPerCSSPixel() * LayerToParentLayerScale(1.0f);
   ParentLayerPoint translation =
       (currentViewportOffset - lastPaintViewport.TopLeft()) * effectiveZoom;
   LayerToParentLayerScale compositedAsyncZoom;
 
   return AsyncTransform(compositedAsyncZoom, -translation);
 }
 
 AsyncTransform AsyncPanZoomController::GetCurrentAsyncTransform(
--- a/js/src/gc/GC.cpp
+++ b/js/src/gc/GC.cpp
@@ -5214,18 +5214,17 @@ void js::NotifyGCPostSwap(JSObject* a, J
   if (removedFlags & JS_GC_SWAP_OBJECT_A_REMOVED) {
     DelayCrossCompartmentGrayMarking(b);
   }
   if (removedFlags & JS_GC_SWAP_OBJECT_B_REMOVED) {
     DelayCrossCompartmentGrayMarking(a);
   }
 }
 
-static inline void MaybeCheckWeakMapMarking(GCRuntime* gc)
-{
+static inline void MaybeCheckWeakMapMarking(GCRuntime* gc) {
 #if defined(JS_GC_ZEAL) || defined(DEBUG)
 
   bool shouldCheck;
 #if defined(DEBUG)
   shouldCheck = true;
 #else
   shouldCheck = gc->hasZealMode(ZealMode::CheckWeakMapMarking);
 #endif
@@ -6858,18 +6857,19 @@ static bool IsShutdownGC(JS::gcreason::R
 static bool ShouldCleanUpEverything(JS::gcreason::Reason reason,
                                     JSGCInvocationKind gckind) {
   // During shutdown, we must clean everything up, for the sake of leak
   // detection. When a runtime has no contexts, or we're doing a GC before a
   // shutdown CC, those are strong indications that we're shutting down.
   return IsShutdownGC(reason) || gckind == GC_SHRINK;
 }
 
-void GCRuntime::incrementalSlice(
-    SliceBudget& budget, JS::gcreason::Reason reason, AutoGCSession& session) {
+void GCRuntime::incrementalSlice(SliceBudget& budget,
+                                 JS::gcreason::Reason reason,
+                                 AutoGCSession& session) {
   AutoDisableBarriers disableBarriers(rt);
 
   bool destroyingRuntime = (reason == JS::gcreason::DESTROY_RUNTIME);
 
   number++;
 
   initialState = incrementalState;
 
@@ -7009,31 +7009,30 @@ void GCRuntime::incrementalSlice(
       }
 
       endSweepPhase(destroyingRuntime);
 
       incrementalState = State::Finalize;
 
       MOZ_FALLTHROUGH;
 
-    case State::Finalize:
-      {
-        gcstats::AutoPhase ap(stats(),
-                              gcstats::PhaseKind::WAIT_BACKGROUND_THREAD);
-
-        // Yield until background finalization is done.
-        if (!budget.isUnlimited()) {
-          // Poll for end of background sweeping
-          if (isBackgroundSweeping()) {
-            break;
-          }
-        } else {
-          waitBackgroundSweepEnd();
+    case State::Finalize: {
+      gcstats::AutoPhase ap(stats(),
+                            gcstats::PhaseKind::WAIT_BACKGROUND_THREAD);
+
+      // Yield until background finalization is done.
+      if (!budget.isUnlimited()) {
+        // Poll for end of background sweeping
+        if (isBackgroundSweeping()) {
+          break;
         }
+      } else {
+        waitBackgroundSweepEnd();
       }
+    }
 
       {
         // Re-sweep the zones list, now that background finalization is
         // finished to actually remove and free dead zones.
         gcstats::AutoPhase ap1(stats(), gcstats::PhaseKind::SWEEP);
         gcstats::AutoPhase ap2(stats(), gcstats::PhaseKind::DESTROY);
         AutoSetThreadIsSweeping threadIsSweeping;
         FreeOp fop(rt);
@@ -7292,18 +7291,17 @@ void GCRuntime::maybeCallGCCallback(JSGC
 }
 
 /*
  * We disable inlining to ensure that the bottom of the stack with possible GC
  * roots recorded in MarkRuntime excludes any pointers we use during the marking
  * implementation.
  */
 MOZ_NEVER_INLINE GCRuntime::IncrementalResult GCRuntime::gcCycle(
-    bool nonincrementalByAPI, SliceBudget budget,
-    JS::gcreason::Reason reason) {
+    bool nonincrementalByAPI, SliceBudget budget, JS::gcreason::Reason reason) {
   // Assert if this is a GC unsafe region.
   rt->mainContextFromOwnThread()->verifyIsSafeToGC();
 
   // It's ok if threads other than the main thread have suppressGC set, as
   // they are operating on zones which will not be collected from here.
   MOZ_ASSERT(!rt->mainContextFromOwnThread()->suppressGC);
 
   // Note that GC callbacks are allowed to re-enter GC.
--- a/js/src/gc/Verifier.cpp
+++ b/js/src/gc/Verifier.cpp
@@ -753,17 +753,17 @@ static JSObject* MaybeGetDelegate(Cell* 
   }
 
   JSObject* object = cell->as<JSObject>();
   JSWeakmapKeyDelegateOp op = object->getClass()->extWeakmapKeyDelegateOp();
   if (!op) {
     return nullptr;
   }
 
-  JS::AutoSuppressGCAnalysis nogc; // Calling the delegate op cannot GC.
+  JS::AutoSuppressGCAnalysis nogc;  // Calling the delegate op cannot GC.
   return op(object);
 }
 
 bool js::gc::CheckWeakMapEntryMarking(const WeakMapBase* map, Cell* key,
                                       Cell* value) {
   DebugOnly<Zone*> zone = map->zone();
   MOZ_ASSERT(zone->isGCMarking());
 
@@ -778,18 +778,18 @@ bool js::gc::CheckWeakMapEntryMarking(co
   DebugOnly<Zone*> valueZone = GetCellZone(value);
   MOZ_ASSERT(valueZone == zone || valueZone->isAtomsZone());
 
   // We may not know the color of the map, but we know that it's
   // alive so it must at least be marked gray.
   CellColor mapColor = object ? GetCellColor(object) : CellColor::Gray;
 
   CellColor keyColor = GetCellColor(key);
-  CellColor valueColor = valueZone->isGCMarking() ? GetCellColor(value)
-                                                  : CellColor::Black;
+  CellColor valueColor =
+      valueZone->isGCMarking() ? GetCellColor(value) : CellColor::Black;
 
   if (valueColor < Min(mapColor, keyColor)) {
     fprintf(stderr, "WeakMap value is less marked than map and key\n");
     fprintf(stderr, "(map %p is %s, key %p is %s, value %p is %s)\n", map,
             CellColorName(mapColor), key, CellColorName(keyColor), value,
             CellColorName(valueColor));
     return false;
   }
--- a/layout/base/PresShell.h
+++ b/layout/base/PresShell.h
@@ -190,18 +190,17 @@ class PresShell final : public nsIPresSh
       override;
 
   LayerManager* GetLayerManager() override;
 
   bool AsyncPanZoomEnabled() override;
 
   void SetIgnoreViewportScrolling(bool aIgnore) override;
 
-  nsresult SetResolutionAndScaleTo(float aResolution,
-                                   nsAtom* aOrigin) override;
+  nsresult SetResolutionAndScaleTo(float aResolution, nsAtom* aOrigin) override;
   bool IsResolutionUpdated() const override { return mResolutionUpdated; }
   void SetResolutionUpdated(bool aUpdated) override {
     mResolutionUpdated = aUpdated;
   }
   float GetCumulativeResolution() override;
   float GetCumulativeNonRootScaleResolution() override;
   void SetRestoreResolution(float aResolution,
                             LayoutDeviceIntSize aDisplaySize) override;
--- a/toolkit/recordreplay/ProcessRedirectDarwin.cpp
+++ b/toolkit/recordreplay/ProcessRedirectDarwin.cpp
@@ -2540,24 +2540,23 @@ static PreambleResult Preamble_PLDHashTa
 
 #define MAKE_DIAGNOSTIC_ENTRY_WITH_TYPE(aType, aAddress, aPreamble) \
   {#aAddress, nullptr, nullptr, nullptr, aPreamble},
 
 #define MAKE_DIAGNOSTIC_ENTRY(aAddress, aPreamble) \
   {#aAddress, nullptr, nullptr, nullptr, aPreamble},
 
 static Redirection gDiagnosticRedirections[] = {
-  // clang-format off
+    // clang-format off
   FOR_EACH_DIAGNOSTIC_REDIRECTION(MAKE_DIAGNOSTIC_ENTRY)
   FOR_EACH_DIAGNOSTIC_MEMBER_PTR_WITH_TYPE_REDIRECTION(MAKE_DIAGNOSTIC_ENTRY_WITH_TYPE)
   FOR_EACH_DIAGNOSTIC_MEMBER_PTR_REDIRECTION(MAKE_DIAGNOSTIC_ENTRY)
-  // clang-format on
+    // clang-format on
 };
 
-
 #undef MAKE_DIAGNOSTIC_ENTRY_WITH_TYPE
 #undef MAKE_DIAGNOSTIC_ENTRY
 
 ///////////////////////////////////////////////////////////////////////////////
 // Redirection generation
 ///////////////////////////////////////////////////////////////////////////////
 
 size_t NumRedirections() {
--- a/widget/gtk/mozcontainer.cpp
+++ b/widget/gtk/mozcontainer.cpp
@@ -27,17 +27,18 @@ using namespace mozilla::widget;
 
 /* init methods */
 static void moz_container_class_init(MozContainerClass *klass);
 static void moz_container_init(MozContainer *container);
 
 /* widget class methods */
 static void moz_container_map(GtkWidget *widget);
 #if defined(MOZ_WAYLAND)
-static gboolean moz_container_map_wayland(GtkWidget *widget, GdkEventAny *event);
+static gboolean moz_container_map_wayland(GtkWidget *widget,
+                                          GdkEventAny *event);
 #endif
 static void moz_container_unmap(GtkWidget *widget);
 static void moz_container_realize(GtkWidget *widget);
 static void moz_container_size_allocate(GtkWidget *widget,
                                         GtkAllocation *allocation);
 
 /* container class methods */
 static void moz_container_remove(GtkContainer *container,
@@ -128,19 +129,19 @@ void moz_container_put(MozContainer *con
 void moz_container_class_init(MozContainerClass *klass) {
   /*GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
     GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass); */
   GtkContainerClass *container_class = GTK_CONTAINER_CLASS(klass);
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
 
   widget_class->map = moz_container_map;
 #if defined(MOZ_WAYLAND)
-    if (!GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
-      widget_class->map_event = moz_container_map_wayland;
-    }
+  if (!GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
+    widget_class->map_event = moz_container_map_wayland;
+  }
 #endif
   widget_class->unmap = moz_container_unmap;
   widget_class->realize = moz_container_realize;
   widget_class->size_allocate = moz_container_size_allocate;
 
   container_class->remove = moz_container_remove;
   container_class->forall = moz_container_forall;
   container_class->add = moz_container_add;
@@ -177,18 +178,19 @@ static void frame_callback_handler(void 
   MozContainer *container = MOZ_CONTAINER(data);
   g_clear_pointer(&container->frame_callback_handler, wl_callback_destroy);
   container->ready_to_draw = true;
 }
 
 static const struct wl_callback_listener frame_listener = {
     frame_callback_handler};
 
-static gboolean moz_container_map_wayland(GtkWidget *widget, GdkEventAny *event) {
-  MozContainer* container = MOZ_CONTAINER(widget);
+static gboolean moz_container_map_wayland(GtkWidget *widget,
+                                          GdkEventAny *event) {
+  MozContainer *container = MOZ_CONTAINER(widget);
 
   if (container->ready_to_draw || container->frame_callback_handler) {
     return FALSE;
   }
 
   wl_surface *gtk_container_surface =
       moz_container_get_gtk_container_surface(container);