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

Unified Diff: chrome/browser/extensions/api/feedback_private/feedback_service.cc

Issue 296173003: Refactor FeedbackData and add tests. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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 | « no previous file | components/components_tests.gyp » ('j') | components/feedback/feedback_common.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/feedback_private/feedback_service.cc
diff --git a/chrome/browser/extensions/api/feedback_private/feedback_service.cc b/chrome/browser/extensions/api/feedback_private/feedback_service.cc
index 31a1c6ca036b68c9bad9f0aff6e595d596e18d68..786d87d926d71db82225f6d19de243bb9fa726ae 100644
--- a/chrome/browser/extensions/api/feedback_private/feedback_service.cc
+++ b/chrome/browser/extensions/api/feedback_private/feedback_service.cc
@@ -73,9 +73,8 @@ void FeedbackService::SendFeedback(
void FeedbackService::AttachedFileCallback(scoped_ptr<std::string> data,
int64 /* total_blob_length */) {
- if (!data.get())
- feedback_data_->set_attached_file_uuid(std::string());
- else
+ feedback_data_->set_attached_file_uuid(std::string());
+ if (data.get())
Zachary Kuznia 2014/05/28 21:39:36 just use: if (data)
achaulk 2014/05/29 17:22:29 Done.
feedback_data_->AttachAndCompressFileData(data.Pass());
CompleteSendFeedback();
@@ -83,9 +82,8 @@ void FeedbackService::AttachedFileCallback(scoped_ptr<std::string> data,
void FeedbackService::ScreenshotCallback(scoped_ptr<std::string> data,
int64 /* total_blob_length */) {
- if (!data.get())
- feedback_data_->set_screenshot_uuid(std::string());
- else
+ feedback_data_->set_screenshot_uuid(std::string());
+ if (data.get())
Zachary Kuznia 2014/05/28 21:39:36 ditto
achaulk 2014/05/29 17:22:29 Done.
feedback_data_->set_image(data.Pass());
CompleteSendFeedback();
@@ -125,12 +123,8 @@ void FeedbackService::CompleteSendFeedback() {
// b.) The associated data object exists, meaning that the data has been read
// and the read callback has updated the associated data on the feedback
// object.
- bool attached_file_completed =
- feedback_data_->attached_file_uuid().empty() ||
- feedback_data_->attached_filedata();
- bool screenshot_completed =
- feedback_data_->screenshot_uuid().empty() ||
- feedback_data_->image();
+ bool attached_file_completed = feedback_data_->attached_file_uuid().empty();
+ bool screenshot_completed = feedback_data_->screenshot_uuid().empty();
if (screenshot_completed && attached_file_completed) {
// Signal the feedback object that the data from the feedback page has been
« no previous file with comments | « no previous file | components/components_tests.gyp » ('j') | components/feedback/feedback_common.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698