In content process, we should set nsIPrintSettings::IsCancelled to true in order
to cancel the print job. nsPrintEngine use this flag for cancelling.
MozReview-Commit-ID: EqnNJOlIm5s
--HG--
extra : rebase_source : 500cd839e2e0926a19108d953532056871651af8
This patch will use existing nsIObserver, and distinguish each message by using
parameter character.
MozReview-Commit-ID: GAhPl7n9wmS
--HG--
extra : rebase_source : b230b818bf481dc31c1e490065d132572a79f9b6
This patch will add empty ipc interface in order to notify cancelling print job.
MozReview-Commit-ID: KqBN5A4ARSd
--HG--
extra : rebase_source : 634ba69269948a0f8c6363fd6f965ffc6811225b
This patch will change moz.build of printingui and xre to use common printingui
implementation.
Memo of merging printingui:
* The nsProgress / nsProgressParam is used by Windows and GTK, macOS doesn't
have this implementation.
* The merged implementation located toolkit/components/printingui/ directory.
MozReview-Commit-ID: 3Z5MAzGVo1b
--HG--
extra : rebase_source : f07ddb9fc0ebc181fd6e1b63a3d6762235629378
This patch will merge mac printingui implementation to common code.
Primary differences are:
* Remove progress implementation if build target is macOS.
MozReview-Commit-ID: 8qoxgmzhqnM
--HG--
extra : rebase_source : 4c0aa4a718105a579b0d3f7fbfe9c1e53afce0df
This patch will merge windows printingui implementation to common code.
Primary differences are:
* Use nsCOMPtr on nsPIDOMWindowOuter.
* Return NS_ERROR_FAILURE if nsPrintingPromptService doesn't have the
nsPrintProgress member when calling ShowProgress().
This is the unexpected case.
Original windows implementation has following difference, but this patch will
not copy it:
* Windows has own NS_IMPL_ADDREF / NS_IMPL_RELEASE implementation, however this
implementation isn't different from XPCOM implementation. Bug 156318
doesn't show this reason.
* Windows implementation lacks some function parameter checks.
But unixshared code covers these checks.
* Windows implementation doesn't have the nsIPrintSettings member into
nsPrintProgress, but this is necessary in order to make printing cancelable.
MozReview-Commit-ID: 8ja40rAaXBo
--HG--
extra : rebase_source : 01902bc3fc162a3b57f4243749e24ef581fba68a
This patch will copy printingui implementation from unixshared in order to merge
other platform implementation.
This unixshared implementation has much common code hence using unixshared code
is reasonable for merging.
MozReview-Commit-ID: 4VManmNcbdc
--HG--
rename : toolkit/components/printingui/unixshared/nsPrintProgress.cpp => toolkit/components/printingui/nsPrintProgress.cpp
rename : toolkit/components/printingui/unixshared/nsPrintProgress.h => toolkit/components/printingui/nsPrintProgress.h
rename : toolkit/components/printingui/unixshared/nsPrintProgressParams.cpp => toolkit/components/printingui/nsPrintProgressParams.cpp
rename : toolkit/components/printingui/unixshared/nsPrintProgressParams.h => toolkit/components/printingui/nsPrintProgressParams.h
rename : toolkit/components/printingui/unixshared/nsPrintingPromptService.cpp => toolkit/components/printingui/nsPrintingPromptService.cpp
rename : toolkit/components/printingui/unixshared/nsPrintingPromptService.h => toolkit/components/printingui/nsPrintingPromptService.h
extra : rebase_source : 09666ec789773b5fe074f9c170591f6d79dc184a
We can remove nsIPrintingPromptService::showPrinterProperties() since this
caller doesn't exist and this implementation of each platform returns
NS_ERROR_NOT_IMPLEMENTED.
MozReview-Commit-ID: 4s4ncv9U5Od
--HG--
extra : rebase_source : 81154a58766695e9ed230379d372ef1ff20b893b
A printingui uses the xul print dialog(i.e. printdialog.xul) if there
are not nsIPrintDialogService. But this code is unreachable code since
current gtk widget has nsIPrintDialogService always.
So this patch will remove this code.
MozReview-Commit-ID: EeM6YytEfdW
--HG--
extra : rebase_source : 844bf8e0237dcee4c76690a170c344672227c77c
We can remove nsIPrintingPromptService::showPrinterProperties() since this
caller doesn't exist and this implementation of each platform returns
NS_ERROR_NOT_IMPLEMENTED.
MozReview-Commit-ID: 4s4ncv9U5Od
--HG--
extra : rebase_source : b8e5b71a7d16998126a5cde06f59fb0dfc901aa7
A printingui uses the xul print dialog(i.e. printdialog.xul) if there
are not nsIPrintDialogService. But this code is unreachable code since
current gtk widget has nsIPrintDialogService always.
So this patch will remove this code.
MozReview-Commit-ID: EeM6YytEfdW
--HG--
extra : rebase_source : f7e49996710bb93441ff8d3b5977815a3b7d2e4a
This patch will
* Move native print dialog code to the PrintDialogService of widget.
* Toolkit call PrintDialogService instead of calling the native print dialog.
* Change SetWindowText/CreateWindow to SetWindowTextW/CreateWindowW
in order to treat localized string correctly.
MozReview-Commit-ID: DOgp3STaJ4t
--HG--
rename : toolkit/components/printingui/win/nsPrintDialogUtil.cpp => widget/windows/nsPrintDialogUtil.cpp
rename : toolkit/components/printingui/win/nsPrintDialogUtil.h => widget/windows/nsPrintDialogUtil.h
extra : rebase_source : 9b428f528156a70f5a127b1eeec60f6f593387a0
This avoids a lot of mismatches between nsAString and char16_t*, thus removing
many getter_Copies() and ToNewUnicode() and get() calls, and generally making
things simpler.
Note: the patch removes GetDefaultPrinterNameFromGlobalPrinters() by simply
inlining it at its two callsites, which is easy with the changed types.
--HG--
extra : rebase_source : 9ab9b3694f093fc9b22c7f8e2394a98674d76c11
macOS implementation doesn't use nsPrintProgress, so we should remove this.
MozReview-Commit-ID: FJSXtjlv3mL
--HG--
extra : rebase_source : 2826317c83b9d90066e878899485b7146fd54a85
This is straightforward, with only two notable things.
- `#include "nsXPIDLString.h" is replaced with `#include "nsString.h"`
throughout, because all nsXPIDLString.h did was include nsString.h. The
exception is for files which already include nsString.h, in which case the
patch just removes the nsXPIDLString.h inclusion.
- The patch removes the |xpidl_string| gtest, but improves the |voided| test to
cover some of its ground, e.g. testing Adopt(nullptr).
--HG--
extra : rebase_source : 452cc4a08046a1adb1a8099a7e85a1917de5add8
nsXPIDLStrings are marked as VOIDED upon initialization. Most of these local
nsXPIDLString variables are immediately set via getter_Copies(), which will
either assign a string value (using Adopt()) or do SetIsVoid(). These can be
trivially converted to nsString, which will get the same treatment.
The patch suitably converts the remaining nsXPIDLString local variable as well.
--HG--
extra : rebase_source : 5fff9f2c6844559198f601853f8db08564add7d5
This removes about 2/3 of the occurrences of nsXPIDLString in the tree. The
places where nsXPIDLStrings are null-checked are replaced with |rv| checks.
The patch also removes a couple of unused declarations from
nsIStringBundle.idl.
Note that nsStringBundle::GetStringFromNameHelper() was merged into
GetStringFromName(), because they both would have had the same signature.
--HG--
extra : rebase_source : ac40bc31c2a4997f2db0bd5069cc008757a2df6d
This patch replaces four functions of the name AssignWithConversion which
are essentially wrappers around CopyASCIItoUTF16 and LossyCopyUTF16toASCII
with direct calls to the latter two functions. The replaced functions are:
void nsCString::AssignWithConversion( const nsAString& aData )
void nsString::AssignWithConversion( const nsACString& aData )
void nsTString_CharT::AssignWithConversion(
const incompatible_char_type* aData,
int32_t aLength = -1);
The last of the three exists inside the double-included nsTString* world and
so describes two functions, giving four in total.
This has two advantages:
* it removes code
* at the call points, it makes clear (from the replacement name) which
conversion is being carried out. The generic name "AssignWithConversion"
doesn't make that obvious -- one had to infer it from the types.
The patch also removes two commented out lines from
editor/composer/nsComposerCommands.cpp, that appear to be related. They are
at top level, where they would never have compiled. They look like
leftovers from some previous change.
--HG--
extra : rebase_source : fb47bf450771c3c9ee3341dd14520f5da69ec4f5
Most of the names passed to nsIStringBundle::{Get,Format}StringFromUTF8Name
have one of the two following forms:
- a 16-bit C string literal, which is then converted to an 8-bit string in
order for the lookup to occur;
- an 8-bit C string literal converted to a 16-bit string, which is then
converted back to an 8-bit string in order for the lookup to occur.
This patch introduces and uses alternative methods that can take an 8-bit C
string literal, which requires changing some signatures in other methods and
functions. It replaces all C++ uses of the old methods.
The patch also changes the existing {Get,Format}StringFromName() methods so
they take an AUTF8String argument for the name instead of a wstring, because
that's nicer for JS code.
Even though there is a method for C++ code and a different one for JS code,
|binaryname| is used so that the existing method names can be used for the
common case in both languages.
The change reduces the number of NS_ConvertUTF8toUTF16 and
NS_ConvertUTF16toUTF8 conversions while running Speedometer v2 from ~270,000 to
~160,000. (Most of these conversions involved the string
"deprecatedReferrerDirective" in nsCSPParser.cpp.)
--HG--
extra : rebase_source : 3bee57a501035f76a81230d95186f8c3f460ff8e
This function is arguably nicer than calling NS_ProcessNextEvent
manually, is slightly more efficient, and will enable better auditing
for NS_ProcessNextEvent when we do Quantum DOM scheduling changes.
nsPrintingPromptServiceX doesn't use Objective-C, so we should change to C++ instead.
Also, nsPrintDialogServiceX::ShowPageSetup should have NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT.
MozReview-Commit-ID: 33LfNFmiUTQ
--HG--
rename : toolkit/components/printingui/mac/nsPrintingPromptServiceX.mm => toolkit/components/printingui/mac/nsPrintingPromptService.cpp
extra : rebase_source : 7ab7e3aeed81afc70d02bd262d87d6858380bb01