Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Side by Side Diff: content/plugin/plugin_channel_base.cc

Issue 7037027: Fixes Issues #5751 & #22631: NPObject identity (Closed)
Patch Set: hopefully added base url Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/plugin/plugin_channel_base.h" 5 #include "content/plugin/plugin_channel_base.h"
6 6
7 #include <stack> 7 #include <stack>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/hash_tables.h" 10 #include "base/hash_tables.h"
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 232
233 bool PluginChannelBase::OnControlMessageReceived(const IPC::Message& msg) { 233 bool PluginChannelBase::OnControlMessageReceived(const IPC::Message& msg) {
234 NOTREACHED() << 234 NOTREACHED() <<
235 "should override in subclass if you care about control messages"; 235 "should override in subclass if you care about control messages";
236 return false; 236 return false;
237 } 237 }
238 238
239 void PluginChannelBase::OnChannelError() { 239 void PluginChannelBase::OnChannelError() {
240 channel_valid_ = false; 240 channel_valid_ = false;
241 } 241 }
242
243 NPObject* PluginChannelBase::GetExistingNPObjectProxy(int route_id) {
244 ProxyMap::iterator iter = proxy_map_.find(route_id);
245 return iter != proxy_map_.end() ? iter->second : NULL;
246 }
247
248 int PluginChannelBase::GetExistingRouteForNPObjectStub(NPObject* npobject) {
249 StubMap::iterator iter = stub_map_.find(npobject);
250 return iter != stub_map_.end() ? iter->second : MSG_ROUTING_NONE;
251 }
252
253 void PluginChannelBase::AddMappingForNPObjectProxy(int route_id, NPObject* objec t) {
254 proxy_map_[route_id] = object;
255 }
256
257 void PluginChannelBase::AddMappingForNPObjectStub(int route_id, NPObject* object ) {
258 DCHECK(object != NULL);
259 stub_map_[object] = route_id;
260 }
261
262 void PluginChannelBase::RemoveMappingForNPObjectStub(int route_id, NPObject* obj ect) {
263 DCHECK(object != NULL);
264 stub_map_.erase(object);
265 }
266
267 void PluginChannelBase::RemoveMappingForNPObjectProxy(int route_id) {
268 proxy_map_.erase(route_id);
269 }
OLDNEW
« no previous file with comments | « content/plugin/plugin_channel_base.h ('k') | webkit/plugins/npapi/test/plugin_npobject_identity_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698