зеркало из https://github.com/mozilla/gecko-dev.git
Bug 953425 - Part b: Move DOMFileMetadataParameters to WebIDL; r=janv
This commit is contained in:
Родитель
47fc8d091f
Коммит
5463f5d483
|
@ -33,6 +33,7 @@
|
|||
#include "nsContentUtils.h"
|
||||
|
||||
#include "mozilla/dom/EncodingUtils.h"
|
||||
#include "mozilla/dom/LockedFileBinding.h"
|
||||
|
||||
#define STREAM_COPY_BLOCK_SIZE 32768
|
||||
|
||||
|
@ -542,20 +543,13 @@ LockedFile::GetMetadata(JS::Handle<JS::Value> aParameters,
|
|||
}
|
||||
|
||||
// Get optional arguments.
|
||||
bool size, lastModified;
|
||||
if (!JSVAL_IS_VOID(aParameters) && !JSVAL_IS_NULL(aParameters)) {
|
||||
idl::DOMFileMetadataParameters config;
|
||||
nsresult rv = config.Init(aCx, aParameters.address());
|
||||
NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_FILEHANDLE_UNKNOWN_ERR);
|
||||
size = config.size;
|
||||
lastModified = config.lastModified;
|
||||
}
|
||||
else {
|
||||
size = lastModified = true;
|
||||
}
|
||||
DOMFileMetadataParameters config;
|
||||
JS::Rooted<JS::Value> parameters(aCx, aParameters);
|
||||
bool result = config.Init(aCx, parameters);
|
||||
NS_ENSURE_TRUE(result, NS_ERROR_DOM_FILEHANDLE_UNKNOWN_ERR);
|
||||
|
||||
nsRefPtr<MetadataParameters> params =
|
||||
new MetadataParameters(size, lastModified);
|
||||
new MetadataParameters(config.mSize, config.mLastModified);
|
||||
if (!params->IsConfigured()) {
|
||||
return NS_ERROR_TYPE_ERR;
|
||||
}
|
||||
|
|
|
@ -9,12 +9,6 @@
|
|||
interface nsIDOMEventListener;
|
||||
interface nsIDOMFileHandle;
|
||||
|
||||
dictionary DOMFileMetadataParameters
|
||||
{
|
||||
boolean size;
|
||||
boolean lastModified;
|
||||
};
|
||||
|
||||
[scriptable, builtinclass, uuid(a09cdc35-6b1e-42ce-95bb-f8f10a354202)]
|
||||
interface nsIDOMLockedFile : nsISupports
|
||||
{
|
||||
|
|
|
@ -30,6 +30,7 @@ interface DummyInterface : EventTarget {
|
|||
optional WifiResultOptions arg2);
|
||||
void AppNotificationServiceOptions(optional AppNotificationServiceOptions arg);
|
||||
void AppInfo(optional AppInfo arg1);
|
||||
void DOMFileMetadataParameters(optional DOMFileMetadataParameters arg);
|
||||
};
|
||||
|
||||
interface DummyInterfaceWorkers {
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
/* 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 obtaone at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
dictionary DOMFileMetadataParameters
|
||||
{
|
||||
boolean size = true;
|
||||
boolean lastModified = true;
|
||||
};
|
|
@ -209,6 +209,7 @@ WEBIDL_FILES = [
|
|||
'LinkStyle.webidl',
|
||||
'LocalMediaStream.webidl',
|
||||
'Location.webidl',
|
||||
'LockedFile.webidl',
|
||||
'MediaElementAudioSourceNode.webidl',
|
||||
'MediaError.webidl',
|
||||
'MediaList.webidl',
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
# Dictionary interface name, interface file name
|
||||
dictionaries = [
|
||||
[ 'DOMFileMetadataParameters', 'nsIDOMLockedFile.idl' ],
|
||||
[ 'CameraSize', 'nsIDOMCameraManager.idl' ],
|
||||
[ 'CameraRegion', 'nsIDOMCameraManager.idl' ],
|
||||
[ 'CameraPosition', 'nsIDOMCameraManager.idl' ],
|
||||
|
|
Загрузка…
Ссылка в новой задаче