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

Side by Side Diff: mojo/edk/system/dispatcher_unittest.cc

Issue 1396783004: Convert mojo::system::ChannelEndpointClient to use our new refcounting stuff (instead of base's). (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « mojo/edk/system/data_pipe_producer_dispatcher.cc ('k') | mojo/edk/system/endpoint_relayer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "mojo/edk/system/dispatcher.h" 5 #include "mojo/edk/system/dispatcher.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
(...skipping 10 matching lines...) Expand all
21 namespace { 21 namespace {
22 22
23 // Trivial subclass that makes the constructor public. 23 // Trivial subclass that makes the constructor public.
24 class TrivialDispatcher final : public Dispatcher { 24 class TrivialDispatcher final : public Dispatcher {
25 public: 25 public:
26 TrivialDispatcher() {} 26 TrivialDispatcher() {}
27 27
28 Type GetType() const override { return Type::UNKNOWN; } 28 Type GetType() const override { return Type::UNKNOWN; }
29 29
30 private: 30 private:
31 friend class base::RefCountedThreadSafe<TrivialDispatcher>;
32 ~TrivialDispatcher() override {} 31 ~TrivialDispatcher() override {}
33 32
34 scoped_refptr<Dispatcher> CreateEquivalentDispatcherAndCloseImplNoLock() 33 scoped_refptr<Dispatcher> CreateEquivalentDispatcherAndCloseImplNoLock()
35 override { 34 override {
36 mutex().AssertHeld(); 35 mutex().AssertHeld();
37 return scoped_refptr<Dispatcher>(new TrivialDispatcher()); 36 return scoped_refptr<Dispatcher>(new TrivialDispatcher());
38 } 37 }
39 38
40 MOJO_DISALLOW_COPY_AND_ASSIGN(TrivialDispatcher); 39 MOJO_DISALLOW_COPY_AND_ASSIGN(TrivialDispatcher);
41 }; 40 };
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 event.Signal(); 296 event.Signal();
298 } // Joins all the threads. 297 } // Joins all the threads.
299 298
300 EXPECT_EQ(MOJO_RESULT_OK, d->Close()); 299 EXPECT_EQ(MOJO_RESULT_OK, d->Close());
301 } 300 }
302 } 301 }
303 302
304 } // namespace 303 } // namespace
305 } // namespace system 304 } // namespace system
306 } // namespace mojo 305 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/data_pipe_producer_dispatcher.cc ('k') | mojo/edk/system/endpoint_relayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698