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

Side by Side Diff: content/shell/tools/plugin/Tests/PassDifferentNPPStruct.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 /* 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 27 matching lines...) Expand all
38 38
39 class PassDifferentNPPStruct : public PluginTest { 39 class PassDifferentNPPStruct : public PluginTest {
40 public: 40 public:
41 PassDifferentNPPStruct(NPP npp, const string& identifier) 41 PassDifferentNPPStruct(NPP npp, const string& identifier)
42 : PluginTest(npp, identifier) 42 : PluginTest(npp, identifier)
43 , m_didReceiveInitialSetWindowCall(false) 43 , m_didReceiveInitialSetWindowCall(false)
44 { 44 {
45 } 45 }
46 46
47 private: 47 private:
48 virtual NPError NPP_SetWindow(NPWindow* window) override 48 NPError NPP_SetWindow(NPWindow* window) override {
49 {
50 if (m_didReceiveInitialSetWindowCall) 49 if (m_didReceiveInitialSetWindowCall)
51 return NPERR_NO_ERROR; 50 return NPERR_NO_ERROR;
52 m_didReceiveInitialSetWindowCall = true; 51 m_didReceiveInitialSetWindowCall = true;
53 52
54 NPP oldNPP = m_npp; 53 NPP oldNPP = m_npp;
55 NPP_t differentNPP = *m_npp; 54 NPP_t differentNPP = *m_npp;
56 m_npp = &differentNPP; 55 m_npp = &differentNPP;
57 56
58 NPBool privateMode; 57 NPBool privateMode;
59 NPError error = NPN_GetValue(NPNVprivateModeBool, &privateMode); 58 NPError error = NPN_GetValue(NPNVprivateModeBool, &privateMode);
60 59
61 m_npp = oldNPP; 60 m_npp = oldNPP;
62 61
63 if (error != NPERR_NO_ERROR) { 62 if (error != NPERR_NO_ERROR) {
64 log("NPN_GetValue(NPNVprivateModeBool) with a different NPP struct f ailed with error %d", error); 63 log("NPN_GetValue(NPNVprivateModeBool) with a different NPP struct f ailed with error %d", error);
65 notifyDone(); 64 notifyDone();
66 return NPERR_GENERIC_ERROR; 65 return NPERR_GENERIC_ERROR;
67 } 66 }
68 log("NPN_GetValue(NPNVprivateModeBool) with a different NPP struct succe eded"); 67 log("NPN_GetValue(NPNVprivateModeBool) with a different NPP struct succe eded");
69 notifyDone(); 68 notifyDone();
70 return NPERR_NO_ERROR; 69 return NPERR_NO_ERROR;
71 } 70 }
72 71
73 bool m_didReceiveInitialSetWindowCall; 72 bool m_didReceiveInitialSetWindowCall;
74 }; 73 };
75 74
76 static PluginTest::Register<PassDifferentNPPStruct> getValueNetscapeWindow("pass -different-npp-struct"); 75 static PluginTest::Register<PassDifferentNPPStruct> getValueNetscapeWindow("pass -different-npp-struct");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698