| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/media/webrtc_log_uploader.h" | 5 #include "chrome/browser/media/webrtc_log_uploader.h" |
| 6 | 6 |
| 7 #include "base/files/file_enumerator.h" | 7 #include "base/files/file_enumerator.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 // using the test framework for that without hanging. | 190 // using the test framework for that without hanging. |
| 191 // TODO(grunell): Remove this when the api test for this feature is fully | 191 // TODO(grunell): Remove this when the api test for this feature is fully |
| 192 // implemented according to the test plan. http://crbug.com/257329. | 192 // implemented according to the test plan. http://crbug.com/257329. |
| 193 if (post_data_) { | 193 if (post_data_) { |
| 194 *post_data_ = *post_data; | 194 *post_data_ = *post_data; |
| 195 NotifyUploadDone(kHttpResponseOk, "", upload_done_data); | 195 NotifyUploadDone(kHttpResponseOk, "", upload_done_data); |
| 196 return; | 196 return; |
| 197 } | 197 } |
| 198 | 198 |
| 199 content::BrowserThread::PostTask( | 199 content::BrowserThread::PostTask( |
| 200 content::BrowserThread::UI, | 200 content::BrowserThread::UI, FROM_HERE, |
| 201 FROM_HERE, | |
| 202 base::Bind(&WebRtcLogUploader::CreateAndStartURLFetcher, | 201 base::Bind(&WebRtcLogUploader::CreateAndStartURLFetcher, |
| 203 base::Unretained(this), | 202 base::Unretained(this), upload_done_data, |
| 204 upload_done_data, | 203 base::Passed(&post_data))); |
| 205 Passed(&post_data))); | |
| 206 | 204 |
| 207 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, | 205 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, |
| 208 base::Bind(&WebRtcLogUploader::DecreaseLogCount, base::Unretained(this))); | 206 base::Bind(&WebRtcLogUploader::DecreaseLogCount, base::Unretained(this))); |
| 209 } | 207 } |
| 210 | 208 |
| 211 void WebRtcLogUploader::UploadStoredLog( | 209 void WebRtcLogUploader::UploadStoredLog( |
| 212 const WebRtcLogUploadDoneData& upload_data) { | 210 const WebRtcLogUploadDoneData& upload_data) { |
| 213 DCHECK(file_thread_checker_.CalledOnValidThread()); | 211 DCHECK(file_thread_checker_.CalledOnValidThread()); |
| 214 DCHECK(!upload_data.local_log_id.empty()); | 212 DCHECK(!upload_data.local_log_id.empty()); |
| 215 DCHECK(!upload_data.log_path.empty()); | 213 DCHECK(!upload_data.log_path.empty()); |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 if (!success) { | 564 if (!success) { |
| 567 error_message = "Uploading failed, response code: " + | 565 error_message = "Uploading failed, response code: " + |
| 568 base::IntToString(response_code); | 566 base::IntToString(response_code); |
| 569 } | 567 } |
| 570 content::BrowserThread::PostTask( | 568 content::BrowserThread::PostTask( |
| 571 content::BrowserThread::UI, FROM_HERE, | 569 content::BrowserThread::UI, FROM_HERE, |
| 572 base::Bind(upload_done_data.callback, success, report_id, | 570 base::Bind(upload_done_data.callback, success, report_id, |
| 573 error_message)); | 571 error_message)); |
| 574 } | 572 } |
| 575 } | 573 } |
| OLD | NEW |