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

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

Issue 2650343005: Clean up param validation in browsing_data_api.cc (Closed)
Patch Set: comments Created 3 years, 11 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 | « chrome/browser/extensions/api/browsing_data/browsing_data_api.cc ('k') | no next file » | 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 EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_ 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_
6 #define EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_ 6 #define EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <list> 10 #include <list>
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 // Specifies the raw arguments to the function, as a JSON value. 234 // Specifies the raw arguments to the function, as a JSON value.
235 // TODO(dcheng): This should take a const ref. 235 // TODO(dcheng): This should take a const ref.
236 virtual void SetArgs(const base::ListValue* args); 236 virtual void SetArgs(const base::ListValue* args);
237 237
238 // Retrieves the results of the function as a ListValue. 238 // Retrieves the results of the function as a ListValue.
239 const base::ListValue* GetResultList() const; 239 const base::ListValue* GetResultList() const;
240 240
241 // Retrieves any error string from the function. 241 // Retrieves any error string from the function.
242 virtual const std::string& GetError() const; 242 virtual const std::string& GetError() const;
243 243
244 bool bad_message() const { return bad_message_; }
245 void set_bad_message(bool bad_message) { bad_message_ = bad_message; } 244 void set_bad_message(bool bad_message) { bad_message_ = bad_message; }
246 245
247 // Specifies the name of the function. A long-lived string (such as a string 246 // Specifies the name of the function. A long-lived string (such as a string
248 // literal) must be provided. 247 // literal) must be provided.
249 void set_name(const char* name) { name_ = name; } 248 void set_name(const char* name) { name_ = name; }
250 const char* name() const { return name_; } 249 const char* name() const { return name_; }
251 250
252 void set_profile_id(void* profile_id) { profile_id_ = profile_id; } 251 void set_profile_id(void* profile_id) { profile_id_ = profile_id; }
253 void* profile_id() const { return profile_id_; } 252 void* profile_id() const { return profile_id_; }
254 253
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 private: 689 private:
691 // If you're hitting a compile error here due to "final" - great! You're 690 // If you're hitting a compile error here due to "final" - great! You're
692 // doing the right thing, you just need to extend UIThreadExtensionFunction 691 // doing the right thing, you just need to extend UIThreadExtensionFunction
693 // instead of AsyncExtensionFunction. 692 // instead of AsyncExtensionFunction.
694 ResponseAction Run() final; 693 ResponseAction Run() final;
695 694
696 DISALLOW_COPY_AND_ASSIGN(AsyncExtensionFunction); 695 DISALLOW_COPY_AND_ASSIGN(AsyncExtensionFunction);
697 }; 696 };
698 697
699 #endif // EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_ 698 #endif // EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/browsing_data/browsing_data_api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698