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

Side by Side Diff: chrome/browser/feedback/feedback_data.cc

Issue 56443004: Properly complete sending feedback reports when a trace is attached (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/browser/feedback/feedback_data.h" 5 #include "chrome/browser/feedback/feedback_data.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/json/json_string_value_serializer.h" 8 #include "base/json/json_string_value_serializer.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 attached_file, 164 attached_file,
165 *(attached_filedata_.get()), 165 *(attached_filedata_.get()),
166 compressed_file_ptr), 166 compressed_file_ptr),
167 base::Bind(&FeedbackData::OnCompressFileComplete, 167 base::Bind(&FeedbackData::OnCompressFileComplete,
168 this, 168 this,
169 base::Passed(&compressed_file))); 169 base::Passed(&compressed_file)));
170 } 170 }
171 } 171 }
172 172
173 void FeedbackData::OnGetTraceData( 173 void FeedbackData::OnGetTraceData(
174 int trace_id_, 174 int trace_id,
175 scoped_refptr<base::RefCountedString> trace_data) { 175 scoped_refptr<base::RefCountedString> trace_data) {
176 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 176 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
177 TracingManager* manager = TracingManager::Get(); 177 TracingManager* manager = TracingManager::Get();
178 if (manager) 178 if (manager)
179 manager->DiscardTraceData(trace_id_); 179 manager->DiscardTraceData(trace_id);
180 180
181 scoped_ptr<std::string> data(new std::string(trace_data->data())); 181 scoped_ptr<std::string> data(new std::string);
182 data->swap(trace_data->data());
182 183
183 attached_filename_ = kTraceFilename; 184 attached_filename_ = kTraceFilename;
184 attached_filedata_ = data.Pass(); 185 attached_filedata_ = data.Pass();
186 attached_file_compression_complete_ = true;
185 trace_id_ = 0; 187 trace_id_ = 0;
186 188
187 set_category_tag(kPerformanceCategoryTag); 189 set_category_tag(kPerformanceCategoryTag);
188 190
189 SendReport(); 191 SendReport();
190 } 192 }
191 193
192 void FeedbackData::OnCompressLogsComplete( 194 void FeedbackData::OnCompressLogsComplete(
193 scoped_ptr<std::string> compressed_logs) { 195 scoped_ptr<std::string> compressed_logs) {
194 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 196 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
(...skipping 27 matching lines...) Expand all
222 feedback_page_data_complete_; 224 feedback_page_data_complete_;
223 } 225 }
224 226
225 void FeedbackData::SendReport() { 227 void FeedbackData::SendReport() {
226 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 228 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
227 if (IsDataComplete() && !report_sent_) { 229 if (IsDataComplete() && !report_sent_) {
228 report_sent_ = true; 230 report_sent_ = true;
229 feedback_util::SendReport(this); 231 feedback_util::SendReport(this);
230 } 232 }
231 } 233 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698