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

Unified Diff: content/child/geofencing/geofencing_dispatcher.cc

Issue 1235083006: CallbackPromiseAdapter types should be more compatible with WebCallbacks (2/3). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@web-callbacks-3
Patch Set: Created 5 years, 4 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
« no previous file with comments | « no previous file | content/child/notifications/notification_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/geofencing/geofencing_dispatcher.cc
diff --git a/content/child/geofencing/geofencing_dispatcher.cc b/content/child/geofencing/geofencing_dispatcher.cc
index 37ba161aa289fa8ec44174beae43bfdf59e2f29c..2dda75213aa3be9a607c4d7ac356e875c7701521 100644
--- a/content/child/geofencing/geofencing_dispatcher.cc
+++ b/content/child/geofencing/geofencing_dispatcher.cc
@@ -166,7 +166,7 @@ void GeofencingDispatcher::OnRegisterRegionComplete(int thread_id,
if (status == GEOFENCING_STATUS_OK) {
callbacks->onSuccess();
} else {
- callbacks->onError(new WebGeofencingError(
+ callbacks->onError(WebGeofencingError(
WebGeofencingError::ErrorTypeAbort,
blink::WebString::fromUTF8(GeofencingStatusToString(status))));
}
@@ -183,7 +183,7 @@ void GeofencingDispatcher::OnUnregisterRegionComplete(int thread_id,
if (status == GEOFENCING_STATUS_OK) {
callbacks->onSuccess();
} else {
- callbacks->onError(new WebGeofencingError(
+ callbacks->onError(WebGeofencingError(
WebGeofencingError::ErrorTypeAbort,
blink::WebString::fromUTF8(GeofencingStatusToString(status))));
}
@@ -200,18 +200,17 @@ void GeofencingDispatcher::OnGetRegisteredRegionsComplete(
DCHECK(callbacks);
if (status == GEOFENCING_STATUS_OK) {
- scoped_ptr<blink::WebVector<blink::WebGeofencingRegistration>> result(
- new blink::WebVector<blink::WebGeofencingRegistration>(regions.size()));
+ blink::WebVector<blink::WebGeofencingRegistration> result(regions.size());
size_t index = 0;
for (GeofencingRegistrations::const_iterator it = regions.begin();
it != regions.end();
++it, ++index) {
- (*result)[index].id = blink::WebString::fromUTF8(it->first);
- (*result)[index].region = it->second;
+ result[index].id = blink::WebString::fromUTF8(it->first);
+ result[index].region = it->second;
}
- callbacks->onSuccess(result.release());
+ callbacks->onSuccess(result);
} else {
- callbacks->onError(new WebGeofencingError(
+ callbacks->onError(WebGeofencingError(
WebGeofencingError::ErrorTypeAbort,
blink::WebString::fromUTF8(GeofencingStatusToString(status))));
}
« no previous file with comments | « no previous file | content/child/notifications/notification_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698