summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjbates@chromium.org <jbates@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-03 17:51:25 +0000
committerjbates@chromium.org <jbates@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-03 17:51:25 +0000
commit19d8a90fbc1fd7c26a873dc84fcbc875c509cf11 (patch)
treefc4334d1a7764649899ee6bbfef21c347f1a11fb /chrome
parente4a2d08560a6853ce728c142ee71a104f14acea0 (diff)
downloadchromium_src-19d8a90fbc1fd7c26a873dc84fcbc875c509cf11.zip
chromium_src-19d8a90fbc1fd7c26a873dc84fcbc875c509cf11.tar.gz
chromium_src-19d8a90fbc1fd7c26a873dc84fcbc875c509cf11.tar.bz2
Add trace code to track all posted tasks in message_loop and WorkerThreads (non-official builds only).
It's very helpful to understand what chrome is doing at runtime. Sometimes a thread in chrome does something expensive that causes a frame hitch. With this change, any expensive task will show up clearly in traces, with the file/function of where the task was posted. TEST=go to about:tracing, run a trace and notice that all tasks are traced. Review URL: http://codereview.chromium.org/7778033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103740 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/sync/profile_sync_service.cc8
-rw-r--r--chrome/browser/sync/profile_sync_service.h5
2 files changed, 4 insertions, 9 deletions
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc
index 5be5a23..17cf14a 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -565,7 +565,7 @@ void ProfileSyncService::NotifyObservers() {
void ProfileSyncService::ClearStaleErrors() {
unrecoverable_error_detected_ = false;
unrecoverable_error_message_.clear();
- unrecoverable_error_location_.reset();
+ unrecoverable_error_location_ = tracked_objects::Location();
last_actionable_error_ = SyncProtocolError();
}
@@ -644,11 +644,7 @@ void ProfileSyncService::OnUnrecoverableError(
const std::string& message) {
unrecoverable_error_detected_ = true;
unrecoverable_error_message_ = message;
- unrecoverable_error_location_.reset(
- new tracked_objects::Location(from_here.function_name(),
- from_here.file_name(),
- from_here.line_number(),
- from_here.program_counter()));
+ unrecoverable_error_location_ = from_here;
// Tell the wizard so it can inform the user only if it is already open.
wizard_.Step(SyncSetupWizard::FATAL_ERROR);
diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h
index 1cdd662..1f45e1f 100644
--- a/chrome/browser/sync/profile_sync_service.h
+++ b/chrome/browser/sync/profile_sync_service.h
@@ -293,8 +293,7 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
return unrecoverable_error_message_;
}
tracked_objects::Location unrecoverable_error_location() {
- return unrecoverable_error_location_.get() ?
- *unrecoverable_error_location_.get() : tracked_objects::Location();
+ return unrecoverable_error_location_;
}
bool UIShouldDepictAuthInProgress() const {
@@ -613,7 +612,7 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
// A message sent when an unrecoverable error occurred.
std::string unrecoverable_error_message_;
- scoped_ptr<tracked_objects::Location> unrecoverable_error_location_;
+ tracked_objects::Location unrecoverable_error_location_;
// Manages the start and stop of the various data types.
scoped_ptr<browser_sync::DataTypeManager> data_type_manager_;