OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 /* | 5 /* |
6 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
7 * Copyright (C) 2009 Holger Hans Peter Freyther | 7 * Copyright (C) 2009 Holger Hans Peter Freyther |
8 * Copyright (C) 2010 Collabora Ltd. | 8 * Copyright (C) 2010 Collabora Ltd. |
9 * | 9 * |
10 * Redistribution and use in source and binary forms, with or without | 10 * Redistribution and use in source and binary forms, with or without |
(...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1167 } | 1167 } |
1168 | 1168 |
1169 static bool invalidateRect(PluginObject* obj, | 1169 static bool invalidateRect(PluginObject* obj, |
1170 const NPVariant* args, | 1170 const NPVariant* args, |
1171 uint32_t argCount, | 1171 uint32_t argCount, |
1172 NPVariant* result) { | 1172 NPVariant* result) { |
1173 if (argCount != 4) | 1173 if (argCount != 4) |
1174 return false; | 1174 return false; |
1175 | 1175 |
1176 NPRect rect; | 1176 NPRect rect; |
1177 rect.left = static_cast<int>(NPVARIANT_TO_DOUBLE(args[0])); | 1177 rect.left = static_cast<uint16_t>(NPVARIANT_TO_DOUBLE(args[0])); |
1178 rect.top = static_cast<int>(NPVARIANT_TO_DOUBLE(args[1])); | 1178 rect.top = static_cast<uint16_t>(NPVARIANT_TO_DOUBLE(args[1])); |
1179 rect.right = static_cast<int>(NPVARIANT_TO_DOUBLE(args[2])); | 1179 rect.right = static_cast<uint16_t>(NPVARIANT_TO_DOUBLE(args[2])); |
1180 rect.bottom = static_cast<int>(NPVARIANT_TO_DOUBLE(args[3])); | 1180 rect.bottom = static_cast<uint16_t>(NPVARIANT_TO_DOUBLE(args[3])); |
1181 | 1181 |
1182 browser->invalidaterect(obj->npp, &rect); | 1182 browser->invalidaterect(obj->npp, &rect); |
1183 return true; | 1183 return true; |
1184 } | 1184 } |
1185 | 1185 |
1186 static bool objectsAreSame(PluginObject* obj, | 1186 static bool objectsAreSame(PluginObject* obj, |
1187 const NPVariant* args, | 1187 const NPVariant* args, |
1188 uint32_t argCount, | 1188 uint32_t argCount, |
1189 NPVariant* result) { | 1189 NPVariant* result) { |
1190 if (argCount != 2 || !NPVARIANT_IS_OBJECT(args[0]) || | 1190 if (argCount != 2 || !NPVARIANT_IS_OBJECT(args[0]) || |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1475 DOUBLE_TO_NPVARIANT(242.242, args[4]); | 1475 DOUBLE_TO_NPVARIANT(242.242, args[4]); |
1476 STRINGZ_TO_NPVARIANT("Hello, World", args[5]); | 1476 STRINGZ_TO_NPVARIANT("Hello, World", args[5]); |
1477 OBJECT_TO_NPVARIANT(windowScriptObject, args[6]); | 1477 OBJECT_TO_NPVARIANT(windowScriptObject, args[6]); |
1478 | 1478 |
1479 NPVariant result; | 1479 NPVariant result; |
1480 if (browser->invoke(npp, windowScriptObject, testNPInvoke, args, 7, &result)) | 1480 if (browser->invoke(npp, windowScriptObject, testNPInvoke, args, 7, &result)) |
1481 browser->releasevariantvalue(&result); | 1481 browser->releasevariantvalue(&result); |
1482 | 1482 |
1483 browser->releaseobject(windowScriptObject); | 1483 browser->releaseobject(windowScriptObject); |
1484 } | 1484 } |
OLD | NEW |