xpcom/threads/nsISupportsPriority.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/xpcom/threads/nsISupportsPriority.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,45 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +#include "nsISupports.idl"
     1.9 +
    1.10 +/**
    1.11 + * This interface exposes the general notion of a scheduled object with a
    1.12 + * integral priority value.  Following UNIX conventions, smaller (and possibly
    1.13 + * negative) values have higher priority.
    1.14 + *
    1.15 + * This interface does not strictly define what happens when the priority of an
    1.16 + * object is changed.  An implementation of this interface is free to define
    1.17 + * the side-effects of changing the priority of an object.  In some cases,
    1.18 + * changing the priority of an object may be disallowed (resulting in an
    1.19 + * exception being thrown) or may simply be ignored.
    1.20 + */
    1.21 +[scriptable, uuid(aa578b44-abd5-4c19-8b14-36d4de6fdc36)]
    1.22 +interface nsISupportsPriority : nsISupports
    1.23 +{
    1.24 +  /**
    1.25 +   * Typical priority values.
    1.26 +   */
    1.27 +  const long PRIORITY_HIGHEST = -20;
    1.28 +  const long PRIORITY_HIGH    = -10;
    1.29 +  const long PRIORITY_NORMAL  =   0;
    1.30 +  const long PRIORITY_LOW     =  10;
    1.31 +  const long PRIORITY_LOWEST  =  20;
    1.32 +  
    1.33 +  /**
    1.34 +   * This attribute may be modified to change the priority of this object.  The
    1.35 +   * implementation of this interface is free to truncate a given priority
    1.36 +   * value to whatever limits are appropriate.  Typically, this attribute is
    1.37 +   * initialized to PRIORITY_NORMAL, but implementations may choose to assign a
    1.38 +   * different initial value.
    1.39 +   */
    1.40 +  attribute long priority;
    1.41 +
    1.42 +  /**
    1.43 +   * This method adjusts the priority attribute by a given delta.  It helps
    1.44 +   * reduce the amount of coding required to increment or decrement the value
    1.45 +   * of the priority attribute.
    1.46 +   */
    1.47 +  void adjustPriority(in long delta);
    1.48 +};

mercurial