| 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) 2010 Apple Inc. All rights reserved. | 6 * Copyright (C) 2010 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 struct NPObjectWithInvokeDefault : Object<NPObjectWithInvokeDefault> { | 45 struct NPObjectWithInvokeDefault : Object<NPObjectWithInvokeDefault> { |
| 46 public: | 46 public: |
| 47 bool invokeDefault(const NPVariant*, uint32_t, NPVariant* result) | 47 bool invokeDefault(const NPVariant*, uint32_t, NPVariant* result) |
| 48 { | 48 { |
| 49 INT32_TO_NPVARIANT(1, *result); | 49 INT32_TO_NPVARIANT(1, *result); |
| 50 return true; | 50 return true; |
| 51 } | 51 } |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 virtual NPError NPP_GetValue(NPPVariable variable, void *value) OVERRIDE | 54 virtual NPError NPP_GetValue(NPPVariable variable, void *value) override |
| 55 { | 55 { |
| 56 if (variable != NPPVpluginScriptableNPObject) | 56 if (variable != NPPVpluginScriptableNPObject) |
| 57 return NPERR_GENERIC_ERROR; | 57 return NPERR_GENERIC_ERROR; |
| 58 | 58 |
| 59 NPObject* object; | 59 NPObject* object; |
| 60 if (identifier() == "plugin-scriptable-npobject-invoke-default") | 60 if (identifier() == "plugin-scriptable-npobject-invoke-default") |
| 61 object = NPObjectWithInvokeDefault::create(this); | 61 object = NPObjectWithInvokeDefault::create(this); |
| 62 else | 62 else |
| 63 object = NPObjectWithoutInvokeDefault::create(this); | 63 object = NPObjectWithoutInvokeDefault::create(this); |
| 64 | 64 |
| 65 *(NPObject**)value = object; | 65 *(NPObject**)value = object; |
| 66 | 66 |
| 67 return NPERR_NO_ERROR; | 67 return NPERR_NO_ERROR; |
| 68 } | 68 } |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 static PluginTest::Register<PluginScriptableNPObjectInvokeDefault> pluginScripta
bleNPObjectInvokeDefault("plugin-scriptable-npobject-invoke-default"); | 71 static PluginTest::Register<PluginScriptableNPObjectInvokeDefault> pluginScripta
bleNPObjectInvokeDefault("plugin-scriptable-npobject-invoke-default"); |
| 72 static PluginTest::Register<PluginScriptableNPObjectInvokeDefault> pluginScripta
bleNPObjectNoInvokeDefault("plugin-scriptable-npobject-no-invoke-default"); | 72 static PluginTest::Register<PluginScriptableNPObjectInvokeDefault> pluginScripta
bleNPObjectNoInvokeDefault("plugin-scriptable-npobject-no-invoke-default"); |
| OLD | NEW |