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

Side by Side Diff: ppapi/proxy/plugin_var_serialization_rules.cc

Issue 6334016: Refactor PPAPI proxy resource handling to maintain which host they came from,... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « ppapi/proxy/plugin_var_serialization_rules.h ('k') | ppapi/proxy/plugin_var_tracker.h » ('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 "ppapi/proxy/plugin_var_serialization_rules.h" 5 #include "ppapi/proxy/plugin_var_serialization_rules.h"
6 6
7 #include "ppapi/proxy/plugin_dispatcher.h" 7 #include "ppapi/proxy/plugin_dispatcher.h"
8 #include "ppapi/proxy/plugin_var_tracker.h" 8 #include "ppapi/proxy/plugin_var_tracker.h"
9 9
10 namespace pp { 10 namespace pp {
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 111
112 // Objects need special translations to get the IDs valid in the host. 112 // Objects need special translations to get the IDs valid in the host.
113 if (var.type == PP_VARTYPE_OBJECT) 113 if (var.type == PP_VARTYPE_OBJECT)
114 return var_tracker_->GetHostObject(var); 114 return var_tracker_->GetHostObject(var);
115 115
116 if (var.type == PP_VARTYPE_STRING) 116 if (var.type == PP_VARTYPE_STRING)
117 *str_val = var_tracker_->GetString(var); 117 *str_val = var_tracker_->GetString(var);
118 return var; 118 return var;
119 } 119 }
120 120
121 void PluginVarSerializationRules::EndSendPassRef(const PP_Var& var) { 121 void PluginVarSerializationRules::EndSendPassRef(const PP_Var& var,
122 Dispatcher* dispatcher) {
122 // See BeginSendPassRef for an example of why we release our ref here. 123 // See BeginSendPassRef for an example of why we release our ref here.
124 // The var we have in our inner class has been converted to a host object
125 // by BeginSendPassRef. This means it's not a normal var valid in the plugin,
126 // so we need to use the special ReleaseHostObject.
123 if (var.type == PP_VARTYPE_OBJECT) 127 if (var.type == PP_VARTYPE_OBJECT)
124 var_tracker_->Release(var); 128 var_tracker_->ReleaseHostObject(dispatcher, var);
125 } 129 }
126 130
127 void PluginVarSerializationRules::ReleaseObjectRef(const PP_Var& var) { 131 void PluginVarSerializationRules::ReleaseObjectRef(const PP_Var& var) {
128 var_tracker_->Release(var); 132 var_tracker_->Release(var);
129 } 133 }
130 134
131 } // namespace proxy 135 } // namespace proxy
132 } // namespace pp 136 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/proxy/plugin_var_serialization_rules.h ('k') | ppapi/proxy/plugin_var_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698