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

Unified Diff: chrome/browser/extensions/api/webstore_private/webstore_private_api.cc

Issue 1871713002: Convert //chrome/browser/extensions from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and fix header Created 4 years, 8 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/webstore_private/webstore_private_api.cc
diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
index 4bb451b76c0ff5f16a86eb769e246e941bdb09b7..4f30861cf8744999c836f086961057c795053d36 100644
--- a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
+++ b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
@@ -64,9 +64,11 @@ class PendingApprovals {
PendingApprovals();
~PendingApprovals();
- void PushApproval(scoped_ptr<WebstoreInstaller::Approval> approval);
- scoped_ptr<WebstoreInstaller::Approval> PopApproval(
- Profile* profile, const std::string& id);
+ void PushApproval(std::unique_ptr<WebstoreInstaller::Approval> approval);
+ std::unique_ptr<WebstoreInstaller::Approval> PopApproval(
+ Profile* profile,
+ const std::string& id);
+
private:
typedef ScopedVector<WebstoreInstaller::Approval> ApprovalList;
@@ -79,21 +81,22 @@ PendingApprovals::PendingApprovals() {}
PendingApprovals::~PendingApprovals() {}
void PendingApprovals::PushApproval(
- scoped_ptr<WebstoreInstaller::Approval> approval) {
+ std::unique_ptr<WebstoreInstaller::Approval> approval) {
approvals_.push_back(approval.release());
}
-scoped_ptr<WebstoreInstaller::Approval> PendingApprovals::PopApproval(
- Profile* profile, const std::string& id) {
+std::unique_ptr<WebstoreInstaller::Approval> PendingApprovals::PopApproval(
+ Profile* profile,
+ const std::string& id) {
for (size_t i = 0; i < approvals_.size(); ++i) {
WebstoreInstaller::Approval* approval = approvals_[i];
if (approval->extension_id == id &&
profile->IsSameProfile(approval->profile)) {
approvals_.weak_erase(approvals_.begin() + i);
- return scoped_ptr<WebstoreInstaller::Approval>(approval);
+ return std::unique_ptr<WebstoreInstaller::Approval>(approval);
}
}
- return scoped_ptr<WebstoreInstaller::Approval>();
+ return std::unique_ptr<WebstoreInstaller::Approval>();
}
api::webstore_private::Result WebstoreInstallHelperResultToApiResult(
@@ -161,9 +164,9 @@ void WebstorePrivateApi::SetWebstoreInstallerDelegateForTesting(
}
// static
-scoped_ptr<WebstoreInstaller::Approval>
-WebstorePrivateApi::PopApprovalForTesting(
- Profile* profile, const std::string& extension_id) {
+std::unique_ptr<WebstoreInstaller::Approval>
+WebstorePrivateApi::PopApprovalForTesting(Profile* profile,
+ const std::string& extension_id) {
return g_pending_approvals.Get().PopApproval(profile, extension_id);
}
@@ -315,7 +318,7 @@ void WebstorePrivateBeginInstallWithManifest3Function::HandleInstallProceed() {
// This gets cleared in CrxInstaller::ConfirmInstall(). TODO(asargent) - in
// the future we may also want to add time-based expiration, where a whitelist
// entry is only valid for some number of minutes.
- scoped_ptr<WebstoreInstaller::Approval> approval(
+ std::unique_ptr<WebstoreInstaller::Approval> approval(
WebstoreInstaller::Approval::CreateWithNoInstallPrompt(
chrome_details_.GetProfile(), details().id,
std::move(parsed_manifest_), false));
@@ -372,7 +375,7 @@ WebstorePrivateBeginInstallWithManifest3Function::BuildResponse(
CreateResults(api::webstore_private::RESULT_EMPTY_STRING));
}
-scoped_ptr<base::ListValue>
+std::unique_ptr<base::ListValue>
WebstorePrivateBeginInstallWithManifest3Function::CreateResults(
api::webstore_private::Result result) const {
return BeginInstallWithManifest3::Results::Create(result);
@@ -386,7 +389,7 @@ WebstorePrivateCompleteInstallFunction::
ExtensionFunction::ResponseAction
WebstorePrivateCompleteInstallFunction::Run() {
- scoped_ptr<CompleteInstall::Params> params(
+ std::unique_ptr<CompleteInstall::Params> params(
CompleteInstall::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params);
if (chrome_details_.GetProfile()->IsGuestSession() ||
@@ -621,7 +624,7 @@ WebstorePrivateSetStoreLoginFunction::
~WebstorePrivateSetStoreLoginFunction() {}
ExtensionFunction::ResponseAction WebstorePrivateSetStoreLoginFunction::Run() {
- scoped_ptr<SetStoreLogin::Params> params(
+ std::unique_ptr<SetStoreLogin::Params> params(
SetStoreLogin::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params);
SetWebstoreLogin(chrome_details_.GetProfile(), params->login);

Powered by Google App Engine
This is Rietveld 408576698