summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2022-01-09 02:41:39 -0600
committerMatt A. Tobin <email@mattatobin.com>2022-01-09 02:41:39 -0600
commiteed98f7886e68bbe89fbf170f5f9f136cd8ac766 (patch)
treec0c97183f41f5778d4a10547596b30c7d034b036 /components
parent2c76f5eea2723cf0496448d35c9cba6a48ddbc30 (diff)
downloadaura-central-eed98f7886e68bbe89fbf170f5f9f136cd8ac766.tar.gz
Bug 1419704 - Remove nsIGlobalHistory2 and docshell's nsDownloadHistory as they are redundant(ly busted).
* Since gecko/22 the actual impl for nsIGlobalHistory has been removed and without it nsDownloadHistory in docshell will not function. As well as, Mozilla only be sheer luck was able to rely on the places impl for nsIDownloadHistory overriding docshell's. Obviously this is fuckin moronic as hell and as demonstrated with moving things around it in its broken state became dominate. * The difference between our port and what Mozilla is doing is that we are not gonna remove the interface for nsIDownloadHistory nor the observer topic as there are consumers of them.
Diffstat (limited to 'components')
-rw-r--r--components/places/moz.build1
-rw-r--r--components/places/public/nsIBrowserHistory.idl2
-rw-r--r--components/places/public/nsIDownloadHistory.idl53
-rw-r--r--components/places/src/History.cpp2
4 files changed, 57 insertions, 1 deletions
diff --git a/components/places/moz.build b/components/places/moz.build
index 540265537..2be099873 100644
--- a/components/places/moz.build
+++ b/components/places/moz.build
@@ -15,6 +15,7 @@ if CONFIG['MOZ_PLACES']:
'public/mozIPlacesPendingOperation.idl',
'public/nsIAnnotationService.idl',
'public/nsIBrowserHistory.idl',
+ 'public/nsIDownloadHistory.idl',
'public/nsIFaviconService.idl',
'public/nsINavBookmarksService.idl',
'public/nsITaggingService.idl',
diff --git a/components/places/public/nsIBrowserHistory.idl b/components/places/public/nsIBrowserHistory.idl
index 8f3265972..35a186293 100644
--- a/components/places/public/nsIBrowserHistory.idl
+++ b/components/places/public/nsIBrowserHistory.idl
@@ -8,7 +8,7 @@
*/
#include "nsISupports.idl"
-#include "nsIGlobalHistory2.idl"
+interface nsIURI;
[scriptable, uuid(20d31479-38de-49f4-9300-566d6e834c66)]
interface nsIBrowserHistory : nsISupports
diff --git a/components/places/public/nsIDownloadHistory.idl b/components/places/public/nsIDownloadHistory.idl
new file mode 100644
index 000000000..ca0a06549
--- /dev/null
+++ b/components/places/public/nsIDownloadHistory.idl
@@ -0,0 +1,53 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ * vim: sw=2 ts=2 sts=2
+ * 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 nsIURI;
+
+[scriptable, uuid(4dcd6a12-a091-4f38-8360-022929635746)]
+interface nsIDownloadHistory : nsISupports {
+ /**
+ * Adds a download to history. This will also notify observers that the
+ * URI aSource is visited with the topic NS_LINK_VISITED_EVENT_TOPIC if
+ * aSource has not yet been visited.
+ *
+ * @param aSource
+ * The source of the download we are adding to history. This cannot be
+ * null.
+ * @param aReferrer
+ * [optional] The referrer of source URI.
+ * @param aStartTime
+ * [optional] The time the download was started. If the start time
+ * is not given, the current time is used.
+ * @param aDestination
+ * [optional] The target where the download is to be saved on the local
+ * filesystem.
+ * @throws NS_ERROR_NOT_AVAILABLE
+ * In a situation where a history implementation is not available,
+ * where 'history implementation' refers to something like
+ * nsIGlobalHistory and friends.
+ * @note This addition is not guaranteed to be synchronous, since it delegates
+ * the actual addition to the underlying history implementation. If you
+ * need to observe the completion of the addition, use the underlying
+ * history implementation's notifications system (e.g. nsINavHistoryObserver
+ * for toolkit's implementation of this interface).
+ */
+ void addDownload(in nsIURI aSource, [optional] in nsIURI aReferrer,
+ [optional] in PRTime aStartTime,
+ [optional] in nsIURI aDestination);
+
+ /**
+ * Remove all downloads from history.
+ *
+ * @note This removal is not guaranteed to be synchronous, since it delegates
+ * the actual removal to the underlying history implementation. If you
+ * need to observe the completion of the removal, use the underlying
+ * history implementation's notifications system (e.g. nsINavHistoryObserver
+ * for toolkit's implementation of this interface).
+ */
+ void removeAllDownloads();
+};
diff --git a/components/places/src/History.cpp b/components/places/src/History.cpp
index e9c27d1d6..fe74e230e 100644
--- a/components/places/src/History.cpp
+++ b/components/places/src/History.cpp
@@ -43,6 +43,8 @@
// Initial length for the visits removal hash.
#define VISITS_REMOVAL_INITIAL_HASH_LENGTH 64
+#define NS_LINK_VISITED_EVENT_TOPIC "link-visited"
+
using namespace mozilla::dom;
using namespace mozilla::ipc;
using mozilla::Unused;