summaryrefslogtreecommitdiff
path: root/chromium/content/common/network_service.mojom
blob: a771cbd96b1e628f307c29a33232605130a4ca7d (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
34
35
36
37
38
39
// Copyright 2017 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 content.mojom;

import "mojo/common/file_path.mojom";
import "url_loader.mojom";
import "url_loader_factory.mojom";
import "url/mojo/url.mojom";

// Parameters for constructing a network context.
struct NetworkContextParams {
  // Points to the cookie file. If null, an in-memory database is used.
  mojo.common.mojom.FilePath? cookie_path;
  // Points to the cache directory. If null, an in-memory database is used.
  mojo.common.mojom.FilePath? cache_dir;
};

// Represents a distinct context for making network requests, with its own
// storage (e.g. cookies and cache).
interface NetworkContext {
  // |process_id| is 0 for requests initiated in the browser process, otherwise
  // it's the child process ID.
  CreateURLLoaderFactory(URLLoaderFactory& url_loader_factory,
                         uint32 process_id);

  // Handle a request to display cache data to the user. |url| is parsed to
  // display different parts of the cache.
  HandleViewCacheRequest(url.mojom.Url url,
                         URLLoaderClient client);
};

// Browser interface to the network service.
interface NetworkService {
  // Creates a new network context with the given parameters.
  CreateNetworkContext(NetworkContext& context,
                       NetworkContextParams params);
};