| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/host/ppapi_host.h" | 5 #include "ppapi/host/ppapi_host.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ppapi/c/pp_errors.h" | 8 #include "ppapi/c/pp_errors.h" |
| 9 #include "ppapi/host/host_factory.h" | 9 #include "ppapi/host/host_factory.h" |
| 10 #include "ppapi/host/host_message_context.h" | 10 #include "ppapi/host/host_message_context.h" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 176 |
| 177 void PpapiHost::OnHostMsgResourceDestroyed(PP_Resource resource) { | 177 void PpapiHost::OnHostMsgResourceDestroyed(PP_Resource resource) { |
| 178 ResourceMap::iterator found = resources_.find(resource); | 178 ResourceMap::iterator found = resources_.find(resource); |
| 179 if (found == resources_.end()) { | 179 if (found == resources_.end()) { |
| 180 NOTREACHED(); | 180 NOTREACHED(); |
| 181 return; | 181 return; |
| 182 } | 182 } |
| 183 resources_.erase(found); | 183 resources_.erase(found); |
| 184 } | 184 } |
| 185 | 185 |
| 186 ResourceHost* PpapiHost::GetResourceHost(PP_Resource resource) { | 186 ResourceHost* PpapiHost::GetResourceHost(PP_Resource resource) const { |
| 187 ResourceMap::iterator found = resources_.find(resource); | 187 ResourceMap::const_iterator found = resources_.find(resource); |
| 188 return found == resources_.end() ? NULL : found->second.get(); | 188 return found == resources_.end() ? NULL : found->second.get(); |
| 189 } | 189 } |
| 190 | 190 |
| 191 } // namespace host | 191 } // namespace host |
| 192 } // namespace ppapi | 192 } // namespace ppapi |
| OLD | NEW |