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

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

Issue 9139054: Revert 117399 - Make it possible to have 1 PpapiGlobals per thread. Update unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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_resource_tracker.cc ('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) 2012 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 "base/logging.h" 7 #include "base/logging.h"
8 #include "ppapi/proxy/plugin_dispatcher.h" 8 #include "ppapi/proxy/plugin_dispatcher.h"
9 #include "ppapi/proxy/plugin_globals.h" 9 #include "ppapi/proxy/plugin_globals.h"
10 #include "ppapi/proxy/plugin_resource_tracker.h" 10 #include "ppapi/proxy/plugin_resource_tracker.h"
11 #include "ppapi/proxy/plugin_var_tracker.h" 11 #include "ppapi/proxy/plugin_var_tracker.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 // Browser calls BeginSendPassRef 3 2 0 1 78 // Browser calls BeginSendPassRef 3 2 0 1
79 // Plugin calls ReceivePassRef 4 1 1 1 79 // Plugin calls ReceivePassRef 4 1 1 1
80 // Browser calls EndSendPassRef 4 1 1 1 80 // Browser calls EndSendPassRef 4 1 1 1
81 // 81 //
82 // In example 1 before the send, the plugin has 3 refs which are represented 82 // In example 1 before the send, the plugin has 3 refs which are represented
83 // as one ref in the browser (since the plugin only tells the browser when 83 // as one ref in the browser (since the plugin only tells the browser when
84 // it's refcount goes from 1 -> 0). The initial state is that the browser 84 // it's refcount goes from 1 -> 0). The initial state is that the browser
85 // plugin code started to return a value, which means it gets another ref 85 // plugin code started to return a value, which means it gets another ref
86 // on behalf of the caller. This needs to be transferred to the plugin and 86 // on behalf of the caller. This needs to be transferred to the plugin and
87 // folded in to its set of refs it maintains (with one ref representing all 87 // folded in to its set of refs it maintains (with one ref representing all
88 // of them in the browser). 88 // fo them in the browser).
89 if (var.type == PP_VARTYPE_OBJECT) { 89 if (var.type == PP_VARTYPE_OBJECT) {
90 DCHECK(dispatcher->IsPlugin()); 90 DCHECK(dispatcher->IsPlugin());
91 return var_tracker_->ReceiveObjectPassRef( 91 return var_tracker_->ReceiveObjectPassRef(
92 var, static_cast<PluginDispatcher*>(dispatcher)); 92 var, static_cast<PluginDispatcher*>(dispatcher));
93 } 93 }
94 94
95 // Other types are unchanged. 95 // Other types are unchanged.
96 return var; 96 return var;
97 } 97 }
98 98
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 var_tracker_->ReleaseVar(var); 140 var_tracker_->ReleaseVar(var);
141 } 141 }
142 } 142 }
143 143
144 void PluginVarSerializationRules::ReleaseObjectRef(const PP_Var& var) { 144 void PluginVarSerializationRules::ReleaseObjectRef(const PP_Var& var) {
145 var_tracker_->ReleaseVar(var); 145 var_tracker_->ReleaseVar(var);
146 } 146 }
147 147
148 } // namespace proxy 148 } // namespace proxy
149 } // namespace ppapi 149 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/plugin_resource_tracker.cc ('k') | ppapi/proxy/plugin_var_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698