Chromium Code Reviews| Index: chrome/browser/extensions/api/feedback_private/feedback_service.h |
| diff --git a/chrome/browser/extensions/api/feedback_private/feedback_service.h b/chrome/browser/extensions/api/feedback_private/feedback_service.h |
| index 9588c534d61988e998a1891e2c48cd892218f9d0..dddb149881a34310773caa22b605058ffebc6577 100644 |
| --- a/chrome/browser/extensions/api/feedback_private/feedback_service.h |
| +++ b/chrome/browser/extensions/api/feedback_private/feedback_service.h |
| @@ -7,7 +7,9 @@ |
| #include <stdint.h> |
| +#include <map> |
| #include <vector> |
| + |
| #include "base/callback.h" |
| #include "base/macros.h" |
| #include "base/memory/linked_ptr.h" |
| @@ -30,6 +32,7 @@ typedef std::vector<linked_ptr<SystemInformation> > SystemInformationList; |
| // the pieces are available. |
| class FeedbackService : public base::SupportsWeakPtr<FeedbackService> { |
| public: |
| + typedef int64_t RequestId; |
|
xiyuan
2016/03/14 23:47:28
nit: new style is to use "using"
using RequestId
afakhry
2016/03/15 19:25:38
Done.
|
| typedef base::Callback<void(bool)> SendFeedbackCallback; |
| typedef base::Callback<void(const SystemInformationList& sys_info)> |
| GetSystemInformationCallback; |
| @@ -47,23 +50,28 @@ class FeedbackService : public base::SupportsWeakPtr<FeedbackService> { |
| void GetSystemInformation(const GetSystemInformationCallback& callback); |
| private: |
| + struct SendRequest; |
| + |
| // Callbacks to receive blob data. |
| - void AttachedFileCallback(scoped_ptr<std::string> data, |
| + void AttachedFileCallback(RequestId request_id, |
| + scoped_ptr<std::string> data, |
| int64_t total_blob_length); |
| - void ScreenshotCallback(scoped_ptr<std::string> data, |
| + void ScreenshotCallback(RequestId request_id, |
| + scoped_ptr<std::string> data, |
| int64_t total_blob_length); |
| - // Checks if we have read all the blobs we need to; signals the feedback |
| - // data object once all the requisite data has been populated. |
| - void CompleteSendFeedback(); |
| - |
| void OnSystemLogsFetchComplete( |
| + RequestId request_id, |
| scoped_ptr<system_logs::SystemLogsResponse> sys_info); |
| - GetSystemInformationCallback system_information_callback_; |
| - SendFeedbackCallback send_feedback_callback_; |
| + // Checks if we have read all the blobs we need to; signals the feedback |
| + // data object once all the requisite data has been populated. |
| + void CompleteSendFeedback(RequestId request_id); |
| + |
| + std::map<RequestId, GetSystemInformationCallback> |
| + system_information_callbacks_; |
| - scoped_refptr<feedback::FeedbackData> feedback_data_; |
| + std::map<RequestId, SendRequest> send_feedback_requests_; |
| DISALLOW_COPY_AND_ASSIGN(FeedbackService); |
| }; |