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

Side by Side Diff: content/browser/tracing/tracing_controller_impl.cc

Issue 1222153004: [tracing] Simplify and improve thread-hopping logic of memory-infra (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re dsinclair #7 Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « base/trace_event/memory_dump_manager_unittest.cc ('k') | 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #include "content/browser/tracing/tracing_controller_impl.h" 4 #include "content/browser/tracing/tracing_controller_impl.h"
5 5
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/json/string_escape.h" 8 #include "base/json/string_escape.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 DLOG(WARNING) << "Global memory dump failed because of NACK from child " 859 DLOG(WARNING) << "Global memory dump failed because of NACK from child "
860 << trace_message_filter->peer_pid(); 860 << trace_message_filter->peer_pid();
861 } 861 }
862 FinalizeGlobalMemoryDumpIfAllProcessesReplied(); 862 FinalizeGlobalMemoryDumpIfAllProcessesReplied();
863 } 863 }
864 864
865 void TracingControllerImpl::OnBrowserProcessMemoryDumpDone(uint64 dump_guid, 865 void TracingControllerImpl::OnBrowserProcessMemoryDumpDone(uint64 dump_guid,
866 bool success) { 866 bool success) {
867 DCHECK_GT(pending_memory_dump_ack_count_, 0); 867 DCHECK_GT(pending_memory_dump_ack_count_, 0);
868 --pending_memory_dump_ack_count_; 868 --pending_memory_dump_ack_count_;
869 if (!success) {
870 ++failed_memory_dump_count_;
871 DLOG(WARNING) << "Global memory dump aborted on the current process";
872 }
869 FinalizeGlobalMemoryDumpIfAllProcessesReplied(); 873 FinalizeGlobalMemoryDumpIfAllProcessesReplied();
870 } 874 }
871 875
872 void TracingControllerImpl::FinalizeGlobalMemoryDumpIfAllProcessesReplied() { 876 void TracingControllerImpl::FinalizeGlobalMemoryDumpIfAllProcessesReplied() {
873 if (pending_memory_dump_ack_count_ > 0) 877 if (pending_memory_dump_ack_count_ > 0)
874 return; 878 return;
875 879
876 DCHECK_NE(0u, pending_memory_dump_guid_); 880 DCHECK_NE(0u, pending_memory_dump_guid_);
877 const bool global_success = failed_memory_dump_count_ == 0; 881 const bool global_success = failed_memory_dump_count_ == 0;
878 if (!pending_memory_dump_callback_.is_null()) { 882 if (!pending_memory_dump_callback_.is_null()) {
(...skipping 11 matching lines...) Expand all
890 is_monitoring_ = is_monitoring; 894 is_monitoring_ = is_monitoring;
891 #if !defined(OS_ANDROID) 895 #if !defined(OS_ANDROID)
892 for (std::set<TracingUI*>::iterator it = tracing_uis_.begin(); 896 for (std::set<TracingUI*>::iterator it = tracing_uis_.begin();
893 it != tracing_uis_.end(); it++) { 897 it != tracing_uis_.end(); it++) {
894 (*it)->OnMonitoringStateChanged(is_monitoring); 898 (*it)->OnMonitoringStateChanged(is_monitoring);
895 } 899 }
896 #endif 900 #endif
897 } 901 }
898 902
899 } // namespace content 903 } // namespace content
OLDNEW
« no previous file with comments | « base/trace_event/memory_dump_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698