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

Side by Side Diff: content/child/shared_memory_data_consumer_handle.cc

Issue 2172183003: Return unique_ptr<WebDataConsumerHandle::Reader> directly from obtainReader (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gmock_cxx11
Patch Set: rebase Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "content/child/shared_memory_data_consumer_handle.h" 5 #include "content/child/shared_memory_data_consumer_handle.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <deque> 8 #include <deque>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 writer->reset(new Writer(context_, mode)); 466 writer->reset(new Writer(context_, mode));
467 } 467 }
468 468
469 SharedMemoryDataConsumerHandle::~SharedMemoryDataConsumerHandle() { 469 SharedMemoryDataConsumerHandle::~SharedMemoryDataConsumerHandle() {
470 base::AutoLock lock(context_->lock()); 470 base::AutoLock lock(context_->lock());
471 context_->set_is_handle_active(false); 471 context_->set_is_handle_active(false);
472 context_->ClearIfNecessary(); 472 context_->ClearIfNecessary();
473 } 473 }
474 474
475 std::unique_ptr<blink::WebDataConsumerHandle::Reader> 475 std::unique_ptr<blink::WebDataConsumerHandle::Reader>
476 SharedMemoryDataConsumerHandle::ObtainReader(Client* client) { 476 SharedMemoryDataConsumerHandle::obtainReader(Client* client) {
477 return base::WrapUnique(obtainReaderInternal(client)); 477 return base::WrapUnique(new ReaderImpl(context_, client));
478 }
479
480 SharedMemoryDataConsumerHandle::ReaderImpl*
481 SharedMemoryDataConsumerHandle::obtainReaderInternal(Client* client) {
482 return new ReaderImpl(context_, client);
483 } 478 }
484 479
485 const char* SharedMemoryDataConsumerHandle::debugName() const { 480 const char* SharedMemoryDataConsumerHandle::debugName() const {
486 return "SharedMemoryDataConsumerHandle"; 481 return "SharedMemoryDataConsumerHandle";
487 } 482 }
488 483
489 } // namespace content 484 } // namespace content
OLDNEW
« no previous file with comments | « content/child/shared_memory_data_consumer_handle.h ('k') | content/child/shared_memory_data_consumer_handle_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698