summaryrefslogtreecommitdiff
path: root/chromium/chrome/common/offline_page_auto_fetcher.mojom
blob: 9c1f319484937297d919c3f2ce55eec6a8811e9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright 2018 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.

module chrome.mojom;

import "url/mojom/url.mojom";

enum OfflinePageAutoFetcherScheduleResult {
  // There are too many in flight requests, so the new request was not
  // scheduled.
  kNotEnoughQuota,
  // An error prevented the request from being scheduled.
  kOtherError,
  // There already exists a request for the URL, so the request was not
  // scheduled.
  kAlreadyScheduled,
  // The request was scheduled.
  kScheduled
};

// Provides controls for fetching offline pages automatically and quietly in
// the background.
interface OfflinePageAutoFetcher {
  // Attempts to schedule an auto fetch for the URL on the current page.
  // If user_requested is false, only schedules the fetch if there is remaining
  // quota.
  TrySchedule(bool user_requested) =>
    (OfflinePageAutoFetcherScheduleResult out);

  // Cancels a previously scheduled auto fetch for the URL of the current page.
  CancelSchedule();
};