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

Side by Side Diff: webkit/plugins/ppapi/host_var_tracker.cc

Issue 8930010: Implement in-process PPB_VarArrayBuffer_Dev. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 9 years 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 | Annotate | Revision Log
« no previous file with comments | « webkit/plugins/ppapi/host_var_tracker.h ('k') | webkit/plugins/ppapi/message_channel.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "webkit/plugins/ppapi/host_var_tracker.h" 5 #include "webkit/plugins/ppapi/host_var_tracker.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ppapi/c/pp_var.h" 8 #include "ppapi/c/pp_var.h"
9 #include "webkit/plugins/ppapi/host_array_buffer_var.h"
9 #include "webkit/plugins/ppapi/npobject_var.h" 10 #include "webkit/plugins/ppapi/npobject_var.h"
10 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" 11 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
11 12
13 using ppapi::ArrayBufferVar;
12 using ppapi::NPObjectVar; 14 using ppapi::NPObjectVar;
13 15
14 namespace webkit { 16 namespace webkit {
15 namespace ppapi { 17 namespace ppapi {
16 18
17 HostVarTracker::HostVarTracker() { 19 HostVarTracker::HostVarTracker() {
18 } 20 }
19 21
20 HostVarTracker::~HostVarTracker() { 22 HostVarTracker::~HostVarTracker() {
21 } 23 }
22 24
25 ArrayBufferVar* HostVarTracker::CreateArrayBuffer(uint32 size_in_bytes) {
26 return new HostArrayBufferVar(size_in_bytes);
27 }
28
23 void HostVarTracker::AddNPObjectVar(NPObjectVar* object_var) { 29 void HostVarTracker::AddNPObjectVar(NPObjectVar* object_var) {
24 InstanceMap::iterator found_instance = instance_map_.find( 30 InstanceMap::iterator found_instance = instance_map_.find(
25 object_var->pp_instance()); 31 object_var->pp_instance());
26 if (found_instance == instance_map_.end()) { 32 if (found_instance == instance_map_.end()) {
27 // Lazily create the instance map. 33 // Lazily create the instance map.
28 DCHECK(object_var->pp_instance() != 0); 34 DCHECK(object_var->pp_instance() != 0);
29 found_instance = instance_map_.insert(std::make_pair( 35 found_instance = instance_map_.insert(std::make_pair(
30 object_var->pp_instance(), 36 object_var->pp_instance(),
31 linked_ptr<NPObjectToNPObjectVarMap>(new NPObjectToNPObjectVarMap))). 37 linked_ptr<NPObjectToNPObjectVarMap>(new NPObjectToNPObjectVarMap))).
32 first; 38 first;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 np_object_map->erase(current->first); 109 np_object_map->erase(current->first);
104 } 110 }
105 111
106 // Remove the record for this instance since it should be empty. 112 // Remove the record for this instance since it should be empty.
107 DCHECK(np_object_map->empty()); 113 DCHECK(np_object_map->empty());
108 instance_map_.erase(found_instance); 114 instance_map_.erase(found_instance);
109 } 115 }
110 116
111 } // namespace ppapi 117 } // namespace ppapi
112 } // namespace webkit 118 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/plugins/ppapi/host_var_tracker.h ('k') | webkit/plugins/ppapi/message_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698