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

Side by Side Diff: chrome/browser/media/router/route_id_manager.h

Issue 949293004: Add media router common classes and unittests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review feedback. Created 5 years, 9 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_ROUTE_ID_MANAGER_H_
6 #define CHROME_BROWSER_MEDIA_ROUTER_ROUTE_ID_MANAGER_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "base/gtest_prod_util.h"
12 #include "base/memory/singleton.h"
13 #include "base/threading/non_thread_safe.h"
14
15 namespace media_router {
16
17 class MediaRoute;
18
19 // Shared singleton which coordinates the assignment of unique IDs to
20 // MediaRoute objects.
21 class RouteIDManager : public base::NonThreadSafe {
xhwang 2015/03/10 04:27:07 Is NonThreadSafe needed? You are not checking Call
Kevin M 2015/03/10 17:40:04 An omission that crept in when I rewrote this from
22 public:
23 static RouteIDManager* GetInstance();
24
25 std::string ForLocalRoute();
26
27 private:
28 FRIEND_TEST_ALL_PREFIXES(RouteIDManagerTest, ForLocalRoute);
29 friend struct DefaultSingletonTraits<RouteIDManager>;
30
31 RouteIDManager();
32
33 // Monotonically increasing ID number.
34 uint64 next_local_id_;
35
36 DISALLOW_COPY_AND_ASSIGN(RouteIDManager);
37 };
38
39 } // namespace media_router
40
41 #endif // CHROME_BROWSER_MEDIA_ROUTER_ROUTE_ID_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698