docshell/shistory/nsIPartialSHistory.idl
author Gregory Szorc <gps@mozilla.com>
Tue, 07 Nov 2017 16:38:39 -0800
changeset 441455 b5f79b0f2a3586faf692c715b443264478e921c3
parent 372013 664f73663acba298c8451e1ea446d9af3120512a
permissions -rw-r--r--
Bug 1412932 - Switch to PGO build in Makefile.in; r=ted Previously, client.mk made the decision of whether to perform a PGO build. This required passing around MOZ_PGO and invoking a separate make target if this variable was set. In this commit, we move this logic to Makefile.in. We employ a special mechanism in rules.mk to override the default make target so `make` evaluates "profiledbuild" if MOZ_PGO is set. This also required using an explicit target for $(MAKE) invocations inside the "profiledbuild" rule to avoid infinite recursion. MozReview-Commit-ID: 8sHiVspMisM

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* 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/. */

#include "nsISupports.idl"

interface nsIGroupedSHistory;
interface nsIFrameLoader;

/**
 * nsIPartialSHistory represents a part of nsIGroupedSHistory. It associates to
 * a "partial" nsISHistory in either local or remote process.
 */
[scriptable, builtinclass, uuid(5cd75e28-838c-4a0a-972e-6005f736ef7a)]
interface nsIPartialSHistory : nsISupports
{
  // The number of entries of its corresponding nsISHistory.
  [infallible] readonly attribute unsigned long count;

  // The current global index of the active shentry in this partialSHistory.
  [infallible] readonly attribute long globalIndex;

  // If it's part of a grouped session history, globalIndexOffset denotes the
  // number of entries ahead.
  [infallible] readonly attribute unsigned long globalIndexOffset;

  // The frameloader which owns this partial session history.
  readonly attribute nsIFrameLoader ownerFrameLoader;

  // The groupedSHistory which this partialSHistory is a part of, or null.
  readonly attribute nsIGroupedSHistory groupedSHistory;

  // The current state of the nsIPartialSHistory, whether it is active,
  // inactive, or currently prerendering.
  const long STATE_INACTIVE = 0;
  const long STATE_ACTIVE = 1;
  const long STATE_PRERENDER = 2;

  [infallible] attribute long activeState;

  /**
   * Notify that it's been added to a grouped session history. It also implies
   * it's becoming the active partial history of the group.
   *
   * @param aGroup                 The GroupedSHistory which this partialSHistory
   *                               is joining.
   *
   * @param aOffset                The number of entries in preceding partial
   *                               session histories.
   */
  void onAttachGroupedSHistory(in nsIGroupedSHistory aGroup, in unsigned long aOffset);

  /**
   * This method is used by the TabParent to notify the PartialSHistory
   * that the state of its corresponding nsISHistory in the content process
   * has been updated. It is unused in the in-process case.
   *
   * @param aCount      The number of entries in the associated session history.
   * @param aLocalIndex The local index of the currently active entry in the
   *                    associated session history
   */
  void handleSHistoryUpdate(in unsigned long aCount, in unsigned long aLocalIndex, in boolean aTruncate);

  /**
   * Notify that the partial session history has been swapped in as the active
   * session history. Only an active session history can possibly add / remove /
   * replace its history entries.
   *
   * @param aGlobalLength      The up-to-date global length.
   * @param aTargetLocalIndex  The local index to navigate to.
   */
  void onActive(in unsigned long aGlobalLength, in unsigned long aTargetLocalIndex);

  /**
   * Notify that the partial session history has been swapped out and is no
   * longer active.
   */
  void onDeactive();
};