OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 module mojo; | 5 module mojo; |
6 | 6 |
7 import "network/public/interfaces/url_loader.mojom"; | 7 import "third_party/mojo/src/mojo/public/interfaces/network/url_request.mojom"; |
| 8 import "third_party/mojo/src/mojo/public/interfaces/network/url_response.mojom"; |
8 | 9 |
9 // Factory for |URLLoaderInterceptor|. The factory is called once per URLLoader | 10 // Factory for |URLLoaderInterceptor|. The factory is called once per URLLoader |
10 // and will be associated to it. | 11 // and will be associated to it. |
11 interface URLLoaderInterceptorFactory { | 12 interface URLLoaderInterceptorFactory { |
12 Create(URLLoaderInterceptor& interceptor); | 13 Create(URLLoaderInterceptor& interceptor); |
13 }; | 14 }; |
14 | 15 |
15 // An |URLLoaderInterceptor| is associated to a single URLLoader. It will be | 16 // An |URLLoaderInterceptor| is associated to a single URLLoader. It will be |
16 // able to intercept requests sent to the URLLoader and transform these or | 17 // able to intercept requests sent to the URLLoader and transform these or |
17 // directly respond to it. It will also intercept responses and transform them | 18 // directly respond to it. It will also intercept responses and transform them |
(...skipping 25 matching lines...) Expand all Loading... |
43 | 44 |
44 // Response for the intercept methods. One and only one of the two fields | 45 // Response for the intercept methods. One and only one of the two fields |
45 // must be set. If |request| is set, the url loader will execute the request. | 46 // must be set. If |request| is set, the url loader will execute the request. |
46 // If |response| is set, the url loader will send it to its client. It is the | 47 // If |response| is set, the url loader will send it to its client. It is the |
47 // responsibility of the interceptor not to create infinite loops. | 48 // responsibility of the interceptor not to create infinite loops. |
48 // TODO(qsr): Change this to an union. | 49 // TODO(qsr): Change this to an union. |
49 struct URLLoaderInterceptorResponse { | 50 struct URLLoaderInterceptorResponse { |
50 URLRequest? request; | 51 URLRequest? request; |
51 URLResponse? response; | 52 URLResponse? response; |
52 }; | 53 }; |
OLD | NEW |