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

Side by Side Diff: content/shell/tools/plugin/Tests/FormValue.cpp

Issue 671663002: Standardize usage of virtual/override/final in content/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 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 #include "PluginTest.h" 5 #include "PluginTest.h"
6 #include <string.h> 6 #include <string.h>
7 7
8 extern NPNetscapeFuncs *browser; 8 extern NPNetscapeFuncs *browser;
9 9
10 class FormValue : public PluginTest { 10 class FormValue : public PluginTest {
11 public: 11 public:
12 FormValue(NPP npp, const std::string& identifier) 12 FormValue(NPP npp, const std::string& identifier)
13 : PluginTest(npp, identifier) 13 : PluginTest(npp, identifier)
14 { 14 {
15 } 15 }
16 virtual NPError NPP_GetValue(NPPVariable, void*) override; 16 NPError NPP_GetValue(NPPVariable, void*) override;
17 }; 17 };
18 18
19 NPError FormValue::NPP_GetValue(NPPVariable variable, void *value) 19 NPError FormValue::NPP_GetValue(NPPVariable variable, void *value)
20 { 20 {
21 if (variable == NPPVformValue) { 21 if (variable == NPPVformValue) {
22 static const char formValueText[] = "Plugin form value"; 22 static const char formValueText[] = "Plugin form value";
23 *((void**)value) = browser->memalloc(sizeof(formValueText)); 23 *((void**)value) = browser->memalloc(sizeof(formValueText));
24 if (!*((void**)value)) 24 if (!*((void**)value))
25 return NPERR_OUT_OF_MEMORY_ERROR; 25 return NPERR_OUT_OF_MEMORY_ERROR;
26 strncpy(*((char**)value), formValueText, sizeof(formValueText)); 26 strncpy(*((char**)value), formValueText, sizeof(formValueText));
27 return NPERR_NO_ERROR; 27 return NPERR_NO_ERROR;
28 } 28 }
29 return NPERR_GENERIC_ERROR; 29 return NPERR_GENERIC_ERROR;
30 } 30 }
31 31
32 static PluginTest::Register<FormValue> formValue("form-value"); 32 static PluginTest::Register<FormValue> formValue("form-value");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698