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

Unified Diff: chromecast/media/cma/ipc/media_message.h

Issue 1875623002: Convert //chromecast from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « chromecast/media/cma/decoder/cast_audio_decoder_linux.cc ('k') | chromecast/media/cma/ipc/media_message.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/media/cma/ipc/media_message.h
diff --git a/chromecast/media/cma/ipc/media_message.h b/chromecast/media/cma/ipc/media_message.h
index 0d88dd702d79208d3af758a7fbad8734ce254827..38187c2f32b5ffba47f9019dcabf3f49c6ac0927 100644
--- a/chromecast/media/cma/ipc/media_message.h
+++ b/chromecast/media/cma/ipc/media_message.h
@@ -8,9 +8,10 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
+
#include "base/callback.h"
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
namespace chromecast {
namespace media {
@@ -28,34 +29,34 @@ class MediaMessage {
// Memory allocator: given a number of bytes to allocate,
// return the pointer to the allocated block if successful
// or NULL if allocation failed.
- typedef base::Callback<scoped_ptr<MediaMemoryChunk>(size_t)>
+ typedef base::Callback<std::unique_ptr<MediaMemoryChunk>(size_t)>
MemoryAllocatorCB;
// Creates a message with no associated memory for its content, i.e.
// each write on this message is a dummy operation.
// This type of message can be useful to calculate first the size of the
// message, before allocating the real message.
- static scoped_ptr<MediaMessage> CreateDummyMessage(uint32_t type);
+ static std::unique_ptr<MediaMessage> CreateDummyMessage(uint32_t type);
// Creates a message with a capacity of at least |msg_content_capacity|
// bytes. The actual content size can be smaller than its capacity.
// The message can be populated with some Write functions.
- static scoped_ptr<MediaMessage> CreateMessage(
+ static std::unique_ptr<MediaMessage> CreateMessage(
uint32_t type,
const MemoryAllocatorCB& memory_allocator,
size_t msg_content_capacity);
// Creates a message of type |type| whose serialized structure is stored
// in |mem|.
- static scoped_ptr<MediaMessage> CreateMessage(
+ static std::unique_ptr<MediaMessage> CreateMessage(
uint32_t type,
- scoped_ptr<MediaMemoryChunk> mem);
+ std::unique_ptr<MediaMemoryChunk> mem);
// Creates a message from a memory area which already contains
// the serialized structure of the message.
// Only Read functions can be invoked on this type of message.
- static scoped_ptr<MediaMessage> MapMessage(
- scoped_ptr<MediaMemoryChunk> mem);
+ static std::unique_ptr<MediaMessage> MapMessage(
+ std::unique_ptr<MediaMemoryChunk> mem);
// Return the minimum size of a message.
static size_t minimum_msg_size() {
@@ -112,8 +113,8 @@ class MediaMessage {
private:
MediaMessage(uint32_t type, size_t msg_size);
- MediaMessage(uint32_t type, scoped_ptr<MediaMemoryChunk> memory);
- MediaMessage(scoped_ptr<MediaMemoryChunk> memory);
+ MediaMessage(uint32_t type, std::unique_ptr<MediaMemoryChunk> memory);
+ MediaMessage(std::unique_ptr<MediaMemoryChunk> memory);
struct Header {
// Total size of the message (including both header & content).
@@ -151,7 +152,7 @@ class MediaMessage {
// Memory allocated to store the underlying serialized structure into memory.
// Note: a dummy message has no underlying serialized structure:
// |mem_| is a null pointer in that case.
- scoped_ptr<MediaMemoryChunk> mem_;
+ std::unique_ptr<MediaMemoryChunk> mem_;
// Read iterator into the message.
size_t rd_offset_;
« no previous file with comments | « chromecast/media/cma/decoder/cast_audio_decoder_linux.cc ('k') | chromecast/media/cma/ipc/media_message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698