Bug 606966 - Need an async history visit API exposed to JS

Part 3 - Stub out the methods on mozilla::places::History.
r=mak
a=blocking
This commit is contained in:
Shawn Wilsher 2011-01-13 13:37:04 -08:00
Родитель b98d708920
Коммит 6411138289
3 изменённых файлов: 47 добавлений и 2 удалений

Просмотреть файл

@ -1402,6 +1402,19 @@ History::SetURITitle(nsIURI* aURI, const nsAString& aTitle)
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////
//// mozIAsyncHistory
NS_IMETHODIMP
History::UpdatePlaces(const jsval& aPlaceInfos,
mozIVisitInfoCallback* aCallback,
JSContext* aCtx)
{
NS_ENSURE_TRUE(NS_IsMainThread(), NS_ERROR_UNEXPECTED);
return NS_ERROR_NOT_IMPLEMENTED;
}
////////////////////////////////////////////////////////////////////////////////
//// nsIObserver
@ -1424,9 +1437,10 @@ History::Observe(nsISupports* aSubject, const char* aTopic,
////////////////////////////////////////////////////////////////////////////////
//// nsISupports
NS_IMPL_THREADSAFE_ISUPPORTS2(
NS_IMPL_THREADSAFE_ISUPPORTS3(
History
, IHistory
, mozIAsyncHistory
, nsIObserver
)

Просмотреть файл

@ -16,7 +16,7 @@
* The Original Code is Places code.
*
* The Initial Developer of the Original Code is
* Mozilla Foundation.
* the Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2009
* the Initial Developer. All Rights Reserved.
*
@ -41,6 +41,7 @@
#define mozilla_places_History_h_
#include "mozilla/IHistory.h"
#include "mozIAsyncHistory.h"
#include "mozilla/dom/Link.h"
#include "nsTHashtable.h"
#include "nsString.h"
@ -60,11 +61,13 @@ struct VisitData;
{0x0937a705, 0x91a6, 0x417a, {0x82, 0x92, 0xb2, 0x2e, 0xb1, 0x0d, 0xa8, 0x6c}}
class History : public IHistory
, public mozIAsyncHistory
, public nsIObserver
{
public:
NS_DECL_ISUPPORTS
NS_DECL_IHISTORY
NS_DECL_MOZIASYNCHISTORY
NS_DECL_NSIOBSERVER
History();

Просмотреть файл

@ -0,0 +1,28 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* This file tests the async history API exposed by mozIAsyncHistory.
*/
////////////////////////////////////////////////////////////////////////////////
//// Test Functions
function test_interface_exists()
{
let history = Cc["@mozilla.org/browser/history;1"].getService(Ci.nsISupports);
do_check_true(history instanceof Ci.mozIAsyncHistory);
run_next_test();
}
////////////////////////////////////////////////////////////////////////////////
//// Test Runner
let gTests = [
test_interface_exists,
];
function run_test()
{
run_next_test();
}