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

Unified Diff: extensions/renderer/api_request_handler.h

Issue 2657613005: [Extensions Bindings] Add chrome.runtime.lastError support (Closed)
Patch Set: . 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 side-by-side diff with in-line comments
Download patch
Index: extensions/renderer/api_request_handler.h
diff --git a/extensions/renderer/api_request_handler.h b/extensions/renderer/api_request_handler.h
index f5ce48f18f7b7c8984f4e217ce233d1e474c2d0b..160ecdc707df74eb9bcd9bc6544c20359d7aeb8b 100644
--- a/extensions/renderer/api_request_handler.h
+++ b/extensions/renderer/api_request_handler.h
@@ -11,6 +11,7 @@
#include "base/callback.h"
#include "base/macros.h"
+#include "extensions/renderer/api_last_error.h"
#include "v8/include/v8.h"
namespace base {
@@ -29,7 +30,7 @@ class APIRequestHandler {
int argc,
v8::Local<v8::Value>[])>;
- explicit APIRequestHandler(const CallJSFunction& call_js);
+ APIRequestHandler(const CallJSFunction& call_js, APILastError last_error);
~APIRequestHandler();
// Adds a pending request to the map. Returns a unique identifier for that
@@ -42,7 +43,9 @@ class APIRequestHandler {
// Responds to the request with the given |request_id|, calling the callback
// with the given |response| arguments.
// Invalid ids are ignored.
- void CompleteRequest(int request_id, const base::ListValue& response);
+ void CompleteRequest(int request_id,
+ const base::ListValue& response,
+ const std::string& error);
// Invalidates any requests that are associated with |context|.
void InvalidateContext(v8::Local<v8::Context> context);
@@ -77,6 +80,8 @@ class APIRequestHandler {
// (where we have to deal with e.g. blocking javascript).
CallJSFunction call_js_;
+ APILastError last_error_;
+
DISALLOW_COPY_AND_ASSIGN(APIRequestHandler);
};

Powered by Google App Engine
This is Rietveld 408576698