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

Side by Side Diff: ipc/mojo/ipc_channel_mojo.cc

Issue 1445003002: Use std::default_delete as the default deleter for scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Windows maybe Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ipc/mojo/ipc_channel_mojo.h" 5 #include "ipc/mojo/ipc_channel_mojo.h"
6 6
7 #include <memory>
7 #include "base/bind.h" 8 #include "base/bind.h"
8 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 10 #include "base/command_line.h"
10 #include "base/lazy_instance.h" 11 #include "base/lazy_instance.h"
11 #include "base/thread_task_runner_handle.h" 12 #include "base/thread_task_runner_handle.h"
12 #include "ipc/ipc_listener.h" 13 #include "ipc/ipc_listener.h"
13 #include "ipc/ipc_logging.h" 14 #include "ipc/ipc_logging.h"
14 #include "ipc/ipc_message_attachment_set.h" 15 #include "ipc/ipc_message_attachment_set.h"
15 #include "ipc/ipc_message_macros.h" 16 #include "ipc/ipc_message_macros.h"
16 #include "ipc/mojo/client_channel.mojom.h" 17 #include "ipc/mojo/client_channel.mojom.h"
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 365
365 void ChannelMojo::OnBootstrapError() { 366 void ChannelMojo::OnBootstrapError() {
366 listener_->OnChannelError(); 367 listener_->OnChannelError();
367 } 368 }
368 369
369 namespace { 370 namespace {
370 371
371 // ClosingDeleter calls |CloseWithErrorIfPending| before deleting the 372 // ClosingDeleter calls |CloseWithErrorIfPending| before deleting the
372 // |MessagePipeReader|. 373 // |MessagePipeReader|.
373 struct ClosingDeleter { 374 struct ClosingDeleter {
374 typedef base::DefaultDeleter<internal::MessagePipeReader> DefaultType; 375 typedef std::default_delete<internal::MessagePipeReader> DefaultType;
375 376
376 void operator()(internal::MessagePipeReader* ptr) const { 377 void operator()(internal::MessagePipeReader* ptr) const {
377 ptr->CloseWithErrorIfPending(); 378 ptr->CloseWithErrorIfPending();
378 delete ptr; 379 delete ptr;
379 } 380 }
380 }; 381 };
381 382
382 } // namespace 383 } // namespace
383 384
384 void ChannelMojo::InitMessageReader(mojo::ScopedMessagePipeHandle pipe, 385 void ChannelMojo::InitMessageReader(mojo::ScopedMessagePipeHandle pipe,
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 if (!ok) { 542 if (!ok) {
542 LOG(ERROR) << "Failed to add new Mojo handle."; 543 LOG(ERROR) << "Failed to add new Mojo handle.";
543 return MOJO_RESULT_UNKNOWN; 544 return MOJO_RESULT_UNKNOWN;
544 } 545 }
545 } 546 }
546 547
547 return MOJO_RESULT_OK; 548 return MOJO_RESULT_OK;
548 } 549 }
549 550
550 } // namespace IPC 551 } // namespace IPC
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698