| 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 // Internal API backing the chrome.certificateProvider API events. | 5 // Internal API backing the chrome.certificateProvider API events. |
| 6 // The internal API associates events with replies to these events using request | 6 // The internal API associates events with replies to these events using request |
| 7 // IDs. A custom binding is used to hide these IDs from the public API. | 7 // IDs. A custom binding is used to hide these IDs from the public API. |
| 8 // Before an event hits the extension, the request ID is removed and instead a | 8 // Before an event hits the extension, the request ID is removed and instead a |
| 9 // callback is added to the event arguments. On the way back, when the extension | 9 // callback is added to the event arguments. On the way back, when the extension |
| 10 // runs the callback to report its results, the callback magically prepends the | 10 // runs the callback to report its results, the callback magically prepends the |
| 11 // request ID to the results and calls the respective internal report function | 11 // request ID to the results and calls the respective internal report function |
| 12 // (reportSignature or reportCertificates). | 12 // (reportSignature or reportCertificates). |
| 13 [implemented_in = "chrome/browser/extensions/api/certificate_provider/certificat
e_provider_api.h",use_movable_types=true] | 13 [implemented_in = "chrome/browser/extensions/api/certificate_provider/certificat
e_provider_api.h"] |
| 14 namespace certificateProviderInternal { | 14 namespace certificateProviderInternal { |
| 15 callback DoneCallback = void (); | 15 callback DoneCallback = void (); |
| 16 callback ResultCallback = void (ArrayBuffer[] rejectedCertificates); | 16 callback ResultCallback = void (ArrayBuffer[] rejectedCertificates); |
| 17 | 17 |
| 18 interface Functions { | 18 interface Functions { |
| 19 // Matches certificateProvider.SignCallback. Must be called without the | 19 // Matches certificateProvider.SignCallback. Must be called without the |
| 20 // signature to report an error. | 20 // signature to report an error. |
| 21 static void reportSignature( | 21 static void reportSignature( |
| 22 long requestId, | 22 long requestId, |
| 23 optional ArrayBuffer signature, | 23 optional ArrayBuffer signature, |
| 24 optional DoneCallback callback); | 24 optional DoneCallback callback); |
| 25 | 25 |
| 26 // Matches certificateProvider.CertificatesCallback. Must be called without | 26 // Matches certificateProvider.CertificatesCallback. Must be called without |
| 27 // the certificates argument to report an error. | 27 // the certificates argument to report an error. |
| 28 static void reportCertificates( | 28 static void reportCertificates( |
| 29 long requestId, | 29 long requestId, |
| 30 optional certificateProvider.CertificateInfo[] certificates, | 30 optional certificateProvider.CertificateInfo[] certificates, |
| 31 optional ResultCallback callback); | 31 optional ResultCallback callback); |
| 32 }; | 32 }; |
| 33 }; | 33 }; |
| 34 | 34 |
| OLD | NEW |