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.
5 #include "chrome/browser/media/router/route_id_manager.h"
7 #include "base/memory/singleton.h"
8 #include "base/strings/string_number_conversions.h"
9 #include "chrome/browser/media/router/media_route.h"
11 namespace media_router
{
13 const char kLocalRoutePrefix
[] = "route-local-";
15 RouteIDManager::RouteIDManager() : next_local_id_(0) {}
17 std::string
RouteIDManager::ForLocalRoute() {
18 DCHECK(CalledOnValidThread());
19 return kLocalRoutePrefix
+ base::Uint64ToString(next_local_id_
++);
23 RouteIDManager
* RouteIDManager::GetInstance() {
24 return Singleton
<RouteIDManager
>::get();
27 } // namespace media_router