OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "gpu/command_buffer/service/id_manager.h" | 5 #include "gpu/command_buffer/service/id_manager.h" |
6 #include "base/logging.h" | 6 #include "base/logging.h" |
7 | 7 |
8 namespace gpu { | 8 namespace gpu { |
9 namespace gles2 { | 9 namespace gles2 { |
10 | 10 |
| 11 IdManager::IdManager() {} |
| 12 |
| 13 IdManager::~IdManager() {} |
| 14 |
11 bool IdManager::AddMapping(GLuint client_id, GLuint service_id) { | 15 bool IdManager::AddMapping(GLuint client_id, GLuint service_id) { |
12 std::pair<MapType::iterator, bool> result = id_map_.insert( | 16 std::pair<MapType::iterator, bool> result = id_map_.insert( |
13 std::make_pair(client_id, service_id)); | 17 std::make_pair(client_id, service_id)); |
14 return result.second; | 18 return result.second; |
15 } | 19 } |
16 | 20 |
17 bool IdManager::RemoveMapping(GLuint client_id, GLuint service_id) { | 21 bool IdManager::RemoveMapping(GLuint client_id, GLuint service_id) { |
18 MapType::iterator iter = id_map_.find(client_id); | 22 MapType::iterator iter = id_map_.find(client_id); |
19 if (iter != id_map_.end() && iter->second == service_id) { | 23 if (iter != id_map_.end() && iter->second == service_id) { |
20 id_map_.erase(iter); | 24 id_map_.erase(iter); |
(...skipping 23 matching lines...) Expand all Loading... |
44 return true; | 48 return true; |
45 } | 49 } |
46 } | 50 } |
47 return false; | 51 return false; |
48 } | 52 } |
49 | 53 |
50 } // namespace gles2 | 54 } // namespace gles2 |
51 } // namespace gpu | 55 } // namespace gpu |
52 | 56 |
53 | 57 |
OLD | NEW |