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

Unified Diff: chrome/browser/feedback/feedback_data.cc

Issue 23458031: Fix feedback attach a file and system info code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | « chrome/browser/feedback/feedback_data.h ('k') | chrome/common/extensions/api/feedback_private.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/feedback/feedback_data.cc
diff --git a/chrome/browser/feedback/feedback_data.cc b/chrome/browser/feedback/feedback_data.cc
index cdc2889a9c4835a3207e0a1e87a90822ff482dd5..b4ccfcf2055181ed3dec03c9eb39696133eafa9a 100644
--- a/chrome/browser/feedback/feedback_data.cc
+++ b/chrome/browser/feedback/feedback_data.cc
@@ -98,36 +98,27 @@ void FeedbackData::OnFeedbackPageDataComplete() {
void FeedbackData::set_sys_info(
asargent_no_longer_on_chrome 2013/09/06 22:53:48 style nit: I think the style guide recommends that
rkc 2013/09/06 23:02:17 Yeah, this is just legacy - used to do only one th
scoped_ptr<FeedbackData::SystemLogsMap> sys_info) {
- if (sys_info.get())
- CompressSyslogs(sys_info.Pass());
-}
-
-void FeedbackData::CompressSyslogs(
- scoped_ptr<FeedbackData::SystemLogsMap> sys_info) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- // We get the pointer first since base::Passed will nullify the scoper, hence
- // it's not safe to use <scoper>.get() as a parameter to PostTaskAndReply.
- FeedbackData::SystemLogsMap* sys_info_ptr = sys_info.get();
- std::string* compressed_logs_ptr = new std::string;
- scoped_ptr<std::string> compressed_logs(compressed_logs_ptr);
- BrowserThread::PostBlockingPoolTaskAndReply(
- FROM_HERE,
- base::Bind(&ZipLogs,
- sys_info_ptr,
- compressed_logs_ptr),
- base::Bind(&FeedbackData::OnCompressLogsComplete,
- this,
- base::Passed(&sys_info),
- base::Passed(&compressed_logs)));
+ sys_info_ = sys_info.Pass();
+ if (sys_info_.get()) {
+ std::string* compressed_logs_ptr = new std::string;
+ scoped_ptr<std::string> compressed_logs(compressed_logs_ptr);
+ BrowserThread::PostBlockingPoolTaskAndReply(
+ FROM_HERE,
+ base::Bind(&ZipLogs,
+ sys_info_.get(),
+ compressed_logs_ptr),
+ base::Bind(&FeedbackData::OnCompressLogsComplete,
+ this,
+ base::Passed(&compressed_logs)));
+ }
}
void FeedbackData::OnCompressLogsComplete(
- scoped_ptr<FeedbackData::SystemLogsMap> sys_info,
scoped_ptr<std::string> compressed_logs) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- sys_info_ = sys_info.Pass();
compressed_logs_ = compressed_logs.Pass();
syslogs_compression_complete_ = true;
« no previous file with comments | « chrome/browser/feedback/feedback_data.h ('k') | chrome/common/extensions/api/feedback_private.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698