зеркало из https://github.com/mozilla/gecko-dev.git
Merge m-i to m-c
This commit is contained in:
Коммит
501a8787f4
|
@ -1027,7 +1027,6 @@ pref("services.sync.prefs.sync.privacy.clearOnShutdown.siteSettings", true);
|
|||
pref("services.sync.prefs.sync.privacy.donottrackheader.enabled", true);
|
||||
pref("services.sync.prefs.sync.privacy.donottrackheader.value", true);
|
||||
pref("services.sync.prefs.sync.privacy.sanitize.sanitizeOnShutdown", true);
|
||||
pref("services.sync.prefs.sync.security.OCSP.disable_button.managecrl", true);
|
||||
pref("services.sync.prefs.sync.security.OCSP.enabled", true);
|
||||
pref("services.sync.prefs.sync.security.OCSP.require", true);
|
||||
pref("services.sync.prefs.sync.security.default_personal_cert", true);
|
||||
|
|
|
@ -302,6 +302,15 @@ appUpdater.prototype =
|
|||
return;
|
||||
}
|
||||
|
||||
if (gAppUpdater.update.unsupported) {
|
||||
if (gAppUpdater.update.detailsURL) {
|
||||
let unsupportedLink = document.getElementById("unsupportedLink");
|
||||
unsupportedLink.href = gAppUpdater.update.detailsURL;
|
||||
}
|
||||
gAppUpdater.selectPanel("unsupportedSystem");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!gAppUpdater.aus.canApplyUpdates) {
|
||||
gAppUpdater.selectPanel("manualUpdate");
|
||||
return;
|
||||
|
|
|
@ -82,6 +82,9 @@
|
|||
<hbox id="manualUpdate" align="center">
|
||||
<label>&update.manual.start;</label><label id="manualLink" class="text-link"/><label>&update.manual.end;</label>
|
||||
</hbox>
|
||||
<hbox id="unsupportedSystem" align="center">
|
||||
<label>&update.unsupported.start;</label><label id="unsupportedLink" class="text-link">&update.unsupported.linkText;</label><label>&update.unsupported.end;</label>
|
||||
</hbox>
|
||||
</deck>
|
||||
#endif
|
||||
</vbox>
|
||||
|
|
|
@ -804,16 +804,6 @@ var gAdvancedPane = {
|
|||
"", null);
|
||||
},
|
||||
|
||||
/**
|
||||
* Displays a dialog which describes the user's CRLs.
|
||||
*/
|
||||
showCRLs: function ()
|
||||
{
|
||||
document.documentElement.openWindow("mozilla:crlmanager",
|
||||
"chrome://pippki/content/crlManager.xul",
|
||||
"", null);
|
||||
},
|
||||
|
||||
/**
|
||||
* Displays a dialog in which OCSP preferences can be configured.
|
||||
*/
|
||||
|
|
|
@ -101,9 +101,6 @@
|
|||
<preference id="security.disable_button.openCertManager"
|
||||
name="security.disable_button.openCertManager"
|
||||
type="bool"/>
|
||||
<preference id="security.OCSP.disable_button.managecrl"
|
||||
name="security.OCSP.disable_button.managecrl"
|
||||
type="bool"/>
|
||||
<preference id="security.disable_button.openDeviceManager"
|
||||
name="security.disable_button.openDeviceManager"
|
||||
type="bool"/>
|
||||
|
@ -424,33 +421,19 @@
|
|||
|
||||
<separator/>
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
<vbox>
|
||||
#endif
|
||||
<hbox>
|
||||
<button id="viewCertificatesButton"
|
||||
label="&viewCerts.label;" accesskey="&viewCerts.accesskey;"
|
||||
oncommand="gAdvancedPane.showCertificates();"
|
||||
preference="security.disable_button.openCertManager"/>
|
||||
<button id="viewCRLButton"
|
||||
label="&viewCRLs.label;" accesskey="&viewCRLs.accesskey;"
|
||||
oncommand="gAdvancedPane.showCRLs();"
|
||||
preference="security.OCSP.disable_button.managecrl"/>
|
||||
<button id="verificationButton"
|
||||
label="&verify2.label;" accesskey="&verify2.accesskey;"
|
||||
oncommand="gAdvancedPane.showOCSP();"/>
|
||||
#ifdef XP_MACOSX
|
||||
</hbox>
|
||||
<hbox>
|
||||
#endif
|
||||
<button id="viewSecurityDevicesButton"
|
||||
label="&viewSecurityDevices.label;" accesskey="&viewSecurityDevices.accesskey;"
|
||||
oncommand="gAdvancedPane.showSecurityDevices();"
|
||||
preference="security.disable_button.openDeviceManager"/>
|
||||
</hbox>
|
||||
#ifdef XP_MACOSX
|
||||
</vbox>
|
||||
#endif
|
||||
</tabpanel>
|
||||
|
||||
</tabpanels>
|
||||
|
|
|
@ -768,16 +768,6 @@ var gAdvancedPane = {
|
|||
"model=yes", null);
|
||||
},
|
||||
|
||||
/**
|
||||
* Displays a dialog which describes the user's CRLs.
|
||||
*/
|
||||
showCRLs: function ()
|
||||
{
|
||||
openDialog("chrome://pippki/content/crlManager.xul",
|
||||
"mozilla:crlmanager",
|
||||
"model=yes", null);
|
||||
},
|
||||
|
||||
/**
|
||||
* Displays a dialog in which OCSP preferences can be configured.
|
||||
*/
|
||||
|
|
|
@ -117,9 +117,6 @@
|
|||
<preference id="security.disable_button.openCertManager"
|
||||
name="security.disable_button.openCertManager"
|
||||
type="bool"/>
|
||||
<preference id="security.OCSP.disable_button.managecrl"
|
||||
name="security.OCSP.disable_button.managecrl"
|
||||
type="bool"/>
|
||||
<preference id="security.disable_button.openDeviceManager"
|
||||
name="security.disable_button.openDeviceManager"
|
||||
type="bool"/>
|
||||
|
@ -446,10 +443,6 @@
|
|||
label="&viewCerts.label;" accesskey="&viewCerts.accesskey;"
|
||||
oncommand="gAdvancedPane.showCertificates();"
|
||||
preference="security.disable_button.openCertManager"/>
|
||||
<button id="viewCRLButton"
|
||||
label="&viewCRLs.label;" accesskey="&viewCRLs.accesskey;"
|
||||
oncommand="gAdvancedPane.showCRLs();"
|
||||
preference="security.OCSP.disable_button.managecrl"/>
|
||||
<button id="verificationButton"
|
||||
label="&verify2.label;" accesskey="&verify2.accesskey;"
|
||||
oncommand="gAdvancedPane.showOCSP();"/>
|
||||
|
|
|
@ -20,7 +20,7 @@ const XML_PREFIX = "<updates xmlns=\"http://www.mozilla.org/2005/app-update\""
|
|||
"extensionVersion=\"1.0\" installDate=\"1238441400314\" " +
|
||||
"isCompleteUpdate=\"true\" name=\"Update Test 1.0\" " +
|
||||
"serviceURL=\"https://example.com/\" showNeverForVersion=" +
|
||||
"\"false\" showPrompt=\"false\" showSurvey=\"false\" type=" +
|
||||
"\"false\" showPrompt=\"false\" type=" +
|
||||
"\"minor\" version=\"version 1.0\" detailsURL=" +
|
||||
"\"http://example.com/\" previousAppVersion=\"1.0\" " +
|
||||
"statusText=\"The Update was successfully installed\" " +
|
||||
|
|
|
@ -66,6 +66,16 @@
|
|||
<!ENTITY update.manual.start "Updates available at ">
|
||||
<!ENTITY update.manual.end "">
|
||||
|
||||
<!-- LOCALIZATION NOTE (update.unsupported.start,update.unsupported.linkText,update.unsupported.end):
|
||||
update.unsupported.start, update.unsupported.linkText, and
|
||||
update.unsupported.end all go into one line with linkText being wrapped in
|
||||
an anchor that links to a site to provide additional information regarding
|
||||
why the system is no longer supported. As this is all in one line, try to
|
||||
make the localized text short (see bug 843497 for screenshots). -->
|
||||
<!ENTITY update.unsupported.start "You can not perform further updates on this system. ">
|
||||
<!ENTITY update.unsupported.linkText "Learn more">
|
||||
<!ENTITY update.unsupported.end "">
|
||||
|
||||
<!-- LOCALIZATION NOTE (update.downloading.start,update.downloading.end): update.downloading.start and
|
||||
update.downloading.end all go into one line, with the amount downloaded inserted in between. As this
|
||||
is all in one line, try to make the localized text short (see bug 596813 for screenshots). The — is
|
||||
|
|
|
@ -130,8 +130,6 @@
|
|||
<!ENTITY certs.ask.accesskey "i">
|
||||
<!ENTITY viewCerts.label "View Certificates">
|
||||
<!ENTITY viewCerts.accesskey "s">
|
||||
<!ENTITY viewCRLs.label "Revocation Lists">
|
||||
<!ENTITY viewCRLs.accesskey "R">
|
||||
<!ENTITY verify2.label "Validation">
|
||||
<!ENTITY verify2.accesskey "V">
|
||||
<!ENTITY viewSecurityDevices.label "Security Devices">
|
||||
|
|
|
@ -339,7 +339,6 @@ DOMInterfaces = {
|
|||
'Event': [
|
||||
{
|
||||
'nativeType': 'nsDOMEvent',
|
||||
'hasXPConnectImpls': True
|
||||
},
|
||||
{
|
||||
'nativeType': 'JSObject',
|
||||
|
|
|
@ -131,17 +131,27 @@ public:
|
|||
{
|
||||
AssertIsOnMainThread();
|
||||
|
||||
nsCOMPtr<nsIPrincipal> principal;
|
||||
nsIDocument* doc = nullptr;
|
||||
|
||||
nsCOMPtr<nsPIDOMWindow> window = mWorkerPrivate->GetWindow();
|
||||
nsIDocument* doc = window->GetExtantDoc();
|
||||
if (!doc) {
|
||||
SetDOMStringToNull(mURL);
|
||||
return;
|
||||
if (window) {
|
||||
doc = window->GetExtantDoc();
|
||||
if (!doc) {
|
||||
SetDOMStringToNull(mURL);
|
||||
return;
|
||||
}
|
||||
|
||||
principal = doc->NodePrincipal();
|
||||
} else {
|
||||
MOZ_ASSERT(mWorkerPrivate->IsChromeWorker());
|
||||
principal = mWorkerPrivate->GetPrincipal();
|
||||
}
|
||||
|
||||
nsCString url;
|
||||
nsresult rv = nsHostObjectProtocolHandler::AddDataEntry(
|
||||
NS_LITERAL_CSTRING(BLOBURI_SCHEME),
|
||||
mBlob, doc->NodePrincipal(), url);
|
||||
mBlob, principal, url);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_WARNING("Failed to add data entry for the blob!");
|
||||
|
@ -149,7 +159,12 @@ public:
|
|||
return;
|
||||
}
|
||||
|
||||
doc->RegisterHostObjectUri(url);
|
||||
if (doc) {
|
||||
doc->RegisterHostObjectUri(url);
|
||||
} else {
|
||||
mWorkerPrivate->RegisterHostObjectURI(url);
|
||||
}
|
||||
|
||||
mURL = NS_ConvertUTF8toUTF16(url);
|
||||
}
|
||||
};
|
||||
|
@ -172,24 +187,41 @@ public:
|
|||
{
|
||||
AssertIsOnMainThread();
|
||||
|
||||
nsCOMPtr<nsIPrincipal> principal;
|
||||
nsIDocument* doc = nullptr;
|
||||
|
||||
nsCOMPtr<nsPIDOMWindow> window = mWorkerPrivate->GetWindow();
|
||||
nsIDocument* doc = window->GetExtantDoc();
|
||||
if (!doc) {
|
||||
return;
|
||||
if (window) {
|
||||
doc = window->GetExtantDoc();
|
||||
if (!doc) {
|
||||
return;
|
||||
}
|
||||
|
||||
principal = doc->NodePrincipal();
|
||||
} else {
|
||||
MOZ_ASSERT(mWorkerPrivate->IsChromeWorker());
|
||||
principal = mWorkerPrivate->GetPrincipal();
|
||||
}
|
||||
|
||||
NS_ConvertUTF16toUTF8 url(mURL);
|
||||
|
||||
nsIPrincipal* principal =
|
||||
nsIPrincipal* urlPrincipal =
|
||||
nsHostObjectProtocolHandler::GetDataEntryPrincipal(url);
|
||||
|
||||
bool subsumes;
|
||||
if (principal &&
|
||||
NS_SUCCEEDED(doc->NodePrincipal()->Subsumes(principal, &subsumes)) &&
|
||||
if (urlPrincipal &&
|
||||
NS_SUCCEEDED(principal->Subsumes(urlPrincipal, &subsumes)) &&
|
||||
subsumes) {
|
||||
doc->UnregisterHostObjectUri(url);
|
||||
if (doc) {
|
||||
doc->UnregisterHostObjectUri(url);
|
||||
}
|
||||
|
||||
nsHostObjectProtocolHandler::RemoveDataEntry(url);
|
||||
}
|
||||
|
||||
if (!window) {
|
||||
mWorkerPrivate->UnregisterHostObjectURI(url);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "nsIXPConnect.h"
|
||||
#include "nsIXPCScriptNotify.h"
|
||||
#include "nsPrintfCString.h"
|
||||
#include "nsHostObjectProtocolHandler.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include "jsfriendapi.h"
|
||||
|
@ -529,18 +530,23 @@ class MainThreadReleaseRunnable : public nsRunnable
|
|||
{
|
||||
nsCOMPtr<nsIThread> mThread;
|
||||
nsTArray<nsCOMPtr<nsISupports> > mDoomed;
|
||||
nsTArray<nsCString> mHostObjectURIs;
|
||||
|
||||
public:
|
||||
MainThreadReleaseRunnable(nsCOMPtr<nsIThread>& aThread,
|
||||
nsTArray<nsCOMPtr<nsISupports> >& aDoomed)
|
||||
nsTArray<nsCOMPtr<nsISupports> >& aDoomed,
|
||||
nsTArray<nsCString>& aHostObjectURIs)
|
||||
{
|
||||
mThread.swap(aThread);
|
||||
mDoomed.SwapElements(aDoomed);
|
||||
mHostObjectURIs.SwapElements(aHostObjectURIs);
|
||||
}
|
||||
|
||||
MainThreadReleaseRunnable(nsTArray<nsCOMPtr<nsISupports> >& aDoomed)
|
||||
MainThreadReleaseRunnable(nsTArray<nsCOMPtr<nsISupports> >& aDoomed,
|
||||
nsTArray<nsCString>& aHostObjectURIs)
|
||||
{
|
||||
mDoomed.SwapElements(aDoomed);
|
||||
mHostObjectURIs.SwapElements(aHostObjectURIs);
|
||||
}
|
||||
|
||||
NS_IMETHOD
|
||||
|
@ -555,6 +561,10 @@ public:
|
|||
runtime->NoteIdleThread(mThread);
|
||||
}
|
||||
|
||||
for (uint32_t i = 0, len = mHostObjectURIs.Length(); i < len; ++i) {
|
||||
nsHostObjectProtocolHandler::RemoveDataEntry(mHostObjectURIs[i]);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
};
|
||||
|
@ -592,8 +602,11 @@ public:
|
|||
nsTArray<nsCOMPtr<nsISupports> > doomed;
|
||||
mFinishedWorker->ForgetMainThreadObjects(doomed);
|
||||
|
||||
nsTArray<nsCString> hostObjectURIs;
|
||||
mFinishedWorker->StealHostObjectURIs(hostObjectURIs);
|
||||
|
||||
nsRefPtr<MainThreadReleaseRunnable> runnable =
|
||||
new MainThreadReleaseRunnable(mThread, doomed);
|
||||
new MainThreadReleaseRunnable(mThread, doomed, hostObjectURIs);
|
||||
if (NS_FAILED(NS_DispatchToMainThread(runnable, NS_DISPATCH_NORMAL))) {
|
||||
NS_WARNING("Failed to dispatch, going to leak!");
|
||||
}
|
||||
|
@ -641,8 +654,11 @@ public:
|
|||
nsTArray<nsCOMPtr<nsISupports> > doomed;
|
||||
mFinishedWorker->ForgetMainThreadObjects(doomed);
|
||||
|
||||
nsTArray<nsCString> hostObjectURIs;
|
||||
mFinishedWorker->StealHostObjectURIs(hostObjectURIs);
|
||||
|
||||
nsRefPtr<MainThreadReleaseRunnable> runnable =
|
||||
new MainThreadReleaseRunnable(doomed);
|
||||
new MainThreadReleaseRunnable(doomed, hostObjectURIs);
|
||||
if (NS_FAILED(NS_DispatchToCurrentThread(runnable))) {
|
||||
NS_WARNING("Failed to dispatch, going to leak!");
|
||||
}
|
||||
|
@ -4295,6 +4311,29 @@ WorkerPrivate::AssertIsOnWorkerThread() const
|
|||
}
|
||||
#endif
|
||||
|
||||
template <class Derived>
|
||||
void
|
||||
WorkerPrivateParent<Derived>::RegisterHostObjectURI(const nsACString& aURI)
|
||||
{
|
||||
AssertIsOnMainThread();
|
||||
mHostObjectURIs.AppendElement(aURI);
|
||||
}
|
||||
|
||||
template <class Derived>
|
||||
void
|
||||
WorkerPrivateParent<Derived>::UnregisterHostObjectURI(const nsACString& aURI)
|
||||
{
|
||||
AssertIsOnMainThread();
|
||||
mHostObjectURIs.RemoveElement(aURI);
|
||||
}
|
||||
|
||||
template <class Derived>
|
||||
void
|
||||
WorkerPrivateParent<Derived>::StealHostObjectURIs(nsTArray<nsCString>& aArray)
|
||||
{
|
||||
aArray.SwapElements(mHostObjectURIs);
|
||||
}
|
||||
|
||||
WorkerCrossThreadDispatcher*
|
||||
WorkerPrivate::GetCrossThreadDispatcher()
|
||||
{
|
||||
|
|
|
@ -277,6 +277,9 @@ private:
|
|||
// Only used for top level workers.
|
||||
nsTArray<nsRefPtr<WorkerRunnable> > mQueuedRunnables;
|
||||
|
||||
// Only for ChromeWorkers without window and only touched on the main thread.
|
||||
nsTArray<nsCString> mHostObjectURIs;
|
||||
|
||||
// Protected by mMutex.
|
||||
JSSettings mJSSettings;
|
||||
|
||||
|
@ -615,6 +618,10 @@ public:
|
|||
AssertInnerWindowIsCorrect() const
|
||||
{ }
|
||||
#endif
|
||||
|
||||
void RegisterHostObjectURI(const nsACString& aURI);
|
||||
void UnregisterHostObjectURI(const nsACString& aURI);
|
||||
void StealHostObjectURIs(nsTArray<nsCString>& aArray);
|
||||
};
|
||||
|
||||
class WorkerPrivate : public WorkerPrivateParent<WorkerPrivate>
|
||||
|
|
|
@ -148,6 +148,9 @@ MOCHITEST_CHROME_FILES = \
|
|||
test_workersDisabled.xul \
|
||||
workersDisabled_worker.js \
|
||||
dom_worker_helper.js \
|
||||
test_bug883784.xul \
|
||||
test_bug883784.jsm \
|
||||
url_worker.js \
|
||||
$(NULL)
|
||||
|
||||
libs:: $(_SUBDIRMOCHITEST_FILES)
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
this.EXPORTED_SYMBOLS = ["Test"];
|
||||
|
||||
this.Test = {
|
||||
start: function(ok, is, finish) {
|
||||
let worker = new ChromeWorker("url_worker.js");
|
||||
worker.onmessage = function(event) {
|
||||
|
||||
if (event.data.type == 'finish') {
|
||||
finish();
|
||||
} else if (event.data.type == 'status') {
|
||||
ok(event.data.status, event.data.msg);
|
||||
} else if (event.data.type == 'url') {
|
||||
var xhr = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"]
|
||||
.createInstance(Components.interfaces.nsIXMLHttpRequest);
|
||||
xhr.open('GET', event.data.url, false);
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState == 4) {
|
||||
ok(true, "Blob readable!");
|
||||
}
|
||||
}
|
||||
xhr.send();
|
||||
}
|
||||
};
|
||||
|
||||
var self = this;
|
||||
worker.onerror = function(event) {
|
||||
is(event.target, worker);
|
||||
ok(false, "Worker had an error: " + event.data);
|
||||
self.worker.terminate();
|
||||
finish();
|
||||
};
|
||||
|
||||
worker.postMessage(true);
|
||||
}
|
||||
};
|
|
@ -0,0 +1,36 @@
|
|||
<?xml version="1.0"?>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<window title="DOM Worker Threads Test"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="test();">
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
|
||||
<script type="application/javascript" src="dom_worker_helper.js"/>
|
||||
|
||||
<script type="application/javascript">
|
||||
<![CDATA[
|
||||
|
||||
function test()
|
||||
{
|
||||
waitForWorkerFinish();
|
||||
|
||||
Components.utils.import("chrome://mochitests/content/chrome/dom/workers/test/test_bug883784.jsm");
|
||||
Test.start(ok, is, finish);
|
||||
}
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<body xmlns="http://www.w3.org/1999/xhtml">
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display:none;"></div>
|
||||
<pre id="test"></pre>
|
||||
</body>
|
||||
<label id="test-result"/>
|
||||
</window>
|
|
@ -206,6 +206,8 @@ fix-win32-font-assertion.patch: Bug 838617, fix assertion from bug 717178 that w
|
|||
|
||||
xlib-flush-glyphs.patch: bug 839745, flush glyphs when necessary
|
||||
|
||||
dasharray-zero-gap.patch: bug 885585, ensure strokes get painted when the gaps in a dash array are all zero length
|
||||
|
||||
==== pixman patches ====
|
||||
|
||||
pixman-android-cpu-detect.patch: Add CPU detection support for Android, where we can't reliably access /proc/self/auxv.
|
||||
|
|
|
@ -2578,19 +2578,33 @@ _cairo_quartz_surface_stroke_cg (void *abstract_surface,
|
|||
unsigned int max_dashes = style->num_dashes;
|
||||
unsigned int k;
|
||||
|
||||
if (style->num_dashes%2)
|
||||
max_dashes *= 2;
|
||||
if (max_dashes > STATIC_DASH)
|
||||
fdash = _cairo_malloc_ab (max_dashes, sizeof (cairo_quartz_float_t));
|
||||
if (fdash == NULL)
|
||||
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
|
||||
bool set_line_dash = false;
|
||||
if (style->num_dashes % 2 == 0) {
|
||||
for (k = 1; k < max_dashes; k++) {
|
||||
if (style->dash[k]) {
|
||||
set_line_dash = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else
|
||||
set_line_dash = true;
|
||||
|
||||
for (k = 0; k < max_dashes; k++)
|
||||
fdash[k] = (cairo_quartz_float_t) style->dash[k % style->num_dashes];
|
||||
if (set_line_dash) {
|
||||
if (style->num_dashes%2)
|
||||
max_dashes *= 2;
|
||||
if (max_dashes > STATIC_DASH)
|
||||
fdash = _cairo_malloc_ab (max_dashes, sizeof (cairo_quartz_float_t));
|
||||
if (fdash == NULL)
|
||||
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
|
||||
|
||||
CGContextSetLineDash (surface->cgContext, style->dash_offset, fdash, max_dashes);
|
||||
if (fdash != sdash)
|
||||
free (fdash);
|
||||
for (k = 0; k < max_dashes; k++)
|
||||
fdash[k] = (cairo_quartz_float_t) style->dash[k % style->num_dashes];
|
||||
|
||||
CGContextSetLineDash (surface->cgContext, style->dash_offset, fdash, max_dashes);
|
||||
if (fdash != sdash)
|
||||
free (fdash);
|
||||
} else
|
||||
CGContextSetLineDash (state.context, 0, NULL, 0);
|
||||
} else
|
||||
CGContextSetLineDash (state.context, 0, NULL, 0);
|
||||
|
||||
|
|
|
@ -0,0 +1,60 @@
|
|||
diff --git a/gfx/cairo/cairo/src/cairo-quartz-surface.c b/gfx/cairo/cairo/src/cairo-quartz-surface.c
|
||||
--- a/gfx/cairo/cairo/src/cairo-quartz-surface.c
|
||||
+++ b/gfx/cairo/cairo/src/cairo-quartz-surface.c
|
||||
@@ -2573,29 +2573,43 @@ static cairo_int_status_t
|
||||
|
||||
if (style->dash && style->num_dashes) {
|
||||
#define STATIC_DASH 32
|
||||
cairo_quartz_float_t sdash[STATIC_DASH];
|
||||
cairo_quartz_float_t *fdash = sdash;
|
||||
unsigned int max_dashes = style->num_dashes;
|
||||
unsigned int k;
|
||||
|
||||
- if (style->num_dashes%2)
|
||||
- max_dashes *= 2;
|
||||
- if (max_dashes > STATIC_DASH)
|
||||
- fdash = _cairo_malloc_ab (max_dashes, sizeof (cairo_quartz_float_t));
|
||||
- if (fdash == NULL)
|
||||
- return _cairo_error (CAIRO_STATUS_NO_MEMORY);
|
||||
-
|
||||
- for (k = 0; k < max_dashes; k++)
|
||||
- fdash[k] = (cairo_quartz_float_t) style->dash[k % style->num_dashes];
|
||||
-
|
||||
- CGContextSetLineDash (surface->cgContext, style->dash_offset, fdash, max_dashes);
|
||||
- if (fdash != sdash)
|
||||
- free (fdash);
|
||||
+ bool set_line_dash = false;
|
||||
+ if (style->num_dashes % 2 == 0) {
|
||||
+ for (k = 1; k < max_dashes; k++) {
|
||||
+ if (style->dash[k]) {
|
||||
+ set_line_dash = true;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ } else
|
||||
+ set_line_dash = true;
|
||||
+
|
||||
+ if (set_line_dash) {
|
||||
+ if (style->num_dashes%2)
|
||||
+ max_dashes *= 2;
|
||||
+ if (max_dashes > STATIC_DASH)
|
||||
+ fdash = _cairo_malloc_ab (max_dashes, sizeof (cairo_quartz_float_t));
|
||||
+ if (fdash == NULL)
|
||||
+ return _cairo_error (CAIRO_STATUS_NO_MEMORY);
|
||||
+
|
||||
+ for (k = 0; k < max_dashes; k++)
|
||||
+ fdash[k] = (cairo_quartz_float_t) style->dash[k % style->num_dashes];
|
||||
+
|
||||
+ CGContextSetLineDash (surface->cgContext, style->dash_offset, fdash, max_dashes);
|
||||
+ if (fdash != sdash)
|
||||
+ free (fdash);
|
||||
+ } else
|
||||
+ CGContextSetLineDash (state.context, 0, NULL, 0);
|
||||
} else
|
||||
CGContextSetLineDash (state.context, 0, NULL, 0);
|
||||
|
||||
|
||||
_cairo_quartz_cairo_path_to_quartz_context (path, state.context);
|
||||
|
||||
_cairo_quartz_cairo_matrix_to_quartz (ctm, &strokeTransform);
|
||||
CGContextConcatCTM (state.context, strokeTransform);
|
|
@ -194,14 +194,13 @@ js::ToBooleanSlow(const Value &v)
|
|||
}
|
||||
|
||||
/*
|
||||
* This slow path is only ever taken for Boolean objects from other
|
||||
* compartments. The only caller of the fast path, JSON's PreprocessValue,
|
||||
* makes sure of that.
|
||||
* This slow path is only ever taken for proxies wrapping Boolean objects
|
||||
* The only caller of the fast path, JSON's PreprocessValue, ensures that.
|
||||
*/
|
||||
bool
|
||||
js::BooleanGetPrimitiveValueSlow(HandleObject wrappedBool, JSContext *cx)
|
||||
{
|
||||
JS_ASSERT(wrappedBool->isCrossCompartmentWrapper());
|
||||
JS_ASSERT(wrappedBool->isProxy());
|
||||
JSObject *obj = Wrapper::wrappedObject(wrappedBool);
|
||||
JS_ASSERT(obj);
|
||||
return obj->as<BooleanObject>().unbox();
|
||||
|
|
|
@ -3713,7 +3713,7 @@ nsDisplayTransform::GetResultingTransformMatrixInternal(const FrameTransformProp
|
|||
result = result * gfx3DMatrix::From2D(transformFromSVGParent);
|
||||
}
|
||||
|
||||
if (nsLayoutUtils::Are3DTransformsEnabled() && aProperties.mChildPerspective > 0.0) {
|
||||
if (aProperties.mChildPerspective > 0.0) {
|
||||
gfx3DMatrix perspective;
|
||||
perspective._34 =
|
||||
-1.0 / NSAppUnitsToFloatPixels(aProperties.mChildPerspective, aAppUnitsPerPixel);
|
||||
|
@ -3723,11 +3723,11 @@ nsDisplayTransform::GetResultingTransformMatrixInternal(const FrameTransformProp
|
|||
result = result * nsLayoutUtils::ChangeMatrixBasis(aProperties.mToPerspectiveOrigin - aProperties.mToMozOrigin, perspective);
|
||||
}
|
||||
|
||||
gfxPoint3D rounded(hasSVGTransforms ? newOrigin.x : NS_round(newOrigin.x),
|
||||
hasSVGTransforms ? newOrigin.y : NS_round(newOrigin.y),
|
||||
gfxPoint3D rounded(hasSVGTransforms ? newOrigin.x : NS_round(newOrigin.x),
|
||||
hasSVGTransforms ? newOrigin.y : NS_round(newOrigin.y),
|
||||
0);
|
||||
|
||||
if (frame && frame->Preserves3D() && nsLayoutUtils::Are3DTransformsEnabled()) {
|
||||
|
||||
if (frame && frame->Preserves3D()) {
|
||||
// Include the transform set on our parent
|
||||
NS_ASSERTION(frame->GetParent() &&
|
||||
frame->GetParent()->IsTransformed() &&
|
||||
|
|
|
@ -306,21 +306,6 @@ nsLayoutUtils::GetMaximumAnimatedScale(nsIContent* aContent)
|
|||
return result;
|
||||
}
|
||||
|
||||
bool
|
||||
nsLayoutUtils::Are3DTransformsEnabled()
|
||||
{
|
||||
static bool s3DTransformsEnabled;
|
||||
static bool s3DTransformPrefCached = false;
|
||||
|
||||
if (!s3DTransformPrefCached) {
|
||||
s3DTransformPrefCached = true;
|
||||
Preferences::AddBoolVarCache(&s3DTransformsEnabled,
|
||||
"layout.3d-transforms.enabled");
|
||||
}
|
||||
|
||||
return s3DTransformsEnabled;
|
||||
}
|
||||
|
||||
bool
|
||||
nsLayoutUtils::AreAsyncAnimationsEnabled()
|
||||
{
|
||||
|
|
|
@ -1579,11 +1579,6 @@ public:
|
|||
static bool HasAnimationsForCompositor(nsIContent* aContent,
|
||||
nsCSSProperty aProperty);
|
||||
|
||||
/**
|
||||
* Checks if CSS 3D transforms are currently enabled.
|
||||
*/
|
||||
static bool Are3DTransformsEnabled();
|
||||
|
||||
/**
|
||||
* Checks if off-main-thread animations are enabled.
|
||||
*/
|
||||
|
|
|
@ -309,6 +309,7 @@ pref(svg.text.css-frames.enabled,true) == text-layout-08.svg text-layout-08-ref.
|
|||
HTTP(..) == text-scale-02.svg text-scale-02-ref.svg
|
||||
HTTP(..) == text-scale-03.svg text-scale-03-ref.svg
|
||||
== text-stroke-scaling-01.svg text-stroke-scaling-01-ref.svg
|
||||
== stroke-dasharray-01.svg stroke-dasharray-01-ref.svg
|
||||
== stroke-dasharray-and-pathLength-01.svg pass.svg
|
||||
== stroke-dasharray-and-text-01.svg stroke-dasharray-and-text-01-ref.svg
|
||||
== stroke-linecap-square-w-zero-length-segs-01.svg pass.svg
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<title>Reference for a stroke with a dasharray whose gaps add up to 0 still painting</title>
|
||||
<!-- https://bugzilla.mozilla.org/show_bug.cgi?id=885585 -->
|
||||
|
||||
<g fill="none" stroke="black" stroke-width="2">
|
||||
<path d="M 100,100 v 100"/>
|
||||
<path d="M 110,100 h 100"/>
|
||||
</g>
|
||||
</svg>
|
После Ширина: | Высота: | Размер: 446 B |
|
@ -0,0 +1,13 @@
|
|||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<title>Test for a stroke with a dasharray whose gaps add up to 0 still painting</title>
|
||||
<!-- https://bugzilla.mozilla.org/show_bug.cgi?id=885585 -->
|
||||
|
||||
<g fill="none" stroke="black" stroke-width="2" stroke-dasharray="10 0">
|
||||
<path d="M 100,100 v 100"/>
|
||||
<path d="M 110,100 h 100"/>
|
||||
</g>
|
||||
</svg>
|
После Ширина: | Высота: | Размер: 465 B |
|
@ -672,7 +672,7 @@ protected:
|
|||
}
|
||||
|
||||
/* Functions for transform Parsing */
|
||||
bool ParseSingleTransform(bool aIsPrefixed, nsCSSValue& aValue, bool& aIs3D);
|
||||
bool ParseSingleTransform(bool aIsPrefixed, nsCSSValue& aValue);
|
||||
bool ParseFunction(nsCSSKeyword aFunction, const int32_t aAllowedTypes[],
|
||||
int32_t aVariantMaskAll, uint16_t aMinElems,
|
||||
uint16_t aMaxElems, nsCSSValue &aValue);
|
||||
|
@ -9847,8 +9847,7 @@ static bool GetFunctionParseInformation(nsCSSKeyword aToken,
|
|||
bool aIsPrefixed,
|
||||
uint16_t &aMinElems,
|
||||
uint16_t &aMaxElems,
|
||||
const int32_t *& aVariantMask,
|
||||
bool &aIs3D)
|
||||
const int32_t *& aVariantMask)
|
||||
{
|
||||
/* These types represent the common variant masks that will be used to
|
||||
* parse out the individual functions. The order in the enumeration
|
||||
|
@ -9903,8 +9902,6 @@ static bool GetFunctionParseInformation(nsCSSKeyword aToken,
|
|||
|
||||
int32_t variantIndex = eNumVariantMasks;
|
||||
|
||||
aIs3D = false;
|
||||
|
||||
switch (aToken) {
|
||||
case eCSSKeyword_translatex:
|
||||
case eCSSKeyword_translatey:
|
||||
|
@ -9918,17 +9915,14 @@ static bool GetFunctionParseInformation(nsCSSKeyword aToken,
|
|||
variantIndex = eLengthCalc;
|
||||
aMinElems = 1U;
|
||||
aMaxElems = 1U;
|
||||
aIs3D = true;
|
||||
break;
|
||||
case eCSSKeyword_translate3d:
|
||||
/* Exactly two lengthds or percents and a number */
|
||||
variantIndex = eTwoLengthPercentCalcsOneLengthCalc;
|
||||
aMinElems = 3U;
|
||||
aMaxElems = 3U;
|
||||
aIs3D = true;
|
||||
break;
|
||||
case eCSSKeyword_scalez:
|
||||
aIs3D = true;
|
||||
case eCSSKeyword_scalex:
|
||||
case eCSSKeyword_scaley:
|
||||
/* Exactly one scale factor. */
|
||||
|
@ -9941,11 +9935,9 @@ static bool GetFunctionParseInformation(nsCSSKeyword aToken,
|
|||
variantIndex = eThreeNumbers;
|
||||
aMinElems = 3U;
|
||||
aMaxElems = 3U;
|
||||
aIs3D = true;
|
||||
break;
|
||||
case eCSSKeyword_rotatex:
|
||||
case eCSSKeyword_rotatey:
|
||||
aIs3D = true;
|
||||
case eCSSKeyword_rotate:
|
||||
case eCSSKeyword_rotatez:
|
||||
/* Exactly one angle. */
|
||||
|
@ -9957,7 +9949,6 @@ static bool GetFunctionParseInformation(nsCSSKeyword aToken,
|
|||
variantIndex = eThreeNumbersOneAngle;
|
||||
aMinElems = 4U;
|
||||
aMaxElems = 4U;
|
||||
aIs3D = true;
|
||||
break;
|
||||
case eCSSKeyword_translate:
|
||||
/* One or two lengths or percents. */
|
||||
|
@ -10000,14 +9991,12 @@ static bool GetFunctionParseInformation(nsCSSKeyword aToken,
|
|||
variantIndex = aIsPrefixed ? eMatrix3dPrefixed : eMatrix3d;
|
||||
aMinElems = 16U;
|
||||
aMaxElems = 16U;
|
||||
aIs3D = true;
|
||||
break;
|
||||
case eCSSKeyword_perspective:
|
||||
/* Exactly one scale number. */
|
||||
variantIndex = ePositiveLength;
|
||||
aMinElems = 1U;
|
||||
aMaxElems = 1U;
|
||||
aIs3D = true;
|
||||
break;
|
||||
default:
|
||||
/* Oh dear, we didn't match. Report an error. */
|
||||
|
@ -10034,8 +10023,7 @@ static bool GetFunctionParseInformation(nsCSSKeyword aToken,
|
|||
* error if something goes wrong.
|
||||
*/
|
||||
bool
|
||||
CSSParserImpl::ParseSingleTransform(bool aIsPrefixed,
|
||||
nsCSSValue& aValue, bool& aIs3D)
|
||||
CSSParserImpl::ParseSingleTransform(bool aIsPrefixed, nsCSSValue& aValue)
|
||||
{
|
||||
if (!GetToken(true))
|
||||
return false;
|
||||
|
@ -10050,7 +10038,7 @@ CSSParserImpl::ParseSingleTransform(bool aIsPrefixed,
|
|||
nsCSSKeyword keyword = nsCSSKeywords::LookupKeyword(mToken.mIdent);
|
||||
|
||||
if (!GetFunctionParseInformation(keyword, aIsPrefixed,
|
||||
minElems, maxElems, variantMask, aIs3D))
|
||||
minElems, maxElems, variantMask))
|
||||
return false;
|
||||
|
||||
return ParseFunction(keyword, variantMask, 0, minElems, maxElems, aValue);
|
||||
|
@ -10070,11 +10058,7 @@ bool CSSParserImpl::ParseTransform(bool aIsPrefixed)
|
|||
} else {
|
||||
nsCSSValueList* cur = value.SetListValue();
|
||||
for (;;) {
|
||||
bool is3D;
|
||||
if (!ParseSingleTransform(aIsPrefixed, cur->mValue, is3D)) {
|
||||
return false;
|
||||
}
|
||||
if (is3D && !nsLayoutUtils::Are3DTransformsEnabled()) {
|
||||
if (!ParseSingleTransform(aIsPrefixed, cur->mValue)) {
|
||||
return false;
|
||||
}
|
||||
if (CheckEndProperty()) {
|
||||
|
@ -10116,9 +10100,7 @@ bool CSSParserImpl::ParseTransformOrigin(bool aPerspective)
|
|||
value.SetPairValue(position.mXValue, position.mYValue);
|
||||
} else {
|
||||
nsCSSValue depth;
|
||||
if (!nsLayoutUtils::Are3DTransformsEnabled() ||
|
||||
// only try parsing if 3-D transforms are enabled
|
||||
!ParseVariant(depth, VARIANT_LENGTH | VARIANT_CALC, nullptr)) {
|
||||
if (!ParseVariant(depth, VARIANT_LENGTH | VARIANT_CALC, nullptr)) {
|
||||
depth.SetFloatValue(0.0f, eCSSUnit_Pixel);
|
||||
}
|
||||
value.SetTripletValue(position.mXValue, position.mYValue, depth);
|
||||
|
|
|
@ -1108,7 +1108,6 @@ var gCSSProperties = {
|
|||
"translate(calc(5px - 10% * 3))",
|
||||
"translate(calc(5px - 3 * 10%), 50px)",
|
||||
"translate(-50px, calc(5px - 10% * 3))",
|
||||
].concat(SpecialPowers.getBoolPref("layout.3d-transforms.enabled") ? [
|
||||
"translatez(1px)", "translatez(4em)", "translatez(-4px)",
|
||||
"translatez(0px)", "translatez(2px) translatez(5px)",
|
||||
"translate3d(3px, 4px, 5px)", "translate3d(2em, 3px, 1em)",
|
||||
|
@ -1118,7 +1117,7 @@ var gCSSProperties = {
|
|||
"rotate3d(-3, 7, 0, 12rad)", "rotatex(15deg)", "rotatey(-12grad)",
|
||||
"rotatez(72rad)", "rotatex(0.125turn)", "perspective(1000px)",
|
||||
"matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)",
|
||||
] : []),
|
||||
],
|
||||
invalid_values: ["1px", "#0000ff", "red", "auto",
|
||||
"translatex(1)", "translatey(1)", "translate(2)",
|
||||
"translate(-3, -4)",
|
||||
|
@ -1135,8 +1134,7 @@ var gCSSProperties = {
|
|||
"translatex(-moz-max(5px,10%))",
|
||||
"translate(10px, calc(min(5px,10%)))",
|
||||
"translate(calc(max(5px,10%)), 10%)",
|
||||
"matrix(1, 0, 0, 1, max(5px * 3), calc(10% - 3px))"
|
||||
].concat(SpecialPowers.getBoolPref("layout.3d-transforms.enabled") ? [
|
||||
"matrix(1, 0, 0, 1, max(5px * 3), calc(10% - 3px))",
|
||||
"perspective(0px)", "perspective(-10px)", "matrix3d(dinosaur)",
|
||||
"matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)",
|
||||
"matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)",
|
||||
|
@ -1145,7 +1143,7 @@ var gCSSProperties = {
|
|||
"rotatey(words)", "rotatex(7)", "translate3d(3px, 4px, 1px, 7px)",
|
||||
"matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13px, 14em, 15px, 16)",
|
||||
"matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 20%, 10%, 15, 16)"
|
||||
] : [])
|
||||
],
|
||||
},
|
||||
"transform-origin": {
|
||||
domProp: "transformOrigin",
|
||||
|
@ -1169,11 +1167,10 @@ var gCSSProperties = {
|
|||
"calc(20px + 1em) calc(20px / 2)",
|
||||
"calc(20px + 50%) calc(50% - 10px)",
|
||||
"calc(-20px) calc(-50%)",
|
||||
"calc(-20%) calc(-50%)"
|
||||
].concat(SpecialPowers.getBoolPref("layout.3d-transforms.enabled") ? [
|
||||
"calc(-20%) calc(-50%)",
|
||||
"6px 5px 5px",
|
||||
"top center 10px"
|
||||
] : []),
|
||||
],
|
||||
invalid_values: ["red", "auto", "none", "0.5 0.5", "40px #0000ff",
|
||||
"border", "center red", "right diagonal",
|
||||
"#00ffff bottom"]
|
||||
|
@ -3740,7 +3737,6 @@ var gCSSProperties = {
|
|||
"matrix(1, 2, 3, 4, 5%, 6%)",
|
||||
"matrix(1, 2, 3, 4, 5px, 6em)",
|
||||
"matrix(1, 0, 0, 1, calc(5px * 3), calc(10% - 3px))",
|
||||
].concat(SpecialPowers.getBoolPref("layout.3d-transforms.enabled") ? [
|
||||
"translatez(1px)", "translatez(4em)", "translatez(-4px)",
|
||||
"translatez(0px)", "translatez(2px) translatez(5px)",
|
||||
"translate3d(3px, 4px, 5px)", "translate3d(2em, 3px, 1em)",
|
||||
|
@ -3753,7 +3749,7 @@ var gCSSProperties = {
|
|||
/* valid only when prefixed */
|
||||
"matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13px, 14em, 15px, 16)",
|
||||
"matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 20%, 10%, 15, 16)",
|
||||
] : []),
|
||||
],
|
||||
invalid_values: ["1px", "#0000ff", "red", "auto",
|
||||
"translatex(1)", "translatey(1)", "translate(2)",
|
||||
"translate(-3, -4)",
|
||||
|
@ -3768,15 +3764,14 @@ var gCSSProperties = {
|
|||
"translatex(-moz-max(5px,10%))",
|
||||
"translate(10px, calc(min(5px,10%)))",
|
||||
"translate(calc(max(5px,10%)), 10%)",
|
||||
"matrix(1, 0, 0, 1, max(5px * 3), calc(10% - 3px))"
|
||||
].concat(SpecialPowers.getBoolPref("layout.3d-transforms.enabled") ? [
|
||||
"matrix(1, 0, 0, 1, max(5px * 3), calc(10% - 3px))",
|
||||
"perspective(0px)", "perspective(-10px)", "matrix3d(dinosaur)",
|
||||
"matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)",
|
||||
"matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)",
|
||||
"matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15%, 16)",
|
||||
"matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16px)",
|
||||
"rotatey(words)", "rotatex(7)", "translate3d(3px, 4px, 1px, 7px)",
|
||||
] : [])
|
||||
],
|
||||
},
|
||||
"-moz-transform-origin": {
|
||||
domProp: "MozTransformOrigin",
|
||||
|
@ -3801,11 +3796,10 @@ var gCSSProperties = {
|
|||
"calc(20px + 1em) calc(20px / 2)",
|
||||
"calc(20px + 50%) calc(50% - 10px)",
|
||||
"calc(-20px) calc(-50%)",
|
||||
"calc(-20%) calc(-50%)"
|
||||
].concat(SpecialPowers.getBoolPref("layout.3d-transforms.enabled") ? [
|
||||
"calc(-20%) calc(-50%)",
|
||||
"6px 5px 5px",
|
||||
"top center 10px"
|
||||
] : []),
|
||||
],
|
||||
invalid_values: ["red", "auto", "none", "0.5 0.5", "40px #0000ff",
|
||||
"border", "center red", "right diagonal",
|
||||
"#00ffff bottom"]
|
||||
|
|
|
@ -295,42 +295,35 @@ var transformTests = [
|
|||
expected: computeMatrix('rotate(90deg)') },
|
||||
{ start: 'none', end: 'rotatez(360deg)',
|
||||
expected_uncomputed: 'rotate(90deg)',
|
||||
expected: computeMatrix('rotate(90deg)'),
|
||||
requires_3d: true },
|
||||
expected: computeMatrix('rotate(90deg)') },
|
||||
{ start: 'none', end: 'rotate(720deg)',
|
||||
expected_uncomputed: 'rotate(180deg)',
|
||||
expected: computeMatrix('rotate(180deg)') },
|
||||
{ start: 'none', end: 'rotate(720deg)',
|
||||
expected_uncomputed: 'rotatez(180deg)',
|
||||
expected: computeMatrix('rotate(180deg)'),
|
||||
requires_3d: true },
|
||||
expected: computeMatrix('rotate(180deg)') },
|
||||
{ start: 'none', end: 'rotate(1080deg)',
|
||||
expected_uncomputed: 'rotate(270deg)',
|
||||
expected: computeMatrix('rotate(270deg)') },
|
||||
{ start: 'none', end: 'rotate(1080deg)',
|
||||
expected_uncomputed: 'rotate(270deg)',
|
||||
expected: computeMatrix('rotatez(270deg)'),
|
||||
requires_3d: true },
|
||||
expected: computeMatrix('rotatez(270deg)') },
|
||||
{ start: 'none', end: 'rotate(1440deg)',
|
||||
expected_uncomputed: 'rotate(360deg)',
|
||||
expected: computeMatrix('scale(1)'),
|
||||
round_error_ok: true },
|
||||
{ start: 'none', end: 'rotatey(60deg)',
|
||||
expected_uncomputed: 'rotatey(15deg)',
|
||||
expected: computeMatrix('rotatey(15deg)'),
|
||||
requires_3d: true },
|
||||
expected: computeMatrix('rotatey(15deg)') },
|
||||
{ start: 'none', end: 'rotatey(720deg)',
|
||||
expected_uncomputed: 'rotatey(180deg)',
|
||||
expected: computeMatrix('rotatey(180deg)'),
|
||||
requires_3d: true },
|
||||
expected: computeMatrix('rotatey(180deg)') },
|
||||
{ start: 'none', end: 'rotatex(60deg)',
|
||||
expected_uncomputed: 'rotatex(15deg)',
|
||||
expected: computeMatrix('rotatex(15deg)'),
|
||||
requires_3d: true },
|
||||
expected: computeMatrix('rotatex(15deg)') },
|
||||
{ start: 'none', end: 'rotatex(720deg)',
|
||||
expected_uncomputed: 'rotatex(180deg)',
|
||||
expected: computeMatrix('rotatex(180deg)'),
|
||||
requires_3d: true },
|
||||
expected: computeMatrix('rotatex(180deg)') },
|
||||
|
||||
// translate
|
||||
{ start: 'translate(20px)', end: 'none',
|
||||
|
@ -347,12 +340,10 @@ var transformTests = [
|
|||
expected: 'matrix(1, 0, 0, 1, 0, -30)' },
|
||||
{ start: 'translateZ(40px)', end: 'none',
|
||||
expected_uncomputed: 'translateZ(30px)',
|
||||
expected: 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 30, 1)',
|
||||
requires_3d: true },
|
||||
expected: 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 30, 1)' },
|
||||
{ start: 'none', end: 'translate3D(40px, 60px, -40px)',
|
||||
expected_uncomputed: 'translate3D(10px, 15px, -10px)',
|
||||
expected: 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 10, 15, -10, 1)',
|
||||
requires_3d: true },
|
||||
expected: 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 10, 15, -10, 1)' },
|
||||
// percentages are relative to 300px (width) and 50px (height)
|
||||
// per the prerequisites in property_database.js
|
||||
{ start: 'translate(20%)', end: 'none',
|
||||
|
@ -427,12 +418,10 @@ var transformTests = [
|
|||
expected: 'matrix(1, 0, 0, 4, 0, 0)' },
|
||||
{ start: 'scaleZ(5)', end: 'none',
|
||||
expected_uncomputed: 'scaleZ(4)',
|
||||
expected: 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 4, 0, 0, 0, 0, 1)',
|
||||
requires_3d: true },
|
||||
expected: 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 4, 0, 0, 0, 0, 1)' },
|
||||
{ start: 'none', end: 'scale3D(5, 5, 5)',
|
||||
expected_uncomputed: 'scale3D(2, 2, 2)',
|
||||
expected: 'matrix3d(2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1)',
|
||||
requires_3d: true },
|
||||
expected: 'matrix3d(2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1)' },
|
||||
|
||||
// skew
|
||||
{ start: 'skewX(45deg)', end: 'none',
|
||||
|
@ -697,11 +686,6 @@ function get_distance(prop, v1, v2)
|
|||
.computeAnimationDistance(div, prop, v1, v2);
|
||||
}
|
||||
|
||||
function transform3D_enabled()
|
||||
{
|
||||
return SpecialPowers.getBoolPref("layout.3d-transforms.enabled");
|
||||
}
|
||||
|
||||
function check_distance(prop, start, quarter, end)
|
||||
{
|
||||
var sq = get_distance(prop, start, quarter);
|
||||
|
@ -1655,9 +1639,6 @@ function test_transform_transition(prop) {
|
|||
|
||||
for (var i in transformTests) {
|
||||
var test = transformTests[i];
|
||||
if (test.requires_3d && !transform3D_enabled()) {
|
||||
continue;
|
||||
}
|
||||
div.style.setProperty("transition-property", "none", "");
|
||||
div.style.setProperty(prop, test.start, "");
|
||||
cs.getPropertyValue(prop);
|
||||
|
@ -1708,12 +1689,6 @@ function nextAsyncTransformTest()
|
|||
return;
|
||||
}
|
||||
|
||||
if (test.requires_3d && !transform3D_enabled()) {
|
||||
transformTestIndex++;
|
||||
window.requestAnimationFrame(nextAsyncTransformTest);
|
||||
return;
|
||||
}
|
||||
|
||||
transformDiv.style.setProperty("transition-property", "none", "");
|
||||
transformDiv.style.setProperty("transform", test.start, "");
|
||||
transformCs.getPropertyValue("transform");
|
||||
|
|
|
@ -207,11 +207,21 @@ bool ThreadPosix::Start(unsigned int& thread_id)
|
|||
int result = pthread_attr_setdetachstate(&attr_, PTHREAD_CREATE_DETACHED);
|
||||
// Set the stack stack size to 1M.
|
||||
result |= pthread_attr_setstacksize(&attr_, 1024 * 1024);
|
||||
#if 0
|
||||
// Temporarily remove the attempt to set this to real-time scheduling.
|
||||
//
|
||||
// See: https://code.google.com/p/webrtc/issues/detail?id=1956
|
||||
//
|
||||
// To be removed when upstream is fixed.
|
||||
#ifdef WEBRTC_THREAD_RR
|
||||
const int policy = SCHED_RR;
|
||||
#else
|
||||
const int policy = SCHED_FIFO;
|
||||
#endif
|
||||
#else
|
||||
const int policy = SCHED_OTHER;
|
||||
#endif
|
||||
|
||||
event_->Reset();
|
||||
// If pthread_create was successful, a thread was created and is running.
|
||||
// Don't return false if it was successful since if there are any other
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
|
||||
* 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/. */
|
||||
|
||||
package org.mozilla.gecko;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
class AlignRightLinkPreference extends LinkPreference {
|
||||
|
||||
public AlignRightLinkPreference(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
setLayoutResource(R.layout.preference_rightalign_icon);
|
||||
}
|
||||
|
||||
public AlignRightLinkPreference(Context context, AttributeSet attrs, int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
setLayoutResource(R.layout.preference_rightalign_icon);
|
||||
}
|
||||
}
|
|
@ -15,8 +15,10 @@ import org.mozilla.gecko.util.ThreadUtils;
|
|||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.app.Fragment;
|
||||
import android.app.NotificationManager;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
|
@ -71,6 +73,9 @@ public class GeckoPreferences
|
|||
private static String PREFS_MP_ENABLED = "privacy.masterpassword.enabled";
|
||||
private static String PREFS_UPDATER_AUTODOWNLOAD = "app.update.autodownload";
|
||||
private static String PREFS_GEO_REPORTING = "app.geo.reportdata";
|
||||
private static String PREFS_HEALTHREPORT_LINK = NON_PREF_PREFIX + "healthreport.link";
|
||||
|
||||
private static int REQUEST_CODE_PREF_SCREEN = 5;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -177,6 +182,37 @@ public class GeckoPreferences
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startActivity(Intent intent) {
|
||||
// For settings, we want to be able to pass results up the chain
|
||||
// of preference screens so Settings can behave as a single unit.
|
||||
// Specifically, when we open a link, we want to back out of all
|
||||
// the settings screens.
|
||||
// We need to start nested PreferenceScreens withStartActivityForResult().
|
||||
// Android doesn't let us do that (see Preference.onClick), so we're overriding here.
|
||||
startActivityForResult(intent, REQUEST_CODE_PREF_SCREEN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startWithFragment(String fragmentName, Bundle args,
|
||||
Fragment resultTo, int resultRequestCode, int titleRes, int shortTitleRes) {
|
||||
// Overriding because we want to use startActivityForResult for Fragment intents.
|
||||
Intent intent = onBuildStartFragmentIntent(fragmentName, args, titleRes, shortTitleRes);
|
||||
if (resultTo == null) {
|
||||
startActivityForResult(intent, REQUEST_CODE_PREF_SCREEN);
|
||||
} else {
|
||||
resultTo.startActivityForResult(intent, resultRequestCode);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (REQUEST_CODE_PREF_SCREEN == requestCode && Activity.RESULT_CANCELED == resultCode) {
|
||||
setResult(Activity.RESULT_CANCELED);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleMessage(String event, JSONObject message) {
|
||||
try {
|
||||
|
@ -235,19 +271,24 @@ public class GeckoPreferences
|
|||
setupPreferences((PreferenceGroup) pref, prefs);
|
||||
} else {
|
||||
pref.setOnPreferenceChangeListener(this);
|
||||
if (PREFS_UPDATER_AUTODOWNLOAD.equals(key) && !AppConstants.MOZ_UPDATER) {
|
||||
if (!AppConstants.MOZ_UPDATER &&
|
||||
PREFS_UPDATER_AUTODOWNLOAD.equals(key)) {
|
||||
preferences.removePreference(pref);
|
||||
i--;
|
||||
continue;
|
||||
} else if (PREFS_TELEMETRY_ENABLED.equals(key) && !AppConstants.MOZ_TELEMETRY_REPORTING) {
|
||||
} else if (!AppConstants.MOZ_TELEMETRY_REPORTING &&
|
||||
PREFS_TELEMETRY_ENABLED.equals(key)) {
|
||||
preferences.removePreference(pref);
|
||||
i--;
|
||||
continue;
|
||||
} else if (PREFS_HEALTHREPORT_UPLOAD_ENABLED.equals(key) && !AppConstants.MOZ_SERVICES_HEALTHREPORT) {
|
||||
} else if (!AppConstants.MOZ_SERVICES_HEALTHREPORT &&
|
||||
(PREFS_HEALTHREPORT_UPLOAD_ENABLED.equals(key) ||
|
||||
PREFS_HEALTHREPORT_LINK.equals(key))) {
|
||||
preferences.removePreference(pref);
|
||||
i--;
|
||||
continue;
|
||||
} else if (PREFS_CRASHREPORTER_ENABLED.equals(key) && !AppConstants.MOZ_CRASHREPORTER) {
|
||||
} else if (!AppConstants.MOZ_CRASHREPORTER &&
|
||||
PREFS_CRASHREPORTER_ENABLED.equals(key)) {
|
||||
preferences.removePreference(pref);
|
||||
i--;
|
||||
continue;
|
||||
|
@ -413,6 +454,7 @@ public class GeckoPreferences
|
|||
CharSequence newEntry = ((ListPreference) preference).getEntries()[newIndex];
|
||||
((ListPreference) preference).setSummary(newEntry);
|
||||
} else if (preference instanceof LinkPreference) {
|
||||
setResult(Activity.RESULT_CANCELED);
|
||||
finish();
|
||||
} else if (preference instanceof FontSizePreference) {
|
||||
final FontSizePreference fontSizePref = (FontSizePreference) preference;
|
||||
|
|
|
@ -52,6 +52,7 @@ FENNEC_JAVA_FILES = \
|
|||
ANRReporter.java \
|
||||
ActivityHandlerHelper.java \
|
||||
AlertNotification.java \
|
||||
AlignRightLinkPreference.java \
|
||||
AllCapsTextView.java \
|
||||
AndroidImport.java \
|
||||
AndroidImportPreference.java \
|
||||
|
@ -473,6 +474,7 @@ RES_LAYOUT = \
|
|||
res/layout/notification_icon_text.xml \
|
||||
res/layout/notification_progress.xml \
|
||||
res/layout/notification_progress_text.xml \
|
||||
res/layout/preference_rightalign_icon.xml \
|
||||
res/layout/site_setting_item.xml \
|
||||
res/layout/site_setting_title.xml \
|
||||
res/layout/setup_screen.xml \
|
||||
|
|
|
@ -147,7 +147,8 @@ size. -->
|
|||
healthReportDesc.label, telemetrySection.label, telemetryDesc.label,
|
||||
crashReporterDesc.label). -->
|
||||
<!ENTITY datareporting_fhr_title "&brandShortName; Health Report">
|
||||
<!ENTITY datareporting_fhr_summary "Helps you understand your browser performance and shares data with &vendorShortName; about your browser health">
|
||||
<!ENTITY datareporting_fhr_summary "Shares data with &vendorShortName; about your browser health and helps you understand your browser performance">
|
||||
<!ENTITY datareporting_abouthr_title "View my Health Report">
|
||||
<!ENTITY datareporting_telemetry_title "Telemetry">
|
||||
<!ENTITY datareporting_telemetry_summary "Shares performance, usage, hardware and customization data about your browser with &vendorShortName; to help us make &brandShortName; better">
|
||||
<!ENTITY datareporting_crashreporter_summary "&brandShortName; submits crash reports to help &vendorShortName; make your browser more stable and secure">
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 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/. -->
|
||||
|
||||
<!-- This custom layout matches the Android layout for preferences in
|
||||
padding and margins, so it is visually consistent. -->
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingRight="?android:attr/scrollbarSize">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="right"
|
||||
android:layout_marginLeft="15dip"
|
||||
android:layout_marginRight="6dip"
|
||||
android:layout_marginTop="6dip"
|
||||
android:layout_marginBottom="6dip"
|
||||
android:paddingRight="6dip"
|
||||
android:layout_weight="1">
|
||||
|
||||
<TextView android:id="@+android:id/title"
|
||||
android:layout_gravity="right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:ellipsize="marquee"
|
||||
android:fadingEdge="horizontal" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<ImageView android:src="@drawable/menu_item_more"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:paddingRight="16dp" />
|
||||
|
||||
</LinearLayout>
|
|
@ -13,11 +13,6 @@
|
|||
android:title="@string/datareporting_telemetry_title"
|
||||
android:summary="@string/datareporting_telemetry_summary" />
|
||||
|
||||
<CheckBoxPreference android:key="android.not_a_preference.healthreport.uploadEnabled"
|
||||
android:title="@string/datareporting_fhr_title"
|
||||
android:summary="@string/datareporting_fhr_summary"
|
||||
android:defaultValue="true" />
|
||||
|
||||
<CheckBoxPreference android:key="datareporting.crashreporter.submitEnabled"
|
||||
android:title="@string/datareporting_crashreporter_title_short"
|
||||
android:summary="@string/datareporting_crashreporter_summary"
|
||||
|
@ -27,4 +22,12 @@
|
|||
android:title="@string/datareporting_wifi_title"
|
||||
android:summary="@string/datareporting_wifi_summary" />
|
||||
|
||||
<CheckBoxPreference android:key="android.not_a_preference.healthreport.uploadEnabled"
|
||||
android:title="@string/datareporting_fhr_title"
|
||||
android:summary="@string/datareporting_fhr_summary"
|
||||
android:defaultValue="true" />
|
||||
|
||||
<org.mozilla.gecko.AlignRightLinkPreference android:key="android.not_a_preference.healthreport.link"
|
||||
android:title="@string/datareporting_abouthr_title"
|
||||
url="about:healthreport" />
|
||||
</PreferenceScreen>
|
||||
|
|
|
@ -145,6 +145,7 @@
|
|||
<string name="datareporting_telemetry_summary">&datareporting_telemetry_summary;</string>
|
||||
<string name="datareporting_fhr_title">&datareporting_fhr_title;</string>
|
||||
<string name="datareporting_fhr_summary">&datareporting_fhr_summary;</string>
|
||||
<string name="datareporting_abouthr_title">&datareporting_abouthr_title;</string>
|
||||
<string name="datareporting_crashreporter_title_short">&datareporting_crashreporter_title_short;</string>
|
||||
<string name="datareporting_crashreporter_summary">&datareporting_crashreporter_summary;</string>
|
||||
<string name="datareporting_wifi_title">&datareporting_wifi_title;</string>
|
||||
|
|
|
@ -146,12 +146,6 @@ NSSDialogs.prototype = {
|
|||
this.showPrompt(p);
|
||||
},
|
||||
|
||||
crlImportStatusDialog: function(aCtx, aCrl) {
|
||||
// this dialog is never shown in Fennec; in Desktop it is shown after importing a CRL
|
||||
// via Preferences->Advanced->Encryption->Revocation Lists->Import.
|
||||
throw "Unimplemented";
|
||||
},
|
||||
|
||||
viewCertDetails: function(details) {
|
||||
let p = this.getPrompt(this.getString("clientAuthAsk.message3"),
|
||||
'',
|
||||
|
|
|
@ -4104,9 +4104,6 @@ pref("dom.idle-observers-api.enabled", true);
|
|||
// Time limit, in milliseconds, for nsEventStateManager::IsHandlingUserInput().
|
||||
// Used to detect long running handlers of user-generated events.
|
||||
pref("dom.event.handling-user-input-time-limit", 1000);
|
||||
|
||||
//3D Transforms
|
||||
pref("layout.3d-transforms.enabled", true);
|
||||
|
||||
// Whether we should layerize all animated images (if otherwise possible).
|
||||
pref("layout.animated-image-layers.enabled", false);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include "necko-config.h"
|
||||
|
||||
#define ALLOW_LATE_NSHTTP_H_INCLUDE 1
|
||||
#define ALLOW_LATE_HTTPLOG_H_INCLUDE 1
|
||||
#include "base/basictypes.h"
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
|
@ -37,6 +37,7 @@
|
|||
#include "nsCategoryCache.h"
|
||||
#include "nsIContentSniffer.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "mozilla/net/NeckoChild.h"
|
||||
|
||||
#include "nsNetCID.h"
|
||||
|
||||
|
|
|
@ -0,0 +1,85 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set sw=2 ts=8 et tw=80 ft=c: */
|
||||
|
||||
/* 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 URIParams;
|
||||
include InputStreamParams;
|
||||
include "mozilla/net/PHttpChannelParams.h";
|
||||
|
||||
using mozilla::void_t;
|
||||
using RequestHeaderTuples;
|
||||
using nsHttpAtom;
|
||||
|
||||
namespace mozilla {
|
||||
namespace net {
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// HTTP IPDL structs
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
struct HttpChannelOpenArgs
|
||||
{
|
||||
URIParams uri;
|
||||
// - TODO: bug 571161: unclear if any HTTP channel clients ever
|
||||
// set originalURI != uri (about:credits?); also not clear if
|
||||
// chrome channel would ever need to know. Get rid of next arg?
|
||||
OptionalURIParams original;
|
||||
OptionalURIParams doc;
|
||||
OptionalURIParams referrer;
|
||||
OptionalURIParams apiRedirectTo;
|
||||
uint32_t loadFlags;
|
||||
RequestHeaderTuples requestHeaders;
|
||||
nsHttpAtom requestMethod;
|
||||
OptionalInputStreamParams uploadStream;
|
||||
bool uploadStreamHasHeaders;
|
||||
uint16_t priority;
|
||||
uint8_t redirectionLimit;
|
||||
bool allowPipelining;
|
||||
bool forceAllowThirdPartyCookie;
|
||||
bool resumeAt;
|
||||
uint64_t startPos;
|
||||
nsCString entityID;
|
||||
bool chooseApplicationCache;
|
||||
nsCString appCacheClientID;
|
||||
bool allowSpdy;
|
||||
};
|
||||
|
||||
struct HttpChannelConnectArgs
|
||||
{
|
||||
uint32_t channelId;
|
||||
};
|
||||
|
||||
union HttpChannelCreationArgs
|
||||
{
|
||||
HttpChannelOpenArgs; // For AsyncOpen: the common case.
|
||||
HttpChannelConnectArgs; // Used for redirected-to channels
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// FTP IPDL structs
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
struct FTPChannelOpenArgs
|
||||
{
|
||||
URIParams uri;
|
||||
uint64_t startPos;
|
||||
nsCString entityID;
|
||||
OptionalInputStreamParams uploadStream;
|
||||
};
|
||||
|
||||
struct FTPChannelConnectArgs
|
||||
{
|
||||
uint32_t channelId;
|
||||
};
|
||||
|
||||
union FTPChannelCreationArgs
|
||||
{
|
||||
FTPChannelOpenArgs; // For AsyncOpen: the common case.
|
||||
FTPChannelConnectArgs; // Used for redirected-to channels
|
||||
};
|
||||
|
||||
} // namespace ipc
|
||||
} // namespace mozilla
|
|
@ -62,7 +62,8 @@ void NeckoChild::DestroyNeckoChild()
|
|||
|
||||
PHttpChannelChild*
|
||||
NeckoChild::AllocPHttpChannel(PBrowserChild* browser,
|
||||
const SerializedLoadContext& loadContext)
|
||||
const SerializedLoadContext& loadContext,
|
||||
const HttpChannelCreationArgs& aOpenArgs)
|
||||
{
|
||||
// We don't allocate here: instead we always use IPDL constructor that takes
|
||||
// an existing HttpChildChannel
|
||||
|
@ -82,7 +83,8 @@ NeckoChild::DeallocPHttpChannel(PHttpChannelChild* channel)
|
|||
|
||||
PFTPChannelChild*
|
||||
NeckoChild::AllocPFTPChannel(PBrowserChild* aBrowser,
|
||||
const SerializedLoadContext& aSerialized)
|
||||
const SerializedLoadContext& aSerialized,
|
||||
const FTPChannelCreationArgs& aOpenArgs)
|
||||
{
|
||||
// We don't allocate here: see FTPChannelChild::AsyncOpen()
|
||||
NS_RUNTIMEABORT("AllocPFTPChannel should not be called");
|
||||
|
|
|
@ -26,15 +26,18 @@ public:
|
|||
static void DestroyNeckoChild();
|
||||
|
||||
protected:
|
||||
virtual PHttpChannelChild* AllocPHttpChannel(PBrowserChild*,
|
||||
const SerializedLoadContext&);
|
||||
virtual PHttpChannelChild*
|
||||
AllocPHttpChannel(PBrowserChild*, const SerializedLoadContext&,
|
||||
const HttpChannelCreationArgs& aOpenArgs);
|
||||
virtual bool DeallocPHttpChannel(PHttpChannelChild*);
|
||||
virtual PCookieServiceChild* AllocPCookieService();
|
||||
virtual bool DeallocPCookieService(PCookieServiceChild*);
|
||||
virtual PWyciwygChannelChild* AllocPWyciwygChannel();
|
||||
virtual bool DeallocPWyciwygChannel(PWyciwygChannelChild*);
|
||||
virtual PFTPChannelChild* AllocPFTPChannel(PBrowserChild* aBrowser,
|
||||
const SerializedLoadContext& aSerialized);
|
||||
virtual PFTPChannelChild*
|
||||
AllocPFTPChannel(PBrowserChild* aBrowser,
|
||||
const SerializedLoadContext& aSerialized,
|
||||
const FTPChannelCreationArgs& aOpenArgs);
|
||||
virtual bool DeallocPFTPChannel(PFTPChannelChild*);
|
||||
virtual PWebSocketChild* AllocPWebSocket(PBrowserChild*, const SerializedLoadContext&);
|
||||
virtual bool DeallocPWebSocket(PWebSocketChild*);
|
||||
|
|
|
@ -35,6 +35,12 @@ namespace net {
|
|||
// C++ file contents
|
||||
NeckoParent::NeckoParent()
|
||||
{
|
||||
// Init HTTP protocol handler now since we need atomTable up and running very
|
||||
// early (IPDL argument handling for PHttpChannel constructor needs it) so
|
||||
// normal init (during 1st Http channel request) isn't early enough.
|
||||
nsCOMPtr<nsIProtocolHandler> proto =
|
||||
do_GetService("@mozilla.org/network/protocol;1?name=http");
|
||||
|
||||
if (UsingNeckoIPCSecurity()) {
|
||||
// cache values for core/packaged apps basepaths
|
||||
nsAutoString corePath, webPath;
|
||||
|
@ -153,7 +159,8 @@ NeckoParent::CreateChannelLoadContext(PBrowserParent* aBrowser,
|
|||
|
||||
PHttpChannelParent*
|
||||
NeckoParent::AllocPHttpChannel(PBrowserParent* aBrowser,
|
||||
const SerializedLoadContext& aSerialized)
|
||||
const SerializedLoadContext& aSerialized,
|
||||
const HttpChannelCreationArgs& aOpenArgs)
|
||||
{
|
||||
nsCOMPtr<nsILoadContext> loadContext;
|
||||
const char *error = CreateChannelLoadContext(aBrowser, aSerialized,
|
||||
|
@ -178,9 +185,21 @@ NeckoParent::DeallocPHttpChannel(PHttpChannelParent* channel)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
NeckoParent::RecvPHttpChannelConstructor(
|
||||
PHttpChannelParent* aActor,
|
||||
PBrowserParent* aBrowser,
|
||||
const SerializedLoadContext& aSerialized,
|
||||
const HttpChannelCreationArgs& aOpenArgs)
|
||||
{
|
||||
HttpChannelParent* p = static_cast<HttpChannelParent*>(aActor);
|
||||
return p->Init(aOpenArgs);
|
||||
}
|
||||
|
||||
PFTPChannelParent*
|
||||
NeckoParent::AllocPFTPChannel(PBrowserParent* aBrowser,
|
||||
const SerializedLoadContext& aSerialized)
|
||||
const SerializedLoadContext& aSerialized,
|
||||
const FTPChannelCreationArgs& aOpenArgs)
|
||||
{
|
||||
nsCOMPtr<nsILoadContext> loadContext;
|
||||
const char *error = CreateChannelLoadContext(aBrowser, aSerialized,
|
||||
|
@ -205,6 +224,17 @@ NeckoParent::DeallocPFTPChannel(PFTPChannelParent* channel)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
NeckoParent::RecvPFTPChannelConstructor(
|
||||
PFTPChannelParent* aActor,
|
||||
PBrowserParent* aBrowser,
|
||||
const SerializedLoadContext& aSerialized,
|
||||
const FTPChannelCreationArgs& aOpenArgs)
|
||||
{
|
||||
FTPChannelParent* p = static_cast<FTPChannelParent*>(aActor);
|
||||
return p->Init(aOpenArgs);
|
||||
}
|
||||
|
||||
PCookieServiceParent*
|
||||
NeckoParent::AllocPCookieService()
|
||||
{
|
||||
|
|
|
@ -51,15 +51,30 @@ public:
|
|||
nsCOMPtr<nsILoadContext> &aResult);
|
||||
|
||||
protected:
|
||||
virtual PHttpChannelParent* AllocPHttpChannel(PBrowserParent*,
|
||||
const SerializedLoadContext&);
|
||||
virtual PHttpChannelParent*
|
||||
AllocPHttpChannel(PBrowserParent*, const SerializedLoadContext&,
|
||||
const HttpChannelCreationArgs& aOpenArgs);
|
||||
virtual bool
|
||||
RecvPHttpChannelConstructor(
|
||||
PHttpChannelParent* aActor,
|
||||
PBrowserParent* aBrowser,
|
||||
const SerializedLoadContext& aSerialized,
|
||||
const HttpChannelCreationArgs& aOpenArgs);
|
||||
virtual bool DeallocPHttpChannel(PHttpChannelParent*);
|
||||
virtual PCookieServiceParent* AllocPCookieService();
|
||||
virtual bool DeallocPCookieService(PCookieServiceParent*);
|
||||
virtual PWyciwygChannelParent* AllocPWyciwygChannel();
|
||||
virtual bool DeallocPWyciwygChannel(PWyciwygChannelParent*);
|
||||
virtual PFTPChannelParent* AllocPFTPChannel(PBrowserParent* aBrowser,
|
||||
const SerializedLoadContext& aSerialized);
|
||||
virtual PFTPChannelParent*
|
||||
AllocPFTPChannel(PBrowserParent* aBrowser,
|
||||
const SerializedLoadContext& aSerialized,
|
||||
const FTPChannelCreationArgs& aOpenArgs);
|
||||
virtual bool
|
||||
RecvPFTPChannelConstructor(
|
||||
PFTPChannelParent* aActor,
|
||||
PBrowserParent* aBrowser,
|
||||
const SerializedLoadContext& aSerialized,
|
||||
const FTPChannelCreationArgs& aOpenArgs);
|
||||
virtual bool DeallocPFTPChannel(PFTPChannelParent*);
|
||||
virtual PWebSocketParent* AllocPWebSocket(PBrowserParent* browser,
|
||||
const SerializedLoadContext& aSerialized);
|
||||
|
|
|
@ -14,7 +14,11 @@ include protocol PFTPChannel;
|
|||
include protocol PWebSocket;
|
||||
include protocol PTCPSocket;
|
||||
include protocol PRemoteOpenFile;
|
||||
include protocol PBlob; //FIXME: bug #792908
|
||||
|
||||
include URIParams;
|
||||
include InputStreamParams;
|
||||
include NeckoChannelParams;
|
||||
|
||||
include "SerializedLoadContext.h";
|
||||
|
||||
|
@ -23,7 +27,6 @@ using IPC::SerializedLoadContext;
|
|||
namespace mozilla {
|
||||
namespace net {
|
||||
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
sync protocol PNecko
|
||||
{
|
||||
|
@ -41,9 +44,12 @@ parent:
|
|||
|
||||
PCookieService();
|
||||
PHttpChannel(nullable PBrowser browser,
|
||||
SerializedLoadContext loadContext);
|
||||
SerializedLoadContext loadContext,
|
||||
HttpChannelCreationArgs args);
|
||||
PWyciwygChannel();
|
||||
PFTPChannel(PBrowser browser, SerializedLoadContext loadContext);
|
||||
PFTPChannel(PBrowser browser, SerializedLoadContext loadContext,
|
||||
FTPChannelCreationArgs args);
|
||||
|
||||
PWebSocket(PBrowser browser, SerializedLoadContext loadContext);
|
||||
PTCPSocket(nsString host, uint16_t port, bool useSSL, nsString binaryType,
|
||||
nullable PBrowser browser);
|
||||
|
|
|
@ -5,5 +5,6 @@
|
|||
IPDLSRCS = \
|
||||
PNecko.ipdl \
|
||||
PRemoteOpenFile.ipdl \
|
||||
NeckoChannelParams.ipdlh \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -169,8 +169,6 @@ FTPChannelChild::AsyncOpen(::nsIStreamListener* listener, nsISupports* aContext)
|
|||
return NS_ERROR_ILLEGAL_VALUE;
|
||||
}
|
||||
|
||||
// FIXME: like bug 558623, merge constructor+SendAsyncOpen into 1 IPC msg
|
||||
gNeckoChild->SendPFTPChannelConstructor(this, tabChild, IPC::SerializedLoadContext(this));
|
||||
mListener = listener;
|
||||
mListenerContext = aContext;
|
||||
|
||||
|
@ -178,13 +176,18 @@ FTPChannelChild::AsyncOpen(::nsIStreamListener* listener, nsISupports* aContext)
|
|||
if (mLoadGroup)
|
||||
mLoadGroup->AddRequest(this, nullptr);
|
||||
|
||||
URIParams uri;
|
||||
SerializeURI(nsBaseChannel::URI(), uri);
|
||||
|
||||
OptionalInputStreamParams uploadStream;
|
||||
SerializeInputStream(mUploadStream, uploadStream);
|
||||
|
||||
SendAsyncOpen(uri, mStartPos, mEntityID, uploadStream);
|
||||
FTPChannelOpenArgs openArgs;
|
||||
SerializeURI(nsBaseChannel::URI(), openArgs.uri());
|
||||
openArgs.startPos() = mStartPos;
|
||||
openArgs.entityID() = mEntityID;
|
||||
openArgs.uploadStream() = uploadStream;
|
||||
|
||||
gNeckoChild->
|
||||
SendPFTPChannelConstructor(this, tabChild, IPC::SerializedLoadContext(this),
|
||||
openArgs);
|
||||
|
||||
// The socket transport layer in the chrome process now has a logical ref to
|
||||
// us until OnStopRequest is called.
|
||||
|
@ -517,12 +520,13 @@ FTPChannelChild::ConnectParent(uint32_t id)
|
|||
// until OnStopRequest, or we do a redirect, or we hit an IPDL error.
|
||||
AddIPDLReference();
|
||||
|
||||
if (!gNeckoChild->SendPFTPChannelConstructor(this, tabChild,
|
||||
IPC::SerializedLoadContext(this)))
|
||||
return NS_ERROR_FAILURE;
|
||||
FTPChannelConnectArgs connectArgs(id);
|
||||
|
||||
if (!SendConnectChannel(id))
|
||||
if (!gNeckoChild->SendPFTPChannelConstructor(this, tabChild,
|
||||
IPC::SerializedLoadContext(this),
|
||||
connectArgs)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -60,11 +60,35 @@ NS_IMPL_ISUPPORTS4(FTPChannelParent,
|
|||
// FTPChannelParent::PFTPChannelParent
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// FTPChannelParent methods
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool
|
||||
FTPChannelParent::RecvAsyncOpen(const URIParams& aURI,
|
||||
const uint64_t& aStartPos,
|
||||
const nsCString& aEntityID,
|
||||
const OptionalInputStreamParams& aUploadStream)
|
||||
FTPChannelParent::Init(const FTPChannelCreationArgs& aArgs)
|
||||
{
|
||||
switch (aArgs.type()) {
|
||||
case FTPChannelCreationArgs::TFTPChannelOpenArgs:
|
||||
{
|
||||
const FTPChannelOpenArgs& a = aArgs.get_FTPChannelOpenArgs();
|
||||
return DoAsyncOpen(a.uri(), a.startPos(), a.entityID(), a.uploadStream());
|
||||
}
|
||||
case FTPChannelCreationArgs::TFTPChannelConnectArgs:
|
||||
{
|
||||
const FTPChannelConnectArgs& cArgs = aArgs.get_FTPChannelConnectArgs();
|
||||
return ConnectChannel(cArgs.channelId());
|
||||
}
|
||||
default:
|
||||
NS_NOTREACHED("unknown open type");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
FTPChannelParent::DoAsyncOpen(const URIParams& aURI,
|
||||
const uint64_t& aStartPos,
|
||||
const nsCString& aEntityID,
|
||||
const OptionalInputStreamParams& aUploadStream)
|
||||
{
|
||||
nsCOMPtr<nsIURI> uri = DeserializeURI(aURI);
|
||||
if (!uri)
|
||||
|
@ -73,7 +97,7 @@ FTPChannelParent::RecvAsyncOpen(const URIParams& aURI,
|
|||
#ifdef DEBUG
|
||||
nsCString uriSpec;
|
||||
uri->GetSpec(uriSpec);
|
||||
LOG(("FTPChannelParent RecvAsyncOpen [this=%p uri=%s]\n",
|
||||
LOG(("FTPChannelParent DoAsyncOpen [this=%p uri=%s]\n",
|
||||
this, uriSpec.get()));
|
||||
#endif
|
||||
|
||||
|
@ -117,7 +141,7 @@ FTPChannelParent::RecvAsyncOpen(const URIParams& aURI,
|
|||
}
|
||||
|
||||
bool
|
||||
FTPChannelParent::RecvConnectChannel(const uint32_t& channelId)
|
||||
FTPChannelParent::ConnectChannel(const uint32_t& channelId)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
|
|
|
@ -34,12 +34,17 @@ public:
|
|||
FTPChannelParent(nsILoadContext* aLoadContext, PBOverrideStatus aOverrideStatus);
|
||||
virtual ~FTPChannelParent();
|
||||
|
||||
bool Init(const FTPChannelCreationArgs& aOpenArgs);
|
||||
|
||||
protected:
|
||||
virtual bool RecvAsyncOpen(const URIParams& uri,
|
||||
const uint64_t& startPos,
|
||||
const nsCString& entityID,
|
||||
const OptionalInputStreamParams& uploadStream) MOZ_OVERRIDE;
|
||||
virtual bool RecvConnectChannel(const uint32_t& channelId) MOZ_OVERRIDE;
|
||||
bool DoAsyncOpen(const URIParams& aURI, const uint64_t& aStartPos,
|
||||
const nsCString& aEntityID,
|
||||
const OptionalInputStreamParams& aUploadStream);
|
||||
|
||||
// used to connect redirected-to channel in parent with just created
|
||||
// ChildChannel. Used during HTTP->FTP redirects.
|
||||
bool ConnectChannel(const uint32_t& channelId);
|
||||
|
||||
virtual bool RecvCancel(const nsresult& status) MOZ_OVERRIDE;
|
||||
virtual bool RecvSuspend() MOZ_OVERRIDE;
|
||||
virtual bool RecvResume() MOZ_OVERRIDE;
|
||||
|
|
|
@ -9,6 +9,8 @@ include protocol PNecko;
|
|||
include InputStreamParams;
|
||||
include URIParams;
|
||||
|
||||
//FIXME: bug #792908 (NeckoChannelParams already included by PNecko)
|
||||
include NeckoChannelParams;
|
||||
include protocol PBlob; //FIXME: bug #792908
|
||||
|
||||
include "SerializedLoadContext.h";
|
||||
|
@ -23,14 +25,11 @@ async protocol PFTPChannel
|
|||
manager PNecko;
|
||||
|
||||
parent:
|
||||
// Note: channels are opened during construction, so no open method here:
|
||||
// see PNecko.ipdl
|
||||
|
||||
__delete__();
|
||||
|
||||
AsyncOpen(URIParams uri,
|
||||
uint64_t startPos,
|
||||
nsCString entityID,
|
||||
OptionalInputStreamParams uploadStream);
|
||||
|
||||
ConnectChannel(uint32_t channelId);
|
||||
Cancel(nsresult status);
|
||||
Suspend();
|
||||
Resume();
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
* 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/. */
|
||||
|
||||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include "nsHttp.h"
|
||||
#include "nsHttpHandler.h"
|
||||
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
* 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/. */
|
||||
|
||||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include "nsHttpConnectionMgr.h"
|
||||
#include "nsHttpConnection.h"
|
||||
#include "SpdySession2.h"
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
* 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/. */
|
||||
|
||||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include "mozilla/net/HttpBaseChannel.h"
|
||||
|
||||
#include "nsHttpHandler.h"
|
||||
|
|
|
@ -34,6 +34,8 @@
|
|||
#include "PrivateBrowsingChannel.h"
|
||||
#include "mozilla/net/DNS.h"
|
||||
|
||||
extern PRLogModuleInfo *gHttpLog;
|
||||
|
||||
namespace mozilla {
|
||||
namespace net {
|
||||
|
||||
|
@ -339,7 +341,8 @@ protected:
|
|||
template <class T>
|
||||
nsresult HttpAsyncAborter<T>::AsyncAbort(nsresult status)
|
||||
{
|
||||
LOG(("HttpAsyncAborter::AsyncAbort [this=%p status=%x]\n", mThis, status));
|
||||
PR_LOG(gHttpLog, 4,
|
||||
("HttpAsyncAborter::AsyncAbort [this=%p status=%x]\n", mThis, status));
|
||||
|
||||
mThis->mStatus = status;
|
||||
mThis->mIsPending = false;
|
||||
|
@ -356,8 +359,8 @@ inline void HttpAsyncAborter<T>::HandleAsyncAbort()
|
|||
NS_PRECONDITION(!mCallOnResume, "How did that happen?");
|
||||
|
||||
if (mThis->mSuspendCount) {
|
||||
LOG(("Waiting until resume to do async notification [this=%p]\n",
|
||||
mThis));
|
||||
PR_LOG(gHttpLog, 4,
|
||||
("Waiting until resume to do async notification [this=%p]\n", mThis));
|
||||
mCallOnResume = &T::HandleAsyncAbort;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
* 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/. */
|
||||
|
||||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include "nsHttp.h"
|
||||
#include "mozilla/dom/TabChild.h"
|
||||
#include "mozilla/net/NeckoChild.h"
|
||||
|
@ -814,14 +817,14 @@ HttpChannelChild::ConnectParent(uint32_t id)
|
|||
// until OnStopRequest, or we do a redirect, or we hit an IPDL error.
|
||||
AddIPDLReference();
|
||||
|
||||
if (!gNeckoChild->SendPHttpChannelConstructor(
|
||||
this, tabChild, IPC::SerializedLoadContext(this))) {
|
||||
HttpChannelConnectArgs connectArgs(id);
|
||||
if (!gNeckoChild->
|
||||
SendPHttpChannelConstructor(this, tabChild,
|
||||
IPC::SerializedLoadContext(this),
|
||||
connectArgs)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if (!SendConnectChannel(id))
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -1045,8 +1048,6 @@ HttpChannelChild::AsyncOpen(nsIStreamListener *listener, nsISupports *aContext)
|
|||
// Send request to the chrome process...
|
||||
//
|
||||
|
||||
// FIXME: bug 558623: Combine constructor and SendAsyncOpen into one IPC msg
|
||||
|
||||
mozilla::dom::TabChild* tabChild = nullptr;
|
||||
nsCOMPtr<nsITabChild> iTabChild;
|
||||
GetCallback(iTabChild);
|
||||
|
@ -1057,31 +1058,37 @@ HttpChannelChild::AsyncOpen(nsIStreamListener *listener, nsISupports *aContext)
|
|||
return NS_ERROR_ILLEGAL_VALUE;
|
||||
}
|
||||
|
||||
HttpChannelOpenArgs openArgs;
|
||||
// No access to HttpChannelOpenArgs members, but they each have a
|
||||
// function with the struct name that returns a ref.
|
||||
SerializeURI(mURI, openArgs.uri());
|
||||
SerializeURI(mOriginalURI, openArgs.original());
|
||||
SerializeURI(mDocumentURI, openArgs.doc());
|
||||
SerializeURI(mReferrer, openArgs.referrer());
|
||||
SerializeURI(mAPIRedirectToURI, openArgs.apiRedirectTo());
|
||||
openArgs.loadFlags() = mLoadFlags;
|
||||
openArgs.requestHeaders() = mClientSetRequestHeaders;
|
||||
openArgs.requestMethod() = mRequestHead.Method();
|
||||
SerializeInputStream(mUploadStream, openArgs.uploadStream());
|
||||
openArgs.uploadStreamHasHeaders() = mUploadStreamHasHeaders;
|
||||
openArgs.priority() = mPriority;
|
||||
openArgs.redirectionLimit() = mRedirectionLimit;
|
||||
openArgs.allowPipelining() = mAllowPipelining;
|
||||
openArgs.forceAllowThirdPartyCookie() = mForceAllowThirdPartyCookie;
|
||||
openArgs.resumeAt() = mSendResumeAt;
|
||||
openArgs.startPos() = mStartPos;
|
||||
openArgs.entityID() = mEntityID;
|
||||
openArgs.chooseApplicationCache() = mChooseApplicationCache;
|
||||
openArgs.appCacheClientID() = appCacheClientId;
|
||||
openArgs.allowSpdy() = mAllowSpdy;
|
||||
|
||||
// The socket transport in the chrome process now holds a logical ref to us
|
||||
// until OnStopRequest, or we do a redirect, or we hit an IPDL error.
|
||||
AddIPDLReference();
|
||||
|
||||
gNeckoChild->SendPHttpChannelConstructor(this, tabChild,
|
||||
IPC::SerializedLoadContext(this));
|
||||
|
||||
URIParams uri;
|
||||
SerializeURI(mURI, uri);
|
||||
|
||||
OptionalURIParams originalURI, documentURI, referrer, redirectURI;
|
||||
SerializeURI(mOriginalURI, originalURI);
|
||||
SerializeURI(mDocumentURI, documentURI);
|
||||
SerializeURI(mReferrer, referrer);
|
||||
SerializeURI(mAPIRedirectToURI, redirectURI);
|
||||
|
||||
OptionalInputStreamParams uploadStream;
|
||||
SerializeInputStream(mUploadStream, uploadStream);
|
||||
|
||||
SendAsyncOpen(uri, originalURI, documentURI, referrer, redirectURI, mLoadFlags,
|
||||
mClientSetRequestHeaders, mRequestHead.Method(), uploadStream,
|
||||
mUploadStreamHasHeaders, mPriority, mRedirectionLimit,
|
||||
mAllowPipelining, mForceAllowThirdPartyCookie, mSendResumeAt,
|
||||
mStartPos, mEntityID, mChooseApplicationCache,
|
||||
appCacheClientId, mAllowSpdy);
|
||||
IPC::SerializedLoadContext(this),
|
||||
openArgs);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
* 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/. */
|
||||
|
||||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include "mozilla/net/HttpChannelParent.h"
|
||||
#include "mozilla/dom/TabParent.h"
|
||||
#include "mozilla/net/NeckoParent.h"
|
||||
|
@ -66,6 +69,33 @@ HttpChannelParent::ActorDestroy(ActorDestroyReason why)
|
|||
mIPCClosed = true;
|
||||
}
|
||||
|
||||
bool
|
||||
HttpChannelParent::Init(const HttpChannelCreationArgs& aArgs)
|
||||
{
|
||||
switch (aArgs.type()) {
|
||||
case HttpChannelCreationArgs::THttpChannelOpenArgs:
|
||||
{
|
||||
const HttpChannelOpenArgs& a = aArgs.get_HttpChannelOpenArgs();
|
||||
return DoAsyncOpen(a.uri(), a.original(), a.doc(), a.referrer(),
|
||||
a.apiRedirectTo(), a.loadFlags(), a.requestHeaders(),
|
||||
a.requestMethod(), a.uploadStream(),
|
||||
a.uploadStreamHasHeaders(), a.priority(),
|
||||
a.redirectionLimit(), a.allowPipelining(),
|
||||
a.forceAllowThirdPartyCookie(), a.resumeAt(),
|
||||
a.startPos(), a.entityID(), a.chooseApplicationCache(),
|
||||
a.appCacheClientID(), a.allowSpdy());
|
||||
}
|
||||
case HttpChannelCreationArgs::THttpChannelConnectArgs:
|
||||
{
|
||||
const HttpChannelConnectArgs& cArgs = aArgs.get_HttpChannelConnectArgs();
|
||||
return ConnectChannel(cArgs.channelId());
|
||||
}
|
||||
default:
|
||||
NS_NOTREACHED("unknown open type");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// HttpChannelParent::nsISupports
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -108,7 +138,7 @@ HttpChannelParent::GetInterface(const nsIID& aIID, void **result)
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool
|
||||
HttpChannelParent::RecvAsyncOpen(const URIParams& aURI,
|
||||
HttpChannelParent::DoAsyncOpen( const URIParams& aURI,
|
||||
const OptionalURIParams& aOriginalURI,
|
||||
const OptionalURIParams& aDocURI,
|
||||
const OptionalURIParams& aReferrerURI,
|
||||
|
@ -237,7 +267,7 @@ HttpChannelParent::RecvAsyncOpen(const URIParams& aURI,
|
|||
}
|
||||
|
||||
bool
|
||||
HttpChannelParent::RecvConnectChannel(const uint32_t& channelId)
|
||||
HttpChannelParent::ConnectChannel(const uint32_t& channelId)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
|
|
|
@ -49,29 +49,34 @@ public:
|
|||
PBOverrideStatus aStatus);
|
||||
virtual ~HttpChannelParent();
|
||||
|
||||
protected:
|
||||
virtual bool RecvAsyncOpen(const URIParams& uri,
|
||||
const OptionalURIParams& originalUri,
|
||||
const OptionalURIParams& docUri,
|
||||
const OptionalURIParams& referrerUri,
|
||||
const OptionalURIParams& internalRedirectUri,
|
||||
const uint32_t& loadFlags,
|
||||
const RequestHeaderTuples& requestHeaders,
|
||||
const nsHttpAtom& requestMethod,
|
||||
const OptionalInputStreamParams& uploadStream,
|
||||
const bool& uploadStreamHasHeaders,
|
||||
const uint16_t& priority,
|
||||
const uint8_t& redirectionLimit,
|
||||
const bool& allowPipelining,
|
||||
const bool& forceAllowThirdPartyCookie,
|
||||
const bool& doResumeAt,
|
||||
const uint64_t& startPos,
|
||||
const nsCString& entityID,
|
||||
const bool& chooseApplicationCache,
|
||||
const nsCString& appCacheClientID,
|
||||
const bool& allowSpdy) MOZ_OVERRIDE;
|
||||
bool Init(const HttpChannelCreationArgs& aOpenArgs);
|
||||
|
||||
protected:
|
||||
// used to connect redirected-to channel in parent with just created
|
||||
// ChildChannel. Used during redirects.
|
||||
bool ConnectChannel(const uint32_t& channelId);
|
||||
|
||||
bool DoAsyncOpen(const URIParams& uri,
|
||||
const OptionalURIParams& originalUri,
|
||||
const OptionalURIParams& docUri,
|
||||
const OptionalURIParams& referrerUri,
|
||||
const OptionalURIParams& internalRedirectUri,
|
||||
const uint32_t& loadFlags,
|
||||
const RequestHeaderTuples& requestHeaders,
|
||||
const nsHttpAtom& requestMethod,
|
||||
const OptionalInputStreamParams& uploadStream,
|
||||
const bool& uploadStreamHasHeaders,
|
||||
const uint16_t& priority,
|
||||
const uint8_t& redirectionLimit,
|
||||
const bool& allowPipelining,
|
||||
const bool& forceAllowThirdPartyCookie,
|
||||
const bool& doResumeAt,
|
||||
const uint64_t& startPos,
|
||||
const nsCString& entityID,
|
||||
const bool& chooseApplicationCache,
|
||||
const nsCString& appCacheClientID,
|
||||
const bool& allowSpdy);
|
||||
|
||||
virtual bool RecvConnectChannel(const uint32_t& channelId);
|
||||
virtual bool RecvSetPriority(const uint16_t& priority);
|
||||
virtual bool RecvSetCacheTokenCachedCharset(const nsCString& charset);
|
||||
virtual bool RecvSuspend();
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
* 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/. */
|
||||
|
||||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include "HttpChannelParentListener.h"
|
||||
#include "mozilla/net/HttpChannelParent.h"
|
||||
#include "mozilla/dom/TabParent.h"
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
* 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/. */
|
||||
|
||||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include "nsHttpHandler.h"
|
||||
#include "HttpInfo.h"
|
||||
|
||||
|
|
|
@ -0,0 +1,75 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* vim:set ts=4 sw=4 sts=4 et cin: */
|
||||
/* 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/. */
|
||||
|
||||
#ifndef HttpLog_h__
|
||||
#define HttpLog_h__
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* This file should ONLY be #included by source (.cpp) files in the /http
|
||||
* directory, not headers (.h). If you need to use LOG() in a .h file, call
|
||||
* PR_LOG directly.
|
||||
*
|
||||
* This file should also be the first #include in your file.
|
||||
*
|
||||
* Yes, this is kludgy.
|
||||
*******************************************************************************/
|
||||
|
||||
|
||||
// e10s mess: IPDL-generated headers include chromium files that both #include
|
||||
// prlog.h, and #define LOG in conflict with this file.
|
||||
// Solution: (as described in bug 545995)
|
||||
// 1) ensure that this file is #included before any IPDL-generated files and
|
||||
// anything else that #includes prlog.h, so that we can make sure prlog.h
|
||||
// sees FORCE_PR_LOG
|
||||
// 2) #include IPDL boilerplate, and then undef LOG so our LOG wins.
|
||||
// 3) nsNetModule.cpp does its own crazy stuff with #including prlog.h
|
||||
// multiple times; allow it to define ALLOW_LATE_HTTPLOG_H_INCLUDE to bypass
|
||||
// check.
|
||||
#if defined(PR_LOG) && !defined(ALLOW_LATE_HTTPLOG_H_INCLUDE)
|
||||
#error "If HttpLog.h #included it must come before any IPDL-generated files or other files that #include prlog.h"
|
||||
#endif
|
||||
|
||||
// NeckoChild.h will include chromium, which will include prlog.h so define
|
||||
// PR_FORCE before we do that.
|
||||
#if defined(MOZ_LOGGING)
|
||||
#define FORCE_PR_LOG
|
||||
#endif
|
||||
|
||||
#include "mozilla/net/NeckoChild.h"
|
||||
|
||||
// Get rid of Chromium's LOG definition
|
||||
#undef LOG
|
||||
|
||||
#if defined(PR_LOGGING)
|
||||
//
|
||||
// Log module for HTTP Protocol logging...
|
||||
//
|
||||
// To enable logging (see prlog.h for full details):
|
||||
//
|
||||
// set NSPR_LOG_MODULES=nsHttp:5
|
||||
// set NSPR_LOG_FILE=http.log
|
||||
//
|
||||
// this enables PR_LOG_ALWAYS level information and places all output in
|
||||
// the file http.log
|
||||
//
|
||||
extern PRLogModuleInfo *gHttpLog;
|
||||
#endif
|
||||
|
||||
// http logging
|
||||
#define LOG1(args) PR_LOG(gHttpLog, 1, args)
|
||||
#define LOG2(args) PR_LOG(gHttpLog, 2, args)
|
||||
#define LOG3(args) PR_LOG(gHttpLog, 3, args)
|
||||
#define LOG4(args) PR_LOG(gHttpLog, 4, args)
|
||||
#define LOG(args) LOG4(args)
|
||||
|
||||
#define LOG1_ENABLED() PR_LOG_TEST(gHttpLog, 1)
|
||||
#define LOG2_ENABLED() PR_LOG_TEST(gHttpLog, 2)
|
||||
#define LOG3_ENABLED() PR_LOG_TEST(gHttpLog, 3)
|
||||
#define LOG4_ENABLED() PR_LOG_TEST(gHttpLog, 4)
|
||||
#define LOG_ENABLED() LOG4_ENABLED()
|
||||
|
||||
#endif // HttpLog_h__
|
|
@ -4,6 +4,9 @@
|
|||
* 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/. */
|
||||
|
||||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include "nsHttp.h"
|
||||
#include "NullHttpTransaction.h"
|
||||
#include "nsProxyRelease.h"
|
||||
|
|
|
@ -31,33 +31,8 @@ protocol PHttpChannel
|
|||
manager PNecko;
|
||||
|
||||
parent:
|
||||
AsyncOpen(URIParams uri,
|
||||
// - TODO: bug 571161: unclear if any HTTP channel clients ever
|
||||
// set originalURI != uri (about:credits?); also not clear if
|
||||
// chrome channel would ever need to know. Get rid of next arg?
|
||||
OptionalURIParams original,
|
||||
OptionalURIParams doc,
|
||||
OptionalURIParams referrer,
|
||||
OptionalURIParams apiRedirectTo,
|
||||
uint32_t loadFlags,
|
||||
RequestHeaderTuples requestHeaders,
|
||||
nsHttpAtom requestMethod,
|
||||
OptionalInputStreamParams uploadStream,
|
||||
bool uploadStreamHasHeaders,
|
||||
uint16_t priority,
|
||||
uint8_t redirectionLimit,
|
||||
bool allowPipelining,
|
||||
bool forceAllowThirdPartyCookie,
|
||||
bool resumeAt,
|
||||
uint64_t startPos,
|
||||
nsCString entityID,
|
||||
bool chooseApplicationCache,
|
||||
nsCString appCacheClientID,
|
||||
bool allowSpdy);
|
||||
|
||||
// Used to connect redirected-to channel on the parent with redirected-to
|
||||
// channel on the child.
|
||||
ConnectChannel(uint32_t channelId);
|
||||
// Note: channels are opened during construction, so no open method here:
|
||||
// see PNecko.ipdl
|
||||
|
||||
SetPriority(uint16_t priority);
|
||||
|
||||
|
|
|
@ -25,6 +25,12 @@ struct RequestHeaderTuple {
|
|||
nsCString mHeader;
|
||||
nsCString mValue;
|
||||
bool mMerge;
|
||||
|
||||
bool operator ==(const RequestHeaderTuple &other) const {
|
||||
return mHeader.Equals(other.mHeader) &&
|
||||
mValue.Equals(other.mValue) &&
|
||||
mMerge == other.mMerge;
|
||||
}
|
||||
};
|
||||
|
||||
typedef nsTArray<RequestHeaderTuple> RequestHeaderTuples;
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
* 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/. */
|
||||
|
||||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "nsDependentString.h"
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
* 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/. */
|
||||
|
||||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include "nsHttp.h"
|
||||
#include "SpdySession2.h"
|
||||
#include "SpdyStream2.h"
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
* 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/. */
|
||||
|
||||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "nsHttp.h"
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
* 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/. */
|
||||
|
||||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include "nsHttp.h"
|
||||
#include "SpdySession2.h"
|
||||
#include "SpdyStream2.h"
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
* 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/. */
|
||||
|
||||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "nsAlgorithm.h"
|
||||
#include "nsHttp.h"
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
* 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/. */
|
||||
|
||||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include "nsHttp.h"
|
||||
#include "pldhash.h"
|
||||
#include "mozilla/Mutex.h"
|
||||
|
|
|
@ -7,61 +7,13 @@
|
|||
#ifndef nsHttp_h__
|
||||
#define nsHttp_h__
|
||||
|
||||
#if defined(MOZ_LOGGING)
|
||||
#define FORCE_PR_LOG
|
||||
#endif
|
||||
|
||||
// e10s mess: IPDL-generatd headers include chromium which both #includes
|
||||
// prlog.h, and #defines LOG in conflict with this file.
|
||||
// Solution: (as described in bug 545995)
|
||||
// 1) ensure that this file is #included before any IPDL-generated files and
|
||||
// anything else that #includes prlog.h, so that we can make sure prlog.h
|
||||
// sees FORCE_PR_LOG if needed.
|
||||
// 2) #include IPDL boilerplate, and then undef LOG so our LOG wins.
|
||||
// 3) nsNetModule.cpp does its own crazy stuff with #including prlog.h
|
||||
// multiple times; allow it to define ALLOW_LATE_NSHTTP_H_INCLUDE to bypass
|
||||
// check.
|
||||
#if defined(PR_LOG) && !defined(ALLOW_LATE_NSHTTP_H_INCLUDE)
|
||||
#error "If nsHttp.h #included it must come before any IPDL-generated files or other files that #include prlog.h"
|
||||
#endif
|
||||
#include "mozilla/net/NeckoChild.h"
|
||||
#undef LOG
|
||||
|
||||
#include "plstr.h"
|
||||
#include "prlog.h"
|
||||
#include "prtime.h"
|
||||
#include "nsISupportsUtils.h"
|
||||
#include "nsPromiseFlatString.h"
|
||||
#include "nsURLHelper.h"
|
||||
#include "netCore.h"
|
||||
|
||||
#if defined(PR_LOGGING)
|
||||
//
|
||||
// Log module for HTTP Protocol logging...
|
||||
//
|
||||
// To enable logging (see prlog.h for full details):
|
||||
//
|
||||
// set NSPR_LOG_MODULES=nsHttp:5
|
||||
// set NSPR_LOG_FILE=http.log
|
||||
//
|
||||
// this enables PR_LOG_ALWAYS level information and places all output in
|
||||
// the file http.log
|
||||
//
|
||||
extern PRLogModuleInfo *gHttpLog;
|
||||
#endif
|
||||
|
||||
// http logging
|
||||
#define LOG1(args) PR_LOG(gHttpLog, 1, args)
|
||||
#define LOG2(args) PR_LOG(gHttpLog, 2, args)
|
||||
#define LOG3(args) PR_LOG(gHttpLog, 3, args)
|
||||
#define LOG4(args) PR_LOG(gHttpLog, 4, args)
|
||||
#define LOG(args) LOG4(args)
|
||||
|
||||
#define LOG1_ENABLED() PR_LOG_TEST(gHttpLog, 1)
|
||||
#define LOG2_ENABLED() PR_LOG_TEST(gHttpLog, 2)
|
||||
#define LOG3_ENABLED() PR_LOG_TEST(gHttpLog, 3)
|
||||
#define LOG4_ENABLED() PR_LOG_TEST(gHttpLog, 4)
|
||||
#define LOG_ENABLED() LOG4_ENABLED()
|
||||
#include "mozilla/Mutex.h"
|
||||
|
||||
// http version codes
|
||||
#define NS_HTTP_VERSION_UNKNOWN 0
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
* 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/. */
|
||||
|
||||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include "nsHttpActivityDistributor.h"
|
||||
#include "nsIChannel.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
* 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/. */
|
||||
|
||||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include "nsHttpAuthCache.h"
|
||||
#include <stdlib.h>
|
||||
#include "base/compiler_specific.h"
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
* 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/. */
|
||||
|
||||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include "nsHttpHandler.h"
|
||||
#include "nsHttpChannel.h"
|
||||
#include "nsHttpAuthManager.h"
|
||||
|
|
|
@ -3,11 +3,12 @@
|
|||
* 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 <stdlib.h>
|
||||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include "nsHttp.h"
|
||||
#include "nsHttpBasicAuth.h"
|
||||
#include "plbase64.h"
|
||||
#include "plstr.h"
|
||||
#include "nsString.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
* 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/. */
|
||||
|
||||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include "nsHttp.h"
|
||||
#include "nsHttpChannel.h"
|
||||
#include "nsHttpHandler.h"
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
* 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/. */
|
||||
|
||||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include "nsHttpChannelAuthProvider.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsHttpHandler.h"
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
* 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/. */
|
||||
|
||||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include "nsHttpChunkedDecoder.h"
|
||||
#include "nsHttp.h"
|
||||
#include <algorithm>
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
* 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/. */
|
||||
|
||||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include "nsHttpConnection.h"
|
||||
#include "nsHttpTransaction.h"
|
||||
#include "nsHttpRequestHead.h"
|
||||
|
|
|
@ -1,10 +1,38 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* vim: set sw=4 ts=8 et tw=80 : */
|
||||
/* 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/. */
|
||||
|
||||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include "nsHttpConnectionInfo.h"
|
||||
|
||||
nsHttpConnectionInfo::nsHttpConnectionInfo(const nsACString &host, int32_t port,
|
||||
nsProxyInfo* proxyInfo,
|
||||
bool usingSSL)
|
||||
: mRef(0)
|
||||
, mProxyInfo(proxyInfo)
|
||||
, mUsingSSL(usingSSL)
|
||||
, mUsingConnect(false)
|
||||
{
|
||||
LOG(("Creating nsHttpConnectionInfo @%x\n", this));
|
||||
|
||||
mUsingHttpProxy = (proxyInfo && proxyInfo->IsHTTP());
|
||||
|
||||
if (mUsingHttpProxy) {
|
||||
mUsingConnect = mUsingSSL; // SSL always uses CONNECT
|
||||
uint32_t resolveFlags = 0;
|
||||
if (NS_SUCCEEDED(mProxyInfo->GetResolveFlags(&resolveFlags)) &&
|
||||
resolveFlags & nsIProtocolProxyService::RESOLVE_ALWAYS_TUNNEL) {
|
||||
mUsingConnect = true;
|
||||
}
|
||||
}
|
||||
|
||||
SetOriginServer(host, port);
|
||||
}
|
||||
|
||||
void
|
||||
nsHttpConnectionInfo::SetOriginServer(const nsACString &host, int32_t port)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* vim: set sw=4 ts=8 et tw=80 : */
|
||||
/* 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/. */
|
||||
|
@ -15,6 +16,8 @@
|
|||
#include "nsCRT.h"
|
||||
#include "nsIProtocolProxyService.h"
|
||||
|
||||
extern PRLogModuleInfo *gHttpLog;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// nsHttpConnectionInfo - holds the properties of a connection
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -24,31 +27,11 @@ class nsHttpConnectionInfo
|
|||
public:
|
||||
nsHttpConnectionInfo(const nsACString &host, int32_t port,
|
||||
nsProxyInfo* proxyInfo,
|
||||
bool usingSSL=false)
|
||||
: mRef(0)
|
||||
, mProxyInfo(proxyInfo)
|
||||
, mUsingSSL(usingSSL)
|
||||
, mUsingConnect(false)
|
||||
{
|
||||
LOG(("Creating nsHttpConnectionInfo @%x\n", this));
|
||||
|
||||
mUsingHttpProxy = (proxyInfo && proxyInfo->IsHTTP());
|
||||
|
||||
if (mUsingHttpProxy) {
|
||||
mUsingConnect = mUsingSSL; // SSL always uses CONNECT
|
||||
uint32_t resolveFlags = 0;
|
||||
if (NS_SUCCEEDED(mProxyInfo->GetResolveFlags(&resolveFlags)) &&
|
||||
resolveFlags & nsIProtocolProxyService::RESOLVE_ALWAYS_TUNNEL) {
|
||||
mUsingConnect = true;
|
||||
}
|
||||
}
|
||||
|
||||
SetOriginServer(host, port);
|
||||
}
|
||||
bool usingSSL=false);
|
||||
|
||||
~nsHttpConnectionInfo()
|
||||
{
|
||||
LOG(("Destroying nsHttpConnectionInfo @%x\n", this));
|
||||
PR_LOG(gHttpLog, 4, ("Destroying nsHttpConnectionInfo @%x\n", this));
|
||||
}
|
||||
|
||||
nsrefcnt AddRef()
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
* 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/. */
|
||||
|
||||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include "nsHttpConnectionMgr.h"
|
||||
#include "nsHttpConnection.h"
|
||||
#include "nsHttpPipeline.h"
|
||||
|
|
|
@ -4,7 +4,9 @@
|
|||
* 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 <stdlib.h>
|
||||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include "nsHttp.h"
|
||||
#include "nsHttpDigestAuth.h"
|
||||
#include "nsIHttpAuthenticableChannel.h"
|
||||
|
@ -17,7 +19,6 @@
|
|||
#include "nsEscape.h"
|
||||
#include "nsNetCID.h"
|
||||
#include "plbase64.h"
|
||||
#include "plstr.h"
|
||||
#include "prprf.h"
|
||||
#include "nsCRT.h"
|
||||
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
* 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/. */
|
||||
|
||||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include "nsHttp.h"
|
||||
#include "nsHttpHandler.h"
|
||||
#include "nsHttpChannel.h"
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
* 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/. */
|
||||
|
||||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include "nsHttpHeaderArray.h"
|
||||
#include "nsHttp.h"
|
||||
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
* 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 <stdlib.h>
|
||||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include "nsHttp.h"
|
||||
#include "nsHttpNTLMAuth.h"
|
||||
#include "nsIComponentManager.h"
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
* 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 <stdlib.h>
|
||||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include "nsHttp.h"
|
||||
#include "nsHttpPipeline.h"
|
||||
#include "nsHttpHandler.h"
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
* 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/. */
|
||||
|
||||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include "nsHttpRequestHead.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -4,7 +4,9 @@
|
|||
* 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 <stdlib.h>
|
||||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include "nsHttpResponseHead.h"
|
||||
#include "nsPrintfCString.h"
|
||||
#include "prprf.h"
|
||||
|
|
|
@ -28,6 +28,8 @@ public:
|
|||
const nsHttpHeaderArray & Headers() const { return mHeaders; }
|
||||
nsHttpHeaderArray &Headers() { return mHeaders; }
|
||||
nsHttpVersion Version() const { return mVersion; }
|
||||
// X11's Xlib.h #defines 'Status' to 'int' on some systems!
|
||||
#undef Status
|
||||
uint16_t Status() const { return mStatus; }
|
||||
const nsAFlatCString &StatusText() const { return mStatusText; }
|
||||
int64_t ContentLength() const { return mContentLength; }
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
* 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/. */
|
||||
|
||||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include "base/basictypes.h"
|
||||
|
||||
#include "nsIOService.h"
|
||||
|
|
|
@ -338,15 +338,6 @@ CertInfoPurposes=Purposes
|
|||
CertInfoEmail=Email
|
||||
CertInfoStoredIn=Stored in:
|
||||
P12DefaultNickname=Imported Certificate
|
||||
CrlImportFailure1x=The application cannot import the Certificate Revocation List (CRL).
|
||||
CrlImportFailureExpired=A more recent version of this CRL is available.
|
||||
CrlImportFailureBadSignature=CRL has an invalid Signature.
|
||||
CrlImportFailureInvalid=New CRL has an invalid format.
|
||||
CrlImportFailureOld=New CRL is older than the current one.
|
||||
CrlImportFailureNotYetValid=The CRL is not yet valid. You might want to check your system clock.
|
||||
CrlImportFailureNetworkProblem=Download of the CRL failed due to Network problems.
|
||||
CrlImportFailureReasonUnknown=Error Importing CRL to local Database. Error Code:
|
||||
CrlImportFailure2=Please ask your system administrator for assistance.
|
||||
NSSInitProblemX=Could not initialize the application's security component. The most likely cause is problems with files in your application's profile directory. Please check that this directory has no read/write restrictions and your hard disk is not full or close to full. It is recommended that you exit the application and fix the problem. If you continue to use this session, you might see incorrect application behaviour when accessing security features.
|
||||
VerifyExpired=<Expired>
|
||||
VerifyRevoked=<Revoked>
|
||||
|
|
|
@ -76,8 +76,6 @@
|
|||
<!ENTITY examineCert.label "View Certificate">
|
||||
<!ENTITY examineCert.accesskey "V">
|
||||
|
||||
<!ENTITY serverCrlNextupdate.message "Please ask your system administrator for assistance">
|
||||
|
||||
<!-- Strings for the CreateCertInfo dialog -->
|
||||
<!ENTITY createCertInfo.title "Generating A Private Key">
|
||||
<!ENTITY createCertInfo.msg1 "Key Generation in progress… This may take a few minutes….">
|
||||
|
|
|
@ -125,30 +125,8 @@ disable_fips=Disable FIPS
|
|||
fips_nonempty_password_required=FIPS mode requires that you have a Master Password set for each security device. Please set the password before trying to enable FIPS mode.
|
||||
unable_to_toggle_fips=Unable to change the FIPS mode for the security device. It is recommended that you exit and restart this application.
|
||||
|
||||
# CRL next update.
|
||||
crlNextUpdateMsg1=%S cannot establish an encrypted connection with "%S".
|
||||
crlNextUpdateMsg2=The certificate revocation list (CRL) from "%S" needs to be updated.
|
||||
NoUpdateFailure=None
|
||||
lastFetchUrlLabel=URL originally fetched from
|
||||
advertisedUrlLabel=URL advertised by the CA
|
||||
crlAutoUpdateDayCntError=Number of days before next update must be a number greater than zero.
|
||||
crlAutoUpdtaeFreqCntError=Frequency of update must be a number greater than zero.
|
||||
disabledStatement=Automatic Update is not enabled for this CRL.
|
||||
enabledStatement=Automatic Update is enabled for this CRL.
|
||||
crlAutoupdateQuestion1=Would you like to enable automatic update?
|
||||
crlAutoupdateQuestion2=Would you like to view the automatic update settings?
|
||||
undefinedValStr=<Not Defined>
|
||||
undefinedURL=Auto update URL is not defined.
|
||||
yesButton=Yes
|
||||
noButton=No
|
||||
resetPasswordConfirmationTitle=Reset Master Password
|
||||
resetPasswordConfirmationMessage=Your password has been reset.
|
||||
crlAutoupdateEnabled=Enabled
|
||||
crlAutoupdateNotEnabled=Not Enabled
|
||||
crlAutoupdateOk=OK
|
||||
crlAutoupdateFailed=Failed
|
||||
crlImportNewCRLTitle=Import Certificate Revocation List
|
||||
crlImportNewCRLLabel=Import the CRL from:
|
||||
|
||||
#Import certificate(s) file dialog
|
||||
importEmailCertPrompt=Select File containing somebody's Email certificate to import
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
<!-- 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/. -->
|
||||
|
||||
<!ENTITY validation.crlmanager.label "Manage CRLs">
|
||||
<!ENTITY validation.crlmanager.description "These Certificate Revocation Lists (CRL) are stored in your certificate database:">
|
||||
<!ENTITY validation.crlname.label "Name">
|
||||
<!ENTITY validation.crllastupdate.label "Last Update">
|
||||
<!ENTITY validation.crlnextupdate.label "Next Update">
|
||||
<!ENTITY validation.crlautoupdateenabled.label "Auto Update">
|
||||
<!ENTITY validation.crlautoupdatestatus.label "Auto Update Status">
|
||||
<!ENTITY validation.deletecrl.label "Delete">
|
||||
<!ENTITY validation.deletecrl.accesskey "D">
|
||||
<!ENTITY validation.updatecrl.label "Update">
|
||||
<!ENTITY validation.updatecrl.accesskey "U">
|
||||
<!ENTITY validation.advanced.label "Settings">
|
||||
<!ENTITY validation.advanced.accesskey "S">
|
||||
|
||||
<!ENTITY validation.crl.autoupdate.title "Automatic CRL Update Preferences">
|
||||
<!ENTITY validation.crl.autoupdate.enable.label "Enable Automatic Update for this CRL">
|
||||
<!ENTITY validation.crl.autoupdate.time.label1 "Update">
|
||||
<!ENTITY validation.crl.autoupdate.time.label2 "Day(s) before Next Update date">
|
||||
<!ENTITY validation.crl.autoupdate.freq.label1 "Update every">
|
||||
<!ENTITY validation.crl.autoupdate.freq.label2 "Day(s)">
|
||||
<!ENTITY validation.crl.autoupdate.url.label "CRL would be imported From:">
|
||||
<!ENTITY crl.import.status.title "CRL Import Status">
|
||||
<!ENTITY crl.import.success.message "The Certificate Revocation List (CRL) was successfully imported.">
|
||||
<!ENTITY crl.issuer.label "CRL Issued By:">
|
||||
<!ENTITY crl.issuer.org.label "Organization: ">
|
||||
<!ENTITY crl.issuer.orgunit.label "Unit: ">
|
||||
<!ENTITY crl.import.nextupdate.label "Next Update On: ">
|
||||
<!ENTITY crl.autoupdate.fail.cnt.label "Previous Consecutive Update Failures: ">
|
||||
<!ENTITY crl.autoupdate.fail.reason.label "Details of Last Update Failure: ">
|
||||
<!ENTITY edit.button "Settings">
|
|
@ -14,4 +14,3 @@
|
|||
locale/@AB_CD@/pippki/pippki.properties (%chrome/pippki/pippki.properties)
|
||||
locale/@AB_CD@/pippki/certManager.dtd (%chrome/pippki/certManager.dtd)
|
||||
locale/@AB_CD@/pippki/deviceManager.dtd (%chrome/pippki/deviceManager.dtd)
|
||||
locale/@AB_CD@/pippki/validation.dtd (%chrome/pippki/validation.dtd)
|
||||
|
|
|
@ -1,84 +0,0 @@
|
|||
/* 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/. */
|
||||
|
||||
const nsPKIParamBlock = "@mozilla.org/security/pkiparamblock;1";
|
||||
const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
|
||||
const nsIX509Cert = Components.interfaces.nsIX509Cert;
|
||||
const nsICRLInfo = Components.interfaces.nsICRLInfo;
|
||||
const nsIPrefService = Components.interfaces.nsIPrefService
|
||||
|
||||
var pkiParams;
|
||||
var cert;
|
||||
var crl;
|
||||
|
||||
function onLoad()
|
||||
{
|
||||
pkiParams = window.arguments[0].QueryInterface(nsIPKIParamBlock);
|
||||
isupport = pkiParams.getISupportAtIndex(1);
|
||||
if (isupport) {
|
||||
crl = isupport.QueryInterface(nsICRLInfo);
|
||||
}
|
||||
var bundle = document.getElementById("pippki_bundle");
|
||||
var yesButton = bundle.getString("yesButton");
|
||||
var noButton = bundle.getString("noButton");
|
||||
document.documentElement.getButton("accept").label = yesButton;
|
||||
document.documentElement.getButton("cancel").label = noButton;
|
||||
|
||||
var nextUpdateStr;
|
||||
var orgStr;
|
||||
var orgUnitStr;
|
||||
|
||||
if(crl != null) {
|
||||
nextUpdateStr = crl.nextUpdateLocale;
|
||||
if( (nextUpdateStr == null) || (nextUpdateStr.length == 0) ){
|
||||
nextUpdateStr = bundle.getString("undefinedValStr");
|
||||
}
|
||||
var nextUpdate = document.getElementById("nextUpdate");
|
||||
nextUpdate.setAttribute("value",nextUpdateStr);
|
||||
var org = document.getElementById("orgText");
|
||||
org.setAttribute("value", crl.organization);
|
||||
var orgUnit = document.getElementById("orgUnitText");
|
||||
orgUnit.setAttribute("value", crl.organizationalUnit);
|
||||
|
||||
var autoupdateEnabledString = "security.crl.autoupdate.enable." + crl.nameInDb;
|
||||
|
||||
var updateEnabled = false;
|
||||
try {
|
||||
var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(nsIPrefService);
|
||||
var prefBranch = prefService.getBranch(null);
|
||||
updateEnabled = prefBranch.getBoolPref(autoupdateEnabledString);
|
||||
if(updateEnabled) {
|
||||
var autoupdateURLString = "security.crl.autoupdate.url." + crl.nameInDb;
|
||||
prefBranch.setCharPref(autoupdateURLString, crl.lastFetchURL);
|
||||
prefService.savePrefFile(null);
|
||||
}
|
||||
}catch(exception){}
|
||||
|
||||
var statement = document.getElementById("status");
|
||||
var question = document.getElementById("question");
|
||||
if(updateEnabled) {
|
||||
statement.setAttribute("value", bundle.getString("enabledStatement"));
|
||||
question.setAttribute("value", bundle.getString("crlAutoupdateQuestion2"));
|
||||
} else {
|
||||
statement.setAttribute("value", bundle.getString("disabledStatement"));
|
||||
question.setAttribute("value", bundle.getString("crlAutoupdateQuestion1"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onCancel()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function onAccept()
|
||||
{
|
||||
var params = Components.classes[nsPKIParamBlock].createInstance(nsIPKIParamBlock);
|
||||
params.setISupportAtIndex(1, crl);
|
||||
|
||||
window.openDialog("chrome://pippki/content/pref-crlupdate.xul","",
|
||||
"chrome,centerscreen,modal",params);
|
||||
return true;
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- 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/. -->
|
||||
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
|
||||
<!DOCTYPE dialog SYSTEM "chrome://pippki/locale/validation.dtd">
|
||||
|
||||
<dialog id="crlImportSuccess"
|
||||
title="&crl.import.status.title;"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="onLoad();"
|
||||
buttons="accept,cancel"
|
||||
ondialogaccept="return onAccept();"
|
||||
ondialogcancel="return onCancel();">
|
||||
|
||||
<stringbundle id="pippki_bundle" src="chrome://pippki/locale/pippki.properties"/>
|
||||
|
||||
<script type="application/javascript" src="chrome://pippki/content/crlImportDialog.js" />
|
||||
<script type="application/javascript" src="pippki.js" />
|
||||
|
||||
<vbox style="margin: 5px;" flex="1">
|
||||
|
||||
<text value="&crl.import.success.message;" />
|
||||
<separator/>
|
||||
|
||||
<text class="header" value="&crl.issuer.label;" />
|
||||
<hbox>
|
||||
<text value="&crl.issuer.org.label;" />
|
||||
<text id="orgText" />
|
||||
</hbox>
|
||||
<hbox>
|
||||
<text value="&crl.issuer.orgunit.label;" />
|
||||
<text id="orgUnitText" />
|
||||
</hbox>
|
||||
<separator/>
|
||||
|
||||
<hbox>
|
||||
<text value="&crl.import.nextupdate.label;" />
|
||||
<text id="nextUpdate" />
|
||||
</hbox>
|
||||
<separator/>
|
||||
|
||||
<vbox>
|
||||
<text id="status" />
|
||||
<text id="question" />
|
||||
</vbox>
|
||||
|
||||
</vbox>
|
||||
|
||||
</dialog>
|
|
@ -1,222 +0,0 @@
|
|||
/* 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/. */
|
||||
|
||||
const nsICRLManager = Components.interfaces.nsICRLManager;
|
||||
const nsCRLManager = "@mozilla.org/security/crlmanager;1";
|
||||
const nsICRLInfo = Components.interfaces.nsICRLInfo;
|
||||
const nsISupportsArray = Components.interfaces.nsISupportsArray;
|
||||
const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
|
||||
const nsPKIParamBlock = "@mozilla.org/security/pkiparamblock;1";
|
||||
const nsIPrefService = Components.interfaces.nsIPrefService;
|
||||
|
||||
var crlManager;
|
||||
var crls;
|
||||
var prefService;
|
||||
var prefBranch;
|
||||
|
||||
var autoupdateEnabledBaseString = "security.crl.autoupdate.enable.";
|
||||
var autoupdateTimeTypeBaseString = "security.crl.autoupdate.timingType.";
|
||||
var autoupdateTimeBaseString = "security.crl.autoupdate.nextInstant.";
|
||||
var autoupdateURLBaseString = "security.crl.autoupdate.url.";
|
||||
var autoupdateErrCntBaseString = "security.crl.autoupdate.errCount.";
|
||||
var autoupdateErrDetailBaseString = "security.crl.autoupdate.errDetail.";
|
||||
var autoupdateDayCntString = "security.crl.autoupdate.dayCnt.";
|
||||
var autoupdateFreqCntString = "security.crl.autoupdate.freqCnt.";
|
||||
|
||||
function onLoad()
|
||||
{
|
||||
var crlEntry;
|
||||
var i;
|
||||
|
||||
crlManager = Components.classes[nsCRLManager].getService(nsICRLManager);
|
||||
crls = crlManager.getCrls();
|
||||
prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(nsIPrefService);
|
||||
prefBranch = prefService.getBranch(null);
|
||||
var bundle = document.getElementById("pippki_bundle");
|
||||
var autoupdateEnabledString;
|
||||
var autoupdateErrCntString;
|
||||
|
||||
for (i=0; i<crls.length; i++) {
|
||||
crlEntry = crls.queryElementAt(i, nsICRLInfo);
|
||||
var org = crlEntry.organization;
|
||||
var orgUnit = crlEntry.organizationalUnit;
|
||||
var lastUpdate = crlEntry.lastUpdateLocale;
|
||||
var nextUpdate = crlEntry.nextUpdateLocale;
|
||||
autoupdateEnabledString = autoupdateEnabledBaseString + crlEntry.nameInDb;
|
||||
autoupdateErrCntString = autoupdateErrCntBaseString + crlEntry.nameInDb;
|
||||
var enabled = false;
|
||||
var enabledStr = bundle.getString("crlAutoupdateNotEnabled");
|
||||
var status = "";
|
||||
try{
|
||||
enabled = prefBranch.getBoolPref(autoupdateEnabledString)
|
||||
if(enabled){
|
||||
enabledStr = bundle.getString("crlAutoupdateEnabled");
|
||||
}
|
||||
var cnt;
|
||||
cnt = prefBranch.getIntPref(autoupdateErrCntString);
|
||||
if(cnt > 0){
|
||||
status = bundle.getString("crlAutoupdateFailed");
|
||||
} else {
|
||||
status = bundle.getString("crlAutoupdateOk");
|
||||
}
|
||||
}catch(exception){}
|
||||
|
||||
AddItem("crlList", [org, orgUnit, lastUpdate, nextUpdate, enabledStr, status], "crltree_", i);
|
||||
}
|
||||
}
|
||||
|
||||
function AddItem(children,cells,prefix,idfier)
|
||||
{
|
||||
var kids = document.getElementById(children);
|
||||
var item = document.createElement("treeitem");
|
||||
var row = document.createElement("treerow");
|
||||
for(var i = 0; i < cells.length; i++)
|
||||
{
|
||||
var cell = document.createElement("treecell");
|
||||
cell.setAttribute("class", "propertylist");
|
||||
cell.setAttribute("label", cells[i])
|
||||
row.appendChild(cell);
|
||||
}
|
||||
item.appendChild(row);
|
||||
item.setAttribute("id",prefix + idfier);
|
||||
kids.appendChild(item);
|
||||
}
|
||||
|
||||
function DeleteCrlSelected() {
|
||||
var crlEntry;
|
||||
|
||||
// delete selected item
|
||||
var crltree = document.getElementById("crltree");
|
||||
var i = crltree.currentIndex;
|
||||
if(i<0){
|
||||
return;
|
||||
}
|
||||
crlEntry = crls.queryElementAt(i, nsICRLInfo);
|
||||
|
||||
var autoupdateEnabled = false;
|
||||
var autoupdateParamAvailable = false;
|
||||
var id = crlEntry.nameInDb;
|
||||
|
||||
//First, check if autoupdate was enabled for this crl
|
||||
try {
|
||||
autoupdateEnabled = prefBranch.getBoolPref(autoupdateEnabledBaseString + id);
|
||||
//Note, if the pref is not present, we get an exception right here,
|
||||
//and autoupdateEnabled remains false
|
||||
autoupdateParamAvailable = true;
|
||||
prefBranch.clearUserPref(autoupdateEnabledBaseString + id);
|
||||
prefBranch.clearUserPref(autoupdateTimeTypeBaseString + id);
|
||||
prefBranch.clearUserPref(autoupdateTimeBaseString + id);
|
||||
prefBranch.clearUserPref(autoupdateURLBaseString + id);
|
||||
prefBranch.clearUserPref(autoupdateDayCntString + id);
|
||||
prefBranch.clearUserPref(autoupdateFreqCntString + id);
|
||||
prefBranch.clearUserPref(autoupdateErrCntBaseString + id);
|
||||
prefBranch.clearUserPref(autoupdateErrDetailBaseString + id);
|
||||
} catch(Exception){}
|
||||
|
||||
//Once we have deleted the prefs that can be deleted, we save the
|
||||
//file if relevant, restart the scheduler, and once we are successful
|
||||
//in doind that, we try to delete the crl
|
||||
try{
|
||||
if(autoupdateParamAvailable){
|
||||
prefService.savePrefFile(null);
|
||||
}
|
||||
|
||||
if(autoupdateEnabled){
|
||||
crlManager.rescheduleCRLAutoUpdate();
|
||||
}
|
||||
|
||||
// Now, try to delete it
|
||||
crlManager.deleteCrl(i);
|
||||
DeleteItemSelected("crltree", "crltree_", "crlList");
|
||||
//To do: If delete fails, we should be able to retrieve the deleted
|
||||
//settings
|
||||
//XXXXXXXXXXXXXXXXXXXXX
|
||||
|
||||
}catch(exception) {
|
||||
//To Do: Possibly show an error ...
|
||||
//XXXXXXXXXXXX
|
||||
}
|
||||
|
||||
EnableCrlActions();
|
||||
}
|
||||
|
||||
function EnableCrlActions() {
|
||||
var tree = document.getElementById("crltree");
|
||||
if (tree.view.selection.count) {
|
||||
document.getElementById("deleteCrl").removeAttribute("disabled");
|
||||
document.getElementById("editPrefs").removeAttribute("disabled");
|
||||
document.getElementById("updateCRL").removeAttribute("disabled");
|
||||
} else {
|
||||
document.getElementById("deleteCrl").setAttribute("disabled", "true");
|
||||
document.getElementById("editPrefs").setAttribute("disabled", "true");
|
||||
document.getElementById("updateCRL").setAttribute("disabled", "true");
|
||||
}
|
||||
}
|
||||
|
||||
function DeleteItemSelected(tree, prefix, kids) {
|
||||
var i;
|
||||
var delnarray = [];
|
||||
var rv = "";
|
||||
var cookietree = document.getElementById(tree);
|
||||
var rangeCount = cookietree.view.selection.getRangeCount();
|
||||
for(i = 0; i < rangeCount; ++i)
|
||||
{
|
||||
var start = {}, end = {};
|
||||
cookietree.view.selection.getRangeAt(i, start, end);
|
||||
for (var k = start.value; k <= end.value; ++k) {
|
||||
var item = cookietree.contentView.getItemAtIndex(k);
|
||||
delnarray[i] = document.getElementById(item.id);
|
||||
var itemid = parseInt(item.id.substring(prefix.length, item.id.length));
|
||||
rv += (itemid + ",");
|
||||
}
|
||||
}
|
||||
for(i = 0; i < delnarray.length; i++)
|
||||
{
|
||||
document.getElementById(kids).removeChild(delnarray[i]);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
function EditAutoUpdatePrefs() {
|
||||
var crlEntry;
|
||||
|
||||
// delete selected item
|
||||
var crltree = document.getElementById("crltree");
|
||||
var i = crltree.currentIndex;
|
||||
if(i<0){
|
||||
return;
|
||||
}
|
||||
crlEntry = crls.queryElementAt(i, nsICRLInfo);
|
||||
var params = Components.classes[nsPKIParamBlock].createInstance(nsIPKIParamBlock);
|
||||
params.setISupportAtIndex(1, crlEntry);
|
||||
window.openDialog("chrome://pippki/content/pref-crlupdate.xul","",
|
||||
"chrome,centerscreen,modal", params);
|
||||
}
|
||||
|
||||
function UpdateCRL()
|
||||
{
|
||||
var crlEntry;
|
||||
var crltree = document.getElementById("crltree");
|
||||
var i = crltree.currentIndex;
|
||||
if(i<0){
|
||||
return;
|
||||
}
|
||||
crlEntry = crls.queryElementAt(i, nsICRLInfo);
|
||||
crlManager.updateCRLFromURL(crlEntry.lastFetchURL, crlEntry.nameInDb);
|
||||
}
|
||||
|
||||
function ImportCRL()
|
||||
{
|
||||
// prompt for the URL to import from
|
||||
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);
|
||||
|
||||
var CRLLocation = {value:null};
|
||||
var dummy = { value: 0 };
|
||||
var strBundle = document.getElementById('pippki_bundle');
|
||||
var addCRL = promptService.prompt(window, strBundle.getString('crlImportNewCRLTitle'),
|
||||
strBundle.getString('crlImportNewCRLLabel'), CRLLocation, null, dummy);
|
||||
|
||||
if (addCRL)
|
||||
crlManager.updateCRLFromURL(CRLLocation.value, "");
|
||||
}
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче