diff options
author | haraken@chromium.org <haraken@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-07 09:50:17 +0000 |
---|---|---|
committer | haraken@chromium.org <haraken@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-07 09:50:17 +0000 |
commit | dc85cc31d70a2f35000a5ad3f3e06b2ae2e23caa (patch) | |
tree | 11c84360351f2e362c5c56a96be8dfaeed1ff7be /content/browser/tracing | |
parent | 7ba162762aa14e8bd5ad8ee640dd404cdfeb4c33 (diff) | |
download | chromium_src-dc85cc31d70a2f35000a5ad3f3e06b2ae2e23caa.zip chromium_src-dc85cc31d70a2f35000a5ad3f3e06b2ae2e23caa.tar.gz chromium_src-dc85cc31d70a2f35000a5ad3f3e06b2ae2e23caa.tar.bz2 |
Fix failures in chrome os after r227262
TBR=dsinclair
Review URL: https://codereview.chromium.org/26238002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227269 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/tracing')
-rw-r--r-- | content/browser/tracing/tracing_controller_impl.cc | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/content/browser/tracing/tracing_controller_impl.cc b/content/browser/tracing/tracing_controller_impl.cc index 845f1c5..7aa90d6 100644 --- a/content/browser/tracing/tracing_controller_impl.cc +++ b/content/browser/tracing/tracing_controller_impl.cc @@ -108,7 +108,8 @@ bool TracingControllerImpl::DisableRecording( result_file_ = file_util::OpenFile(*result_file_path_, "w"); result_file_has_at_least_one_result_ = false; const char* preamble = "{\"traceEvents\": ["; - fwrite(preamble, strlen(preamble), 1, result_file_); + size_t written_bytes = fwrite(preamble, strlen(preamble), 1, result_file_); + DCHECK(written_bytes == strlen(preamble)); } // There could be a case where there are no child processes and filters_ @@ -201,7 +202,8 @@ void TracingControllerImpl::CaptureMonitoringSnapshot( result_file_ = file_util::OpenFile(*result_file_path_, "w"); result_file_has_at_least_one_result_ = false; const char* preamble = "{\"traceEvents\": ["; - fwrite(preamble, strlen(preamble), 1, result_file_); + size_t written_bytes = fwrite(preamble, strlen(preamble), 1, result_file_); + DCHECK(written_bytes == strlen(preamble)); // There could be a case where there are no child processes and filters_ // is empty. In that case we can immediately tell the subscriber that tracing @@ -289,7 +291,8 @@ void TracingControllerImpl::OnDisableRecordingAcked( pending_get_categories_done_callback_.Reset(); } else if (!pending_disable_recording_done_callback_.is_null()) { const char* trailout = "]}"; - fwrite(trailout, strlen(trailout), 1, result_file_); + size_t written_bytes = fwrite(trailout, strlen(trailout), 1, result_file_); + DCHECK(written_bytes == strlen(trailout)); file_util::CloseFile(result_file_); result_file_ = 0; pending_disable_recording_done_callback_.Run(result_file_path_.Pass()); @@ -322,7 +325,8 @@ void TracingControllerImpl::OnCaptureMonitoringSnapshotAcked() { if (!pending_capture_monitoring_snapshot_done_callback_.is_null()) { const char* trailout = "]}"; - fwrite(trailout, strlen(trailout), 1, result_file_); + size_t written_bytes = fwrite(trailout, strlen(trailout), 1, result_file_); + DCHECK(written_bytes == strlen(trailout)); file_util::CloseFile(result_file_); result_file_ = 0; pending_capture_monitoring_snapshot_done_callback_.Run( @@ -349,12 +353,15 @@ void TracingControllerImpl::OnTraceDataCollected( // If there is already a result in the file, then put a commma // before the next batch of results. if (result_file_has_at_least_one_result_) { - fwrite(",", 1, 1, result_file_); + size_t written_bytes = fwrite(",", 1, 1, result_file_); + DCHECK(written_bytes == 1); } else { result_file_has_at_least_one_result_ = true; } - fwrite(events_str_ptr->data().c_str(), events_str_ptr->data().size(), 1, - result_file_); + size_t written_bytes = fwrite(events_str_ptr->data().c_str(), + events_str_ptr->data().size(), 1, + result_file_); + DCHECK(written_bytes == events_str_ptr->data().size()); } void TracingControllerImpl::OnLocalTraceDataCollected( |