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

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: add feedback.gypi to OWNERS file 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/OWNERS » ('j') | no next file with comments »
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..580c86a8431e8c3f6bc847653817918ad04be893 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)
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)
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/OWNERS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698