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

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

Issue 1864293002: Convert //ppapi to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more nullptr Created 4 years, 8 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
« no previous file with comments | « ppapi/shared_impl/var_tracker.h ('k') | ppapi/thunk/ppb_instance_api.h » ('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) 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include <memory>
8
8 #include "ppapi/c/pp_errors.h" 9 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/c/private/ppb_flash_clipboard.h" 10 #include "ppapi/c/private/ppb_flash_clipboard.h"
10 #include "ppapi/thunk/enter.h" 11 #include "ppapi/thunk/enter.h"
11 #include "ppapi/thunk/ppb_flash_clipboard_api.h" 12 #include "ppapi/thunk/ppb_flash_clipboard_api.h"
12 #include "ppapi/thunk/thunk.h" 13 #include "ppapi/thunk/thunk.h"
13 14
14 namespace ppapi { 15 namespace ppapi {
15 namespace thunk { 16 namespace thunk {
16 17
17 namespace { 18 namespace {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 PP_Flash_Clipboard_Type clipboard_type, 66 PP_Flash_Clipboard_Type clipboard_type,
66 PP_Flash_Clipboard_Format format) { 67 PP_Flash_Clipboard_Format format) {
67 return ReadData(instance, clipboard_type, static_cast<uint32_t>(format)); 68 return ReadData(instance, clipboard_type, static_cast<uint32_t>(format));
68 } 69 }
69 70
70 int32_t WriteData_4_0(PP_Instance instance, 71 int32_t WriteData_4_0(PP_Instance instance,
71 PP_Flash_Clipboard_Type clipboard_type, 72 PP_Flash_Clipboard_Type clipboard_type,
72 uint32_t data_item_count, 73 uint32_t data_item_count,
73 const PP_Flash_Clipboard_Format formats[], 74 const PP_Flash_Clipboard_Format formats[],
74 const PP_Var data_items[]) { 75 const PP_Var data_items[]) {
75 scoped_ptr<uint32_t[]> new_formats(new uint32_t[data_item_count]); 76 std::unique_ptr<uint32_t[]> new_formats(new uint32_t[data_item_count]);
76 for (uint32_t i = 0; i < data_item_count; ++i) 77 for (uint32_t i = 0; i < data_item_count; ++i)
77 new_formats[i] = static_cast<uint32_t>(formats[i]); 78 new_formats[i] = static_cast<uint32_t>(formats[i]);
78 return WriteData(instance, clipboard_type, data_item_count, 79 return WriteData(instance, clipboard_type, data_item_count,
79 new_formats.get(), data_items); 80 new_formats.get(), data_items);
80 } 81 }
81 82
82 PP_Bool GetSequenceNumber(PP_Instance instance, 83 PP_Bool GetSequenceNumber(PP_Instance instance,
83 PP_Flash_Clipboard_Type clipboard_type, 84 PP_Flash_Clipboard_Type clipboard_type,
84 uint64_t* sequence_number) { 85 uint64_t* sequence_number) {
85 EnterInstanceAPI<PPB_Flash_Clipboard_API> enter(instance); 86 EnterInstanceAPI<PPB_Flash_Clipboard_API> enter(instance);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 const PPB_Flash_Clipboard_5_0* GetPPB_Flash_Clipboard_5_0_Thunk() { 120 const PPB_Flash_Clipboard_5_0* GetPPB_Flash_Clipboard_5_0_Thunk() {
120 return &g_ppb_flash_clipboard_thunk_5_0; 121 return &g_ppb_flash_clipboard_thunk_5_0;
121 } 122 }
122 123
123 const PPB_Flash_Clipboard_5_1* GetPPB_Flash_Clipboard_5_1_Thunk() { 124 const PPB_Flash_Clipboard_5_1* GetPPB_Flash_Clipboard_5_1_Thunk() {
124 return &g_ppb_flash_clipboard_thunk_5_1; 125 return &g_ppb_flash_clipboard_thunk_5_1;
125 } 126 }
126 127
127 } // namespace thunk 128 } // namespace thunk
128 } // namespace ppapi 129 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/shared_impl/var_tracker.h ('k') | ppapi/thunk/ppb_instance_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698