diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-26 19:16:01 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-26 19:16:01 +0000 |
commit | 3fd881083236b3175d7968420a6301dcbf94fb1d (patch) | |
tree | 5bb6bd3d2d7ac4c5c4575d0dc01ca11370426e23 | |
parent | edbdaa5bc7db584d24aeabb82297c3f69b5eed13 (diff) | |
download | chromium_src-3fd881083236b3175d7968420a6301dcbf94fb1d.zip chromium_src-3fd881083236b3175d7968420a6301dcbf94fb1d.tar.gz chromium_src-3fd881083236b3175d7968420a6301dcbf94fb1d.tar.bz2 |
[Sync] Subclass BrowserThreadModelWorker with descriptive names
This is so that we can distinguish threads from stack traces alone.
BUG=97271
TEST=
Review URL: http://codereview.chromium.org/8002032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102773 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/sync/glue/browser_thread_model_worker.cc | 10 | ||||
-rw-r--r-- | chrome/browser/sync/glue/browser_thread_model_worker.h | 15 | ||||
-rw-r--r-- | chrome/browser/sync/glue/sync_backend_registrar.cc | 6 |
3 files changed, 27 insertions, 4 deletions
diff --git a/chrome/browser/sync/glue/browser_thread_model_worker.cc b/chrome/browser/sync/glue/browser_thread_model_worker.cc index 49bdfb8..7e76630 100644 --- a/chrome/browser/sync/glue/browser_thread_model_worker.cc +++ b/chrome/browser/sync/glue/browser_thread_model_worker.cc @@ -49,4 +49,14 @@ ModelSafeGroup BrowserThreadModelWorker::GetModelSafeGroup() { return group_; } +DatabaseModelWorker::DatabaseModelWorker() + : BrowserThreadModelWorker(BrowserThread::DB, GROUP_DB) {} + +DatabaseModelWorker::~DatabaseModelWorker() {} + +FileModelWorker::FileModelWorker() + : BrowserThreadModelWorker(BrowserThread::FILE, GROUP_FILE) {} + +FileModelWorker::~FileModelWorker() {} + } // namespace browser_sync diff --git a/chrome/browser/sync/glue/browser_thread_model_worker.h b/chrome/browser/sync/glue/browser_thread_model_worker.h index 51670a1..9720cdb 100644 --- a/chrome/browser/sync/glue/browser_thread_model_worker.h +++ b/chrome/browser/sync/glue/browser_thread_model_worker.h @@ -39,6 +39,21 @@ class BrowserThreadModelWorker : public browser_sync::ModelSafeWorker { DISALLOW_COPY_AND_ASSIGN(BrowserThreadModelWorker); }; +// Subclass BrowserThreadModelWorker so that we can distinguish them +// from stack traces alone. + +class DatabaseModelWorker : public BrowserThreadModelWorker { + public: + DatabaseModelWorker(); + virtual ~DatabaseModelWorker(); +}; + +class FileModelWorker : public BrowserThreadModelWorker { + public: + FileModelWorker(); + virtual ~FileModelWorker(); +}; + } // namespace browser_sync #endif // CHROME_BROWSER_SYNC_GLUE_BROWSER_THREAD_MODEL_WORKER_H_ diff --git a/chrome/browser/sync/glue/sync_backend_registrar.cc b/chrome/browser/sync/glue/sync_backend_registrar.cc index 7f1ea45..6408104 100644 --- a/chrome/browser/sync/glue/sync_backend_registrar.cc +++ b/chrome/browser/sync/glue/sync_backend_registrar.cc @@ -60,10 +60,8 @@ SyncBackendRegistrar::SyncBackendRegistrar( DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); CHECK(profile_); DCHECK(sync_loop_); - workers_[GROUP_DB] = - new BrowserThreadModelWorker(BrowserThread::DB, GROUP_DB); - workers_[GROUP_FILE] = - new BrowserThreadModelWorker(BrowserThread::FILE, GROUP_FILE); + workers_[GROUP_DB] = new DatabaseModelWorker(); + workers_[GROUP_FILE] = new FileModelWorker(); workers_[GROUP_UI] = ui_worker_; workers_[GROUP_PASSIVE] = new ModelSafeWorker(); |