huangcm
2025-08-30 0269911b91ed7e03c24005924cc6423abf245fb8
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
// Copyright 2015 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.
 
library fuchsia.net.oldhttp;
 
struct URLLoaderStatus {
  // If the loader has failed due to a network level error, this field will be
  // set.
  HttpError? error;
 
  // Set to true if the URLLoader is still working. Set to false once an error
  // is encountered or the response body is completely copied to the response
  // body stream.
  bool is_loading;
 
  // TODO(darin): Add further details about the stages of loading (e.g.,
  // "resolving host") that happen prior to receiving bytes.
};
 
interface URLLoader {
  // Loads the given |request|, asynchronously producing |response|. Consult
  // |response| to determine if the request resulted in an error, was
  // redirected, or has a response body to be consumed.
  1: Start(URLRequest request) -> (URLResponse response);
 
  // If the request passed to |Start| had |auto_follow_redirects| set to false,
  // then upon receiving an URLResponse with a non-NULL |redirect_url| field,
  // |FollowRedirect| may be called to load the URL indicated by the redirect.
  2: FollowRedirect() -> (URLResponse response);
 
  // Query status about the URLLoader.
  3: QueryStatus() -> (URLLoaderStatus status);
};