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

Side by Side Diff: ppapi/thunk/ppb_flash_clipboard_thunk.cc

Issue 136183002: Add GetSequenceNumber function to PPB_Flash_Clipboard (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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/thunk/ppb_flash_clipboard_api.h ('k') | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "ppapi/c/pp_errors.h" 6 #include "ppapi/c/pp_errors.h"
7 #include "ppapi/c/private/ppb_flash_clipboard.h" 7 #include "ppapi/c/private/ppb_flash_clipboard.h"
8 #include "ppapi/thunk/enter.h" 8 #include "ppapi/thunk/enter.h"
9 #include "ppapi/thunk/ppb_flash_clipboard_api.h" 9 #include "ppapi/thunk/ppb_flash_clipboard_api.h"
10 #include "ppapi/thunk/thunk.h" 10 #include "ppapi/thunk/thunk.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 uint32_t data_item_count, 70 uint32_t data_item_count,
71 const PP_Flash_Clipboard_Format formats[], 71 const PP_Flash_Clipboard_Format formats[],
72 const PP_Var data_items[]) { 72 const PP_Var data_items[]) {
73 scoped_ptr<uint32_t[]> new_formats(new uint32_t[data_item_count]); 73 scoped_ptr<uint32_t[]> new_formats(new uint32_t[data_item_count]);
74 for (uint32_t i = 0; i < data_item_count; ++i) 74 for (uint32_t i = 0; i < data_item_count; ++i)
75 new_formats[i] = static_cast<uint32_t>(formats[i]); 75 new_formats[i] = static_cast<uint32_t>(formats[i]);
76 return WriteData(instance, clipboard_type, data_item_count, 76 return WriteData(instance, clipboard_type, data_item_count,
77 new_formats.get(), data_items); 77 new_formats.get(), data_items);
78 } 78 }
79 79
80 PP_Bool GetSequenceNumber(PP_Instance instance,
81 PP_Flash_Clipboard_Type clipboard_type,
82 uint64_t* sequence_number) {
83 EnterInstanceAPI<PPB_Flash_Clipboard_API> enter(instance);
84 if (enter.failed())
85 return PP_FALSE;
86 return enter.functions()->GetSequenceNumber(instance, clipboard_type,
87 sequence_number);
88 }
89
80 const PPB_Flash_Clipboard_4_0 g_ppb_flash_clipboard_thunk_4_0 = { 90 const PPB_Flash_Clipboard_4_0 g_ppb_flash_clipboard_thunk_4_0 = {
81 &IsFormatAvailable_4_0, 91 &IsFormatAvailable_4_0,
82 &ReadData_4_0, 92 &ReadData_4_0,
83 &WriteData_4_0 93 &WriteData_4_0
84 }; 94 };
85 95
86 const PPB_Flash_Clipboard_5_0 g_ppb_flash_clipboard_thunk_5_0 = { 96 const PPB_Flash_Clipboard_5_0 g_ppb_flash_clipboard_thunk_5_0 = {
87 &RegisterCustomFormat, 97 &RegisterCustomFormat,
88 &IsFormatAvailable, 98 &IsFormatAvailable,
89 &ReadData, 99 &ReadData,
90 &WriteData 100 &WriteData
91 }; 101 };
92 102
103 const PPB_Flash_Clipboard_5_1 g_ppb_flash_clipboard_thunk_5_1 = {
104 &RegisterCustomFormat,
105 &IsFormatAvailable,
106 &ReadData,
107 &WriteData,
108 &GetSequenceNumber
109 };
110
93 } // namespace 111 } // namespace
94 112
95 const PPB_Flash_Clipboard_4_0* GetPPB_Flash_Clipboard_4_0_Thunk() { 113 const PPB_Flash_Clipboard_4_0* GetPPB_Flash_Clipboard_4_0_Thunk() {
96 return &g_ppb_flash_clipboard_thunk_4_0; 114 return &g_ppb_flash_clipboard_thunk_4_0;
97 } 115 }
98 116
99 const PPB_Flash_Clipboard_5_0* GetPPB_Flash_Clipboard_5_0_Thunk() { 117 const PPB_Flash_Clipboard_5_0* GetPPB_Flash_Clipboard_5_0_Thunk() {
100 return &g_ppb_flash_clipboard_thunk_5_0; 118 return &g_ppb_flash_clipboard_thunk_5_0;
101 } 119 }
102 120
121 const PPB_Flash_Clipboard_5_1* GetPPB_Flash_Clipboard_5_1_Thunk() {
122 return &g_ppb_flash_clipboard_thunk_5_1;
123 }
124
103 } // namespace thunk 125 } // namespace thunk
104 } // namespace ppapi 126 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/thunk/ppb_flash_clipboard_api.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698