diff options
Diffstat (limited to 'components/gcm_driver/instance_id/instance_id_driver.h')
-rw-r--r-- | components/gcm_driver/instance_id/instance_id_driver.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/components/gcm_driver/instance_id/instance_id_driver.h b/components/gcm_driver/instance_id/instance_id_driver.h new file mode 100644 index 0000000..73d05b0 --- /dev/null +++ b/components/gcm_driver/instance_id/instance_id_driver.h @@ -0,0 +1,39 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_GCM_DRIVER_INSTANCE_ID_INSTANCE_ID_DRIVER_H_ +#define COMPONENTS_GCM_DRIVER_INSTANCE_ID_INSTANCE_ID_DRIVER_H_ + +#include <map> +#include <string> + +#include "base/macros.h" +#include "base/stl_util.h" + +namespace instance_id { + +class InstanceID; + +// Bridge between Instance ID users in Chrome and the platform-specific +// implementation. +class InstanceIDDriver { + public: + InstanceIDDriver(); + ~InstanceIDDriver(); + + // Returns the InstanceID that provides the Instance ID service for the given + // application. The lifetime of InstanceID will be managed by this class. + InstanceID* GetInstanceID(const std::string& app_id); + + private: + typedef std::map<std::string, InstanceID*> InstanceIDMap; + InstanceIDMap instance_id_map_; + STLValueDeleter<InstanceIDMap> instance_id_map_deleter_; + + DISALLOW_COPY_AND_ASSIGN(InstanceIDDriver); +}; + +} // namespace instance_id + +#endif // COMPONENTS_GCM_DRIVER_INSTANCE_ID_INSTANCE_ID_DRIVER_H_ |