Commit 5d78c63f authored by Tim Judkins's avatar Tim Judkins Committed by Commit Bot

[Extensions] Remove nodefine from schemas and the APIs that used it

The nodefine property was added over 4 years ago when deprecating some
Media Gallery APIs. This CL removes those deprecated APIs, along with
the nodefine property.

Bug: 1136659
Change-Id: Idf087287926903fbaa83ee13c2340320043fc038
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2462254Reviewed-by: default avatarTommy Li <tommycli@chromium.org>
Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Commit-Queue: Tim Judkins <tjudkins@chromium.org>
Cr-Commit-Position: refs/heads/master@{#816306}
parent ae0d959a
......@@ -21,5 +21,4 @@ class ExtensionIdltestApiTest : public extensions::ExtensionApiTest {
IN_PROC_BROWSER_TEST_F(ExtensionIdltestApiTest, IdlCompiler) {
EXPECT_TRUE(RunExtensionSubtest("idltest/binary_data", "binary.html"));
EXPECT_TRUE(RunExtensionSubtest("idltest/nocompile", "nocompile.html"));
EXPECT_TRUE(RunExtensionSubtest("idltest/nodefine", "nodefine.html"));
}
......@@ -34,18 +34,6 @@ namespace mediaGalleries {
mimeTypeOnly
};
[nodefine, inline_doc] enum ScanProgressType {
// The scan started.
start,
// The scan was cancelled.
cancel,
// The scan finished but none of the result have been added,
// addScanResults() has to be called to ask the user for permission.
finish,
// The scan encountered an error and could not proceed.
error
};
[inline_doc] dictionary GalleryChangeDetails {
// Type of change event.
GalleryChangeType type;
......@@ -76,8 +64,6 @@ namespace mediaGalleries {
void ([instanceOf=DOMFileSystem] object[] mediaFileSystems,
DOMString selectedFileSystemName);
[nodefine] callback DropPermissionForMediaFileSystemCallback = void ();
[inline_doc] dictionary MediaFileSystemMetadata {
// The name of the file system.
DOMString name;
......@@ -100,20 +86,6 @@ namespace mediaGalleries {
boolean isAvailable;
};
[nodefine, inline_doc] dictionary ScanProgressDetails {
// The type of progress event, i.e. start, finish, etc.
ScanProgressType type;
// The number of Galleries found.
long? galleryCount;
// Appoximate number of media files found; some file types can be either
// audio or video and are included in both counts.
long? audioCount;
long? imageCount;
long? videoCount;
};
callback MediaFileSystemsMetadataCallback =
void (MediaFileSystemMetadata[] metadata);
......@@ -168,8 +140,6 @@ namespace mediaGalleries {
};
callback AddGalleryWatchCallback = void (AddGalleryWatchResult result);
[nodefine] callback GetAllGalleryWatchCallback =
void (DOMString[] galleryIds);
interface Functions {
// Get the media galleries configured in this user agent. If none are
......@@ -184,41 +154,10 @@ namespace mediaGalleries {
// gesture, the callback will run as though the user canceled.
static void addUserSelectedFolder(AddUserFolderCallback callback);
// Give up access to a given media gallery.
[nodefine, deprecated="The user can manually drop access to galleries
via the permissions dialog."]
static void dropPermissionForMediaFileSystem(
DOMString galleryId,
optional DropPermissionForMediaFileSystemCallback callback);
// Start a scan of the user's hard disks for directories containing media.
// The scan may take a long time so progress and completion is communicated
// by events. No permission is granted as a result of the scan, see
// addScanResults.
[nodefine, deprecated="The mediaGalleries API no longer supports scanning."]
static void startMediaScan();
// Cancel any pending media scan. Well behaved apps should provide a way
// for the user to cancel scans they start.
[nodefine, deprecated="The mediaGalleries API no longer supports scanning."]
static void cancelMediaScan();
// Show the user the scan results and let them add any or all of them as
// galleries. This should be used after the 'finish' onScanProgress()
// event has happened. All galleries the app has access to are returned, not
// just the newly added galleries.
[nodefine, deprecated="The mediaGalleries API no longer supports scanning."]
static void addScanResults(MediaFileSystemsCallback callback);
// Get metadata about a specific media file system.
[nocompile] static MediaFileSystemMetadata getMediaFileSystemMetadata(
[instanceOf=DOMFileSystem] object mediaFileSystem);
// Get metadata for all available media galleries.
[nodefine, deprecated="Use getMediaFileSystemMetadata instead."]
static void getAllMediaFileSystemMetadata(
MediaFileSystemsMetadataCallback callback);
// Gets the media-specific metadata for a media file. This should work
// for files in media galleries as well as other DOM filesystems.
static void getMetadata([instanceOf=Blob] object mediaFile,
......@@ -232,24 +171,10 @@ namespace mediaGalleries {
// Removes a gallery watch for the gallery with the specified gallery ID.
static void removeGalleryWatch(DOMString galleryId);
// Notifies which galleries are being watched via the given callback.
[nodefine, deprecated="Applications should store their own gallery watches
as they are added."]
static void getAllGalleryWatch(GetAllGalleryWatchCallback callback);
// Removes all gallery watches.
[nodefine, deprecated="Use removeGalleryWatch instead."]
static void removeAllGalleryWatch();
};
interface Events {
// Fired when a media gallery is changed or a gallery watch is dropped.
static void onGalleryChanged(GalleryChangeDetails details);
// The pending media scan has changed state. See details for more
// information.
[nodefine, deprecated="The mediaGalleries API no longer supports scanning."]
static void onScanProgress(ScanProgressDetails details);
};
};
......@@ -26,11 +26,6 @@ namespace idltest {
// |switch| should cause compile errors if it does). But the name should
// get defined and made visible from within extensions/apps code.
[nocompile] static void nocompileFunc(long switch);
// This function should not have C++ code autogenerated (the variable name
// |switch| should cause compile errors if it does). The name should also
// never be defined in Javascript and invisible to extensions/apps code.
[nodefine] static void nodefineFunc(long switch);
};
};
{
"name": "IDLTest API test extension",
"version": "0.5",
"permissions": ["idltest"],
"manifest_version": 2
}
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
chrome.test.runTests([
function nodefineFunc() {
chrome.test.assertEq("undefined", typeof(chrome.idltest.nodefineFunc));
chrome.test.succeed();
}
]);
......@@ -58,9 +58,6 @@ def GenerateSchema(generator_name,
if generator_name == 'cpp':
api_def = json_schema.DeleteNodes(api_def, 'nocompile')
# Delete all 'nodefine' nodes. They are only for documentation.
api_def = json_schema.DeleteNodes(api_def, 'nodefine')
api_defs.extend(api_def)
api_model = Model(allow_inline_enums=False)
......
......@@ -163,8 +163,6 @@ class Dictionary(object):
result = {'id': self.node.GetName(),
'properties': properties,
'type': 'object'}
if self.node.GetProperty('nodefine'):
result['nodefine'] = True
if self.node.GetProperty('nodoc'):
result['nodoc'] = True
elif self.node.GetProperty('inline_doc'):
......@@ -191,7 +189,7 @@ class Member(object):
properties['deprecated'] = self.node.GetProperty('deprecated')
for property_name in ['allowAmbiguousOptionalArguments',
'nodoc', 'nocompile', 'nodart', 'nodefine']:
'nodoc', 'nocompile', 'nodart']:
if self.node.GetProperty(property_name):
properties[property_name] = True
......@@ -385,8 +383,8 @@ class Enum(object):
'description': self.description,
'type': 'string',
'enum': enum}
for property_name in ('cpp_enum_prefix_override', 'inline_doc',
'noinline_doc', 'nodefine', 'nodoc',):
for property_name in ['cpp_enum_prefix_override', 'inline_doc',
'noinline_doc', 'nodoc']:
if self.node.GetProperty(property_name):
result[property_name] = self.node.GetProperty(property_name)
if self.node.GetProperty('deprecated'):
......
......@@ -127,12 +127,6 @@ class IdlSchemaTest(unittest.TestCase):
self.assertTrue(func is not None)
self.assertTrue(func['nocompile'])
def testNoDefine(self):
schema = self.idl_basics
func = getFunction(schema, 'function31')
self.assertTrue(func is not None)
self.assertTrue(func['nodefine'])
def testNoDocOnEnum(self):
schema = self.idl_basics
enum_with_nodoc = getType(schema, 'EnumTypeWithNoDoc')
......
......@@ -356,7 +356,6 @@ class Function(object):
self.optional = json.get('optional', False)
self.parent = parent
self.nocompile = json.get('nocompile')
self.nodefine = json.get('nodefine')
options = json.get('options', {})
self.conditions = options.get('conditions', [])
self.actions = options.get('actions', [])
......
......@@ -114,8 +114,6 @@
static EnumType[] function28();
static idl_other_namespace.SomeType function29();
static idl_other_namespace.SomeType[] function30();
[nodefine] static void function31(long switch);
};
interface Events {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment