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

Unified Diff: android_webview/native/aw_contents_client_bridge.cc

Issue 2480293004: Mandate unique_ptr for base::IDMap in IDMapOwnPointer mode. (Closed)
Patch Set: Fix typo breaking a bunch of trybot builds, oops 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: android_webview/native/aw_contents_client_bridge.cc
diff --git a/android_webview/native/aw_contents_client_bridge.cc b/android_webview/native/aw_contents_client_bridge.cc
index 41a7c1561e7c8d010c6e64c42093f8956942974d..396d61d5a0dca383222840c2adc5178ec4d024de 100644
--- a/android_webview/native/aw_contents_client_bridge.cc
+++ b/android_webview/native/aw_contents_client_bridge.cc
@@ -102,7 +102,7 @@ void AwContentsClientBridge::AllowCertificateError(
// We need to add the callback before making the call to java side,
// as it may do a synchronous callback prior to returning.
int request_id = pending_cert_error_callbacks_.Add(
- new CertErrorCallback(callback));
+ base::MakeUnique<CertErrorCallback>(callback));
*cancel_request = !Java_AwContentsClientBridge_allowCertificateError(
env, obj, cert_error, jcert, jurl, request_id);
// if the request is cancelled, then cancel the stored callback
@@ -280,7 +280,8 @@ void AwContentsClientBridge::RunJavaScriptDialog(
}
int callback_id = pending_js_dialog_callbacks_.Add(
- new content::JavaScriptDialogManager::DialogClosedCallback(callback));
+ base::MakeUnique<
+ content::JavaScriptDialogManager::DialogClosedCallback>(callback));
ScopedJavaLocalRef<jstring> jurl(
ConvertUTF8ToJavaString(env, origin_url.spec()));
ScopedJavaLocalRef<jstring> jmessage(
@@ -328,7 +329,8 @@ void AwContentsClientBridge::RunBeforeUnloadDialog(
l10n_util::GetStringUTF16(IDS_BEFOREUNLOAD_MESSAGEBOX_MESSAGE);
int callback_id = pending_js_dialog_callbacks_.Add(
- new content::JavaScriptDialogManager::DialogClosedCallback(callback));
+ base::MakeUnique<
+ content::JavaScriptDialogManager::DialogClosedCallback>(callback));
ScopedJavaLocalRef<jstring> jurl(
ConvertUTF8ToJavaString(env, origin_url.spec()));
ScopedJavaLocalRef<jstring> jmessage(

Powered by Google App Engine
This is Rietveld 408576698