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

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

Issue 949293004: Add media router common classes and unittests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More typedef=>using conversions. 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_MEDIA_ROUTE_FACTORY_H_
6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTE_FACTORY_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 "chrome/browser/media/router/media_sink.h"
14 #include "chrome/browser/media/router/media_source.h"
15
16 namespace media_router {
17
18 class MediaRoute;
19
20 // Shared singleton which coordinates the assignment of unique IDs to
21 // MediaRoute objects.
22 class MediaRouteFactory {
23 public:
24 static MediaRouteFactory* GetInstance();
25
26 // Creates a MediaRoute object with a unique ID.
27 // |type|: Type of media route.
28 // |media_source|: Description of source of the route.
29 // |sink_id|: ID of the MediaSink of the route.
30 // |description|: Description of the route to be displayed.
31 // |is_local|: true if the route was created from this browser.
32 MediaRoute* Create(const MediaSource& media_source,
imcheng 2015/03/03 22:53:10 I think the fact that this returns a dynamically a
Kevin M 2015/03/03 23:28:05 Done.
mark a. foltz 2015/03/04 06:22:59 Doesn't look that way from my diff.
Kevin M 2015/03/04 23:33:32 I neglected to git cl upload. Sorry.
33 const MediaSinkId& sink_id,
34 const std::string& description,
35 bool is_local);
36
37 private:
38 FRIEND_TEST_ALL_PREFIXES(MediaRouteFactoryTest, Create);
39 friend struct DefaultSingletonTraits<MediaRouteFactory>;
40
41 MediaRouteFactory();
42
43 // Gets the next route ID.
44 std::string NextRouteId();
45
46 // Monotonically increasing ID number.
47 uint64 next_id_;
48
49 DISALLOW_COPY_AND_ASSIGN(MediaRouteFactory);
50 };
51
52 } // namespace media_router
53
54 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTE_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698