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

Side by Side Diff: components/gcm_driver/instance_id/instance_id_driver.h

Issue 1096983002: Update usages of std::map to use ScopedPtrMap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@passwordmanager-scopedmemory
Patch Set: Rebase. Created 5 years, 5 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 #ifndef COMPONENTS_GCM_DRIVER_INSTANCE_ID_INSTANCE_ID_DRIVER_H_ 5 #ifndef COMPONENTS_GCM_DRIVER_INSTANCE_ID_INSTANCE_ID_DRIVER_H_
6 #define COMPONENTS_GCM_DRIVER_INSTANCE_ID_INSTANCE_ID_DRIVER_H_ 6 #define COMPONENTS_GCM_DRIVER_INSTANCE_ID_INSTANCE_ID_DRIVER_H_
7 7
8 #include <map>
9 #include <string> 8 #include <string>
10 9
10 #include "base/containers/scoped_ptr_map.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/stl_util.h" 12 #include "base/memory/scoped_ptr.h"
13 13
14 namespace gcm { 14 namespace gcm {
15 class GCMDriver; 15 class GCMDriver;
16 } // namespace gcm 16 } // namespace gcm
17 17
18 namespace instance_id { 18 namespace instance_id {
19 19
20 class InstanceID; 20 class InstanceID;
21 21
22 // Bridge between Instance ID users in Chrome and the platform-specific 22 // Bridge between Instance ID users in Chrome and the platform-specific
(...skipping 13 matching lines...) Expand all
36 // Removes the InstanceID when it is not longer needed, i.e. the app is being 36 // Removes the InstanceID when it is not longer needed, i.e. the app is being
37 // uninstalled. 37 // uninstalled.
38 void RemoveInstanceID(const std::string& app_id); 38 void RemoveInstanceID(const std::string& app_id);
39 39
40 // Returns true if the InstanceID for the given application has been created. 40 // Returns true if the InstanceID for the given application has been created.
41 // This is currently only used for testing purpose. 41 // This is currently only used for testing purpose.
42 bool ExistsInstanceID(const std::string& app_id) const; 42 bool ExistsInstanceID(const std::string& app_id) const;
43 43
44 private: 44 private:
45 gcm::GCMDriver* gcm_driver_; // Not owned. 45 gcm::GCMDriver* gcm_driver_; // Not owned.
46 typedef std::map<std::string, InstanceID*> InstanceIDMap; 46 base::ScopedPtrMap<std::string, scoped_ptr<InstanceID>> instance_id_map_;
47 InstanceIDMap instance_id_map_;
48 STLValueDeleter<InstanceIDMap> instance_id_map_deleter_;
49 47
50 DISALLOW_COPY_AND_ASSIGN(InstanceIDDriver); 48 DISALLOW_COPY_AND_ASSIGN(InstanceIDDriver);
51 }; 49 };
52 50
53 } // namespace instance_id 51 } // namespace instance_id
54 52
55 #endif // COMPONENTS_GCM_DRIVER_INSTANCE_ID_INSTANCE_ID_DRIVER_H_ 53 #endif // COMPONENTS_GCM_DRIVER_INSTANCE_ID_INSTANCE_ID_DRIVER_H_
OLDNEW
« no previous file with comments | « components/gcm_driver/instance_id/instance_id_android.cc ('k') | components/gcm_driver/instance_id/instance_id_driver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698