From ca943e7182d3e4bc7ae2e8c1c80df5310fbdab38 Mon Sep 17 00:00:00 2001 From: "battre@chromium.org" Date: Tue, 3 May 2011 16:58:04 +0000 Subject: Improve error handling in proxy settings api Introduce a bad_message parameter in order to simulate EXTENSION_FUNCTION_VALIDATE. This allows the Proxy Settings API to terminate extensions that circumvent the input parameter validation performed by the generic extension api. BUG=none TEST=none Review URL: http://codereview.chromium.org/6902039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83901 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/extensions/extension_preference_api.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'chrome/browser/extensions/extension_preference_api.h') diff --git a/chrome/browser/extensions/extension_preference_api.h b/chrome/browser/extensions/extension_preference_api.h index 19325d5..2ff2c1b 100644 --- a/chrome/browser/extensions/extension_preference_api.h +++ b/chrome/browser/extensions/extension_preference_api.h @@ -48,12 +48,12 @@ class PrefTransformerInterface { // Converts the representation of a preference as seen by the extension // into a representation that is used in the pref stores of the browser. // Returns the pref store representation in case of success or sets - // |error| and returns NULL otherwise. + // |error| and returns NULL otherwise. |bad_message| is passed to simulate + // the behavior of EXTENSION_FUNCTION_VALIDATE. It is never NULL. // The ownership of the returned value is passed to the caller. - // TODO(battre): add bool* bad_message to allow terminating the entire - // extension in order to simulate the behavior of EXTENSION_FUNCTION_VALIDATE. virtual Value* ExtensionToBrowserPref(const Value* extension_pref, - std::string* error) = 0; + std::string* error, + bool* bad_message) = 0; // Converts the representation of the preference as stored in the browser // into a representation that is used by the extension. -- cgit v1.1