1 // Copyright (c) 2012 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 "base/supports_user_data.h"
9 SupportsUserData::SupportsUserData() {}
11 SupportsUserData::Data
* SupportsUserData::GetUserData(const void* key
) const {
12 DataMap::const_iterator found
= user_data_
.find(key
);
13 if (found
!= user_data_
.end())
14 return found
->second
.get();
18 void SupportsUserData::SetUserData(const void* key
, Data
* data
) {
19 user_data_
[key
] = linked_ptr
<Data
>(data
);
22 SupportsUserData::~SupportsUserData() {}