diff options
author | dcheng <dcheng@chromium.org> | 2015-12-18 09:48:00 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-18 17:48:52 +0000 |
commit | e59eca16010c109a5e3e4922189c8b264d34caa9 (patch) | |
tree | 838815399c6364a99a465938df9978aeaf75c766 /extensions/browser/guest_view | |
parent | 5100baf1eac806abbdaaf8002887aacf652f34e5 (diff) | |
download | chromium_src-e59eca16010c109a5e3e4922189c8b264d34caa9.zip chromium_src-e59eca16010c109a5e3e4922189c8b264d34caa9.tar.gz chromium_src-e59eca16010c109a5e3e4922189c8b264d34caa9.tar.bz2 |
Convert Pass()→std::move() in //extensions
BUG=557422
Review URL: https://codereview.chromium.org/1537893002
Cr-Commit-Position: refs/heads/master@{#366120}
Diffstat (limited to 'extensions/browser/guest_view')
10 files changed, 48 insertions, 32 deletions
diff --git a/extensions/browser/guest_view/app_view/app_view_guest.cc b/extensions/browser/guest_view/app_view/app_view_guest.cc index 64bcd90..d5a4e85 100644 --- a/extensions/browser/guest_view/app_view/app_view_guest.cc +++ b/extensions/browser/guest_view/app_view/app_view_guest.cc @@ -4,6 +4,8 @@ #include "extensions/browser/guest_view/app_view/app_view_guest.h" +#include <utility> + #include "base/command_line.h" #include "components/guest_view/browser/guest_view_manager.h" #include "content/public/browser/render_process_host.h" @@ -270,7 +272,7 @@ void AppViewGuest::LaunchAppAndFireEvent( embed_request->SetString(appview::kEmbedderID, owner_host()); embed_request->Set(appview::kData, data.release()); AppRuntimeEventRouter::DispatchOnEmbedRequestedEvent( - browser_context(), embed_request.Pass(), extension_host->extension()); + browser_context(), std::move(embed_request), extension_host->extension()); } void AppViewGuest::SetAppDelegateForTest(AppDelegate* delegate) { diff --git a/extensions/browser/guest_view/extension_options/extension_options_guest.cc b/extensions/browser/guest_view/extension_options/extension_options_guest.cc index 5806540..f594ade 100644 --- a/extensions/browser/guest_view/extension_options/extension_options_guest.cc +++ b/extensions/browser/guest_view/extension_options/extension_options_guest.cc @@ -4,6 +4,8 @@ #include "extensions/browser/guest_view/extension_options/extension_options_guest.h" +#include <utility> + #include "base/values.h" #include "components/crx_file/id_util.h" #include "components/guest_view/browser/guest_view_event.h" @@ -126,7 +128,7 @@ void ExtensionOptionsGuest::DidInitialize( void ExtensionOptionsGuest::GuestViewDidStopLoading() { scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); DispatchEventToView(new GuestViewEvent( - extension_options_internal::OnLoad::kEventName, args.Pass())); + extension_options_internal::OnLoad::kEventName, std::move(args))); } const char* ExtensionOptionsGuest::GetAPINamespace() const { diff --git a/extensions/browser/guest_view/extension_view/extension_view_guest.cc b/extensions/browser/guest_view/extension_view/extension_view_guest.cc index 0a341ff..d2db41e 100644 --- a/extensions/browser/guest_view/extension_view/extension_view_guest.cc +++ b/extensions/browser/guest_view/extension_view/extension_view_guest.cc @@ -4,6 +4,8 @@ #include "extensions/browser/guest_view/extension_view/extension_view_guest.h" +#include <utility> + #include "components/crx_file/id_util.h" #include "components/guest_view/browser/guest_view_event.h" #include "content/public/browser/render_process_host.h" @@ -127,7 +129,7 @@ void ExtensionViewGuest::DidCommitProvisionalLoadForFrame( scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); args->SetString(guest_view::kUrl, url_.spec()); DispatchEventToView( - new GuestViewEvent(extensionview::kEventLoadCommit, args.Pass())); + new GuestViewEvent(extensionview::kEventLoadCommit, std::move(args))); } void ExtensionViewGuest::DidNavigateMainFrame( diff --git a/extensions/browser/guest_view/extensions_guest_view_manager_delegate.cc b/extensions/browser/guest_view/extensions_guest_view_manager_delegate.cc index a5ae79bf44..ec44ed2 100644 --- a/extensions/browser/guest_view/extensions_guest_view_manager_delegate.cc +++ b/extensions/browser/guest_view/extensions_guest_view_manager_delegate.cc @@ -4,6 +4,8 @@ #include "extensions/browser/guest_view/extensions_guest_view_manager_delegate.h" +#include <utility> + #include "components/guest_view/browser/guest_view_base.h" #include "components/guest_view/browser/guest_view_manager.h" #include "components/guest_view/common/guest_view_constants.h" @@ -55,9 +57,10 @@ void ExtensionsGuestViewManagerDelegate::DispatchEvent( << " must have a histogram value"; content::WebContents* owner = guest->owner_web_contents(); - EventRouter::DispatchEventToSender( - owner, guest->browser_context(), guest->owner_host(), histogram_value, - event_name, event_args.Pass(), EventRouter::USER_GESTURE_UNKNOWN, info); + EventRouter::DispatchEventToSender(owner, guest->browser_context(), + guest->owner_host(), histogram_value, + event_name, std::move(event_args), + EventRouter::USER_GESTURE_UNKNOWN, info); } bool ExtensionsGuestViewManagerDelegate::IsGuestAvailableToContext( diff --git a/extensions/browser/guest_view/mime_handler_view/mime_handler_stream_manager.cc b/extensions/browser/guest_view/mime_handler_view/mime_handler_stream_manager.cc index fe90ef7..b0b8feb 100644 --- a/extensions/browser/guest_view/mime_handler_view/mime_handler_stream_manager.cc +++ b/extensions/browser/guest_view/mime_handler_view/mime_handler_stream_manager.cc @@ -132,7 +132,7 @@ scoped_ptr<StreamContainer> MimeHandlerStreamManager::ReleaseStream( streams_by_extension_id_[result->extension_id()].erase(view_id); streams_.erase(stream); embedder_observers_.erase(view_id); - return result.Pass(); + return result; } void MimeHandlerStreamManager::OnExtensionUnloaded( diff --git a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc index 2341db12..d704b9f 100644 --- a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc +++ b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc @@ -4,6 +4,8 @@ #include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h" +#include <utility> + #include "base/strings/stringprintf.h" #include "components/guest_view/common/guest_view_constants.h" #include "content/public/browser/browser_thread.h" @@ -39,7 +41,7 @@ StreamContainer::StreamContainer(scoped_ptr<content::StreamInfo> stream, bool embedded, const GURL& handler_url, const std::string& extension_id) - : stream_(stream.Pass()), + : stream_(std::move(stream)), embedded_(embedded), tab_id_(tab_id), handler_url_(handler_url), diff --git a/extensions/browser/guest_view/web_view/web_view_apitest.cc b/extensions/browser/guest_view/web_view/web_view_apitest.cc index 805fb9d..312545a 100644 --- a/extensions/browser/guest_view/web_view/web_view_apitest.cc +++ b/extensions/browser/guest_view/web_view/web_view_apitest.cc @@ -4,6 +4,8 @@ #include "extensions/browser/guest_view/web_view/web_view_apitest.h" +#include <utility> + #include "base/command_line.h" #include "base/path_service.h" #include "base/strings/string_util.h" @@ -69,7 +71,7 @@ static scoped_ptr<net::test_server::HttpResponse> UserAgentResponseHandler( new net::test_server::BasicHttpResponse); http_response->set_code(net::HTTP_MOVED_PERMANENTLY); http_response->AddCustomHeader("Location", redirect_target.spec()); - return http_response.Pass(); + return std::move(http_response); } class WebContentsHiddenObserver : public content::WebContentsObserver { @@ -109,7 +111,7 @@ scoped_ptr<net::test_server::HttpResponse> RedirectResponseHandler( new net::test_server::BasicHttpResponse); http_response->set_code(net::HTTP_MOVED_PERMANENTLY); http_response->AddCustomHeader("Location", redirect_target.spec()); - return http_response.Pass(); + return std::move(http_response); } // Handles |request| by serving an empty response. diff --git a/extensions/browser/guest_view/web_view/web_view_find_helper.cc b/extensions/browser/guest_view/web_view/web_view_find_helper.cc index ecc35b4..725326a 100644 --- a/extensions/browser/guest_view/web_view/web_view_find_helper.cc +++ b/extensions/browser/guest_view/web_view/web_view_find_helper.cc @@ -41,7 +41,7 @@ void WebViewFindHelper::DispatchFindUpdateEvent(bool canceled, args->SetBoolean(webview::kFindFinalUpdate, final_update); DCHECK(webview_guest_); webview_guest_->DispatchEventToView( - new GuestViewEvent(webview::kEventFindReply, args.Pass())); + new GuestViewEvent(webview::kEventFindReply, std::move(args))); } void WebViewFindHelper::EndFindSession(int session_request_id, bool canceled) { diff --git a/extensions/browser/guest_view/web_view/web_view_guest.cc b/extensions/browser/guest_view/web_view/web_view_guest.cc index ce1d3d5..ca7c780 100644 --- a/extensions/browser/guest_view/web_view/web_view_guest.cc +++ b/extensions/browser/guest_view/web_view/web_view_guest.cc @@ -4,6 +4,8 @@ #include "extensions/browser/guest_view/web_view/web_view_guest.h" +#include <utility> + #include "base/message_loop/message_loop.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" @@ -369,7 +371,7 @@ void WebViewGuest::DidDropLink(const GURL& url) { scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); args->SetString(guest_view::kUrl, url.spec()); DispatchEventToView( - new GuestViewEvent(webview::kEventDropLink, args.Pass())); + new GuestViewEvent(webview::kEventDropLink, std::move(args))); } void WebViewGuest::DidInitialize(const base::DictionaryValue& create_params) { @@ -424,7 +426,7 @@ void WebViewGuest::ClearDataInternal(base::Time remove_since, void WebViewGuest::GuestViewDidStopLoading() { scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); DispatchEventToView( - new GuestViewEvent(webview::kEventLoadStop, args.Pass())); + new GuestViewEvent(webview::kEventLoadStop, std::move(args))); } void WebViewGuest::EmbedderFullscreenToggled(bool entered_fullscreen) { @@ -479,7 +481,7 @@ void WebViewGuest::GuestSizeChangedDueToAutoSize(const gfx::Size& old_size, args->SetInteger(webview::kNewHeight, new_size.height()); args->SetInteger(webview::kNewWidth, new_size.width()); DispatchEventToView( - new GuestViewEvent(webview::kEventSizeChanged, args.Pass())); + new GuestViewEvent(webview::kEventSizeChanged, std::move(args))); } bool WebViewGuest::IsAutoSizeSupported() const { @@ -495,7 +497,7 @@ void WebViewGuest::GuestZoomChanged(double old_zoom_level, args->SetDouble(webview::kOldZoomFactor, old_zoom_factor); args->SetDouble(webview::kNewZoomFactor, new_zoom_factor); DispatchEventToView( - new GuestViewEvent(webview::kEventZoomChange, args.Pass())); + new GuestViewEvent(webview::kEventZoomChange, std::move(args))); } void WebViewGuest::WillDestroy() { @@ -515,14 +517,14 @@ bool WebViewGuest::AddMessageToConsole(WebContents* source, args->SetInteger(webview::kLine, line_no); args->SetString(webview::kSourceId, source_id); DispatchEventToView( - new GuestViewEvent(webview::kEventConsoleMessage, args.Pass())); + new GuestViewEvent(webview::kEventConsoleMessage, std::move(args))); return true; } void WebViewGuest::CloseContents(WebContents* source) { scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); DispatchEventToView( - new GuestViewEvent(webview::kEventClose, args.Pass())); + new GuestViewEvent(webview::kEventClose, std::move(args))); } void WebViewGuest::FindReply(WebContents* source, @@ -573,7 +575,7 @@ void WebViewGuest::LoadProgressChanged(WebContents* source, double progress) { args->SetString(guest_view::kUrl, web_contents()->GetURL().spec()); args->SetDouble(webview::kProgress, progress); DispatchEventToView( - new GuestViewEvent(webview::kEventLoadProgress, args.Pass())); + new GuestViewEvent(webview::kEventLoadProgress, std::move(args))); } void WebViewGuest::LoadAbort(bool is_top_level, @@ -586,7 +588,7 @@ void WebViewGuest::LoadAbort(bool is_top_level, args->SetInteger(guest_view::kCode, error_code); args->SetString(guest_view::kReason, error_type); DispatchEventToView( - new GuestViewEvent(webview::kEventLoadAbort, args.Pass())); + new GuestViewEvent(webview::kEventLoadAbort, std::move(args))); } void WebViewGuest::SetContextMenuPosition(const gfx::Point& position) { @@ -638,7 +640,7 @@ void WebViewGuest::RendererResponsive(WebContents* source) { args->SetInteger(webview::kProcessId, web_contents()->GetRenderProcessHost()->GetID()); DispatchEventToView( - new GuestViewEvent(webview::kEventResponsive, args.Pass())); + new GuestViewEvent(webview::kEventResponsive, std::move(args))); } void WebViewGuest::RendererUnresponsive(WebContents* source) { @@ -646,7 +648,7 @@ void WebViewGuest::RendererUnresponsive(WebContents* source) { args->SetInteger(webview::kProcessId, web_contents()->GetRenderProcessHost()->GetID()); DispatchEventToView( - new GuestViewEvent(webview::kEventUnresponsive, args.Pass())); + new GuestViewEvent(webview::kEventUnresponsive, std::move(args))); } void WebViewGuest::Observe(int type, @@ -814,7 +816,7 @@ void WebViewGuest::DidCommitProvisionalLoadForFrame( args->SetInteger(webview::kInternalProcessId, web_contents()->GetRenderProcessHost()->GetID()); DispatchEventToView( - new GuestViewEvent(webview::kEventLoadCommit, args.Pass())); + new GuestViewEvent(webview::kEventLoadCommit, std::move(args))); find_helper_.CancelAllFindSessions(); } @@ -842,7 +844,7 @@ void WebViewGuest::DidStartProvisionalLoadForFrame( args->SetString(guest_view::kUrl, validated_url.spec()); args->SetBoolean(guest_view::kIsTopLevel, !render_frame_host->GetParent()); DispatchEventToView( - new GuestViewEvent(webview::kEventLoadStart, args.Pass())); + new GuestViewEvent(webview::kEventLoadStart, std::move(args))); } void WebViewGuest::RenderProcessGone(base::TerminationStatus status) { @@ -853,8 +855,7 @@ void WebViewGuest::RenderProcessGone(base::TerminationStatus status) { args->SetInteger(webview::kProcessId, web_contents()->GetRenderProcessHost()->GetID()); args->SetString(webview::kReason, TerminationStatusToString(status)); - DispatchEventToView( - new GuestViewEvent(webview::kEventExit, args.Pass())); + DispatchEventToView(new GuestViewEvent(webview::kEventExit, std::move(args))); } void WebViewGuest::UserAgentOverrideSet(const std::string& user_agent) { @@ -882,13 +883,13 @@ void WebViewGuest::ReportFrameNameChange(const std::string& name) { scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); args->SetString(webview::kName, name); DispatchEventToView( - new GuestViewEvent(webview::kEventFrameNameChanged, args.Pass())); + new GuestViewEvent(webview::kEventFrameNameChanged, std::move(args))); } void WebViewGuest::LoadHandlerCalled() { scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); DispatchEventToView( - new GuestViewEvent(webview::kEventContentLoad, args.Pass())); + new GuestViewEvent(webview::kEventContentLoad, std::move(args))); } void WebViewGuest::LoadRedirect(const GURL& old_url, @@ -899,7 +900,7 @@ void WebViewGuest::LoadRedirect(const GURL& old_url, args->SetString(webview::kNewURL, new_url.spec()); args->SetString(webview::kOldURL, old_url.spec()); DispatchEventToView( - new GuestViewEvent(webview::kEventLoadRedirect, args.Pass())); + new GuestViewEvent(webview::kEventLoadRedirect, std::move(args))); } void WebViewGuest::PushWebViewStateToIOThread() { @@ -1497,7 +1498,7 @@ void WebViewGuest::SetFullscreenState(bool is_fullscreen) { // on the embedder. scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); DispatchEventToView( - new GuestViewEvent(webview::kEventExitFullscreen, args.Pass())); + new GuestViewEvent(webview::kEventExitFullscreen, std::move(args))); } // Since we changed fullscreen state, sending a Resize message ensures that // renderer/ sees the change. diff --git a/extensions/browser/guest_view/web_view/web_view_permission_helper.cc b/extensions/browser/guest_view/web_view/web_view_permission_helper.cc index 46ded6b..462f23a 100644 --- a/extensions/browser/guest_view/web_view/web_view_permission_helper.cc +++ b/extensions/browser/guest_view/web_view/web_view_permission_helper.cc @@ -4,6 +4,8 @@ #include "extensions/browser/guest_view/web_view/web_view_permission_helper.h" +#include <utility> + #include "components/guest_view/browser/guest_view_event.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_view_host.h" @@ -332,19 +334,19 @@ int WebViewPermissionHelper::RequestPermission( switch (permission_type) { case WEB_VIEW_PERMISSION_TYPE_NEW_WINDOW: { web_view_guest_->DispatchEventToView( - new GuestViewEvent(webview::kEventNewWindow, args.Pass())); + new GuestViewEvent(webview::kEventNewWindow, std::move(args))); break; } case WEB_VIEW_PERMISSION_TYPE_JAVASCRIPT_DIALOG: { web_view_guest_->DispatchEventToView( - new GuestViewEvent(webview::kEventDialog, args.Pass())); + new GuestViewEvent(webview::kEventDialog, std::move(args))); break; } default: { args->SetString(webview::kPermission, PermissionTypeToString(permission_type)); web_view_guest_->DispatchEventToView(new GuestViewEvent( - webview::kEventPermissionRequest, args.Pass())); + webview::kEventPermissionRequest, std::move(args))); break; } } |