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

Side by Side Diff: remoting/base/task_thread_proxy.h

Issue 7355011: Modify Chromoting logging to hook into base logging. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « remoting/base/logger.cc ('k') | remoting/base/task_thread_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef REMOTING_BASE_TASK_THREAD_PROXY_H_
6 #define REMOTING_BASE_TASK_THREAD_PROXY_H_
7
8 #include "base/message_loop.h"
9
10 namespace remoting {
11
12 // This is a refcounted class that is used to switch to the appropriate thread
13 // before running a task on a target object. It should be used whenever you
14 // need to post to an object, but:
15 // (1) You don't know when the object might be deleted, and
16 // (2) You cannot subclass the target from RefCountedThreadSafe.
17 //
18 // Example usage:
19 // Instead of:
20 // MyClass* obj;
21 // obj->Method(param);
22 // Use:
23 // proxy->Call(base::Bind(&MyClass::Method,
24 // base::Unretained(obj),
25 // param);
26 class TaskThreadProxy : public base::RefCountedThreadSafe<TaskThreadProxy> {
27 public:
28 TaskThreadProxy(MessageLoop* loop);
29
30 // Detach should be called when the target of the posted task is being
31 // destroyed.
32 void Detach();
33
34 void Call(const base::Closure& closure);
35
36 private:
37 friend class base::RefCountedThreadSafe<TaskThreadProxy>;
38
39 virtual ~TaskThreadProxy();
40
41 void CallClosure(const base::Closure& closure);
42
43 MessageLoop* message_loop_;
44
45 DISALLOW_COPY_AND_ASSIGN(TaskThreadProxy);
46 };
47
48 } // namespace remoting
49
50 #endif // REMOTING_BASE_TASK_THREAD_PROXY_H_
OLDNEW
« no previous file with comments | « remoting/base/logger.cc ('k') | remoting/base/task_thread_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698