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

Unified Diff: extensions/browser/api/test/test_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: extensions/browser/api/test/test_api.cc
diff --git a/extensions/browser/api/test/test_api.cc b/extensions/browser/api/test/test_api.cc
index 9345a8f1dc7950489e50f03938d31923bbed0296..376dcb96acc4972830496efbab20bfb49121eb32 100644
--- a/extensions/browser/api/test/test_api.cc
+++ b/extensions/browser/api/test/test_api.cc
@@ -7,6 +7,7 @@
#include <string>
#include "base/command_line.h"
+#include "base/memory/ptr_util.h"
#include "base/memory/singleton.h"
#include "content/public/browser/notification_service.h"
#include "content/public/common/content_switches.h"
@@ -91,7 +92,7 @@ bool TestSendMessageFunction::RunAsync() {
TestSendMessageFunction::~TestSendMessageFunction() {}
void TestSendMessageFunction::Reply(const std::string& message) {
- SetResult(new base::StringValue(message));
+ SetResult(base::MakeUnique<base::StringValue>(message));
SendResponse(true);
}
@@ -126,7 +127,7 @@ bool TestGetConfigFunction::RunSafe() {
return false;
}
- SetResult(test_config_state->config_state()->DeepCopy());
+ SetResult(test_config_state->config_state()->CreateDeepCopy());
return true;
}
@@ -135,7 +136,7 @@ TestWaitForRoundTripFunction::~TestWaitForRoundTripFunction() {}
bool TestWaitForRoundTripFunction::RunSafe() {
std::unique_ptr<WaitForRoundTrip::Params> params(
WaitForRoundTrip::Params::Create(*args_));
- SetResult(new base::StringValue(params->message));
+ SetResult(base::MakeUnique<base::StringValue>(params->message));
return true;
}

Powered by Google App Engine
This is Rietveld 408576698