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

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

Issue 15806016: Update ppapi/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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/serialized_var.cc ('k') | ppapi/proxy/url_loader_resource.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/truetype_font_singleton_resource.h" 5 #include "ppapi/proxy/truetype_font_singleton_resource.h"
6 6
7 #include "ppapi/proxy/ppapi_messages.h" 7 #include "ppapi/proxy/ppapi_messages.h"
8 #include "ppapi/proxy/serialized_structs.h" 8 #include "ppapi/proxy/serialized_structs.h"
9 #include "ppapi/shared_impl/array_writer.h" 9 #include "ppapi/shared_impl/array_writer.h"
10 #include "ppapi/shared_impl/ppapi_globals.h" 10 #include "ppapi/shared_impl/ppapi_globals.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 return PP_OK_COMPLETIONPENDING; 42 return PP_OK_COMPLETIONPENDING;
43 } 43 }
44 44
45 int32_t TrueTypeFontSingletonResource::GetFontsInFamily( 45 int32_t TrueTypeFontSingletonResource::GetFontsInFamily(
46 PP_Instance instance, 46 PP_Instance instance,
47 PP_Var family, 47 PP_Var family,
48 const PP_ArrayOutput& output, 48 const PP_ArrayOutput& output,
49 const scoped_refptr<TrackedCallback>& callback) { 49 const scoped_refptr<TrackedCallback>& callback) {
50 scoped_refptr<StringVar> family_var = StringVar::FromPPVar(family); 50 scoped_refptr<StringVar> family_var = StringVar::FromPPVar(family);
51 const uint32_t kMaxFamilySizeInBytes = 1024; 51 const uint32_t kMaxFamilySizeInBytes = 1024;
52 if (!family_var || family_var->value().size() > kMaxFamilySizeInBytes) 52 if (!family_var.get() || family_var->value().size() > kMaxFamilySizeInBytes)
53 return PP_ERROR_BADARGUMENT; 53 return PP_ERROR_BADARGUMENT;
54 Call<PpapiPluginMsg_TrueTypeFontSingleton_GetFontsInFamilyReply>(BROWSER, 54 Call<PpapiPluginMsg_TrueTypeFontSingleton_GetFontsInFamilyReply>(BROWSER,
55 PpapiHostMsg_TrueTypeFontSingleton_GetFontsInFamily(family_var->value()), 55 PpapiHostMsg_TrueTypeFontSingleton_GetFontsInFamily(family_var->value()),
56 base::Bind( 56 base::Bind(
57 &TrueTypeFontSingletonResource::OnPluginMsgGetFontsInFamilyComplete, 57 &TrueTypeFontSingletonResource::OnPluginMsgGetFontsInFamilyComplete,
58 this, callback, output)); 58 this, callback, output));
59 return PP_OK_COMPLETIONPENDING; 59 return PP_OK_COMPLETIONPENDING;
60 } 60 }
61 61
62 void TrueTypeFontSingletonResource::OnPluginMsgGetFontFamiliesComplete( 62 void TrueTypeFontSingletonResource::OnPluginMsgGetFontFamiliesComplete(
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 } 112 }
113 } else { 113 } else {
114 result = PP_ERROR_FAILED; 114 result = PP_ERROR_FAILED;
115 } 115 }
116 116
117 callback->Run(result); 117 callback->Run(result);
118 } 118 }
119 119
120 } // namespace proxy 120 } // namespace proxy
121 } // namespace ppapi 121 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/serialized_var.cc ('k') | ppapi/proxy/url_loader_resource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698