| 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 [DartPackage="mojo_services"] |
| 5 module mojo; | 6 module mojo; |
| 6 | 7 |
| 7 import "third_party/mojo/src/mojo/public/interfaces/network/url_request.mojom"; | 8 import "mojo/public/interfaces/network/url_request.mojom"; |
| 8 import "third_party/mojo/src/mojo/public/interfaces/network/url_response.mojom"; | 9 import "mojo/public/interfaces/network/url_response.mojom"; |
| 9 | 10 |
| 10 // Factory for |URLLoaderInterceptor|. The factory is called once per URLLoader | 11 // Factory for |URLLoaderInterceptor|. The factory is called once per URLLoader |
| 11 // and will be associated to it. | 12 // and will be associated to it. |
| 12 interface URLLoaderInterceptorFactory { | 13 interface URLLoaderInterceptorFactory { |
| 13 Create(URLLoaderInterceptor& interceptor); | 14 Create(URLLoaderInterceptor& interceptor); |
| 14 }; | 15 }; |
| 15 | 16 |
| 16 // An |URLLoaderInterceptor| is associated to a single URLLoader. It will be | 17 // An |URLLoaderInterceptor| is associated to a single URLLoader. It will be |
| 17 // able to intercept requests sent to the URLLoader and transform these or | 18 // able to intercept requests sent to the URLLoader and transform these or |
| 18 // directly respond to it. It will also intercept responses and transform them | 19 // directly respond to it. It will also intercept responses and transform them |
| (...skipping 25 matching lines...) Expand all Loading... |
| 44 | 45 |
| 45 // Response for the intercept methods. One and only one of the two fields | 46 // Response for the intercept methods. One and only one of the two fields |
| 46 // must be set. If |request| is set, the url loader will execute the request. | 47 // must be set. If |request| is set, the url loader will execute the request. |
| 47 // If |response| is set, the url loader will send it to its client. It is the | 48 // If |response| is set, the url loader will send it to its client. It is the |
| 48 // responsibility of the interceptor not to create infinite loops. | 49 // responsibility of the interceptor not to create infinite loops. |
| 49 // TODO(qsr): Change this to an union. | 50 // TODO(qsr): Change this to an union. |
| 50 struct URLLoaderInterceptorResponse { | 51 struct URLLoaderInterceptorResponse { |
| 51 URLRequest? request; | 52 URLRequest? request; |
| 52 URLResponse? response; | 53 URLResponse? response; |
| 53 }; | 54 }; |
| OLD | NEW |