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

Unified Diff: components/test_runner/mock_screen_orientation_client.cc

Issue 2480293004: Mandate unique_ptr for base::IDMap in IDMapOwnPointer mode. (Closed)
Patch Set: Make changes requested by danakj, fix a few more headers Created 4 years, 1 month 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: components/test_runner/mock_screen_orientation_client.cc
diff --git a/components/test_runner/mock_screen_orientation_client.cc b/components/test_runner/mock_screen_orientation_client.cc
index e734897194187b25544a26a7eb62e392b209e122..72e60b47532278f716cb361a691948ebf8956ca3 100644
--- a/components/test_runner/mock_screen_orientation_client.cc
+++ b/components/test_runner/mock_screen_orientation_client.cc
@@ -4,6 +4,8 @@
#include "components/test_runner/mock_screen_orientation_client.h"
+#include <memory>
+
#include "base/bind.h"
#include "base/logging.h"
#include "base/single_thread_task_runner.h"
@@ -115,10 +117,11 @@ bool MockScreenOrientationClient::IsOrientationAllowedByCurrentLock(
void MockScreenOrientationClient::lockOrientation(
blink::WebScreenOrientationLockType orientation,
- blink::WebLockOrientationCallback* callback) {
+ std::unique_ptr<blink::WebLockOrientationCallback> callback) {
base::ThreadTaskRunnerHandle::Get()->PostTask(
- FROM_HERE, base::Bind(&MockScreenOrientationClient::UpdateLockSync,
- base::Unretained(this), orientation, callback));
+ FROM_HERE,
+ base::Bind(&MockScreenOrientationClient::UpdateLockSync,
+ base::Unretained(this), orientation, base::Passed(&callback)));
}
void MockScreenOrientationClient::unlockOrientation() {
@@ -129,13 +132,12 @@ void MockScreenOrientationClient::unlockOrientation() {
void MockScreenOrientationClient::UpdateLockSync(
blink::WebScreenOrientationLockType lock,
- blink::WebLockOrientationCallback* callback) {
+ std::unique_ptr<blink::WebLockOrientationCallback> callback) {
DCHECK(lock != blink::WebScreenOrientationLockDefault);
current_lock_ = lock;
if (!IsOrientationAllowedByCurrentLock(current_orientation_))
UpdateScreenOrientation(SuitableOrientationForCurrentLock());
callback->onSuccess();
- delete callback;
}
void MockScreenOrientationClient::ResetLockSync() {
« no previous file with comments | « components/test_runner/mock_screen_orientation_client.h ('k') | content/browser/cache_storage/cache_storage_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698