LCOV - code coverage report
Current view: top level - dom/plugins/ipc - ChildTimer.h (source / functions) Hit Total Coverage
Test: output.info Lines: 0 4 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 3 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
       2             :  * vim: sw=2 ts=8 et :
       3             :  */
       4             : /* This Source Code Form is subject to the terms of the Mozilla Public
       5             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       6             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
       7             : 
       8             : #ifndef mozilla_plugins_ChildTimer_h
       9             : #define mozilla_plugins_ChildTimer_h
      10             : 
      11             : #include "PluginMessageUtils.h"
      12             : #include "npapi.h"
      13             : #include "base/timer.h"
      14             : 
      15             : namespace mozilla {
      16             : namespace plugins {
      17             : 
      18             : class PluginInstanceChild;
      19             : typedef void (*TimerFunc)(NPP npp, uint32_t timerID);
      20             : 
      21             : class ChildTimer
      22             : {
      23             : public:
      24             :   /**
      25             :    * If initialization failed, ID() will return 0.
      26             :    */
      27             :   ChildTimer(PluginInstanceChild* instance,
      28             :              uint32_t interval,
      29             :              bool repeat,
      30             :              TimerFunc func);
      31           0 :   ~ChildTimer() { }
      32             : 
      33           0 :   uint32_t ID() const { return mID; }
      34             : 
      35             :   class IDComparator
      36             :   {
      37             :   public:
      38           0 :     bool Equals(ChildTimer* t, uint32_t id) const {
      39           0 :       return t->ID() == id;
      40             :     }
      41             :   };
      42             : 
      43             : private:
      44             :   PluginInstanceChild* mInstance;
      45             :   TimerFunc mFunc;
      46             :   bool mRepeating;
      47             :   uint32_t mID;
      48             :   base::RepeatingTimer<ChildTimer> mTimer;
      49             : 
      50             :   void Run();
      51             : 
      52             :   static uint32_t gNextTimerID;
      53             : };
      54             : 
      55             : } // namespace plugins
      56             : } // namespace mozilla
      57             : 
      58             : #endif // mozilla_plugins_ChildTimer_h

Generated by: LCOV version 1.13