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

Side by Side Diff: chrome/browser/extensions/chrome_extension_function.h

Issue 950023005: [Extensions] Apply WARN_UNUSED_RESULT and final keyword to ExtensionFunctions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix chromeos api Created 5 years, 9 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
« no previous file with comments | « no previous file | extensions/browser/api/networking_config/networking_config_api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSION_FUNCTION_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSION_FUNCTION_H_
6 #define CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSION_FUNCTION_H_ 6 #define CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSION_FUNCTION_H_
7 7
8 #include "extensions/browser/extension_function.h" 8 #include "extensions/browser/extension_function.h"
9 9
10 class Browser; 10 class Browser;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 protected: 80 protected:
81 ~ChromeAsyncExtensionFunction() override; 81 ~ChromeAsyncExtensionFunction() override;
82 82
83 // Deprecated, see AsyncExtensionFunction::RunAsync. 83 // Deprecated, see AsyncExtensionFunction::RunAsync.
84 virtual bool RunAsync() = 0; 84 virtual bool RunAsync() = 0;
85 85
86 // ValidationFailure override to match RunAsync(). 86 // ValidationFailure override to match RunAsync().
87 static bool ValidationFailure(ChromeAsyncExtensionFunction* function); 87 static bool ValidationFailure(ChromeAsyncExtensionFunction* function);
88 88
89 private: 89 private:
90 ResponseAction Run() override; 90 // If you're hitting a compile error here due to "final" - great! You're doing
91 // the right thing, you just need to extend ChromeUIThreadExtensionFunction
92 // instead of ChromeAsyncExtensionFunction.
93 ResponseAction Run() final;
91 }; 94 };
92 95
93 // A chrome specific analog to SyncExtensionFunction. This has access to a 96 // A chrome specific analog to SyncExtensionFunction. This has access to a
94 // chrome Profile. 97 // chrome Profile.
95 // 98 //
96 // DEPRECATED: Please consider inherting UIThreadExtensionFunction or 99 // DEPRECATED: Please consider inherting UIThreadExtensionFunction or
97 // SyncExtensionFunction directly. Then if you need access to Chrome details, 100 // SyncExtensionFunction directly. Then if you need access to Chrome details,
98 // you can construct a ChromeExtensionFunctionDetails object within your 101 // you can construct a ChromeExtensionFunctionDetails object within your
99 // function implementation. 102 // function implementation.
100 class ChromeSyncExtensionFunction : public ChromeUIThreadExtensionFunction { 103 class ChromeSyncExtensionFunction : public ChromeUIThreadExtensionFunction {
101 public: 104 public:
102 ChromeSyncExtensionFunction(); 105 ChromeSyncExtensionFunction();
103 106
104 protected: 107 protected:
105 ~ChromeSyncExtensionFunction() override; 108 ~ChromeSyncExtensionFunction() override;
106 109
107 // Deprecated, see SyncExtensionFunction::RunSync. 110 // Deprecated, see SyncExtensionFunction::RunSync.
108 virtual bool RunSync() = 0; 111 virtual bool RunSync() = 0;
109 112
110 // ValidationFailure override to match RunSync(). 113 // ValidationFailure override to match RunSync().
111 static bool ValidationFailure(ChromeSyncExtensionFunction* function); 114 static bool ValidationFailure(ChromeSyncExtensionFunction* function);
112 115
113 private: 116 private:
114 ResponseAction Run() override; 117 // If you're hitting a compile error here due to "final" - great! You're doing
118 // the right thing, you just need to extend ChromeUIThreadExtensionFunction
119 // instead of ChromeSyncExtensionFunction.
120 ResponseAction Run() final;
115 }; 121 };
116 122
117 #endif // CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSION_FUNCTION_H_ 123 #endif // CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSION_FUNCTION_H_
OLDNEW
« no previous file with comments | « no previous file | extensions/browser/api/networking_config/networking_config_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698