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

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

Issue 100213: use EXTENSION_FUNCTION_VALIDATE (Closed)
Patch Set: final CR change Created 11 years, 7 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 | chrome/browser/extensions/extension_tabs_module.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 (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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_EXTENSION_FUNCTION_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/values.h" 10 #include "base/values.h"
11 #include "base/scoped_ptr.h" 11 #include "base/scoped_ptr.h"
12 12
13 class ExtensionFunctionDispatcher; 13 class ExtensionFunctionDispatcher;
14 class Profile; 14 class Profile;
15 15
16 #define EXTENSION_FUNCTION_VALIDATE(test) do { \ 16 #define EXTENSION_FUNCTION_VALIDATE(test) do { \
17 if (!test) { \ 17 if (!(test)) { \
18 bad_message_ = true; \ 18 bad_message_ = true; \
19 return false; \ 19 return false; \
20 } \ 20 } \
21 } while (0) 21 } while (0)
22 22
23 // Base class for an extension function. 23 // Base class for an extension function.
24 // TODO(aa): This will have to become reference counted when we introduce APIs 24 // TODO(aa): This will have to become reference counted when we introduce APIs
25 // that live beyond a single stack frame. 25 // that live beyond a single stack frame.
26 class ExtensionFunction { 26 class ExtensionFunction {
27 public: 27 public:
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 virtual void Run() { 100 virtual void Run() {
101 SendResponse(RunImpl()); 101 SendResponse(RunImpl());
102 } 102 }
103 103
104 private: 104 private:
105 DISALLOW_COPY_AND_ASSIGN(SyncExtensionFunction); 105 DISALLOW_COPY_AND_ASSIGN(SyncExtensionFunction);
106 }; 106 };
107 107
108 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ 108 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_tabs_module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698