mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 3cc898b3ef5d (bug 1057166) for build bustage
--HG-- extra : rebase_source : 724c8cb9e4c021a523a58af7e2f53a23aaa1901a
This commit is contained in:
parent
ea6a65d232
commit
d8e3e20495
@ -694,7 +694,7 @@ function gKeywordURIFixup({ target: browser, data: fixupInfo }) {
|
||||
// whether the original input would be vaguely interpretable as a URL,
|
||||
// so figure that out first.
|
||||
let alternativeURI = deserializeURI(fixupInfo.fixedURI);
|
||||
if (!fixupInfo.keywordProviderName || !alternativeURI || !alternativeURI.host) {
|
||||
if (!fixupInfo.fixupUsedKeyword || !alternativeURI || !alternativeURI.host) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -300,16 +300,20 @@ nsDefaultURIFixup::GetFixupURIInfo(const nsACString& aStringURI, uint32_t aFixup
|
||||
ioService->GetProtocolHandler(scheme.get(), getter_AddRefs(ourHandler));
|
||||
extHandler = do_GetService(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX"default");
|
||||
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
if (ourHandler != extHandler || !PossiblyHostPortUrl(uriString)) {
|
||||
// Just try to create an URL out of it
|
||||
rv = NS_NewURI(getter_AddRefs(info->mFixedURI), uriString, nullptr);
|
||||
rv = NS_NewURI(getter_AddRefs(uri), uriString, nullptr);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
info->mFixedURI = uri;
|
||||
}
|
||||
|
||||
if (!info->mFixedURI && rv != NS_ERROR_MALFORMED_URI) {
|
||||
if (!uri && rv != NS_ERROR_MALFORMED_URI) {
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
if (info->mFixedURI && ourHandler == extHandler && sFixupKeywords &&
|
||||
if (uri && ourHandler == extHandler && sFixupKeywords &&
|
||||
(aFixupFlags & FIXUP_FLAG_FIX_SCHEME_TYPOS)) {
|
||||
nsCOMPtr<nsIExternalProtocolService> extProtService =
|
||||
do_GetService(NS_EXTERNALPROTOCOLSERVICE_CONTRACTID);
|
||||
@ -324,17 +328,18 @@ nsDefaultURIFixup::GetFixupURIInfo(const nsACString& aStringURI, uint32_t aFixup
|
||||
// It's more likely the user wants to search, and so we
|
||||
// chuck this over to their preferred search provider instead:
|
||||
if (!handlerExists) {
|
||||
TryKeywordFixupForURIInfo(uriString, info, aPostData);
|
||||
nsresult rv = KeywordToURI(uriString, aPostData, getter_AddRefs(uri));
|
||||
if (NS_SUCCEEDED(rv) && uri) {
|
||||
info->mFixupUsedKeyword = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (info->mFixedURI) {
|
||||
if (!info->mPreferredURI) {
|
||||
if (uri) {
|
||||
if (aFixupFlags & FIXUP_FLAGS_MAKE_ALTERNATE_URI)
|
||||
info->mFixupCreatedAlternateURI = MakeAlternateURI(info->mFixedURI);
|
||||
info->mPreferredURI = info->mFixedURI;
|
||||
}
|
||||
info->mFixupCreatedAlternateURI = MakeAlternateURI(uri);
|
||||
info->mPreferredURI = uri;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -410,7 +415,12 @@ nsDefaultURIFixup::GetFixupURIInfo(const nsACString& aStringURI, uint32_t aFixup
|
||||
// If we still haven't been able to construct a valid URI, try to force a
|
||||
// keyword match. This catches search strings with '.' or ':' in them.
|
||||
if (sFixupKeywords && (aFixupFlags & FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP)) {
|
||||
rv = TryKeywordFixupForURIInfo(aStringURI, info, aPostData);
|
||||
rv = KeywordToURI(aStringURI, aPostData, getter_AddRefs(info->mPreferredURI));
|
||||
if (NS_SUCCEEDED(rv) && info->mPreferredURI)
|
||||
{
|
||||
info->mFixupUsedKeyword = true;
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
@ -418,11 +428,9 @@ nsDefaultURIFixup::GetFixupURIInfo(const nsACString& aStringURI, uint32_t aFixup
|
||||
|
||||
NS_IMETHODIMP nsDefaultURIFixup::KeywordToURI(const nsACString& aKeyword,
|
||||
nsIInputStream **aPostData,
|
||||
nsIURIFixupInfo **aInfo)
|
||||
nsIURI **aURI)
|
||||
{
|
||||
nsRefPtr<nsDefaultURIFixupInfo> info = new nsDefaultURIFixupInfo(aKeyword);
|
||||
NS_ADDREF(*aInfo = info);
|
||||
|
||||
*aURI = nullptr;
|
||||
if (aPostData) {
|
||||
*aPostData = nullptr;
|
||||
}
|
||||
@ -443,14 +451,10 @@ NS_IMETHODIMP nsDefaultURIFixup::KeywordToURI(const nsACString& aKeyword,
|
||||
|
||||
ipc::OptionalInputStreamParams postData;
|
||||
ipc::OptionalURIParams uri;
|
||||
nsAutoString providerName;
|
||||
if (!contentChild->SendKeywordToURI(keyword, &providerName, &postData, &uri)) {
|
||||
if (!contentChild->SendKeywordToURI(keyword, &postData, &uri)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
CopyUTF8toUTF16(keyword, info->mKeywordAsSent);
|
||||
info->mKeywordProviderName = providerName;
|
||||
|
||||
if (aPostData) {
|
||||
nsTArray<ipc::FileDescriptor> fds;
|
||||
nsCOMPtr<nsIInputStream> temp = DeserializeInputStream(postData, fds);
|
||||
@ -460,7 +464,7 @@ NS_IMETHODIMP nsDefaultURIFixup::KeywordToURI(const nsACString& aKeyword,
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIURI> temp = DeserializeURI(uri);
|
||||
info->mPreferredURI = temp.forget();
|
||||
temp.forget(aURI);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -482,8 +486,7 @@ NS_IMETHODIMP nsDefaultURIFixup::KeywordToURI(const nsACString& aKeyword,
|
||||
responseType.Assign(mozKeywordSearch);
|
||||
}
|
||||
|
||||
NS_ConvertUTF8toUTF16 keywordW(keyword);
|
||||
defaultEngine->GetSubmission(keywordW,
|
||||
defaultEngine->GetSubmission(NS_ConvertUTF8toUTF16(keyword),
|
||||
responseType,
|
||||
NS_LITERAL_STRING("keyword"),
|
||||
getter_AddRefs(submission));
|
||||
@ -501,9 +504,21 @@ NS_IMETHODIMP nsDefaultURIFixup::KeywordToURI(const nsACString& aKeyword,
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
defaultEngine->GetName(info->mKeywordProviderName);
|
||||
info->mKeywordAsSent = keywordW;
|
||||
return submission->GetUri(getter_AddRefs(info->mPreferredURI));
|
||||
// This notification is meant for Firefox Health Report so it
|
||||
// can increment counts from the search engine. The assumption
|
||||
// here is that this keyword/submission will eventually result
|
||||
// in a search. Since we only generate a URI here, there is the
|
||||
// possibility we'll increment the counter without actually
|
||||
// incurring a search. A robust solution would involve currying
|
||||
// the search engine's name through various function calls.
|
||||
nsCOMPtr<nsIObserverService> obsSvc = mozilla::services::GetObserverService();
|
||||
if (obsSvc) {
|
||||
// Note that "keyword-search" refers to a search via the url
|
||||
// bar, not a bookmarks keyword search.
|
||||
obsSvc->NotifyObservers(defaultEngine, "keyword-search", NS_ConvertUTF8toUTF16(keyword).get());
|
||||
}
|
||||
|
||||
return submission->GetUri(aURI);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -513,22 +528,6 @@ NS_IMETHODIMP nsDefaultURIFixup::KeywordToURI(const nsACString& aKeyword,
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
// Helper to deal with passing around uri fixup stuff
|
||||
nsresult
|
||||
nsDefaultURIFixup::TryKeywordFixupForURIInfo(const nsACString & aURIString,
|
||||
nsDefaultURIFixupInfo* aFixupInfo,
|
||||
nsIInputStream **aPostData)
|
||||
{
|
||||
nsCOMPtr<nsIURIFixupInfo> keywordInfo;
|
||||
nsresult rv = KeywordToURI(aURIString, aPostData, getter_AddRefs(keywordInfo));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
keywordInfo->GetKeywordProviderName(aFixupInfo->mKeywordProviderName);
|
||||
keywordInfo->GetKeywordAsSent(aFixupInfo->mKeywordAsSent);
|
||||
keywordInfo->GetPreferredURI(getter_AddRefs(aFixupInfo->mPreferredURI));
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
bool nsDefaultURIFixup::MakeAlternateURI(nsIURI *aURI)
|
||||
{
|
||||
if (!Preferences::GetRootBranch())
|
||||
@ -1074,7 +1073,11 @@ void nsDefaultURIFixup::KeywordURIFixup(const nsACString & aURIString,
|
||||
(isValidAsciiHost && isValidHost && !hasAsciiAlpha &&
|
||||
host.EqualsIgnoreCase(asciiHost.get()))) {
|
||||
|
||||
rv = TryKeywordFixupForURIInfo(aFixupInfo->mOriginalInput, aFixupInfo, aPostData);
|
||||
rv = KeywordToURI(aFixupInfo->mOriginalInput, aPostData,
|
||||
getter_AddRefs(aFixupInfo->mPreferredURI));
|
||||
if (NS_SUCCEEDED(rv) && aFixupInfo->mPreferredURI) {
|
||||
aFixupInfo->mFixupUsedKeyword = true;
|
||||
}
|
||||
}
|
||||
// ... or if there is no question mark or colon, and there is either no
|
||||
// dot, or exactly 1 and it is the first or last character of the input:
|
||||
@ -1088,7 +1091,11 @@ void nsDefaultURIFixup::KeywordURIFixup(const nsACString & aURIString,
|
||||
|
||||
// If we get here, we don't have a valid URI, or we did but the
|
||||
// host is not whitelisted, so we do a keyword search *anyway*:
|
||||
rv = TryKeywordFixupForURIInfo(aFixupInfo->mOriginalInput, aFixupInfo, aPostData);
|
||||
rv = KeywordToURI(aFixupInfo->mOriginalInput, aPostData,
|
||||
getter_AddRefs(aFixupInfo->mPreferredURI));
|
||||
if (NS_SUCCEEDED(rv) && aFixupInfo->mPreferredURI) {
|
||||
aFixupInfo->mFixupUsedKeyword = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1127,6 +1134,7 @@ nsresult NS_NewURIFixup(nsIURIFixup **aURIFixup)
|
||||
NS_IMPL_ISUPPORTS(nsDefaultURIFixupInfo, nsIURIFixupInfo)
|
||||
|
||||
nsDefaultURIFixupInfo::nsDefaultURIFixupInfo(const nsACString& aOriginalInput):
|
||||
mFixupUsedKeyword(false),
|
||||
mFixupChangedProtocol(false),
|
||||
mFixupCreatedAlternateURI(false)
|
||||
{
|
||||
@ -1170,16 +1178,9 @@ nsDefaultURIFixupInfo::GetFixedURI(nsIURI** aFixedURI)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDefaultURIFixupInfo::GetKeywordProviderName(nsAString& aOut)
|
||||
nsDefaultURIFixupInfo::GetFixupUsedKeyword(bool* aOut)
|
||||
{
|
||||
aOut = mKeywordProviderName;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDefaultURIFixupInfo::GetKeywordAsSent(nsAString& aOut)
|
||||
{
|
||||
aOut = mKeywordAsSent;
|
||||
*aOut = mFixupUsedKeyword;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -33,9 +33,6 @@ private:
|
||||
void KeywordURIFixup(const nsACString &aStringURI,
|
||||
nsDefaultURIFixupInfo* aFixupInfo,
|
||||
nsIInputStream** aPostData);
|
||||
nsresult TryKeywordFixupForURIInfo(const nsACString &aStringURI,
|
||||
nsDefaultURIFixupInfo* aFixupInfo,
|
||||
nsIInputStream** aPostData);
|
||||
bool PossiblyByteExpandedFileName(const nsAString& aIn);
|
||||
bool PossiblyHostPortUrl(const nsACString& aUrl);
|
||||
bool MakeAlternateURI(nsIURI *aURI);
|
||||
@ -61,10 +58,9 @@ private:
|
||||
nsCOMPtr<nsISupports> mConsumer;
|
||||
nsCOMPtr<nsIURI> mPreferredURI;
|
||||
nsCOMPtr<nsIURI> mFixedURI;
|
||||
bool mFixupUsedKeyword;
|
||||
bool mFixupChangedProtocol;
|
||||
bool mFixupCreatedAlternateURI;
|
||||
nsString mKeywordProviderName;
|
||||
nsString mKeywordAsSent;
|
||||
nsAutoCString mOriginalInput;
|
||||
};
|
||||
#endif
|
||||
|
@ -201,10 +201,6 @@
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "mozilla/dom/URLSearchParams.h"
|
||||
|
||||
#ifdef MOZ_TOOLKIT_SEARCH
|
||||
#include "nsIBrowserSearchService.h"
|
||||
#endif
|
||||
|
||||
static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
|
||||
|
||||
#if defined(DEBUG_bryner) || defined(DEBUG_chb)
|
||||
@ -4587,7 +4583,6 @@ nsDocShell::LoadURIWithBase(const char16_t * aURI,
|
||||
aLoadFlags &= ~LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIURIFixupInfo> fixupInfo;
|
||||
if (sURIFixup) {
|
||||
// Call the fixup object. This will clobber the rv from NS_NewURI
|
||||
// above, but that's fine with us. Note that we need to do this even
|
||||
@ -4601,6 +4596,7 @@ nsDocShell::LoadURIWithBase(const char16_t * aURI,
|
||||
fixupFlags |= nsIURIFixup::FIXUP_FLAG_FIX_SCHEME_TYPOS;
|
||||
}
|
||||
nsCOMPtr<nsIInputStream> fixupStream;
|
||||
nsCOMPtr<nsIURIFixupInfo> fixupInfo;
|
||||
rv = sURIFixup->GetFixupURIInfo(uriString, fixupFlags,
|
||||
getter_AddRefs(fixupStream),
|
||||
getter_AddRefs(fixupInfo));
|
||||
@ -4611,7 +4607,7 @@ nsDocShell::LoadURIWithBase(const char16_t * aURI,
|
||||
}
|
||||
|
||||
if (fixupStream) {
|
||||
// GetFixupURIInfo only returns a post data stream if it succeeded
|
||||
// CreateFixupURI only returns a post data stream if it succeeded
|
||||
// and changed the URI, in which case we should override the
|
||||
// passed-in post data.
|
||||
postStream = fixupStream;
|
||||
@ -4670,13 +4666,6 @@ nsDocShell::LoadURIWithBase(const char16_t * aURI,
|
||||
loadInfo->SetHeadersStream(aHeaderStream);
|
||||
loadInfo->SetBaseURI(aBaseURI);
|
||||
|
||||
if (fixupInfo) {
|
||||
nsAutoString searchProvider, keyword;
|
||||
fixupInfo->GetKeywordProviderName(searchProvider);
|
||||
fixupInfo->GetKeywordAsSent(keyword);
|
||||
MaybeNotifyKeywordSearchLoading(searchProvider, keyword);
|
||||
}
|
||||
|
||||
rv = LoadURI(uri, loadInfo, extraFlags, true);
|
||||
|
||||
// Save URI string in case it's needed later when
|
||||
@ -7393,7 +7382,6 @@ nsDocShell::EndPageLoad(nsIWebProgress * aProgress,
|
||||
//
|
||||
// First try keyword fixup
|
||||
//
|
||||
nsAutoString keywordProviderName, keywordAsSent;
|
||||
if (aStatus == NS_ERROR_UNKNOWN_HOST && mAllowKeywordFixup) {
|
||||
bool keywordsEnabled =
|
||||
Preferences::GetBool("keyword.enabled", false);
|
||||
@ -7424,12 +7412,11 @@ nsDocShell::EndPageLoad(nsIWebProgress * aProgress,
|
||||
}
|
||||
|
||||
if (keywordsEnabled && (kNotFound == dotLoc)) {
|
||||
nsCOMPtr<nsIURIFixupInfo> info;
|
||||
// only send non-qualified hosts to the keyword server
|
||||
if (!mOriginalUriString.IsEmpty()) {
|
||||
sURIFixup->KeywordToURI(mOriginalUriString,
|
||||
getter_AddRefs(newPostData),
|
||||
getter_AddRefs(info));
|
||||
getter_AddRefs(newURI));
|
||||
}
|
||||
else {
|
||||
//
|
||||
@ -7451,19 +7438,13 @@ nsDocShell::EndPageLoad(nsIWebProgress * aProgress,
|
||||
NS_SUCCEEDED(idnSrv->ConvertACEtoUTF8(host, utf8Host))) {
|
||||
sURIFixup->KeywordToURI(utf8Host,
|
||||
getter_AddRefs(newPostData),
|
||||
getter_AddRefs(info));
|
||||
getter_AddRefs(newURI));
|
||||
} else {
|
||||
sURIFixup->KeywordToURI(host,
|
||||
getter_AddRefs(newPostData),
|
||||
getter_AddRefs(info));
|
||||
getter_AddRefs(newURI));
|
||||
}
|
||||
}
|
||||
|
||||
info->GetPreferredURI(getter_AddRefs(newURI));
|
||||
if (newURI) {
|
||||
info->GetKeywordAsSent(keywordAsSent);
|
||||
info->GetKeywordProviderName(keywordProviderName);
|
||||
}
|
||||
} // end keywordsEnabled
|
||||
}
|
||||
|
||||
@ -7496,8 +7477,6 @@ nsDocShell::EndPageLoad(nsIWebProgress * aProgress,
|
||||
if (doCreateAlternate) {
|
||||
newURI = nullptr;
|
||||
newPostData = nullptr;
|
||||
keywordProviderName.Truncate();
|
||||
keywordAsSent.Truncate();
|
||||
sURIFixup->CreateFixupURI(oldSpec,
|
||||
nsIURIFixup::FIXUP_FLAGS_MAKE_ALTERNATE_URI,
|
||||
getter_AddRefs(newPostData),
|
||||
@ -7518,10 +7497,6 @@ nsDocShell::EndPageLoad(nsIWebProgress * aProgress,
|
||||
newURI->GetSpec(newSpec);
|
||||
NS_ConvertUTF8toUTF16 newSpecW(newSpec);
|
||||
|
||||
// This notification is meant for Firefox Health Report so it
|
||||
// can increment counts from the search engine
|
||||
MaybeNotifyKeywordSearchLoading(keywordProviderName, keywordAsSent);
|
||||
|
||||
return LoadURI(newSpecW.get(), // URI string
|
||||
LOAD_FLAGS_NONE, // Load flags
|
||||
nullptr, // Referring URI
|
||||
@ -13533,36 +13508,3 @@ nsDocShell::GetURLSearchParams()
|
||||
{
|
||||
return mURLSearchParams;
|
||||
}
|
||||
|
||||
void
|
||||
nsDocShell::MaybeNotifyKeywordSearchLoading(const nsString &aProvider,
|
||||
const nsString &aKeyword) {
|
||||
|
||||
if (aProvider.IsEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (XRE_GetProcessType() == GeckoProcessType_Content) {
|
||||
dom::ContentChild* contentChild = dom::ContentChild::GetSingleton();
|
||||
if (contentChild) {
|
||||
contentChild->SendNotifyKeywordSearchLoading(aProvider, aKeyword);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef MOZ_TOOLKIT_SEARCH
|
||||
nsCOMPtr<nsIBrowserSearchService> searchSvc = do_GetService("@mozilla.org/browser/search-service;1");
|
||||
if (searchSvc) {
|
||||
nsCOMPtr<nsISearchEngine> searchEngine;
|
||||
searchSvc->GetEngineByName(aProvider, getter_AddRefs(searchEngine));
|
||||
if (searchEngine) {
|
||||
nsCOMPtr<nsIObserverService> obsSvc = mozilla::services::GetObserverService();
|
||||
if (obsSvc) {
|
||||
// Note that "keyword-search" refers to a search via the url
|
||||
// bar, not a bookmarks keyword search.
|
||||
obsSvc->NotifyObservers(searchEngine, "keyword-search", aKeyword.get());
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -978,9 +978,6 @@ private:
|
||||
nsIDocShellTreeItem* aOriginalRequestor,
|
||||
nsIDocShellTreeItem** _retval);
|
||||
|
||||
// Notify consumers of a search being loaded through the observer service:
|
||||
void MaybeNotifyKeywordSearchLoading(const nsString &aProvider, const nsString &aKeyword);
|
||||
|
||||
#ifdef DEBUG
|
||||
// We're counting the number of |nsDocShells| to help find leaks
|
||||
static unsigned long gNumberOfDocShells;
|
||||
|
@ -12,7 +12,7 @@ interface nsIInputStream;
|
||||
/**
|
||||
* Interface indicating what we found/corrected when fixing up a URI
|
||||
*/
|
||||
[scriptable, uuid(4819f183-b532-4932-ac09-b309cd853be7)]
|
||||
[scriptable, uuid(62aac1e0-3da8-4920-bd1b-a54fc2e2eb24)]
|
||||
interface nsIURIFixupInfo : nsISupports
|
||||
{
|
||||
/**
|
||||
@ -36,16 +36,9 @@ interface nsIURIFixupInfo : nsISupports
|
||||
readonly attribute nsIURI fixedURI;
|
||||
|
||||
/**
|
||||
* The name of the keyword search provider used to provide a keyword search;
|
||||
* empty string if no keyword search was done.
|
||||
* Whether the preferred option ended up using a keyword search.
|
||||
*/
|
||||
readonly attribute AString keywordProviderName;
|
||||
|
||||
/**
|
||||
* The keyword as used for the search (post trimming etc.)
|
||||
* empty string if no keyword search was done.
|
||||
*/
|
||||
readonly attribute AString keywordAsSent;
|
||||
readonly attribute boolean fixupUsedKeyword;
|
||||
|
||||
/**
|
||||
* Whether we changed the protocol instead of using one from the input as-is.
|
||||
@ -70,7 +63,7 @@ interface nsIURIFixupInfo : nsISupports
|
||||
/**
|
||||
* Interface implemented by objects capable of fixing up strings into URIs
|
||||
*/
|
||||
[scriptable, uuid(d2a78abe-e678-4103-9bcc-dd1377460c44)]
|
||||
[scriptable, uuid(49298f2b-3630-4874-aecc-522300a7fead)]
|
||||
interface nsIURIFixup : nsISupports
|
||||
{
|
||||
/** No fixup flags. */
|
||||
@ -153,7 +146,7 @@ interface nsIURIFixup : nsISupports
|
||||
* @throws NS_ERROR_FAILURE if the resulting URI requires submission of POST
|
||||
* data and aPostData is null.
|
||||
*/
|
||||
nsIURIFixupInfo keywordToURI(in AUTF8String aKeyword,
|
||||
nsIURI keywordToURI(in AUTF8String aKeyword,
|
||||
[optional] out nsIInputStream aPostData);
|
||||
};
|
||||
|
||||
|
@ -95,6 +95,7 @@ skip-if = e10s # Bug ?????? - event handler checks event.target is the content d
|
||||
[browser_onbeforeunload_navigation.js]
|
||||
skip-if = e10s
|
||||
[browser_search_notification.js]
|
||||
skip-if = e10s
|
||||
[browser_timelineMarkers-01.js]
|
||||
[browser_timelineMarkers-02.js]
|
||||
skip-if = e10s
|
||||
|
@ -4,27 +4,6 @@
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
const kSearchEngineID = "test_urifixup_search_engine";
|
||||
const kSearchEngineURL = "http://localhost/?search={searchTerms}";
|
||||
Services.search.addEngineWithDetails(kSearchEngineID, "", "", "", "get",
|
||||
kSearchEngineURL);
|
||||
|
||||
let oldDefaultEngine = Services.search.defaultEngine;
|
||||
Services.search.defaultEngine = Services.search.getEngineByName(kSearchEngineID);
|
||||
|
||||
let selectedName = Services.search.defaultEngine.name;
|
||||
is(selectedName, kSearchEngineID, "Check fake search engine is selected");
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
if (oldDefaultEngine) {
|
||||
Services.search.defaultEngine = oldDefaultEngine;
|
||||
}
|
||||
let engine = Services.search.getEngineByName(kSearchEngineID);
|
||||
if (engine) {
|
||||
Services.search.removeEngine(engine);
|
||||
}
|
||||
});
|
||||
|
||||
let tab = gBrowser.addTab();
|
||||
gBrowser.selectedTab = tab;
|
||||
|
||||
|
@ -530,7 +530,7 @@ function run_test() {
|
||||
|
||||
// Check booleans on input:
|
||||
let couldDoKeywordLookup = flags & urifixup.FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP;
|
||||
do_check_eq(!!info.keywordProviderName, couldDoKeywordLookup && expectKeywordLookup);
|
||||
do_check_eq(info.fixupUsedKeyword, couldDoKeywordLookup && expectKeywordLookup);
|
||||
do_check_eq(info.fixupChangedProtocol, expectProtocolChange);
|
||||
do_check_eq(info.fixupCreatedAlternateURI, makeAlternativeURI && alternativeURI != null);
|
||||
|
||||
|
@ -187,10 +187,6 @@ using namespace mozilla::system;
|
||||
#include "mozilla/Sandbox.h"
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_TOOLKIT_SEARCH
|
||||
#include "nsIBrowserSearchService.h"
|
||||
#endif
|
||||
|
||||
static NS_DEFINE_CID(kCClipboardCID, NS_CLIPBOARD_CID);
|
||||
static const char* sClipboardTextFlavors[] = { kUnicodeMime };
|
||||
|
||||
@ -3830,9 +3826,7 @@ ContentParent::RecvSetFakeVolumeState(const nsString& fsName, const int32_t& fsS
|
||||
}
|
||||
|
||||
bool
|
||||
ContentParent::RecvKeywordToURI(const nsCString& aKeyword,
|
||||
nsString* aProviderName,
|
||||
OptionalInputStreamParams* aPostData,
|
||||
ContentParent::RecvKeywordToURI(const nsCString& aKeyword, OptionalInputStreamParams* aPostData,
|
||||
OptionalURIParams* aURI)
|
||||
{
|
||||
nsCOMPtr<nsIURIFixup> fixup = do_GetService(NS_URIFIXUP_CONTRACTID);
|
||||
@ -3841,45 +3835,20 @@ ContentParent::RecvKeywordToURI(const nsCString& aKeyword,
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIInputStream> postData;
|
||||
nsCOMPtr<nsIURIFixupInfo> info;
|
||||
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
if (NS_FAILED(fixup->KeywordToURI(aKeyword, getter_AddRefs(postData),
|
||||
getter_AddRefs(info)))) {
|
||||
getter_AddRefs(uri)))) {
|
||||
return true;
|
||||
}
|
||||
info->GetKeywordProviderName(*aProviderName);
|
||||
|
||||
nsTArray<mozilla::ipc::FileDescriptor> fds;
|
||||
SerializeInputStream(postData, *aPostData, fds);
|
||||
MOZ_ASSERT(fds.IsEmpty());
|
||||
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
info->GetPreferredURI(getter_AddRefs(uri));
|
||||
SerializeURI(uri, *aURI);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
ContentParent::RecvNotifyKeywordSearchLoading(const nsString &aProvider,
|
||||
const nsString &aKeyword) {
|
||||
#ifdef MOZ_TOOLKIT_SEARCH
|
||||
nsCOMPtr<nsIBrowserSearchService> searchSvc = do_GetService("@mozilla.org/browser/search-service;1");
|
||||
if (searchSvc) {
|
||||
nsCOMPtr<nsISearchEngine> searchEngine;
|
||||
searchSvc->GetEngineByName(aProvider, getter_AddRefs(searchEngine));
|
||||
if (searchEngine) {
|
||||
nsCOMPtr<nsIObserverService> obsSvc = mozilla::services::GetObserverService();
|
||||
if (obsSvc) {
|
||||
// Note that "keyword-search" refers to a search via the url
|
||||
// bar, not a bookmarks keyword search.
|
||||
obsSvc->NotifyObservers(searchEngine, "keyword-search", aKeyword.get());
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
ContentParent::ShouldContinueFromReplyTimeout()
|
||||
{
|
||||
|
@ -627,14 +627,9 @@ private:
|
||||
|
||||
virtual bool RecvSetFakeVolumeState(const nsString& fsName, const int32_t& fsState) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool RecvKeywordToURI(const nsCString& aKeyword,
|
||||
nsString* aProviderName,
|
||||
OptionalInputStreamParams* aPostData,
|
||||
virtual bool RecvKeywordToURI(const nsCString& aKeyword, OptionalInputStreamParams* aPostData,
|
||||
OptionalURIParams* aURI) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool RecvNotifyKeywordSearchLoading(const nsString &aProvider,
|
||||
const nsString &aKeyword) MOZ_OVERRIDE;
|
||||
|
||||
virtual void ProcessingError(Result what) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool RecvAllocateLayerTreeId(uint64_t* aId) MOZ_OVERRIDE;
|
||||
|
@ -680,9 +680,7 @@ parent:
|
||||
async SetFakeVolumeState(nsString fsName, int32_t fsState);
|
||||
|
||||
sync KeywordToURI(nsCString keyword)
|
||||
returns (nsString providerName, OptionalInputStreamParams postData, OptionalURIParams uri);
|
||||
|
||||
sync NotifyKeywordSearchLoading(nsString providerName, nsString keyword);
|
||||
returns (OptionalInputStreamParams postData, OptionalURIParams uri);
|
||||
|
||||
// Tell the compositor to allocate a layer tree id for nested remote mozbrowsers.
|
||||
sync AllocateLayerTreeId()
|
||||
|
@ -126,9 +126,6 @@ DEFINES['BIN_SUFFIX'] = '"%s"' % CONFIG['BIN_SUFFIX']
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk2', 'gonk', 'qt'):
|
||||
DEFINES['MOZ_ENABLE_FREETYPE'] = True
|
||||
|
||||
if CONFIG['MOZ_TOOLKIT_SEARCH']:
|
||||
DEFINES['MOZ_TOOLKIT_SEARCH'] = True
|
||||
|
||||
for var in ('MOZ_PERMISSIONS', 'MOZ_CHILD_PERMISSIONS'):
|
||||
if CONFIG[var]:
|
||||
DEFINES[var] = True
|
||||
|
Loading…
Reference in New Issue
Block a user