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

Unified Diff: cc/layers/texture_layer.cc

Issue 1866203004: Convert //cc from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptrcc: rebase 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
« no previous file with comments | « cc/layers/texture_layer.h ('k') | cc/layers/texture_layer_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/texture_layer.cc
diff --git a/cc/layers/texture_layer.cc b/cc/layers/texture_layer.cc
index a656955272b65dc401afe46cc2dca82134fbf370..b5b31732ac88dd356dd6974d448dd4135b6602a9 100644
--- a/cc/layers/texture_layer.cc
+++ b/cc/layers/texture_layer.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/callback_helpers.h"
#include "base/location.h"
+#include "base/memory/ptr_util.h"
#include "base/synchronization/lock.h"
#include "base/trace_event/trace_event.h"
#include "cc/base/simple_enclosed_region.h"
@@ -52,7 +53,8 @@ void TextureLayer::ClearTexture() {
SetTextureMailbox(TextureMailbox(), nullptr);
}
-scoped_ptr<LayerImpl> TextureLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) {
+std::unique_ptr<LayerImpl> TextureLayer::CreateLayerImpl(
+ LayerTreeImpl* tree_impl) {
return TextureLayerImpl::Create(tree_impl, id());
}
@@ -115,7 +117,7 @@ void TextureLayer::SetBlendBackgroundColor(bool blend) {
void TextureLayer::SetTextureMailboxInternal(
const TextureMailbox& mailbox,
- scoped_ptr<SingleReleaseCallback> release_callback,
+ std::unique_ptr<SingleReleaseCallback> release_callback,
bool requires_commit,
bool allow_mailbox_reuse) {
DCHECK(!mailbox.IsValid() || !holder_ref_ ||
@@ -145,7 +147,7 @@ void TextureLayer::SetTextureMailboxInternal(
void TextureLayer::SetTextureMailbox(
const TextureMailbox& mailbox,
- scoped_ptr<SingleReleaseCallback> release_callback) {
+ std::unique_ptr<SingleReleaseCallback> release_callback) {
bool requires_commit = true;
bool allow_mailbox_reuse = false;
SetTextureMailboxInternal(mailbox, std::move(release_callback),
@@ -163,7 +165,7 @@ void TextureLayer::SetTextureMailboxWithoutReleaseCallback(
DCHECK(!mailbox.IsValid() || !holder_ref_ ||
!mailbox.Equals(holder_ref_->holder()->mailbox()) ||
mailbox.sync_token() != holder_ref_->holder()->mailbox().sync_token());
- scoped_ptr<SingleReleaseCallback> release;
+ std::unique_ptr<SingleReleaseCallback> release;
bool requires_commit = true;
bool allow_mailbox_reuse = true;
if (mailbox.IsValid())
@@ -202,7 +204,7 @@ bool TextureLayer::Update() {
bool updated = Layer::Update();
if (client_) {
TextureMailbox mailbox;
- scoped_ptr<SingleReleaseCallback> release_callback;
+ std::unique_ptr<SingleReleaseCallback> release_callback;
if (client_->PrepareTextureMailbox(
&mailbox,
&release_callback,
@@ -236,7 +238,7 @@ void TextureLayer::PushPropertiesTo(LayerImpl* layer) {
texture_layer->SetBlendBackgroundColor(blend_background_color_);
if (needs_set_mailbox_) {
TextureMailbox texture_mailbox;
- scoped_ptr<SingleReleaseCallbackImpl> release_callback_impl;
+ std::unique_ptr<SingleReleaseCallbackImpl> release_callback_impl;
if (holder_ref_) {
TextureMailboxHolder* holder = holder_ref_->holder();
texture_mailbox = holder->mailbox();
@@ -261,7 +263,7 @@ TextureLayer::TextureMailboxHolder::MainThreadReference::
TextureLayer::TextureMailboxHolder::TextureMailboxHolder(
const TextureMailbox& mailbox,
- scoped_ptr<SingleReleaseCallback> release_callback)
+ std::unique_ptr<SingleReleaseCallback> release_callback)
: internal_references_(0),
mailbox_(mailbox),
release_callback_(std::move(release_callback)),
@@ -272,11 +274,11 @@ TextureLayer::TextureMailboxHolder::~TextureMailboxHolder() {
DCHECK_EQ(0u, internal_references_);
}
-scoped_ptr<TextureLayer::TextureMailboxHolder::MainThreadReference>
+std::unique_ptr<TextureLayer::TextureMailboxHolder::MainThreadReference>
TextureLayer::TextureMailboxHolder::Create(
const TextureMailbox& mailbox,
- scoped_ptr<SingleReleaseCallback> release_callback) {
- return make_scoped_ptr(new MainThreadReference(
+ std::unique_ptr<SingleReleaseCallback> release_callback) {
+ return base::WrapUnique(new MainThreadReference(
new TextureMailboxHolder(mailbox, std::move(release_callback))));
}
@@ -288,7 +290,7 @@ void TextureLayer::TextureMailboxHolder::Return(
is_lost_ = is_lost;
}
-scoped_ptr<SingleReleaseCallbackImpl>
+std::unique_ptr<SingleReleaseCallbackImpl>
TextureLayer::TextureMailboxHolder::GetCallbackForImplThread() {
// We can't call GetCallbackForImplThread if we released the main thread
// reference.
« no previous file with comments | « cc/layers/texture_layer.h ('k') | cc/layers/texture_layer_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698