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

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

Issue 7621054: Don't use a scoped_refptr for StringVar::FromPPVar (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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/ppb_var_deprecated_proxy.cc ('k') | ppapi/proxy/ppp_messaging_proxy_test.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/ppb_var_proxy.h" 5 #include "ppapi/proxy/ppb_var_proxy.h"
6 6
7 #include "ppapi/c/pp_var.h" 7 #include "ppapi/c/pp_var.h"
8 #include "ppapi/c/ppb_var.h" 8 #include "ppapi/c/ppb_var.h"
9 #include "ppapi/proxy/plugin_resource_tracker.h" 9 #include "ppapi/proxy/plugin_resource_tracker.h"
10 #include "ppapi/proxy/plugin_var_tracker.h" 10 #include "ppapi/proxy/plugin_var_tracker.h"
(...skipping 12 matching lines...) Expand all
23 23
24 void ReleaseVar(PP_Var var) { 24 void ReleaseVar(PP_Var var) {
25 PluginResourceTracker::GetInstance()->var_tracker().ReleaseVar(var); 25 PluginResourceTracker::GetInstance()->var_tracker().ReleaseVar(var);
26 } 26 }
27 27
28 PP_Var VarFromUtf8(PP_Module module, const char* data, uint32_t len) { 28 PP_Var VarFromUtf8(PP_Module module, const char* data, uint32_t len) {
29 return StringVar::StringToPPVar(module, data, len); 29 return StringVar::StringToPPVar(module, data, len);
30 } 30 }
31 31
32 const char* VarToUtf8(PP_Var var, uint32_t* len) { 32 const char* VarToUtf8(PP_Var var, uint32_t* len) {
33 scoped_refptr<StringVar> str(StringVar::FromPPVar(var)); 33 StringVar* str = StringVar::FromPPVar(var);
34 if (str) { 34 if (str) {
35 *len = static_cast<uint32_t>(str->value().size()); 35 *len = static_cast<uint32_t>(str->value().size());
36 return str->value().c_str(); 36 return str->value().c_str();
37 } 37 }
38 *len = 0; 38 *len = 0;
39 return NULL; 39 return NULL;
40 } 40 }
41 41
42 const PPB_Var var_interface = { 42 const PPB_Var var_interface = {
43 &AddRefVar, 43 &AddRefVar,
(...skipping 30 matching lines...) Expand all
74 } 74 }
75 75
76 bool PPB_Var_Proxy::OnMessageReceived(const IPC::Message& msg) { 76 bool PPB_Var_Proxy::OnMessageReceived(const IPC::Message& msg) {
77 // All PPB_Var calls are handled locally; there is no need to send or receive 77 // All PPB_Var calls are handled locally; there is no need to send or receive
78 // messages here. 78 // messages here.
79 return false; 79 return false;
80 } 80 }
81 81
82 } // namespace proxy 82 } // namespace proxy
83 } // namespace ppapi 83 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_var_deprecated_proxy.cc ('k') | ppapi/proxy/ppp_messaging_proxy_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698