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

Unified Diff: extensions/browser/extension_function.h

Issue 2348723002: [Extensions] Remove UIThreadExtensionFunction::DelegateForTests (Closed)
Patch Set: lazyboy's 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
« no previous file with comments | « extensions/browser/api_test_utils.cc ('k') | extensions/browser/extension_function.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/extension_function.h
diff --git a/extensions/browser/extension_function.h b/extensions/browser/extension_function.h
index 40ac407ca5d4a40ed7205e519117c81874a8a5c8..e48e8769205242cfe6398e4c75927e0c23cbd8b2 100644
--- a/extensions/browser/extension_function.h
+++ b/extensions/browser/extension_function.h
@@ -315,6 +315,8 @@ class ExtensionFunction
return source_process_id_;
}
+ ResponseType* response_type() const { return response_type_.get(); }
+
// Sets did_respond_ to true so that the function won't DCHECK if it never
// sends a response. Typically, this shouldn't be used, even in testing. It's
// only for when you want to test functionality that doesn't exercise the
@@ -475,6 +477,9 @@ class ExtensionFunction
private:
base::ElapsedTimer timer_;
+ // The response type of the function, if the response has been sent.
+ std::unique_ptr<ResponseType> response_type_;
+
void OnRespondingLater(ResponseValue response);
DISALLOW_COPY_AND_ASSIGN(ExtensionFunction);
@@ -484,26 +489,12 @@ class ExtensionFunction
// this category.
class UIThreadExtensionFunction : public ExtensionFunction {
public:
- // TODO(yzshen): We should be able to remove this interface now that we
- // support overriding the response callback.
- // A delegate for use in testing, to intercept the call to SendResponse.
- class DelegateForTests {
- public:
- virtual void OnSendResponse(UIThreadExtensionFunction* function,
- bool success,
- bool bad_message) = 0;
- };
-
UIThreadExtensionFunction();
UIThreadExtensionFunction* AsUIThreadExtensionFunction() override;
bool PreRunValidation(std::string* error) override;
- void set_test_delegate(DelegateForTests* delegate) {
- delegate_ = delegate;
- }
-
// Called when a message was received.
// Should return true if it processed the message.
virtual bool OnMessageReceived(const IPC::Message& message);
@@ -579,8 +570,6 @@ class UIThreadExtensionFunction : public ExtensionFunction {
std::unique_ptr<RenderFrameHostTracker> tracker_;
- DelegateForTests* delegate_;
-
// The blobs transferred to the renderer process.
std::vector<std::string> transferred_blob_uuids_;
« no previous file with comments | « extensions/browser/api_test_utils.cc ('k') | extensions/browser/extension_function.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698