Skip to content

Commit

Permalink
Remove TransportDIB::Create
Browse files Browse the repository at this point in the history
TransportDIB::Create is not used anywhere.

Bug: n/a
Change-Id: I1e706919e70e6f7989e272f73e8e4a8d86cbc612
Reviewed-on: https://chromium-review.googlesource.com/558757
Reviewed-by: John Bauman <jbauman@chromium.org>
Commit-Queue: Hajime Hoshi <hajimehoshi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#484839}
  • Loading branch information
Hajime Hoshi authored and Commit Bot committed Jul 7, 2017
1 parent d25bb02 commit c80508b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 40 deletions.
15 changes: 2 additions & 13 deletions ui/surface/transport_dib.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,10 @@ class SURFACE_EXPORT TransportDIB {
public:
~TransportDIB();

// A Handle is the type which can be sent over the wire so that the remote
// side can map the transport DIB.
// A Handle is the type which can be sent over the wire so that the remote
// side can map the transport DIB.
typedef base::SharedMemoryHandle Handle;

// Create a new TransportDIB, returning NULL on failure.
//
// The size is the minimum size in bytes of the memory backing the transport
// DIB (we may actually allocate more than that to give us better reuse when
// cached).
//
// The sequence number is used to uniquely identify the transport DIB. It
// should be unique for all transport DIBs ever created in the same
// renderer.
static TransportDIB* Create(size_t size, uint32_t sequence_num);

// Map the referenced transport DIB. The caller owns the returned object.
// Returns NULL on failure.
static TransportDIB* Map(Handle transport_dib);
Expand Down
12 changes: 0 additions & 12 deletions ui/surface/transport_dib_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,6 @@ TransportDIB::TransportDIB(TransportDIB::Handle dib)
TransportDIB::~TransportDIB() {
}

// static
TransportDIB* TransportDIB::Create(size_t size, uint32_t sequence_num) {
TransportDIB* dib = new TransportDIB;
if (!dib->shared_memory_.CreateAndMapAnonymous(size)) {
delete dib;
return NULL;
}

dib->size_ = size;
return dib;
}

// static
TransportDIB* TransportDIB::Map(Handle handle) {
std::unique_ptr<TransportDIB> dib(CreateWithHandle(handle));
Expand Down
15 changes: 0 additions & 15 deletions ui/surface/transport_dib_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,6 @@ TransportDIB::~TransportDIB() {
TransportDIB::TransportDIB(base::SharedMemoryHandle handle)
: shared_memory_(handle, false /* read write */), size_(0) {}

// static
TransportDIB* TransportDIB::Create(size_t size, uint32_t sequence_num) {
TransportDIB* dib = new TransportDIB;

if (!dib->shared_memory_.CreateAnonymous(size)) {
delete dib;
return NULL;
}

dib->size_ = size;
dib->sequence_num_ = sequence_num;

return dib;
}

// static
TransportDIB* TransportDIB::Map(Handle handle) {
std::unique_ptr<TransportDIB> dib(CreateWithHandle(handle));
Expand Down

0 comments on commit c80508b

Please sign in to comment.