Skip to content

Commit

Permalink
Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
Browse files Browse the repository at this point in the history
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D33456
  • Loading branch information
sylvestre committed Jun 8, 2019
1 parent 8f29d25 commit 7feb25b
Show file tree
Hide file tree
Showing 29 changed files with 111 additions and 100 deletions.
6 changes: 4 additions & 2 deletions dom/base/nsDocumentEncoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,8 @@ NS_INTERFACE_MAP_END

NS_IMPL_CYCLE_COLLECTION(nsDocumentEncoder, mDocument,
mEncodingScope.mSelection, mEncodingScope.mRange,
mEncodingScope.mNode, mSerializer, mCommonAncestorOfRange)
mEncodingScope.mNode, mSerializer,
mCommonAncestorOfRange)

nsDocumentEncoder::nsDocumentEncoder()
: mEncoding(nullptr), mIsCopying(false), mCachedBuffer(nullptr) {
Expand Down Expand Up @@ -1040,7 +1041,8 @@ nsresult nsDocumentEncoder::SerializeRangeToString(nsRange* aRange,
nsContentUtils::GetAncestorsAndOffsets(
endContainer, endOffset, &endContainerPath, &endContainerOffsets);

nsCOMPtr<nsIContent> commonContent = do_QueryInterface(mCommonAncestorOfRange);
nsCOMPtr<nsIContent> commonContent =
do_QueryInterface(mCommonAncestorOfRange);
mStartRootIndex = startContainerPath.IndexOf(commonContent);
mEndRootIndex = endContainerPath.IndexOf(commonContent);

Expand Down
1 change: 0 additions & 1 deletion dom/base/nsIContent.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ class nsIContent : public nsINode {
using IMEState = mozilla::widget::IMEState;
using BindContext = mozilla::dom::BindContext;


void ConstructUbiNode(void* storage) override;

#ifdef MOZILLA_INTERNAL_API
Expand Down
4 changes: 2 additions & 2 deletions dom/events/ContentEventHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -634,8 +634,8 @@ static uint32_t ConvertToXPOffset(nsIContent* aContent,
// On Windows, the length of a native newline ("\r\n") is twice the length of
// the XP newline ("\n"), so XP offset is equal to the length of the native
// offset minus the number of newlines encountered in the string.
return aNativeOffset - CountNewlinesInNativeLength(aContent->AsText(),
aNativeOffset);
return aNativeOffset -
CountNewlinesInNativeLength(aContent->AsText(), aNativeOffset);
#else
// On other platforms, the native and XP newlines are the same.
return aNativeOffset;
Expand Down
2 changes: 1 addition & 1 deletion dom/events/RemoteDragStartData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ using namespace mozilla::ipc;
namespace mozilla {
namespace dom {

RemoteDragStartData::~RemoteDragStartData() { }
RemoteDragStartData::~RemoteDragStartData() {}

RemoteDragStartData::RemoteDragStartData(
BrowserParent* aBrowserParent, nsTArray<IPCDataTransfer>&& aDataTransfer,
Expand Down
5 changes: 3 additions & 2 deletions dom/gamepad/android/AndroidGamepad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ void StopGamepadMonitoring() {
java::GeckoAppShell::GetApplicationContext());
}

void SetGamepadLightIndicatorColor(uint32_t aControllerIdx, uint32_t aLightColorIndex,
uint8_t aRed, uint8_t aGreen, uint8_t aBlue) {
void SetGamepadLightIndicatorColor(uint32_t aControllerIdx,
uint32_t aLightColorIndex, uint8_t aRed,
uint8_t aGreen, uint8_t aBlue) {
NS_WARNING("Android doesn't support gamepad light indicator.");
}

Expand Down
5 changes: 3 additions & 2 deletions dom/gamepad/cocoa/CocoaGamepad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,9 @@ void StopGamepadMonitoring() {
gService->Shutdown();
}

void SetGamepadLightIndicatorColor(uint32_t aControllerIdx, uint32_t aLightColorIndex,
uint8_t aRed, uint8_t aGreen, uint8_t aBlue) {
void SetGamepadLightIndicatorColor(uint32_t aControllerIdx,
uint32_t aLightColorIndex, uint8_t aRed,
uint8_t aGreen, uint8_t aBlue) {
// TODO: Bug 1523353.
NS_WARNING("Mac OS doesn't support gamepad light indicator.");
}
Expand Down
5 changes: 3 additions & 2 deletions dom/gamepad/linux/LinuxGamepad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,9 @@ void StopGamepadMonitoring() {
gService = nullptr;
}

void SetGamepadLightIndicatorColor(uint32_t aControllerIdx, uint32_t aLightColorIndex,
uint8_t aRed, uint8_t aGreen, uint8_t aBlue) {
void SetGamepadLightIndicatorColor(uint32_t aControllerIdx,
uint32_t aLightColorIndex, uint8_t aRed,
uint8_t aGreen, uint8_t aBlue) {
// TODO: Bug 1523355.
NS_WARNING("Linux doesn't support gamepad light indicator.");
}
Expand Down
4 changes: 2 additions & 2 deletions dom/html/HTMLEmbedElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ nsresult HTMLEmbedElement::BindToTree(BindContext& aContext, nsINode& aParent) {

if (IsInComposedDoc()) {
// Don't kick off load from being bound to a plugin document - the plugin
// document will call nsObjectLoadingContent::InitializeFromChannel() for the
// initial load.
// document will call nsObjectLoadingContent::InitializeFromChannel() for
// the initial load.
nsCOMPtr<nsIPluginDocument> pluginDoc =
do_QueryInterface(&aContext.OwnerDoc());
if (!pluginDoc) {
Expand Down
10 changes: 4 additions & 6 deletions dom/ipc/EffectsInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ namespace dom {
* with information on clipping and scaling.
*/
class EffectsInfo {
public:
EffectsInfo() {
*this = EffectsInfo::FullyHidden();
}
public:
EffectsInfo() { *this = EffectsInfo::FullyHidden(); }
static EffectsInfo FullyVisible() { return EffectsInfo{true}; }
static EffectsInfo FullyHidden() { return EffectsInfo{false}; }

Expand All @@ -37,8 +35,8 @@ class EffectsInfo {
* TODO: Add information for ancestor scaling and clipping.
*/

private:
explicit EffectsInfo(bool aVisible) : mVisible(aVisible) { }
private:
explicit EffectsInfo(bool aVisible) : mVisible(aVisible) {}
};

} // namespace dom
Expand Down
4 changes: 1 addition & 3 deletions dom/xul/XULDocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,7 @@ nsresult XULDocument::StartDocumentLoad(const char* aCommand,
return NS_OK;
}

void XULDocument::EndLoad() {
Document::EndLoad();
}
void XULDocument::EndLoad() { Document::EndLoad(); }

//----------------------------------------------------------------------
//
Expand Down
14 changes: 7 additions & 7 deletions gfx/layers/LayerTreeInvalidation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ Maybe<IntRect> TransformedBounds(Layer* aLayer) {
return Some(result);
}

return Some(TransformRect(
aLayer->GetLocalVisibleRegion().GetBounds().ToUnknownRect(),
GetTransformForInvalidation(aLayer)));
return Some(
TransformRect(aLayer->GetLocalVisibleRegion().GetBounds().ToUnknownRect(),
GetTransformForInvalidation(aLayer)));
}

/**
Expand Down Expand Up @@ -181,7 +181,9 @@ struct LayerPropertiesBase : public LayerProperties {
explicit LayerPropertiesBase(Layer* aLayer)
: mLayer(aLayer),
mMaskLayer(nullptr),
mVisibleRegion(mLayer->Extend3DContext() ? nsIntRegion() : mLayer->GetLocalVisibleRegion().ToUnknownRegion()),
mVisibleRegion(mLayer->Extend3DContext()
? nsIntRegion()
: mLayer->GetLocalVisibleRegion().ToUnknownRegion()),
mPostXScale(aLayer->GetPostXScale()),
mPostYScale(aLayer->GetPostYScale()),
mOpacity(aLayer->GetLocalOpacity()),
Expand Down Expand Up @@ -335,9 +337,7 @@ struct LayerPropertiesBase : public LayerProperties {
mTransform);
}

Maybe<IntRect> NewTransformedBounds() {
return TransformedBounds(mLayer);
}
Maybe<IntRect> NewTransformedBounds() { return TransformedBounds(mLayer); }

virtual Maybe<IntRect> OldTransformedBounds() {
return Some(
Expand Down
11 changes: 7 additions & 4 deletions gfx/layers/Layers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "UnitTransforms.h" // for ViewAs
#include "gfxEnv.h"
#include "gfxPlatform.h" // for gfxPlatform
#include "gfxUtils.h" // for gfxUtils, etc
#include "gfxUtils.h" // for gfxUtils, etc
#include "gfx2DGlue.h"
#include "mozilla/DebugOnly.h" // for DebugOnly
#include "mozilla/IntegerPrintfMacros.h"
Expand Down Expand Up @@ -969,7 +969,8 @@ bool ContainerLayer::HasMultipleChildren() {
for (Layer* child = GetFirstChild(); child; child = child->GetNextSibling()) {
const Maybe<ParentLayerIntRect>& clipRect = child->GetLocalClipRect();
if (clipRect && clipRect->IsEmpty()) continue;
if (!child->Extend3DContext() && child->GetLocalVisibleRegion().IsEmpty()) continue;
if (!child->Extend3DContext() && child->GetLocalVisibleRegion().IsEmpty())
continue;
++count;
if (count > 1) return true;
}
Expand Down Expand Up @@ -1181,7 +1182,8 @@ void ContainerLayer::DefaultComputeEffectiveTransforms(
* above. Nor for a child with a mask layer.
*/
if (checkClipRect && (clipRect && !clipRect->IsEmpty() &&
(child->Extend3DContext() || !child->GetLocalVisibleRegion().IsEmpty()))) {
(child->Extend3DContext() ||
!child->GetLocalVisibleRegion().IsEmpty()))) {
useIntermediateSurface = true;
break;
}
Expand Down Expand Up @@ -2269,7 +2271,8 @@ void PrintInfo(std::stringstream& aStream, HostLayer* aLayerComposite) {
AppendToString(aStream, aLayerComposite->GetShadowBaseTransform(),
" [shadow-transform=", "]");
}
if (!aLayerComposite->GetLayer()->Extend3DContext() && !aLayerComposite->GetShadowVisibleRegion().IsEmpty()) {
if (!aLayerComposite->GetLayer()->Extend3DContext() &&
!aLayerComposite->GetShadowVisibleRegion().IsEmpty()) {
AppendToString(aStream,
aLayerComposite->GetShadowVisibleRegion().ToUnknownRegion(),
" [shadow-visible=", "]");
Expand Down
6 changes: 3 additions & 3 deletions gfx/layers/apz/src/APZCTreeManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
#include "mozilla/layers/MatrixMessage.h"
#include "mozilla/layers/WebRenderScrollDataWrapper.h"
#include "mozilla/MouseEvents.h"
#include "mozilla/mozalloc.h" // for operator new
#include "mozilla/Preferences.h" // for Preferences
#include "mozilla/StaticPrefs.h" // for StaticPrefs
#include "mozilla/mozalloc.h" // for operator new
#include "mozilla/Preferences.h" // for Preferences
#include "mozilla/StaticPrefs.h" // for StaticPrefs
#include "mozilla/TouchEvents.h"
#include "mozilla/EventStateManager.h" // for WheelPrefs
#include "mozilla/webrender/WebRenderAPI.h"
Expand Down
2 changes: 1 addition & 1 deletion gfx/layers/apz/src/HitTestingTreeNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "HitTestingTreeNode.h"

#include "AsyncPanZoomController.h" // for AsyncPanZoomController
#include "AsyncPanZoomController.h" // for AsyncPanZoomController
#include "LayersLogging.h" // for Stringify
#include "mozilla/gfx/Point.h" // for Point4D
#include "mozilla/layers/APZUtils.h" // for CompleteAsyncTransform
Expand Down
2 changes: 1 addition & 1 deletion gfx/layers/apz/src/SimpleVelocityTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include "mozilla/ComputedTimingFunction.h" // for ComputedTimingFunction
#include "mozilla/StaticPrefs.h"
#include "mozilla/StaticPtr.h" // for StaticAutoPtr
#include "mozilla/StaticPtr.h" // for StaticAutoPtr

#define SVT_LOG(...)
// #define SVT_LOG(...) printf_stderr("SimpleVelocityTracker: " __VA_ARGS__)
Expand Down
5 changes: 3 additions & 2 deletions gfx/layers/apz/test/gtest/APZTestCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,9 @@ class TestAsyncPanZoomController : public AsyncPanZoomController {
}

CSSPoint GetCompositedScrollOffset() const {
return GetCurrentAsyncScrollOffset(AsyncPanZoomController::eForCompositing)
/ GetFrameMetrics().GetZoom();
return GetCurrentAsyncScrollOffset(
AsyncPanZoomController::eForCompositing) /
GetFrameMetrics().GetZoom();
}

void SetWaitForMainThread() { mWaitForMainThread = true; }
Expand Down
2 changes: 1 addition & 1 deletion gfx/layers/apz/testutil/APZTestData.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "mozilla/DebugOnly.h" // for DebugOnly
#include "mozilla/GfxMessageUtils.h" // for ParamTraits specializations
#include "mozilla/StaticPrefs.h"
#include "mozilla/ToString.h" // for ToString
#include "mozilla/ToString.h" // for ToString
#include "mozilla/gfx/CompositorHitTestInfo.h"
#include "mozilla/layers/ScrollableLayerGuid.h"
#include "ipc/IPCMessageUtils.h"
Expand Down
38 changes: 19 additions & 19 deletions gfx/layers/basic/BasicLayerManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@
* 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 <stdint.h> // for uint32_t
#include <stdlib.h> // for rand, RAND_MAX
#include <sys/types.h> // for int32_t
#include <stack> // for stack
#include "BasicContainerLayer.h" // for BasicContainerLayer
#include "BasicLayersImpl.h" // for ToData, BasicReadbackLayer, etc
#include "GeckoProfiler.h" // for AUTO_PROFILER_LABEL
#include "ImageContainer.h" // for ImageFactory
#include "Layers.h" // for Layer, ContainerLayer, etc
#include "ReadbackLayer.h" // for ReadbackLayer
#include "ReadbackProcessor.h" // for ReadbackProcessor
#include "RenderTrace.h" // for RenderTraceLayers, etc
#include "basic/BasicImplData.h" // for BasicImplData
#include "basic/BasicLayers.h" // for BasicLayerManager, etc
#include "gfxASurface.h" // for gfxASurface, etc
#include "gfxContext.h" // for gfxContext, etc
#include "gfxImageSurface.h" // for gfxImageSurface
#include "gfxMatrix.h" // for gfxMatrix
#include "gfxPlatform.h" // for gfxPlatform
#include <stdint.h> // for uint32_t
#include <stdlib.h> // for rand, RAND_MAX
#include <sys/types.h> // for int32_t
#include <stack> // for stack
#include "BasicContainerLayer.h" // for BasicContainerLayer
#include "BasicLayersImpl.h" // for ToData, BasicReadbackLayer, etc
#include "GeckoProfiler.h" // for AUTO_PROFILER_LABEL
#include "ImageContainer.h" // for ImageFactory
#include "Layers.h" // for Layer, ContainerLayer, etc
#include "ReadbackLayer.h" // for ReadbackLayer
#include "ReadbackProcessor.h" // for ReadbackProcessor
#include "RenderTrace.h" // for RenderTraceLayers, etc
#include "basic/BasicImplData.h" // for BasicImplData
#include "basic/BasicLayers.h" // for BasicLayerManager, etc
#include "gfxASurface.h" // for gfxASurface, etc
#include "gfxContext.h" // for gfxContext, etc
#include "gfxImageSurface.h" // for gfxImageSurface
#include "gfxMatrix.h" // for gfxMatrix
#include "gfxPlatform.h" // for gfxPlatform

#include "gfxPoint.h" // for IntSize, gfxPoint
#include "gfxRect.h" // for gfxRect
Expand Down
2 changes: 1 addition & 1 deletion gfx/layers/client/ClientLayerManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include <stdint.h> // for int32_t
#include "Layers.h"
#include "gfxContext.h" // for gfxContext
#include "gfxContext.h" // for gfxContext
#include "mozilla/Attributes.h" // for override
#include "mozilla/LinkedList.h" // for LinkedList
#include "mozilla/StaticPrefs.h" // for StaticPrefs
Expand Down
4 changes: 2 additions & 2 deletions gfx/layers/client/ClientPaintedLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#include "client/ClientLayerManager.h" // for ClientLayerManager, etc
#include "gfxContext.h" // for gfxContext
#include "gfx2DGlue.h"
#include "gfxEnv.h" // for gfxEnv
#include "gfxRect.h" // for gfxRect
#include "gfxEnv.h" // for gfxEnv
#include "gfxRect.h" // for gfxRect

#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
#include "mozilla/gfx/2D.h" // for DrawTarget
Expand Down
8 changes: 4 additions & 4 deletions gfx/layers/client/ContentClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "mozilla/layers/ContentClient.h"
#include "BasicLayers.h" // for BasicLayerManager
#include "gfxContext.h" // for gfxContext, etc
#include "gfxPlatform.h" // for gfxPlatform
#include "gfxEnv.h" // for gfxEnv
#include "BasicLayers.h" // for BasicLayerManager
#include "gfxContext.h" // for gfxContext, etc
#include "gfxPlatform.h" // for gfxPlatform
#include "gfxEnv.h" // for gfxEnv

#include "gfxPoint.h" // for IntSize, gfxPoint
#include "gfxUtils.h" // for gfxUtils
Expand Down
4 changes: 3 additions & 1 deletion gfx/layers/composite/LayerManagerComposite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,9 @@ void HostLayer::RecomputeShadowVisibleRegionFromChildren() {
// that can only be represented correctly in 3d space. Since
// we can't do that, leave it empty instead to stop anyone
// from trying to use it.
NS_ASSERTION(!GetLayer()->Extend3DContext(), "Can't compute visible region for layers that extend a 3d context");
NS_ASSERTION(
!GetLayer()->Extend3DContext(),
"Can't compute visible region for layers that extend a 3d context");
if (container && !GetLayer()->Extend3DContext()) {
ComputeVisibleRegionForChildren(container, mShadowVisibleRegion);
}
Expand Down
2 changes: 1 addition & 1 deletion gfx/vr/ipc/VRProcessParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "mozilla/ipc/ProtocolTypes.h"
#include "mozilla/ipc/ProtocolUtils.h" // for IToplevelProtocol
#include "mozilla/StaticPrefs.h"
#include "mozilla/TimeStamp.h" // for TimeStamp
#include "mozilla/TimeStamp.h" // for TimeStamp
#include "mozilla/Unused.h"
#include "ProcessUtils.h"
#include "VRChild.h"
Expand Down
3 changes: 2 additions & 1 deletion media/mtransport/nricemediastream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,8 @@ nsresult NrIceMediaStream::ParseTrickleCandidate(const std::string& candidate,
<< candidate);

int r = nr_ice_peer_ctx_parse_trickle_candidate(
ctx_peer_, stream, const_cast<char*>(candidate.c_str()), mdns_addr.c_str());
ctx_peer_, stream, const_cast<char*>(candidate.c_str()),
mdns_addr.c_str());

if (r) {
if (r == R_ALREADY) {
Expand Down
7 changes: 3 additions & 4 deletions media/mtransport/test/ice_unittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1000,9 +1000,8 @@ class IceTestPeer : public sigslot::has_slots<> {
for (size_t i = 0; i < stream_counter_; ++i) {
if (GetStream_s(i) == stream) {
ASSERT_GT(remote_->stream_counter_, i);
nsresult res =
remote_->GetStream_s(i)->ParseTrickleCandidate(candidate, ufrag,
"");
nsresult res = remote_->GetStream_s(i)->ParseTrickleCandidate(
candidate, ufrag, "");
ASSERT_TRUE(NS_SUCCEEDED(res));
return;
}
Expand Down Expand Up @@ -1229,7 +1228,7 @@ class IceTestPeer : public sigslot::has_slots<> {
}

void ParseCandidate(size_t i, const std::string& candidate,
const std::string &mdns_addr) {
const std::string& mdns_addr) {
test_utils_->sts_target()->Dispatch(
WrapRunnable(this, &IceTestPeer::ParseCandidate_s, i, candidate,
mdns_addr),
Expand Down
Loading

0 comments on commit 7feb25b

Please sign in to comment.