Bug 1317430 - Avoid a unnecessary copy by passing a const & in dom/base/ r=smaug

MozReview-Commit-ID: A70LY4ekX8E

--HG--
extra : rebase_source : e370a9637d5c57507feb2dee164145a5992b5645
This commit is contained in:
Sylvestre Ledru 2016-11-14 23:15:46 +01:00
parent 3ac82a47a4
commit 30ee480275
5 changed files with 8 additions and 8 deletions

View File

@ -7907,7 +7907,7 @@ struct GetSurfaceDataShmem
}
static BufferType
GetBuffer(ReturnType aReturnValue)
GetBuffer(const ReturnType& aReturnValue)
{
return aReturnValue.get<char>();
}
@ -8197,7 +8197,7 @@ nsContentUtils::SendKeyEvent(nsIWidget* aWidget,
}
nsresult
nsContentUtils::SendMouseEvent(nsCOMPtr<nsIPresShell> aPresShell,
nsContentUtils::SendMouseEvent(const nsCOMPtr<nsIPresShell>& aPresShell,
const nsAString& aType,
float aX,
float aY,

View File

@ -2550,7 +2550,7 @@ public:
* Synthesize a mouse event to the given widget
* (see nsIDOMWindowUtils.sendMouseEvent).
*/
static nsresult SendMouseEvent(nsCOMPtr<nsIPresShell> aPresShell,
static nsresult SendMouseEvent(const nsCOMPtr<nsIPresShell>& aPresShell,
const nsAString& aType,
float aX,
float aY,

View File

@ -1669,7 +1669,7 @@ nsDOMWindowUtils::SuppressEventHandling(bool aSuppress)
}
static nsresult
getScrollXYAppUnits(nsWeakPtr aWindow, bool aFlushLayout, nsPoint& aScrollPos) {
getScrollXYAppUnits(const nsWeakPtr& aWindow, bool aFlushLayout, nsPoint& aScrollPos) {
nsCOMPtr<nsPIDOMWindowOuter> window = do_QueryReferent(aWindow);
nsCOMPtr<nsIDocument> doc = window ? window->GetExtantDoc() : nullptr;
NS_ENSURE_STATE(doc);

View File

@ -329,7 +329,7 @@ operator<(const RefPtr<nsPluginElement>& lhs,
}
static bool
PluginShouldBeHidden(nsCString aName) {
PluginShouldBeHidden(const nsCString& aName) {
// This only supports one hidden plugin
return Preferences::GetCString("plugins.navigator.hidden_ctp_plugin").Equals(aName);
}

View File

@ -68,7 +68,7 @@ class nsPropertyTable
* Get the value of the property |aPropertyName| for node |aObject|.
* |aResult|, if supplied, is filled in with a return status code.
**/
void* GetProperty(nsPropertyOwner aObject,
void* GetProperty(const nsPropertyOwner& aObject,
nsIAtom *aPropertyName,
nsresult *aResult = nullptr)
{
@ -92,7 +92,7 @@ class nsPropertyTable
* table changes too). If |aTransfer| is false the property will just be
* deleted instead.
*/
nsresult SetProperty(nsPropertyOwner aObject,
nsresult SetProperty(const nsPropertyOwner& aObject,
nsIAtom *aPropertyName,
void *aPropertyValue,
NSPropertyDtorFunc aDtor,
@ -116,7 +116,7 @@ class nsPropertyTable
* |aObject|, but do not call the property's destructor function. The
* property value is returned.
*/
void* UnsetProperty(nsPropertyOwner aObject,
void* UnsetProperty(const nsPropertyOwner& aObject,
nsIAtom *aPropertyName,
nsresult *aStatus = nullptr)
{