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

Side by Side Diff: ppapi/proxy/flash_clipboard_resource.cc

Issue 915403003: Enable size_t to int truncation warnings in PPAPI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
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 "ppapi/proxy/flash_clipboard_resource.h" 5 #include "ppapi/proxy/flash_clipboard_resource.h"
6 6
7 #include "ipc/ipc_message.h" 7 #include "ipc/ipc_message.h"
8 #include "ppapi/c/pp_errors.h" 8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/proxy/ppapi_messages.h" 9 #include "ppapi/proxy/ppapi_messages.h"
10 #include "ppapi/shared_impl/ppapi_globals.h" 10 #include "ppapi/shared_impl/ppapi_globals.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 } 46 }
47 47
48 PP_Var ClipboardStringToPPVar(int32_t format, 48 PP_Var ClipboardStringToPPVar(int32_t format,
49 const std::string& string) { 49 const std::string& string) {
50 if (format == PP_FLASH_CLIPBOARD_FORMAT_PLAINTEXT || 50 if (format == PP_FLASH_CLIPBOARD_FORMAT_PLAINTEXT ||
51 format == PP_FLASH_CLIPBOARD_FORMAT_HTML) { 51 format == PP_FLASH_CLIPBOARD_FORMAT_HTML) {
52 return StringVar::StringToPPVar(string); 52 return StringVar::StringToPPVar(string);
53 } else { 53 } else {
54 // All other formats are expected to be array buffers. 54 // All other formats are expected to be array buffers.
55 return PpapiGlobals::Get()->GetVarTracker()->MakeArrayBufferPPVar( 55 return PpapiGlobals::Get()->GetVarTracker()->MakeArrayBufferPPVar(
56 string.size(), string.data()); 56 static_cast<uint32_t>(string.size()), string.data());
57 } 57 }
58 } 58 }
59 } // namespace 59 } // namespace
60 60
61 FlashClipboardResource::FlashClipboardResource( 61 FlashClipboardResource::FlashClipboardResource(
62 Connection connection, PP_Instance instance) 62 Connection connection, PP_Instance instance)
63 : PluginResource(connection, instance) { 63 : PluginResource(connection, instance) {
64 SendCreate(BROWSER, PpapiHostMsg_FlashClipboard_Create()); 64 SendCreate(BROWSER, PpapiHostMsg_FlashClipboard_Create());
65 } 65 }
66 66
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 int32_t result = 159 int32_t result =
160 SyncCall<PpapiPluginMsg_FlashClipboard_GetSequenceNumberReply>( 160 SyncCall<PpapiPluginMsg_FlashClipboard_GetSequenceNumberReply>(
161 BROWSER, 161 BROWSER,
162 PpapiHostMsg_FlashClipboard_GetSequenceNumber(clipboard_type), 162 PpapiHostMsg_FlashClipboard_GetSequenceNumber(clipboard_type),
163 sequence_number); 163 sequence_number);
164 return PP_FromBool(result == PP_OK); 164 return PP_FromBool(result == PP_OK);
165 } 165 }
166 166
167 } // namespace proxy 167 } // namespace proxy
168 } // namespace ppapi 168 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698