OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_FEEDBACK_FEEDBACK_DATA_H_ | 5 #ifndef COMPONENTS_FEEDBACK_FEEDBACK_DATA_H_ |
6 #define COMPONENTS_FEEDBACK_FEEDBACK_DATA_H_ | 6 #define COMPONENTS_FEEDBACK_FEEDBACK_DATA_H_ |
7 | 7 |
| 8 #include <memory> |
8 #include <string> | 9 #include <string> |
9 | 10 |
10 #include "base/callback.h" | 11 #include "base/callback.h" |
11 #include "base/macros.h" | 12 #include "base/macros.h" |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "components/feedback/feedback_common.h" | 13 #include "components/feedback/feedback_common.h" |
14 #include "url/gurl.h" | 14 #include "url/gurl.h" |
15 | 15 |
16 namespace base { | 16 namespace base { |
17 class FilePath; | 17 class FilePath; |
18 class RefCountedString; | 18 class RefCountedString; |
19 } | 19 } |
20 namespace content { | 20 namespace content { |
21 class BrowserContext; | 21 class BrowserContext; |
22 } | 22 } |
23 | 23 |
24 namespace feedback { | 24 namespace feedback { |
25 | 25 |
26 class FeedbackData : public FeedbackCommon { | 26 class FeedbackData : public FeedbackCommon { |
27 public: | 27 public: |
28 FeedbackData(); | 28 FeedbackData(); |
29 | 29 |
30 // Called once we've updated all the data from the feedback page. | 30 // Called once we've updated all the data from the feedback page. |
31 void OnFeedbackPageDataComplete(); | 31 void OnFeedbackPageDataComplete(); |
32 | 32 |
33 // Sets the system information for this instance and kicks off its | 33 // Sets the system information for this instance and kicks off its |
34 // compression. | 34 // compression. |
35 void SetAndCompressSystemInfo(scoped_ptr<SystemLogsMap> sys_info); | 35 void SetAndCompressSystemInfo(std::unique_ptr<SystemLogsMap> sys_info); |
36 | 36 |
37 // Sets the histograms for this instance and kicks off its | 37 // Sets the histograms for this instance and kicks off its |
38 // compression. | 38 // compression. |
39 void SetAndCompressHistograms(scoped_ptr<std::string> histograms); | 39 void SetAndCompressHistograms(std::unique_ptr<std::string> histograms); |
40 | 40 |
41 // Sets the attached file data and kicks off its compression. | 41 // Sets the attached file data and kicks off its compression. |
42 void AttachAndCompressFileData(scoped_ptr<std::string> attached_filedata); | 42 void AttachAndCompressFileData( |
| 43 std::unique_ptr<std::string> attached_filedata); |
43 | 44 |
44 // Called once we have compressed our system logs. | 45 // Called once we have compressed our system logs. |
45 void OnCompressLogsComplete(scoped_ptr<std::string> compressed_logs); | 46 void OnCompressLogsComplete(std::unique_ptr<std::string> compressed_logs); |
46 | 47 |
47 // Called once we have compressed our attached file. | 48 // Called once we have compressed our attached file. |
48 void OnCompressFileComplete(scoped_ptr<std::string> compressed_file); | 49 void OnCompressFileComplete(std::unique_ptr<std::string> compressed_file); |
49 | 50 |
50 // Returns true if we've completed all the tasks needed before we can send | 51 // Returns true if we've completed all the tasks needed before we can send |
51 // feedback - at this time this is includes getting the feedback page data | 52 // feedback - at this time this is includes getting the feedback page data |
52 // and compressing the system logs. | 53 // and compressing the system logs. |
53 bool IsDataComplete(); | 54 bool IsDataComplete(); |
54 | 55 |
55 // Sends the feedback report if we have all our data complete. | 56 // Sends the feedback report if we have all our data complete. |
56 void SendReport(); | 57 void SendReport(); |
57 | 58 |
58 // Getters | 59 // Getters |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 | 99 |
99 int pending_op_count_; | 100 int pending_op_count_; |
100 bool report_sent_; | 101 bool report_sent_; |
101 | 102 |
102 DISALLOW_COPY_AND_ASSIGN(FeedbackData); | 103 DISALLOW_COPY_AND_ASSIGN(FeedbackData); |
103 }; | 104 }; |
104 | 105 |
105 } // namespace feedback | 106 } // namespace feedback |
106 | 107 |
107 #endif // COMPONENTS_FEEDBACK_FEEDBACK_DATA_H_ | 108 #endif // COMPONENTS_FEEDBACK_FEEDBACK_DATA_H_ |
OLD | NEW |