ipc/chromium/src/base/message_pump_default.h
author jar@chromium.org, L. David Baron <dbaron@dbaron.org>
Thu, 21 Feb 2013 18:10:59 -0800
changeset 122585 85b91048c1cd1cbb9c389621ef425a183161c92d
parent 75704 0f3983da53fb9f3da65630abc6bb495d5d7a663d
child 297590 a2f1e240a92ffef6a9d387f3d9491f16c0a2672b
permissions -rw-r--r--
Bug 842550: Switch to using TimeTicks rather than Time in message loops. rs=cjones The ipc/chromium/src/base/ changes here (except those mentioned below) are the majority of the base/ changes (excluding those that patch code that does not exist yet in our copy) in: > From: jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> > Date: Sat, 6 Nov 2010 22:23:29 +0000 (+0000) > Subject: Switch to using TimeTicks rather than Time in message loops > X-Git-Url: http://git.chromium.org/gitweb/?p=chromium.git;a=commitdiff_plain;h=f592c218c18bd1f8308489aaef2e329244ced330 > > Switch to using TimeTicks rather than Time in message loops > > Switch to using TimeTicks rather than Time so that we > are not dependent on changes in the system clock. > > r=mbelshe,darin > Review URL: http://codereview.chromium.org/3884001 > > git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65322 0039d316-1c4b-4281-b951-d872f2087c98 The ipc/glue changes, and the message_pump_android.* and message_pump_qt.* changes in ipc/chromium/src/base/, change signatures to match.

// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef BASE_MESSAGE_PUMP_DEFAULT_H_
#define BASE_MESSAGE_PUMP_DEFAULT_H_

#include "base/message_pump.h"
#include "base/time.h"
#include "base/waitable_event.h"

namespace base {

class MessagePumpDefault : public MessagePump {
 public:
  MessagePumpDefault();
  ~MessagePumpDefault() {}

  // MessagePump methods:
  virtual void Run(Delegate* delegate);
  virtual void Quit();
  virtual void ScheduleWork();
  virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time);

 protected:
  // This flag is set to false when Run should return.
  bool keep_running_;

  // Used to sleep until there is more work to do.
  WaitableEvent event_;

  // The time at which we should call DoDelayedWork.
  TimeTicks delayed_work_time_;

 private:
  DISALLOW_COPY_AND_ASSIGN(MessagePumpDefault);
};

}  // namespace base

#endif  // BASE_MESSAGE_PUMP_DEFAULT_H_