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

Unified Diff: chrome/browser/extensions/api/identity/identity_api.cc

Issue 1991083002: Remove ExtensionFunction::SetResult(T*) overload. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IWYU Created 4 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: chrome/browser/extensions/api/identity/identity_api.cc
diff --git a/chrome/browser/extensions/api/identity/identity_api.cc b/chrome/browser/extensions/api/identity/identity_api.cc
index 52bacbba5311fd6b14c130633605136c78d0945d..f018e140609a15b79d3888da79f49d909c447966 100644
--- a/chrome/browser/extensions/api/identity/identity_api.cc
+++ b/chrome/browser/extensions/api/identity/identity_api.cc
@@ -13,6 +13,7 @@
#include "base/lazy_instance.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/trace_event/trace_event.h"
@@ -437,8 +438,7 @@ void IdentityGetAuthTokenFunction::CompleteAsyncRun(bool success) {
void IdentityGetAuthTokenFunction::CompleteFunctionWithResult(
const std::string& access_token) {
-
- SetResult(new base::StringValue(access_token));
+ SetResult(base::MakeUnique<base::StringValue>(access_token));
CompleteAsyncRun(true);
}
@@ -1013,7 +1013,7 @@ void IdentityLaunchWebAuthFlowFunction::OnAuthFlowFailure(
void IdentityLaunchWebAuthFlowFunction::OnAuthFlowURLChange(
const GURL& redirect_url) {
if (redirect_url.GetWithEmptyPath() == final_url_prefix_) {
- SetResult(new base::StringValue(redirect_url.spec()));
+ SetResult(base::MakeUnique<base::StringValue>(redirect_url.spec()));
SendResponse(true);
if (auth_flow_)
auth_flow_.release()->DetachDelegateAndDelete();

Powered by Google App Engine
This is Rietveld 408576698