Index: chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc |
diff --git a/chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc b/chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc |
index 3b04125a35373f2826840b85c5a3914624cbc65d..a8b027acf75d224d62a4517012347b67297041d1 100644 |
--- a/chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc |
+++ b/chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc |
@@ -6,6 +6,8 @@ |
#include "chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.h" |
+#include <utility> |
+ |
#include "base/json/json_writer.h" |
#include "base/strings/string_number_conversions.h" |
#include "base/time/time.h" |
@@ -50,10 +52,10 @@ void DispatchEvent(content::BrowserContext* browser_context, |
EventRouter* event_router = EventRouter::Get(profile); |
if (profile && event_router) { |
scoped_ptr<Event> event( |
- new Event(histogram_value, event_name, args.Pass())); |
+ new Event(histogram_value, event_name, std::move(args))); |
event->restrict_to_browser_context = profile; |
event->filter_info = info; |
- event_router->BroadcastEvent(event.Pass()); |
+ event_router->BroadcastEvent(std::move(event)); |
} |
} |
@@ -85,7 +87,7 @@ void DispatchOnBeforeNavigate(content::WebContents* web_contents, |
DispatchEvent(web_contents->GetBrowserContext(), |
events::WEB_NAVIGATION_ON_BEFORE_NAVIGATE, |
- web_navigation::OnBeforeNavigate::kEventName, args.Pass(), |
+ web_navigation::OnBeforeNavigate::kEventName, std::move(args), |
validated_url); |
} |
@@ -125,7 +127,7 @@ void DispatchOnCommitted(events::HistogramValue histogram_value, |
args->Append(dict); |
DispatchEvent(web_contents->GetBrowserContext(), histogram_value, event_name, |
- args.Pass(), url); |
+ std::move(args), url); |
} |
// Constructs and dispatches an onDOMContentLoaded event. |
@@ -144,7 +146,7 @@ void DispatchOnDOMContentLoaded(content::WebContents* web_contents, |
DispatchEvent(web_contents->GetBrowserContext(), |
events::WEB_NAVIGATION_ON_DOM_CONTENT_LOADED, |
- web_navigation::OnDOMContentLoaded::kEventName, args.Pass(), |
+ web_navigation::OnDOMContentLoaded::kEventName, std::move(args), |
url); |
} |
@@ -164,7 +166,7 @@ void DispatchOnCompleted(content::WebContents* web_contents, |
DispatchEvent(web_contents->GetBrowserContext(), |
events::WEB_NAVIGATION_ON_COMPLETED, |
- web_navigation::OnCompleted::kEventName, args.Pass(), url); |
+ web_navigation::OnCompleted::kEventName, std::move(args), url); |
} |
// Constructs and dispatches an onCreatedNavigationTarget event. |
@@ -197,7 +199,7 @@ void DispatchOnCreatedNavigationTarget( |
DispatchEvent(browser_context, |
events::WEB_NAVIGATION_ON_CREATED_NAVIGATION_TARGET, |
web_navigation::OnCreatedNavigationTarget::kEventName, |
- args.Pass(), target_url); |
+ std::move(args), target_url); |
} |
// Constructs and dispatches an onErrorOccurred event. |
@@ -218,7 +220,8 @@ void DispatchOnErrorOccurred(content::WebContents* web_contents, |
DispatchEvent(web_contents->GetBrowserContext(), |
events::WEB_NAVIGATION_ON_ERROR_OCCURRED, |
- web_navigation::OnErrorOccurred::kEventName, args.Pass(), url); |
+ web_navigation::OnErrorOccurred::kEventName, std::move(args), |
+ url); |
} |
// Constructs and dispatches an onTabReplaced event. |
@@ -237,7 +240,8 @@ void DispatchOnTabReplaced( |
args->Append(dict); |
DispatchEvent(browser_context, events::WEB_NAVIGATION_ON_TAB_REPLACED, |
- web_navigation::OnTabReplaced::kEventName, args.Pass(), GURL()); |
+ web_navigation::OnTabReplaced::kEventName, std::move(args), |
+ GURL()); |
} |
} // namespace web_navigation_api_helpers |