dom/plugins/base/nsIPluginHost.idl

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #include "nspluginroot.idl"
michael@0 7 #include "nsISupports.idl"
michael@0 8 #include "nsIPluginTag.idl"
michael@0 9
michael@0 10 %{C++
michael@0 11 #define MOZ_PLUGIN_HOST_CONTRACTID \
michael@0 12 "@mozilla.org/plugin/host;1"
michael@0 13 %}
michael@0 14
michael@0 15 [scriptable, uuid(f89e7679-0adf-4a30-bda9-1afe1ee270d6)]
michael@0 16 interface nsIPluginPlayPreviewInfo : nsISupports
michael@0 17 {
michael@0 18 readonly attribute AUTF8String mimeType;
michael@0 19 readonly attribute boolean ignoreCTP;
michael@0 20 readonly attribute AUTF8String redirectURL;
michael@0 21 };
michael@0 22
michael@0 23 [scriptable, uuid(e8fe94f0-b877-46d0-931a-090967fb1e83)]
michael@0 24 interface nsIPluginHost : nsISupports
michael@0 25 {
michael@0 26 /**
michael@0 27 * Causes the plugins directory to be searched again for new plugin
michael@0 28 * libraries.
michael@0 29 */
michael@0 30 void reloadPlugins();
michael@0 31
michael@0 32 void getPluginTags([optional] out unsigned long aPluginCount,
michael@0 33 [retval, array, size_is(aPluginCount)] out nsIPluginTag aResults);
michael@0 34
michael@0 35 /*
michael@0 36 * Flags for use with clearSiteData.
michael@0 37 *
michael@0 38 * FLAG_CLEAR_ALL: clear all data associated with a site.
michael@0 39 * FLAG_CLEAR_CACHE: clear cached data that can be retrieved again without
michael@0 40 * loss of functionality. To be used out of concern for
michael@0 41 * space and not necessarily privacy.
michael@0 42 */
michael@0 43 const uint32_t FLAG_CLEAR_ALL = 0;
michael@0 44 const uint32_t FLAG_CLEAR_CACHE = 1;
michael@0 45
michael@0 46 /*
michael@0 47 * Clear site data for a given plugin.
michael@0 48 *
michael@0 49 * @param plugin: the plugin to clear data for, such as one returned by
michael@0 50 * nsIPluginHost.getPluginTags.
michael@0 51 * @param domain: the domain to clear data for. If this argument is null,
michael@0 52 * clear data for all domains. Otherwise, it must be a domain
michael@0 53 * only (not a complete URI or IRI). The base domain for the
michael@0 54 * given site will be determined; any data for the base domain
michael@0 55 * or its subdomains will be cleared.
michael@0 56 * @param flags: a flag value defined above.
michael@0 57 * @param maxAge: the maximum age in seconds of data to clear, inclusive. If
michael@0 58 * maxAge is 0, no data is cleared; if it is -1, all data is
michael@0 59 * cleared.
michael@0 60 *
michael@0 61 * @throws NS_ERROR_INVALID_ARG if the domain argument is malformed.
michael@0 62 * @throws NS_ERROR_PLUGIN_TIME_RANGE_NOT_SUPPORTED if maxAge is a value other
michael@0 63 * than -1 and the plugin does not support clearing by timerange in
michael@0 64 * general or for that particular site and/or flag combination.
michael@0 65 */
michael@0 66 void clearSiteData(in nsIPluginTag plugin, in AUTF8String domain,
michael@0 67 in uint64_t flags, in int64_t maxAge);
michael@0 68
michael@0 69 /*
michael@0 70 * Determine if a plugin has stored data for a given site.
michael@0 71 *
michael@0 72 * @param plugin: the plugin to query, such as one returned by
michael@0 73 * nsIPluginHost.getPluginTags.
michael@0 74 * @param domain: the domain to test. If this argument is null, test if data
michael@0 75 * is stored for any site. The base domain for the given domain
michael@0 76 * will be determined; if any data for the base domain or its
michael@0 77 * subdomains is found, return true.
michael@0 78 */
michael@0 79 boolean siteHasData(in nsIPluginTag plugin, in AUTF8String domain);
michael@0 80
michael@0 81 /**
michael@0 82 * Registers the play preview plugin mode for specific mime type
michael@0 83 *
michael@0 84 * @param mimeType: specifies plugin mime type.
michael@0 85 * @param ignoreCTP: if true, the play preview ignores CTP rules, e.g.
michael@0 86 whitelisted websites, will not notify about plugin
michael@0 87 presence in the address bar.
michael@0 88 * @param redirectURL: specifies url for the overlay iframe
michael@0 89 */
michael@0 90 void registerPlayPreviewMimeType(in AUTF8String mimeType,
michael@0 91 [optional] in boolean ignoreCTP,
michael@0 92 [optional] in AUTF8String redirectURL);
michael@0 93
michael@0 94 void unregisterPlayPreviewMimeType(in AUTF8String mimeType);
michael@0 95
michael@0 96 nsIPluginPlayPreviewInfo getPlayPreviewInfo(in AUTF8String mimeType);
michael@0 97
michael@0 98 ACString getPermissionStringForType(in AUTF8String mimeType);
michael@0 99
michael@0 100 /**
michael@0 101 * Get the nsIPluginTag for this MIME type. This method works with both
michael@0 102 * enabled and disabled/blocklisted plugins, but an enabled plugin will
michael@0 103 * always be returned if available.
michael@0 104 *
michael@0 105 * @throws NS_ERROR_NOT_AVAILABLE if no plugin is available for this MIME
michael@0 106 * type.
michael@0 107 */
michael@0 108 nsIPluginTag getPluginTagForType(in AUTF8String mimeType);
michael@0 109
michael@0 110 /**
michael@0 111 * Get the nsIPluginTag state for this MIME type.
michael@0 112 */
michael@0 113 unsigned long getStateForType(in AUTF8String mimeType);
michael@0 114
michael@0 115 /**
michael@0 116 * Get the blocklist state for a MIME type.
michael@0 117 */
michael@0 118 uint32_t getBlocklistStateForType(in string aMimeType);
michael@0 119 };
michael@0 120

mercurial