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

Side by Side Diff: base/message_loop_proxy_impl.h

Issue 9427023: Add functions to expand PostDelayedTask interface. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add fix to RunOnPluginThread() in host_plugin.cc Created 8 years, 10 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 | « no previous file | base/message_loop_proxy_impl.cc » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 4
5 #ifndef BASE_MESSAGE_LOOP_PROXY_IMPL_H_ 5 #ifndef BASE_MESSAGE_LOOP_PROXY_IMPL_H_
6 #define BASE_MESSAGE_LOOP_PROXY_IMPL_H_ 6 #define BASE_MESSAGE_LOOP_PROXY_IMPL_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/base_export.h" 9 #include "base/base_export.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
11 #include "base/message_loop_proxy.h" 11 #include "base/message_loop_proxy.h"
12 #include "base/synchronization/lock.h" 12 #include "base/synchronization/lock.h"
13 13
14 namespace base { 14 namespace base {
15 15
16 // A stock implementation of MessageLoopProxy that is created and managed by a 16 // A stock implementation of MessageLoopProxy that is created and managed by a
17 // MessageLoop. For now a MessageLoopProxyImpl can only be created as part of a 17 // MessageLoop. For now a MessageLoopProxyImpl can only be created as part of a
18 // MessageLoop. 18 // MessageLoop.
19 class BASE_EXPORT MessageLoopProxyImpl 19 class BASE_EXPORT MessageLoopProxyImpl
20 : public MessageLoopProxy { 20 : public MessageLoopProxy {
21 public: 21 public:
22 virtual ~MessageLoopProxyImpl(); 22 virtual ~MessageLoopProxyImpl();
23 23
24 // MessageLoopProxy implementation 24 // MessageLoopProxy implementation
25 virtual bool PostDelayedTask(const tracked_objects::Location& from_here, 25 virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
26 const base::Closure& task, 26 const base::Closure& task,
27 int64 delay_ms) OVERRIDE; 27 int64 delay_ms) OVERRIDE;
28 virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
29 const base::Closure& task,
30 base::TimeDelta delay) OVERRIDE;
28 virtual bool PostNonNestableDelayedTask( 31 virtual bool PostNonNestableDelayedTask(
29 const tracked_objects::Location& from_here, 32 const tracked_objects::Location& from_here,
30 const base::Closure& task, 33 const base::Closure& task,
31 int64 delay_ms) OVERRIDE; 34 int64 delay_ms) OVERRIDE;
35 virtual bool PostNonNestableDelayedTask(
36 const tracked_objects::Location& from_here,
37 const base::Closure& task,
38 base::TimeDelta delay) OVERRIDE;
32 virtual bool RunsTasksOnCurrentThread() const OVERRIDE; 39 virtual bool RunsTasksOnCurrentThread() const OVERRIDE;
33 40
34 protected: 41 protected:
35 // Override OnDestruct so that we can delete the object on the target message 42 // Override OnDestruct so that we can delete the object on the target message
36 // loop if it still exists. 43 // loop if it still exists.
37 virtual void OnDestruct() const OVERRIDE; 44 virtual void OnDestruct() const OVERRIDE;
38 45
39 private: 46 private:
40 MessageLoopProxyImpl(); 47 MessageLoopProxyImpl();
41 48
42 // Called directly by MessageLoop::~MessageLoop. 49 // Called directly by MessageLoop::~MessageLoop.
43 virtual void WillDestroyCurrentMessageLoop(); 50 virtual void WillDestroyCurrentMessageLoop();
44 51
45 52
46 bool PostTaskHelper(const tracked_objects::Location& from_here, 53 bool PostTaskHelper(const tracked_objects::Location& from_here,
47 const base::Closure& task, 54 const base::Closure& task,
48 int64 delay_ms, 55 base::TimeDelta delay,
49 bool nestable); 56 bool nestable);
50 57
51 // Allow the messageLoop to create a MessageLoopProxyImpl. 58 // Allow the messageLoop to create a MessageLoopProxyImpl.
52 friend class ::MessageLoop; 59 friend class ::MessageLoop;
53 60
54 // The lock that protects access to target_message_loop_. 61 // The lock that protects access to target_message_loop_.
55 mutable base::Lock message_loop_lock_; 62 mutable base::Lock message_loop_lock_;
56 MessageLoop* target_message_loop_; 63 MessageLoop* target_message_loop_;
57 64
58 DISALLOW_COPY_AND_ASSIGN(MessageLoopProxyImpl); 65 DISALLOW_COPY_AND_ASSIGN(MessageLoopProxyImpl);
59 }; 66 };
60 67
61 } // namespace base 68 } // namespace base
62 69
63 #endif // BASE_MESSAGE_LOOP_PROXY_IMPL_H_ 70 #endif // BASE_MESSAGE_LOOP_PROXY_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | base/message_loop_proxy_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698