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 "content/renderer/pepper/host_var_tracker.h" | 5 #include "content/renderer/pepper/host_var_tracker.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "content/renderer/pepper/host_array_buffer_var.h" | 8 #include "content/renderer/pepper/host_array_buffer_var.h" |
9 #include "content/renderer/pepper/host_resource_var.h" | 9 #include "content/renderer/pepper/host_resource_var.h" |
10 #include "content/renderer/pepper/npobject_var.h" | 10 #include "content/renderer/pepper/npobject_var.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
96 | 96 |
97 int HostVarTracker::GetLiveNPObjectVarsForInstance(PP_Instance instance) const { | 97 int HostVarTracker::GetLiveNPObjectVarsForInstance(PP_Instance instance) const { |
98 CheckThreadingPreconditions(); | 98 CheckThreadingPreconditions(); |
99 | 99 |
100 InstanceMap::const_iterator found = instance_map_.find(instance); | 100 InstanceMap::const_iterator found = instance_map_.find(instance); |
101 if (found == instance_map_.end()) | 101 if (found == instance_map_.end()) |
102 return 0; | 102 return 0; |
103 return static_cast<int>(found->second->size()); | 103 return static_cast<int>(found->second->size()); |
104 } | 104 } |
105 | 105 |
106 PP_Var HostVarTracker::MakeResourcePPVar(const IPC::Message& creation_message, | |
107 int pending_renderer_id, | |
108 int pending_browser_id, | |
109 PP_Instance instance) { | |
110 return VarTracker::MakeResourcePPVar(0); | |
raymes
2013/10/30 06:31:51
Should this be NOTREACHED?
Matt Giuca
2013/10/30 07:00:39
Well, it's technically valid to call this -- on th
| |
111 } | |
112 | |
106 ppapi::ResourceVar* HostVarTracker::MakeResourceVar(PP_Resource pp_resource) { | 113 ppapi::ResourceVar* HostVarTracker::MakeResourceVar(PP_Resource pp_resource) { |
107 return new HostResourceVar(pp_resource); | 114 return new HostResourceVar(pp_resource); |
108 } | 115 } |
109 | 116 |
110 void HostVarTracker::DidDeleteInstance(PP_Instance instance) { | 117 void HostVarTracker::DidDeleteInstance(PP_Instance instance) { |
111 CheckThreadingPreconditions(); | 118 CheckThreadingPreconditions(); |
112 | 119 |
113 InstanceMap::iterator found_instance = instance_map_.find(instance); | 120 InstanceMap::iterator found_instance = instance_map_.find(instance); |
114 if (found_instance == instance_map_.end()) | 121 if (found_instance == instance_map_.end()) |
115 return; // Nothing to do. | 122 return; // Nothing to do. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
167 if (it->second.instance != instance) | 174 if (it->second.instance != instance) |
168 return false; | 175 return false; |
169 | 176 |
170 *handle = it->second.handle; | 177 *handle = it->second.handle; |
171 *size_in_bytes = it->second.size_in_bytes; | 178 *size_in_bytes = it->second.size_in_bytes; |
172 shared_memory_map_.erase(it); | 179 shared_memory_map_.erase(it); |
173 return true; | 180 return true; |
174 } | 181 } |
175 | 182 |
176 } // namespace content | 183 } // namespace content |
OLD | NEW |