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

Side by Side Diff: chrome/browser/idle.cc

Issue 7864022: Fixing the bug, that caused UI to hang after unsupported device was inserted. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: style fixes Created 9 years, 3 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 | « chrome/browser/idle.h ('k') | chrome/browser/idle_chromeos.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 #include "chrome/browser/idle.h"
6
7 #include "base/bind.h"
8 #include "base/synchronization/waitable_event.h"
9
10
11
12 void IdleStateCallback(IdleState* return_state, base::WaitableEvent* done,
13 IdleState state) {
14 *return_state = state;
15 done->Signal();
16 }
17
18 IdleState CalculateIdleStateSync(unsigned int idle_threshold) {
19 IdleState return_state;
20 base::WaitableEvent done(true, false);
21 CalculateIdleState(idle_threshold, base::Bind(&IdleStateCallback,
22 &return_state, &done));
23 done.Wait();
24 return return_state;
25 }
OLDNEW
« no previous file with comments | « chrome/browser/idle.h ('k') | chrome/browser/idle_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698