dom/time/TimeChangeObserver.h
author Kannan Vijayan <kvijayan@mozilla.com>
Sat, 06 Oct 2012 09:58:06 -0400
changeset 109361 b47091bd31446103a4a66e47da3759e9bdb025d2
parent 106809 d059d752c212d0deecf1e7bd0a764bf51dce272d
child 111134 19e5770f482ad129b3ec142f3e7a230a80817a61
permissions -rw-r--r--
Bug 798589 - Change GetProp IC attachCallGetter to use script being jitted to get ion framesize instaed of script the getprop belongs to. (r=jandem)

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef _mozilla_time_change_observer_h_
#define _mozilla_time_change_observer_h_

#include "mozilla/Hal.h"
#include "mozilla/Observer.h"
#include "mozilla/HalTypes.h"
#include "nsPIDOMWindow.h"
#include "nsWeakPtr.h"

typedef mozilla::Observer<mozilla::hal::SystemTimeChange> SystemTimeChangeObserver;

class nsSystemTimeChangeObserver : public SystemTimeChangeObserver
{
public:
  static nsSystemTimeChangeObserver* GetInstance();
  virtual ~nsSystemTimeChangeObserver();
  void Notify(const mozilla::hal::SystemTimeChange& aReason);
  static nsresult AddWindowListener(nsIDOMWindow* aWindow);
  static nsresult RemoveWindowListener(nsIDOMWindow* aWindow);
private:
  nsresult AddWindowListenerImpl(nsIDOMWindow* aWindow);
  nsresult RemoveWindowListenerImpl(nsIDOMWindow* aWindow);
  nsSystemTimeChangeObserver() { };
  nsTArray<nsWeakPtr> mWindowListeners;
};

#endif //_mozilla_time_change_observer_h_