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 "ppapi/shared_impl/callback_tracker.h" | 5 #include "ppapi/shared_impl/callback_tracker.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
13 #include "ppapi/c/pp_completion_callback.h" | 13 #include "ppapi/c/pp_completion_callback.h" |
14 #include "ppapi/shared_impl/tracked_callback.h" | 14 #include "ppapi/shared_impl/tracked_callback.h" |
15 | 15 |
16 namespace ppapi { | 16 namespace ppapi { |
17 | 17 |
18 // CallbackTracker ------------------------------------------------------------- | 18 // CallbackTracker ------------------------------------------------------------- |
19 | 19 |
20 CallbackTracker::CallbackTracker() { | 20 CallbackTracker::CallbackTracker() { |
21 } | 21 } |
22 | 22 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 CallbackSet::iterator it = map_it->second.find(tracked_callback); | 66 CallbackSet::iterator it = map_it->second.find(tracked_callback); |
67 DCHECK(it != map_it->second.end()); | 67 DCHECK(it != map_it->second.end()); |
68 map_it->second.erase(it); | 68 map_it->second.erase(it); |
69 | 69 |
70 // If there are no pending callbacks left for this ID, get rid of the entry. | 70 // If there are no pending callbacks left for this ID, get rid of the entry. |
71 if (map_it->second.empty()) | 71 if (map_it->second.empty()) |
72 pending_callbacks_.erase(map_it); | 72 pending_callbacks_.erase(map_it); |
73 } | 73 } |
74 | 74 |
75 } // namespace ppapi | 75 } // namespace ppapi |
OLD | NEW |