diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-20 21:17:00 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-20 21:17:00 +0000 |
commit | a6d81c01451303b112e1cb7c8f2598356f348539 (patch) | |
tree | aef52b9b75522ea0ccab00925d1ca288bb1a6166 /ppapi/thunk | |
parent | 6810670b2e104cc67aefc9c53a41866aba4629b7 (diff) | |
download | chromium_src-a6d81c01451303b112e1cb7c8f2598356f348539.zip chromium_src-a6d81c01451303b112e1cb7c8f2598356f348539.tar.gz chromium_src-a6d81c01451303b112e1cb7c8f2598356f348539.tar.bz2 |
Convert pepper font list to new resource system.
This converts the GetFontFamilies call to the new resource system using a singleton resource.
BUG=
Review URL: https://codereview.chromium.org/11578038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174241 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/thunk')
-rw-r--r-- | ppapi/thunk/ppb_browser_font_singleton_api.h | 28 | ||||
-rw-r--r-- | ppapi/thunk/ppb_browser_font_trusted_thunk.cc | 3 | ||||
-rw-r--r-- | ppapi/thunk/ppb_instance_api.h | 3 |
3 files changed, 30 insertions, 4 deletions
diff --git a/ppapi/thunk/ppb_browser_font_singleton_api.h b/ppapi/thunk/ppb_browser_font_singleton_api.h new file mode 100644 index 0000000..0f31d25 --- /dev/null +++ b/ppapi/thunk/ppb_browser_font_singleton_api.h @@ -0,0 +1,28 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef PPAPI_THUNK_PPB_BROWSER_FONT_SINGLETON_API_H_
+#define PPAPI_THUNK_PPB_BROWSER_FONT_SINGLETON_API_H_
+
+#include "ppapi/c/pp_instance.h"
+#include "ppapi/c/pp_var.h"
+#include "ppapi/shared_impl/singleton_resource_id.h"
+
+namespace ppapi {
+namespace thunk {
+
+class PPB_BrowserFont_Singleton_API {
+ public:
+ virtual ~PPB_BrowserFont_Singleton_API() {}
+
+ virtual PP_Var GetFontFamilies(PP_Instance instance) = 0;
+
+ static const SingletonResourceID kSingletonResourceID =
+ BROWSER_FONT_SINGLETON_ID;
+};
+
+} // namespace thunk
+} // namespace ppapi
+
+#endif // PPAPI_THUNK_PPB_BROWSER_FONT_SINGLETON_API_H_
diff --git a/ppapi/thunk/ppb_browser_font_trusted_thunk.cc b/ppapi/thunk/ppb_browser_font_trusted_thunk.cc index bcbc798..5db8b84 100644 --- a/ppapi/thunk/ppb_browser_font_trusted_thunk.cc +++ b/ppapi/thunk/ppb_browser_font_trusted_thunk.cc @@ -4,6 +4,7 @@ #include "ppapi/thunk/thunk.h" #include "ppapi/thunk/enter.h" +#include "ppapi/thunk/ppb_browser_font_singleton_api.h" #include "ppapi/thunk/ppb_browser_font_trusted_api.h" #include "ppapi/thunk/resource_creation_api.h" @@ -15,7 +16,7 @@ namespace { typedef EnterResource<PPB_BrowserFont_Trusted_API> EnterBrowserFont; PP_Var GetFontFamilies(PP_Instance instance) { - EnterInstance enter(instance); + EnterInstanceAPI<PPB_BrowserFont_Singleton_API> enter(instance); if (enter.failed()) return PP_MakeUndefined(); return enter.functions()->GetFontFamilies(instance); diff --git a/ppapi/thunk/ppb_instance_api.h b/ppapi/thunk/ppb_instance_api.h index 0c53c8b..5dbc902 100644 --- a/ppapi/thunk/ppb_instance_api.h +++ b/ppapi/thunk/ppb_instance_api.h @@ -85,9 +85,6 @@ class PPB_Instance_API { virtual void SelectedFindResultChanged(PP_Instance instance, int32_t index) = 0; - // Font. - virtual PP_Var GetFontFamilies(PP_Instance instance) = 0; - // Fullscreen. virtual PP_Bool SetFullscreen(PP_Instance instance, PP_Bool fullscreen) = 0; |