OLD | NEW |
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 Loading... |
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 |
OLD | NEW |