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

Unified Diff: chrome/browser/extensions/chrome_extension_function.h

Issue 2360073002: [Extensions] Isolate ExtensionFunction results_ and error_ (Closed)
Patch Set: errorwithargs Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/chrome_extension_function.h
diff --git a/chrome/browser/extensions/chrome_extension_function.h b/chrome/browser/extensions/chrome_extension_function.h
index a556085562dbf13e8e890d95ba37327bc9d5243f..1319e7812aa5a68b74bea6638285babfb33f8023 100644
--- a/chrome/browser/extensions/chrome_extension_function.h
+++ b/chrome/browser/extensions/chrome_extension_function.h
@@ -54,16 +54,26 @@ class ChromeUIThreadExtensionFunction : public UIThreadExtensionFunction {
// Same as above but uses WindowControllerList instead of BrowserList.
extensions::WindowController* GetExtensionWindowController();
- // Gets the "current" web contents if any. If there is no associated web
- // contents then defaults to the foremost one.
+ // ExtensionFunction:
content::WebContents* GetAssociatedWebContents() override;
+ void SetError(const std::string& error) override;
+ const std::string& GetError() const override;
+
+ protected:
+ ~ChromeUIThreadExtensionFunction() override;
// Responds with success/failure. |results_| or |error_| should be set
// accordingly.
void SendResponse(bool success);
- protected:
- ~ChromeUIThreadExtensionFunction() override;
+ // Sets a single Value as the results of the function.
+ void SetResult(std::unique_ptr<base::Value> result);
+
+ // Sets multiple Values as the results of the function.
+ void SetResultList(std::unique_ptr<base::ListValue> results);
+
+ std::unique_ptr<base::ListValue> results_;
+ std::string error_;
lazyboy 2016/09/30 01:16:05 I'm finding this very hard to grok, can we use dif
Devlin 2016/09/30 18:29:09 We can't name these something different, because e
private:
ChromeExtensionFunctionDetails chrome_details_;

Powered by Google App Engine
This is Rietveld 408576698