Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1388)

Unified Diff: content/browser/screen_orientation/screen_orientation_provider.cc

Issue 2868843002: Use OnceCallback on Mojo interfaces in //device/screen_orientation (Closed)
Patch Set: rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/screen_orientation/screen_orientation_provider.cc
diff --git a/content/browser/screen_orientation/screen_orientation_provider.cc b/content/browser/screen_orientation/screen_orientation_provider.cc
index 80c97870f8e75b90a7a624926da19f33d83bc11a..c9f4a867eb27cd55e3bdca89d09994b4ee88bc70 100644
--- a/content/browser/screen_orientation/screen_orientation_provider.cc
+++ b/content/browser/screen_orientation/screen_orientation_provider.cc
@@ -4,6 +4,8 @@
#include "content/browser/screen_orientation/screen_orientation_provider.h"
+#include <utility>
+
#include "base/callback_helpers.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
@@ -28,12 +30,12 @@ ScreenOrientationProvider::~ScreenOrientationProvider() = default;
void ScreenOrientationProvider::LockOrientation(
blink::WebScreenOrientationLockType orientation,
- const LockOrientationCallback& callback) {
+ LockOrientationCallback callback) {
// Cancel any pending lock request.
NotifyLockResult(ScreenOrientationLockResult::
SCREEN_ORIENTATION_LOCK_RESULT_ERROR_CANCELED);
// Record new pending lock request.
- pending_callback_ = callback;
+ pending_callback_ = std::move(callback);
if (!delegate_ || !delegate_->ScreenOrientationProviderSupported()) {
NotifyLockResult(ScreenOrientationLockResult::
« no previous file with comments | « content/browser/screen_orientation/screen_orientation_provider.h ('k') | device/screen_orientation/public/interfaces/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698