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

Unified Diff: content/renderer/presentation/presentation_dispatcher.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: content/renderer/presentation/presentation_dispatcher.cc
diff --git a/content/renderer/presentation/presentation_dispatcher.cc b/content/renderer/presentation/presentation_dispatcher.cc
index 75435adc81fe8f40cbc6932282e127bb3e060dbc..1d4062a0dd7ea2b93fbe27eba3d11d8951dc2d01 100644
--- a/content/renderer/presentation/presentation_dispatcher.cc
+++ b/content/renderer/presentation/presentation_dispatcher.cc
@@ -103,7 +103,7 @@ void PresentationDispatcher::setController(
void PresentationDispatcher::startSession(
const blink::WebVector<blink::WebURL>& presentationUrls,
- blink::WebPresentationConnectionClientCallbacks* callback) {
+ std::unique_ptr<blink::WebPresentationConnectionClientCallbacks> callback) {
DCHECK(callback);
ConnectToPresentationServiceIfNeeded();
@@ -116,13 +116,13 @@ void PresentationDispatcher::startSession(
// to be destroyed so we transfer its ownership to the mojo callback.
presentation_service_->StartSession(
urls, base::Bind(&PresentationDispatcher::OnSessionCreated,
- base::Unretained(this), base::Owned(callback)));
+ base::Unretained(this), base::Passed(&callback)));
}
void PresentationDispatcher::joinSession(
const blink::WebVector<blink::WebURL>& presentationUrls,
const blink::WebString& presentationId,
- blink::WebPresentationConnectionClientCallbacks* callback) {
+ std::unique_ptr<blink::WebPresentationConnectionClientCallbacks> callback) {
DCHECK(callback);
ConnectToPresentationServiceIfNeeded();
@@ -136,7 +136,7 @@ void PresentationDispatcher::joinSession(
presentation_service_->JoinSession(
urls, presentationId.utf8(),
base::Bind(&PresentationDispatcher::OnSessionCreated,
- base::Unretained(this), base::Owned(callback)));
+ base::Unretained(this), base::Passed(&callback)));
}
void PresentationDispatcher::sendString(const blink::WebURL& presentationUrl,
@@ -244,7 +244,7 @@ void PresentationDispatcher::terminateSession(
void PresentationDispatcher::getAvailability(
const blink::WebURL& availabilityUrl,
- blink::WebPresentationAvailabilityCallbacks* callbacks) {
+ std::unique_ptr<blink::WebPresentationAvailabilityCallbacks> callbacks) {
AvailabilityStatus* status = nullptr;
auto status_it = availability_status_.find(availabilityUrl);
if (status_it == availability_status_.end()) {
@@ -259,12 +259,11 @@ void PresentationDispatcher::getAvailability(
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::Bind(&blink::WebPresentationAvailabilityCallbacks::onSuccess,
- base::Owned(callbacks),
- status->last_known_availability));
+ base::Passed(&callbacks), status->last_known_availability));
return;
}
- status->availability_callbacks.Add(callbacks);
+ status->availability_callbacks.Add(std::move(callbacks));
UpdateListeningState(status);
}
@@ -384,7 +383,7 @@ void PresentationDispatcher::OnDefaultSessionStarted(
}
void PresentationDispatcher::OnSessionCreated(
- blink::WebPresentationConnectionClientCallbacks* callback,
+ std::unique_ptr<blink::WebPresentationConnectionClientCallbacks> callback,
blink::mojom::PresentationSessionInfoPtr session_info,
blink::mojom::PresentationErrorPtr error) {
DCHECK(callback);
« no previous file with comments | « content/renderer/presentation/presentation_dispatcher.h ('k') | content/renderer/push_messaging/push_messaging_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698