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

Unified Diff: ppapi/thunk/ppb_flash_clipboard_thunk.cc

Issue 11359063: Refactor the way singleton-style resources are exposed via PPB_Instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: ppapi/thunk/ppb_flash_clipboard_thunk.cc
diff --git a/ppapi/thunk/ppb_flash_clipboard_thunk.cc b/ppapi/thunk/ppb_flash_clipboard_thunk.cc
index d982cd5a12dafa47ea67339bcfabda99b5e643c5..61c30160e1ab7d6b7ccbb0c427853af49c306511 100644
--- a/ppapi/thunk/ppb_flash_clipboard_thunk.cc
+++ b/ppapi/thunk/ppb_flash_clipboard_thunk.cc
@@ -16,31 +16,31 @@ namespace {
uint32_t RegisterCustomFormat(PP_Instance instance,
const char* format_name) {
- EnterInstance enter(instance);
+ EnterInstanceAPI<PPB_Flash_Clipboard_API> enter(instance,
+ FLASH_CLIPBOARD_SINGLETON_ID);
raymes 2012/11/20 21:14:59 Note that we could make this even easier by associ
raymes 2012/11/20 23:30:23 Done.
if (enter.failed())
return PP_FALSE;
- return enter.functions()->GetFlashClipboardAPI(
- instance)->RegisterCustomFormat(instance, format_name);
+ return enter.functions()->RegisterCustomFormat(instance, format_name);
}
PP_Bool IsFormatAvailable(PP_Instance instance,
PP_Flash_Clipboard_Type clipboard_type,
uint32_t format) {
- EnterInstance enter(instance);
+ EnterInstanceAPI<PPB_Flash_Clipboard_API> enter(instance,
+ FLASH_CLIPBOARD_SINGLETON_ID);
if (enter.failed())
return PP_FALSE;
- return enter.functions()->GetFlashClipboardAPI(
- instance)->IsFormatAvailable(instance, clipboard_type, format);
+ return enter.functions()->IsFormatAvailable(instance, clipboard_type, format);
}
PP_Var ReadData(PP_Instance instance,
PP_Flash_Clipboard_Type clipboard_type,
uint32_t format) {
- EnterInstance enter(instance);
+ EnterInstanceAPI<PPB_Flash_Clipboard_API> enter(instance,
+ FLASH_CLIPBOARD_SINGLETON_ID);
if (enter.failed())
return PP_MakeUndefined();
- return enter.functions()->GetFlashClipboardAPI(instance)->ReadData(
- instance, clipboard_type, format);
+ return enter.functions()->ReadData(instance, clipboard_type, format);
}
int32_t WriteData(PP_Instance instance,
@@ -48,10 +48,11 @@ int32_t WriteData(PP_Instance instance,
uint32_t data_item_count,
const uint32_t formats[],
const PP_Var data_items[]) {
- EnterInstance enter(instance);
+ EnterInstanceAPI<PPB_Flash_Clipboard_API> enter(instance,
+ FLASH_CLIPBOARD_SINGLETON_ID);
if (enter.failed())
return enter.retval();
- return enter.functions()->GetFlashClipboardAPI(instance)->WriteData(
+ return enter.functions()->WriteData(
instance, clipboard_type, data_item_count, formats, data_items);
}
« ppapi/thunk/enter.h ('K') | « ppapi/thunk/enter.h ('k') | ppapi/thunk/ppb_gamepad_thunk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698