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

Side by Side Diff: chrome_frame/task_marshaller.cc

Issue 8555001: base::Bind: Convert chrome_frame/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Win-dies. Created 9 years, 1 month 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 | « chrome_frame/task_marshaller.h ('k') | chrome_frame/test/automation_client_mock.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) 2011 The Chromium Authors. All rights reserved. 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 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 #include "chrome_frame/task_marshaller.h" 5 #include "chrome_frame/task_marshaller.h"
6 #include "base/task.h" 6 #include "base/task.h"
7 7
8 TaskMarshallerThroughMessageQueue::TaskMarshallerThroughMessageQueue() 8 TaskMarshallerThroughMessageQueue::TaskMarshallerThroughMessageQueue()
9 : wnd_(NULL), 9 : wnd_(NULL),
10 msg_(0xFFFF) { 10 msg_(0xFFFF) {
11 } 11 }
12 12
13 TaskMarshallerThroughMessageQueue::~TaskMarshallerThroughMessageQueue() { 13 TaskMarshallerThroughMessageQueue::~TaskMarshallerThroughMessageQueue() {
14 ClearTasks(); 14 ClearTasks();
15 } 15 }
16 16
17 void TaskMarshallerThroughMessageQueue::PostTask( 17 void TaskMarshallerThroughMessageQueue::PostTask(
18 const tracked_objects::Location& from_here, const base::Closure& task) { 18 const tracked_objects::Location& from_here, const base::Closure& task) {
19 DCHECK(wnd_ != NULL); 19 DCHECK(wnd_ != NULL);
20
20 lock_.Acquire(); 21 lock_.Acquire();
21 bool has_work = !pending_tasks_.empty(); 22 bool has_work = !pending_tasks_.empty();
22 pending_tasks_.push(task); 23 pending_tasks_.push(task);
23 lock_.Release(); 24 lock_.Release();
24 25
25 // Don't post message if there is already one. 26 // Don't post message if there is already one.
26 if (has_work) 27 if (has_work)
27 return; 28 return;
28 29
29 if (!::PostMessage(wnd_, msg_, 0, 0)) { 30 if (!::PostMessage(wnd_, msg_, 0, 0)) {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 base::AutoLock lock(lock_); 125 base::AutoLock lock(lock_);
125 DVLOG_IF(1, !pending_tasks_.empty()) << "Destroying " 126 DVLOG_IF(1, !pending_tasks_.empty()) << "Destroying "
126 << pending_tasks_.size() 127 << pending_tasks_.size()
127 << " pending tasks."; 128 << " pending tasks.";
128 while (!pending_tasks_.empty()) 129 while (!pending_tasks_.empty())
129 pending_tasks_.pop(); 130 pending_tasks_.pop();
130 131
131 while (!delayed_tasks_.empty()) 132 while (!delayed_tasks_.empty())
132 delayed_tasks_.pop(); 133 delayed_tasks_.pop();
133 } 134 }
OLDNEW
« no previous file with comments | « chrome_frame/task_marshaller.h ('k') | chrome_frame/test/automation_client_mock.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698