Chromium Code Reviews| Index: extensions/browser/extension_function.h |
| diff --git a/extensions/browser/extension_function.h b/extensions/browser/extension_function.h |
| index 40ac407ca5d4a40ed7205e519117c81874a8a5c8..44e4533d0eeeae0e99e7481d4dc592d798c219cc 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() const { return response_.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 of the function, if one has been set. |
|
lazyboy
2016/09/19 18:08:56
The response type of the function, if response has
Devlin
2016/09/19 20:14:20
Done.
|
| + std::unique_ptr<ResponseType> response_; |
| + |
| 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_; |