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

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

Issue 9373032: PPAPI: Proxy VarArrayBuffer for out-of-process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge... again Created 8 years, 10 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 | « chrome/test/ui/ppapi_uitest.cc ('k') | ppapi/proxy/interface_list.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) 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 "ppapi/proxy/host_var_serialization_rules.h" 5 #include "ppapi/proxy/host_var_serialization_rules.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ppapi/c/ppb_var.h" 8 #include "ppapi/c/ppb_var.h"
9 #include "ppapi/shared_impl/ppapi_globals.h" 9 #include "ppapi/shared_impl/ppapi_globals.h"
10 #include "ppapi/shared_impl/var.h" 10 #include "ppapi/shared_impl/var.h"
(...skipping 17 matching lines...) Expand all
28 return var; 28 return var;
29 } 29 }
30 30
31 PP_Var HostVarSerializationRules::BeginReceiveCallerOwned( 31 PP_Var HostVarSerializationRules::BeginReceiveCallerOwned(
32 const PP_Var& var, 32 const PP_Var& var,
33 Dispatcher* /* dispatcher */) { 33 Dispatcher* /* dispatcher */) {
34 return var; 34 return var;
35 } 35 }
36 36
37 void HostVarSerializationRules::EndReceiveCallerOwned(const PP_Var& var) { 37 void HostVarSerializationRules::EndReceiveCallerOwned(const PP_Var& var) {
38 if (var.type == PP_VARTYPE_STRING) { 38 if (var.type != PP_VARTYPE_OBJECT && var.type >= PP_VARTYPE_STRING) {
39 // Destroy the string. 39 // Release our reference to the local Var.
40 PpapiGlobals::Get()->GetVarTracker()->ReleaseVar(var); 40 PpapiGlobals::Get()->GetVarTracker()->ReleaseVar(var);
41 } 41 }
42 } 42 }
43 43
44 PP_Var HostVarSerializationRules::ReceivePassRef( 44 PP_Var HostVarSerializationRules::ReceivePassRef(
45 const PP_Var& var, 45 const PP_Var& var,
46 Dispatcher* /* dispatcher */) { 46 Dispatcher* /* dispatcher */) {
47 // See PluginVarSerialization::BeginSendPassRef for an example. 47 // See PluginVarSerialization::BeginSendPassRef for an example.
48 if (var.type == PP_VARTYPE_OBJECT) 48 if (var.type == PP_VARTYPE_OBJECT)
49 PpapiGlobals::Get()->GetVarTracker()->AddRefVar(var); 49 PpapiGlobals::Get()->GetVarTracker()->AddRefVar(var);
50 return var; 50 return var;
51 } 51 }
52 52
53 PP_Var HostVarSerializationRules::BeginSendPassRef(const PP_Var& var) { 53 PP_Var HostVarSerializationRules::BeginSendPassRef(const PP_Var& var) {
54 return var; 54 return var;
55 } 55 }
56 56
57 void HostVarSerializationRules::EndSendPassRef(const PP_Var& /* var */, 57 void HostVarSerializationRules::EndSendPassRef(const PP_Var& /* var */,
58 Dispatcher* /* dispatcher */) { 58 Dispatcher* /* dispatcher */) {
59 // See PluginVarSerialization::ReceivePassRef for an example. We don't need 59 // See PluginVarSerialization::ReceivePassRef for an example. We don't need
60 // to do anything here. 60 // to do anything here.
61 } 61 }
62 62
63 void HostVarSerializationRules::ReleaseObjectRef(const PP_Var& var) { 63 void HostVarSerializationRules::ReleaseObjectRef(const PP_Var& var) {
64 PpapiGlobals::Get()->GetVarTracker()->ReleaseVar(var); 64 PpapiGlobals::Get()->GetVarTracker()->ReleaseVar(var);
65 } 65 }
66 66
67 } // namespace proxy 67 } // namespace proxy
68 } // namespace ppapi 68 } // namespace ppapi
OLDNEW
« no previous file with comments | « chrome/test/ui/ppapi_uitest.cc ('k') | ppapi/proxy/interface_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698