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

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

Issue 8826011: Remove PP_Module from parameters for PPB_Var.VarFromUtf8. (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 | « ppapi/proxy/interface_list.cc ('k') | ppapi/proxy/ppb_flash_proxy.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 "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"
(...skipping 26 matching lines...) Expand all
37 NOTREACHED() << "Trying to send unknown string over IPC."; 37 NOTREACHED() << "Trying to send unknown string over IPC.";
38 } 38 }
39 return var; 39 return var;
40 } 40 }
41 41
42 PP_Var PluginVarSerializationRules::BeginReceiveCallerOwned( 42 PP_Var PluginVarSerializationRules::BeginReceiveCallerOwned(
43 const PP_Var& var, 43 const PP_Var& var,
44 const std::string* str_val, 44 const std::string* str_val,
45 Dispatcher* dispatcher) { 45 Dispatcher* dispatcher) {
46 if (var.type == PP_VARTYPE_STRING) 46 if (var.type == PP_VARTYPE_STRING)
47 return StringVar::StringToPPVar(0, *str_val); 47 return StringVar::StringToPPVar(*str_val);
48 48
49 if (var.type == PP_VARTYPE_OBJECT) { 49 if (var.type == PP_VARTYPE_OBJECT) {
50 DCHECK(dispatcher->IsPlugin()); 50 DCHECK(dispatcher->IsPlugin());
51 return var_tracker_->TrackObjectWithNoReference( 51 return var_tracker_->TrackObjectWithNoReference(
52 var, static_cast<PluginDispatcher*>(dispatcher)); 52 var, static_cast<PluginDispatcher*>(dispatcher));
53 } 53 }
54 54
55 return var; 55 return var;
56 } 56 }
57 57
58 void PluginVarSerializationRules::EndReceiveCallerOwned(const PP_Var& var) { 58 void PluginVarSerializationRules::EndReceiveCallerOwned(const PP_Var& var) {
59 if (var.type == PP_VARTYPE_STRING) { 59 if (var.type == PP_VARTYPE_STRING) {
60 // Destroy the string BeginReceiveCallerOwned created above. 60 // Destroy the string BeginReceiveCallerOwned created above.
61 var_tracker_->ReleaseVar(var); 61 var_tracker_->ReleaseVar(var);
62 } else if (var.type == PP_VARTYPE_OBJECT) { 62 } else if (var.type == PP_VARTYPE_OBJECT) {
63 var_tracker_->StopTrackingObjectWithNoReference(var); 63 var_tracker_->StopTrackingObjectWithNoReference(var);
64 } 64 }
65 } 65 }
66 66
67 PP_Var PluginVarSerializationRules::ReceivePassRef(const PP_Var& var, 67 PP_Var PluginVarSerializationRules::ReceivePassRef(const PP_Var& var,
68 const std::string& str_val, 68 const std::string& str_val,
69 Dispatcher* dispatcher) { 69 Dispatcher* dispatcher) {
70 if (var.type == PP_VARTYPE_STRING) 70 if (var.type == PP_VARTYPE_STRING)
71 return StringVar::StringToPPVar(0, str_val); 71 return StringVar::StringToPPVar(str_val);
72 72
73 // Overview of sending an object with "pass ref" from the browser to the 73 // Overview of sending an object with "pass ref" from the browser to the
74 // plugin: 74 // plugin:
75 // Example 1 Example 2 75 // Example 1 Example 2
76 // Plugin Browser Plugin Browser 76 // Plugin Browser Plugin Browser
77 // Before send 3 2 0 1 77 // Before send 3 2 0 1
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 //
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 static_cast<PluginDispatcher*>(dispatcher), var); 138 static_cast<PluginDispatcher*>(dispatcher), var);
139 } 139 }
140 } 140 }
141 141
142 void PluginVarSerializationRules::ReleaseObjectRef(const PP_Var& var) { 142 void PluginVarSerializationRules::ReleaseObjectRef(const PP_Var& var) {
143 var_tracker_->ReleaseVar(var); 143 var_tracker_->ReleaseVar(var);
144 } 144 }
145 145
146 } // namespace proxy 146 } // namespace proxy
147 } // namespace ppapi 147 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/interface_list.cc ('k') | ppapi/proxy/ppb_flash_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698