diff options
author | Moonchild <moonchild@palemoon.org> | 2022-01-09 18:05:06 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2022-01-09 18:05:06 +0000 |
commit | 9b7e0bfe820c09f0e125f7492a0ee7c50ab6b008 (patch) | |
tree | f7425f9d03d324aa64617c10bb9fb12761f1275e /components | |
parent | 9cb21608f1ac1874da7e4ddd9b5f217f3e16fc29 (diff) | |
parent | eed98f7886e68bbe89fbf170f5f9f136cd8ac766 (diff) | |
download | aura-central-9b7e0bfe820c09f0e125f7492a0ee7c50ab6b008.tar.gz |
Merge branch 'master' into Remove-GMP
Diffstat (limited to 'components')
-rw-r--r-- | components/places/moz.build | 1 | ||||
-rw-r--r-- | components/places/public/nsIBrowserHistory.idl | 2 | ||||
-rw-r--r-- | components/places/public/nsIDownloadHistory.idl | 53 | ||||
-rw-r--r-- | components/places/src/History.cpp | 2 |
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; |