diff options
author | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-06 07:09:33 +0000 |
---|---|---|
committer | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-06 07:09:33 +0000 |
commit | 8367dc1173e79e010b5a12dd11f4480729068dfe (patch) | |
tree | a1b67ea9897185f712dee804b7bf6b6f93c2fa40 /base/thread_task_runner_handle.h | |
parent | 476e821a927581f03e07c5a88a0d242aa82e3c23 (diff) | |
download | chromium_src-8367dc1173e79e010b5a12dd11f4480729068dfe.zip chromium_src-8367dc1173e79e010b5a12dd11f4480729068dfe.tar.gz chromium_src-8367dc1173e79e010b5a12dd11f4480729068dfe.tar.bz2 |
Tweak SingleThreadTaskRunner and ThreadTaskRunnerHandle comments.
Review URL: https://chromiumcodereview.appspot.com/13600005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192725 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/thread_task_runner_handle.h')
-rw-r--r-- | base/thread_task_runner_handle.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/base/thread_task_runner_handle.h b/base/thread_task_runner_handle.h index 348c071..9a9dcfd 100644 --- a/base/thread_task_runner_handle.h +++ b/base/thread_task_runner_handle.h @@ -12,16 +12,17 @@ namespace base { class SingleThreadTaskRunner; -// ThreadTaskRunnerHandle stores a reference to the main task runner -// for each thread. Not more than one of these objects can be created -// per thread. After an instance of this object is created the Get() -// function will return the |task_runner| specified in the -// constructor. +// ThreadTaskRunnerHandle stores a reference to a thread's TaskRunner +// in thread-local storage. Callers can then retrieve the TaskRunner +// for the current thread by calling ThreadTaskRunnerHandle::Get(). +// At most one TaskRunner may be bound to each thread at a time. class BASE_EXPORT ThreadTaskRunnerHandle { public: // Gets the SingleThreadTaskRunner for the current thread. static scoped_refptr<SingleThreadTaskRunner> Get(); + // Binds |task_runner| to the current thread. |task_runner| must belong + // to the current thread for this to succeed. explicit ThreadTaskRunnerHandle( const scoped_refptr<SingleThreadTaskRunner>& task_runner); ~ThreadTaskRunnerHandle(); |