Skip to content

Commit

Permalink
Bug 917102 - 0001. WebIDL changes. r=mrbkap, r=ehsan
Browse files Browse the repository at this point in the history
  • Loading branch information
chuck-lee committed Apr 30, 2014
1 parent cbbc877 commit d8afc37
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 0 deletions.
22 changes: 22 additions & 0 deletions dom/webidl/MozWifiManager.webidl
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,28 @@ interface MozWifiManager : EventTarget {
*/
DOMRequest setHttpProxy(MozWifiNetwork network, any info);

/**
* Import a certificate file, only support CA certificate now.
* @param certBlob A Blob object containing raw data of certificate to be imported.
* Supported format: binary/base64 encoded DER certificates.
* (.der/.crt/.cer/.pem)
* Cause error if importing certificates already imported.
* @param certPassword Password of certificate.
* @param certNickname User assigned nickname for imported certificate.
* Nickname must be unique, it causes error on redundant nickname.
* onsuccess: We have successfully imported certificate. request.result is an
* object, containing information of imported CA:
* {
* nickname: Nickname of imported CA, String.
* usage: Supported usage of imported CA, Array of String,
* includes: "ServerCert".
* }
* onerror: We have failed to import certificate.
*/
DOMRequest importCert(Blob certBlob,
DOMString certPassword,
DOMString certNickname);

/**
* Returns whether or not wifi is currently enabled.
*/
Expand Down
14 changes: 14 additions & 0 deletions dom/webidl/WifiOptions.webidl
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,17 @@ dictionary WifiResultOptions
long dns2 = 0;
long server = 0;
};


/**
* This dictionary holds the callback parameter sent back from WifiCertService
* to WifiWorker, and should only be passed around in chrome process.
*/
dictionary WifiCertServiceResultOptions
{
long id = 0; // request id in WifiWorker.
long status = 0; // error code of the request, 0 indicates success.
unsigned short usageFlag = 0; // usage flag of certificate, the flag is defined
// in nsIWifiCertService.idl
DOMString nickname = ""; // nickname of certificate of the request.
};
1 change: 1 addition & 0 deletions dom/wifi/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ XPIDL_SOURCES += [
'nsIDOMMozWifiP2pStatusChangeEvent.idl',
'nsIDOMMozWifiStatusChangeEvent.idl',
'nsIWifi.idl',
'nsIWifiCertService.idl',
'nsIWifiService.idl',
]

Expand Down
35 changes: 35 additions & 0 deletions dom/wifi/nsIWifiCertService.idl
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "nsISupports.idl"

interface nsIDOMBlob;
interface nsIWifiEventListener;

[scriptable, uuid(49e8e04e-eb05-4c92-84a6-7af32310f0c3)]
interface nsIWifiCertService : nsISupports
{
const unsigned short WIFI_CERT_USAGE_FLAG_SERVER = 0x01;
const unsigned short WIFI_CERT_USAGE_FLAG_USER = 0x02;

void start(in nsIWifiEventListener listener);
void shutdown();

/**
* Import a certificate file.
*
* @param id
* Request ID.
* @param certBlob
* A Blob object containing raw data of certificate to be imported.
* @param certPassword
* Password of certificate.
* @param certNickname
* User assigned nickname for imported certificate.
*/
void importCert(in long id,
in nsIDOMBlob certBlob,
in DOMString certPassword,
in DOMString certNickname);
};

0 comments on commit d8afc37

Please sign in to comment.