mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 905761 - Proxy nsDefaultURIFixup::KeywordToURI to the parent. r=smaug
This commit is contained in:
parent
a4335f8552
commit
d5223db06f
@ -21,6 +21,9 @@
|
||||
#include "nsIURIFixup.h"
|
||||
#include "nsDefaultURIFixup.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/dom/ContentChild.h"
|
||||
#include "mozilla/ipc/InputStreamUtils.h"
|
||||
#include "mozilla/ipc/URIUtils.h"
|
||||
#include "nsIObserverService.h"
|
||||
|
||||
using namespace mozilla;
|
||||
@ -335,6 +338,28 @@ NS_IMETHODIMP nsDefaultURIFixup::KeywordToURI(const nsACString& aKeyword,
|
||||
}
|
||||
keyword.Trim(" ");
|
||||
|
||||
if (XRE_GetProcessType() == GeckoProcessType_Content) {
|
||||
dom::ContentChild* contentChild = dom::ContentChild::GetSingleton();
|
||||
if (!contentChild) {
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
ipc::OptionalInputStreamParams postData;
|
||||
ipc::OptionalURIParams uri;
|
||||
if (!contentChild->SendKeywordToURI(keyword, &postData, &uri)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if (aPostData) {
|
||||
nsCOMPtr<nsIInputStream> temp = DeserializeInputStream(postData);
|
||||
temp.forget(aPostData);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIURI> temp = DeserializeURI(uri);
|
||||
temp.forget(aURI);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef MOZ_TOOLKIT_SEARCH
|
||||
// Try falling back to the search service's default search engine
|
||||
nsCOMPtr<nsIBrowserSearchService> searchSvc = do_GetService("@mozilla.org/browser/search-service;1");
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include "mozilla/Hal.h"
|
||||
#include "mozilla/hal_sandbox/PHalParent.h"
|
||||
#include "mozilla/ipc/TestShellParent.h"
|
||||
#include "mozilla/ipc/InputStreamUtils.h"
|
||||
#include "mozilla/layers/CompositorParent.h"
|
||||
#include "mozilla/layers/ImageBridgeParent.h"
|
||||
#include "mozilla/net/NeckoParent.h"
|
||||
@ -48,6 +49,7 @@
|
||||
#include "nsAppDirectoryServiceDefs.h"
|
||||
#include "nsAppRunner.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsCDefaultURIFixup.h"
|
||||
#include "nsCExternalHandlerService.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsChromeRegistryChrome.h"
|
||||
@ -76,6 +78,7 @@
|
||||
#include "nsIScriptError.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#include "nsISupportsPrimitives.h"
|
||||
#include "nsIURIFixup.h"
|
||||
#include "nsIWindowWatcher.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsSystemInfo.h"
|
||||
@ -2760,5 +2763,26 @@ ContentParent::RecvSetFakeVolumeState(const nsString& fsName, const int32_t& fsS
|
||||
#endif
|
||||
}
|
||||
|
||||
bool
|
||||
ContentParent::RecvKeywordToURI(const nsCString& aKeyword, OptionalInputStreamParams* aPostData,
|
||||
OptionalURIParams* aURI)
|
||||
{
|
||||
nsCOMPtr<nsIURIFixup> fixup = do_GetService(NS_URIFIXUP_CONTRACTID);
|
||||
if (!fixup) {
|
||||
return true;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIInputStream> postData;
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
if (NS_FAILED(fixup->KeywordToURI(aKeyword, getter_AddRefs(postData),
|
||||
getter_AddRefs(uri)))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
SerializeInputStream(postData, *aPostData);
|
||||
SerializeURI(uri, *aURI);
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
@ -425,6 +425,9 @@ private:
|
||||
|
||||
virtual bool RecvSetFakeVolumeState(const nsString& fsName, const int32_t& fsState) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool RecvKeywordToURI(const nsCString& aKeyword, OptionalInputStreamParams* aPostData,
|
||||
OptionalURIParams* aURI);
|
||||
|
||||
virtual void ProcessingError(Result what) MOZ_OVERRIDE;
|
||||
|
||||
// If you add strong pointers to cycle collected objects here, be sure to
|
||||
|
@ -411,6 +411,9 @@ parent:
|
||||
async CreateFakeVolume(nsString fsName, nsString mountPoint);
|
||||
async SetFakeVolumeState(nsString fsName, int32_t fsState);
|
||||
|
||||
sync KeywordToURI(nsCString keyword)
|
||||
returns (OptionalInputStreamParams postData, OptionalURIParams uri);
|
||||
|
||||
both:
|
||||
AsyncMessage(nsString aMessage, ClonedMessageData aData, CpowEntry[] aCpows);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user