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) 2012 Apple Inc. All rights reserved. | 6 * Copyright (C) 2012 Apple Inc. All rights reserved. |
7 * | 7 * |
8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
10 * are met: | 10 * are met: |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 int bufferLength = strlen(propertyString) + strlen(message) + 1; | 65 int bufferLength = strlen(propertyString) + strlen(message) + 1; |
66 char* resultBuffer = static_cast<char*>(pluginTest()->NPN_MemAlloc(b
ufferLength)); | 66 char* resultBuffer = static_cast<char*>(pluginTest()->NPN_MemAlloc(b
ufferLength)); |
67 snprintf(resultBuffer, bufferLength, "%s%s", message, propertyString
); | 67 snprintf(resultBuffer, bufferLength, "%s%s", message, propertyString
); |
68 | 68 |
69 STRINGZ_TO_NPVARIANT(resultBuffer, *result); | 69 STRINGZ_TO_NPVARIANT(resultBuffer, *result); |
70 | 70 |
71 return true; | 71 return true; |
72 } | 72 } |
73 }; | 73 }; |
74 | 74 |
75 virtual NPError NPP_GetValue(NPPVariable variable, void *value) OVERRIDE | 75 virtual NPError NPP_GetValue(NPPVariable variable, void *value) override |
76 { | 76 { |
77 if (variable != NPPVpluginScriptableNPObject) | 77 if (variable != NPPVpluginScriptableNPObject) |
78 return NPERR_GENERIC_ERROR; | 78 return NPERR_GENERIC_ERROR; |
79 | 79 |
80 *(NPObject**)value = PluginObject::create(this); | 80 *(NPObject**)value = PluginObject::create(this); |
81 | 81 |
82 return NPERR_NO_ERROR; | 82 return NPERR_NO_ERROR; |
83 } | 83 } |
84 | 84 |
85 }; | 85 }; |
86 | 86 |
87 static PluginTest::Register<PluginScriptableObjectOverridesAllProperties> plugin
ScriptableObjectOverridesAllProperties("plugin-scriptable-object-overrides-all-p
roperties"); | 87 static PluginTest::Register<PluginScriptableObjectOverridesAllProperties> plugin
ScriptableObjectOverridesAllProperties("plugin-scriptable-object-overrides-all-p
roperties"); |
OLD | NEW |