| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 void PpapiHost::OnHostMsgResourceDestroyed(PP_Resource resource) { | 143 void PpapiHost::OnHostMsgResourceDestroyed(PP_Resource resource) { |
| 144 ResourceMap::iterator found = resources_.find(resource); | 144 ResourceMap::iterator found = resources_.find(resource); |
| 145 if (found == resources_.end()) { | 145 if (found == resources_.end()) { |
| 146 NOTREACHED(); | 146 NOTREACHED(); |
| 147 return; | 147 return; |
| 148 } | 148 } |
| 149 resources_.erase(found); | 149 resources_.erase(found); |
| 150 } | 150 } |
| 151 | 151 |
| 152 ResourceHost* PpapiHost::GetResourceHost(PP_Resource resource) { | 152 ResourceHost* PpapiHost::GetResourceHost(PP_Resource resource) const { |
| 153 ResourceMap::iterator found = resources_.find(resource); | 153 ResourceMap::const_iterator found = resources_.find(resource); |
| 154 return found == resources_.end() ? NULL : found->second.get(); | 154 return found == resources_.end() ? NULL : found->second.get(); |
| 155 } | 155 } |
| 156 | 156 |
| 157 } // namespace host | 157 } // namespace host |
| 158 } // namespace ppapi | 158 } // namespace ppapi |
| OLD | NEW |