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

Unified Diff: chrome/renderer/security_filter_peer.cc

Issue 2341693002: Re-write many calls to WrapUnique() with MakeUnique() (Closed)
Patch Set: Change std::string() back to "" to fix compile Created 4 years, 3 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 | « chrome/renderer/pepper/pepper_helper.cc ('k') | chrome/service/service_process.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/security_filter_peer.cc
diff --git a/chrome/renderer/security_filter_peer.cc b/chrome/renderer/security_filter_peer.cc
index aef685c9d22fbaa22e47727cef3f1e0d204f1d6e..bfbdfa1710677af04330940304fd4a70675e7716 100644
--- a/chrome/renderer/security_filter_peer.cc
+++ b/chrome/renderer/security_filter_peer.cc
@@ -48,8 +48,8 @@ SecurityFilterPeer::CreateSecurityFilterPeerForDeniedRequest(
if (content::IsResourceTypeFrame(resource_type))
return CreateSecurityFilterPeerForFrame(std::move(peer), os_error);
// Any other content is entirely filtered-out.
- return base::WrapUnique(new ReplaceContentPeer(
- std::move(peer), std::string(), std::string()));
+ return base::MakeUnique<ReplaceContentPeer>(std::move(peer),
+ std::string(), std::string());
default:
// For other errors, we use our normal error handling.
return peer;
@@ -68,8 +68,8 @@ SecurityFilterPeer::CreateSecurityFilterPeerForFrame(
"<body style='background-color:#990000;color:white;'>"
"%s</body></html>",
l10n_util::GetStringUTF8(IDS_UNSAFE_FRAME_MESSAGE).c_str());
- return base::WrapUnique(
- new ReplaceContentPeer(std::move(peer), "text/html", html));
+ return base::MakeUnique<ReplaceContentPeer>(std::move(peer), "text/html",
+ html);
}
void SecurityFilterPeer::OnUploadProgress(uint64_t position, uint64_t size) {
@@ -147,8 +147,8 @@ void BufferedPeer::OnCompletedRequest(int error_code,
original_peer_->OnReceivedResponse(response_info_);
if (!data_.empty()) {
- original_peer_->OnReceivedData(base::WrapUnique(
- new content::FixedReceivedData(data_.data(), data_.size(), -1, 0)));
+ original_peer_->OnReceivedData(base::MakeUnique<content::FixedReceivedData>(
+ data_.data(), data_.size(), -1, 0));
}
original_peer_->OnCompletedRequest(error_code, was_ignored_by_handler,
stale_copy_in_cache, completion_time,
@@ -187,8 +187,8 @@ void ReplaceContentPeer::OnCompletedRequest(
info.content_length = static_cast<int>(data_.size());
original_peer_->OnReceivedResponse(info);
if (!data_.empty()) {
- original_peer_->OnReceivedData(base::WrapUnique(
- new content::FixedReceivedData(data_.data(), data_.size(), -1, 0)));
+ original_peer_->OnReceivedData(base::MakeUnique<content::FixedReceivedData>(
+ data_.data(), data_.size(), -1, 0));
}
original_peer_->OnCompletedRequest(net::OK, false, stale_copy_in_cache,
completion_time, total_transfer_size);
« no previous file with comments | « chrome/renderer/pepper/pepper_helper.cc ('k') | chrome/service/service_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698