Граф коммитов

55 Коммитов

Автор SHA1 Сообщение Дата
Kris Maglione c31aa68fb4 Bug 1535617: Part 2 - Clear weak references for most cycle collected objects on unlink. r=mccr8
This covers most cycle collected objects which support weak references, but
not the ones which inherit from a cycle collected class and don't do any cycle
collection on their own.

Differential Revision: https://phabricator.services.mozilla.com/D63962

--HG--
extra : moz-landing-system : lando
2020-02-25 19:44:39 +00:00
Simon Giesecke 321844c42a Bug 1613985 - Use default for equivalent-to-default constructors/destructors in dom/commandhandler. r=smaug
Depends on D62571

Differential Revision: https://phabricator.services.mozilla.com/D62572

--HG--
extra : moz-landing-system : lando
2020-02-12 13:25:57 +00:00
Eric Rahm 78ee6675cf Bug 1606187 - Part 2b: Update users of nsClassHashtable to handle UniquePtr differences r=KrisWright,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D59042

--HG--
extra : moz-landing-system : lando
2020-01-13 19:18:56 +00:00
Gabriele Svelto ace6d1063f Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55442

--HG--
extra : moz-landing-system : lando
2019-12-06 09:24:56 +00:00
Dorel Luca a381d5c96d Backed out changeset f6e53d1c6518 (bug 1600545) for Android build bustage. CLOSED TREE 2019-12-04 17:32:27 +02:00
Gabriele Svelto bc9290f767 Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55442

--HG--
extra : moz-landing-system : lando
2019-12-04 15:01:19 +00:00
Emilio Cobos Álvarez 3abaf523d8 Bug 1599843 - nsCommandManager::CommandStatusChanged is infallible. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D54980

--HG--
extra : moz-landing-system : lando
2019-11-28 02:22:29 +00:00
Sebastian Hengst 0341151d63 Bug 1594981 - update Core::DOM* and Core::Storage* bugzilla product and component meta data in moz.build files after reorganization in bug 1594717. r=annevk
Differential Revision: https://phabricator.services.mozilla.com/D52345

--HG--
extra : moz-landing-system : lando
2019-11-08 12:17:57 +00:00
Gabriele Svelto 10d41866a5 Bug 1585156 - Remove useless inclusions of nsIDOMWindow.h and nsIDOMWindowUtils.h r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D47678

--HG--
extra : moz-landing-system : lando
2019-09-30 22:06:47 +00:00
Andrew McCreight c749e75350 Bug 1574627 - Fix some "disbaled" typos. DONTBUILD r=njn
Differential Revision: https://phabricator.services.mozilla.com/D42376

--HG--
extra : moz-landing-system : lando
2019-08-16 23:23:05 +00:00
Sylvestre Ledru 993c03acb1 Bug 1552795 - Remove all trailing whitespaces in idl files r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D31769

--HG--
extra : moz-landing-system : lando
2019-05-22 22:37:14 +00:00
Boris Zbarsky bc14bd97eb Bug 1550927. Stop using idl [array] for getting supported controller commands. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D30764

--HG--
extra : moz-landing-system : lando
2019-05-21 17:06:06 +00:00
Sebastian Hengst 8cf98c5a84 Bug 1541017 - Update in-tree bugzilla components for geolocation and dom/commandhandler/. r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D25762

--HG--
extra : moz-landing-system : lando
2019-04-02 16:39:03 +00:00
Jorg K f15e0ae0bc Bug 1542352 - Restore zero-argument constructor of nsBaseCommandController. r=bz 2019-04-05 12:55:00 +03:00
Masayuki Nakano 98518a7159 Bug 1540969 - Get rid of nsPICommandUpdater r=bzbarsky
`nsPICommandUpdater` is a scriptable interface, but nobody refers it from JS,
and it's implemented only by `nsCommandManager`.  Therefore, we can get rid
of this interface.

Additionally, `nsCommandManager::Init()` is called only by `nsDocShell`, which
is the only instantiater of the class, and returns error only when given window
is nullptr.  Therefore, we can make the constructor take the window instead.

Differential Revision: https://phabricator.services.mozilla.com/D25729

--HG--
extra : moz-landing-system : lando
2019-04-03 12:53:54 +00:00
Masayuki Nakano ac8ecb5c44 Bug 1540965 - Make nsIControllerContext builtinclass and removes its init() method r=bzbarsky
`nsIControllerContext` isn't implemented with JS even in comm-central nor
BlueGriffon.  Therefore, it can be a builtinclass.

Additionally, it's `init()` returns always `NS_OK`, and always called with
`null` from JS, and always called with an instance from C++.  So that its the
only implementation, `nsBaseCommandController` can have 2 constructors which
does what `Init()` currently does.

Differential Revision: https://phabricator.services.mozilla.com/D25728

--HG--
extra : moz-landing-system : lando
2019-04-03 12:52:56 +00:00
Masayuki Nakano 4204b59128 Bug 1540963 - Make nsIControllerCommandTable builtinclass and make its users use nsControllerCommandTable directly r=bzbarsky
`nsIControllerCommandTable` isn't implemented with JS even in comm-central nor
BlueGriffon.  Therefore, we can make it a builtinclass.

Additionally, it's inherited only by nsControllerCommandTable.  So, all users
in C++ can treat the concrete class directly.

Differential Revision: https://phabricator.services.mozilla.com/D25727

--HG--
extra : moz-landing-system : lando
2019-04-03 12:52:14 +00:00
Masayuki Nakano 8329e8382e Bug 1540962 - Make nsICommandManager builtinclass and make users use nsCommandManager directly r=bzbarsky
`nsICommandManager` isn't implemented by JS even in comm-central nor
BlueGriffon.  Therefore, we can make it a builtinclass.

Additionally, this patch makes all users in C++ use `nsCommandManager` which is
the only implementation of `nsICommandManager`.  This avoids QI from
`nsICommandManager` to `nsPICommandUpdater`.

Differential Revision: https://phabricator.services.mozilla.com/D25726

--HG--
extra : moz-landing-system : lando
2019-04-03 12:51:38 +00:00
Boris Zbarsky 6d1f77b386 Bug 1534370 part 2. Annotate doCommand as MOZ_CAN_RUN_SCRIPT. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D23041

--HG--
extra : moz-landing-system : lando
2019-03-12 01:57:42 +00:00
Boris Zbarsky ccfb4f16b1 Bug 1534370 part 1. Annotate doCommandWithParams as MOZ_CAN_RUN_SCRIPT. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D23036

--HG--
extra : moz-landing-system : lando
2019-03-13 00:43:48 +00:00
Ehsan Akhgari e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Gabriele Svelto 266ef73c96 Bug 1503207 - Remove nsWeakPtr.h and cleanup all files including weak reference-related headers r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D10251

--HG--
extra : moz-landing-system : lando
2018-10-31 20:39:03 +00:00
Nathan Froyd e7b3b3140d Bug 1415980 - make hash keys movable and not copyable; r=erahm
Everything that goes in a PLDHashtable (and its derivatives, like
nsTHashtable) needs to inherit from PLDHashEntryHdr. But through a lack
of enforcement, copy constructors for these derived classes didn't
explicitly invoke the copy constructor for PLDHashEntryHdr (and the
compiler didn't invoke the copy constructor for us). Instead,
PLDHashTable explicitly copied around the bits that the copy constructor
would have.

The current setup has two problems:

1) Derived classes should be using move construction, not copy
   construction, since anything that's shuffling hash table keys/entries
   around will be using move construction.

2) Derived classes should take responsibility for transferring bits of
   superclass state around, and not rely on something else to handle that.

The second point is not a huge problem for PLDHashTable (PLDHashTable
only has to copy PLDHashEntryHdr's bits in a single place), but future
hash table implementations that might move entries around more
aggressively would have to insert compensation code all over the
place. Additionally, if moving entries is implemented via memcpy (which
is quite common), PLDHashTable copying around bits *again* is
inefficient.

Let's fix all these problems in one go, by:

1) Explicitly declaring the set of constructors that PLDHashEntryHdr
   implements (and does not implement). In particular, the copy
   constructor is deleted, so any derived classes that attempt to make
   themselves copyable will be detected at compile time: the compiler
   will complain that the superclass type is not copyable.

This change on its own will result in many compiler errors, so...

2) Change any derived classes to implement move constructors instead of
   copy constructors. Note that some of these move constructors are,
   strictly speaking, unnecessary, since the relevant classes are moved
   via memcpy in nsTHashtable and its derivatives.
2018-09-20 11:20:36 -04:00
Ehsan Akhgari 9fe0e0670a Bug 1491605 - Remove nsIControllerCommandGroup because it is dead code; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D5965
2018-09-17 09:54:04 -04:00
Ehsan Akhgari 743c23d1d0 Bug 1491588 - Remove the XPCOM registration for nsCommandParams; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D5959
2018-09-17 09:54:00 -04:00
Ehsan Akhgari 85826ab00c Bug 1489790 - Part 12: Refactor the common code out of the controller/commandtable constructor functions; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D5367
2018-09-11 09:58:33 -04:00
Ehsan Akhgari 751c62d2ae Bug 1489790 - Part 10: Remove the XPCOM component registration for @mozilla.org/editor/editordocstatecontroller;1; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D5365
2018-09-11 09:58:33 -04:00
Ehsan Akhgari f3142db64e Bug 1489790 - Part 9: Remove the XPCOM component registration for @mozilla.org/editor/htmleditorcontroller;1; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D5364
2018-09-11 09:58:33 -04:00
Ehsan Akhgari 65f44ebf27 Bug 1489790 - Part 8: Remove the XPCOM component registration for @mozilla.org/editor/editorcontroller;1; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D5363
2018-09-11 09:58:33 -04:00
Ehsan Akhgari c9bfa076d5 Bug 1489790 - Part 7: Remove the XPCOM component registration for @mozilla.org/editor/editingcontroller;1; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D5362
2018-09-11 09:58:33 -04:00
Ehsan Akhgari 71ac39ed09 Bug 1489790 - Part 5: Remove the XPCOM component registration for @mozilla.org/dom/window-controller;1; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D5360
2018-09-11 09:58:33 -04:00
Ehsan Akhgari 7713f1232f Bug 1489790 - Part 4: Remove the XPCOM component registration for NS_EDITINGCOMMANDTABLE_CID; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D5359
2018-09-11 09:58:33 -04:00
Ehsan Akhgari bded29559c Bug 1489790 - Part 3: Remove the XPCOM component registration for NS_EDITORCOMMANDTABLE_CID; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D5358
2018-09-11 09:58:33 -04:00
Ehsan Akhgari 2740ea8b35 Bug 1489790 - Part 2: Remove the XPCOM component registration for NS_WINDOWCOMMANDTABLE_CID; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D5357
2018-09-11 09:58:33 -04:00
Ehsan Akhgari 554d3d7b44 Bug 1489790 - Part 1: Remove the XPCOM component registration for nsControllerCommandTable as well as kHTMLEditorCommandTableCID and kHTMLEditorDocStateCommandTableCID; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D5356
2018-09-11 09:58:33 -04:00
Ehsan Akhgari b26b734898 Bug 1488112 - Remove the XPCOM component registration for nsBaseCommandController; r=qdot
Differential Revision: https://phabricator.services.mozilla.com/D4835
2018-09-04 15:03:22 -04:00
Ehsan Akhgari d37a149353 Bug 1488111 - Remove the XPCOM component registration for nsCommandManager; r=qdot
Differential Revision: https://phabricator.services.mozilla.com/D4834
2018-09-04 15:03:22 -04:00
Kris Maglione 2dee0aae3c Bug 1484496: Part 4b - Add intrinsic type information to most nsSimpleEnumerators. r=froydnj
This allows JS callers to automatically get the correct types during
interation, without having to explicitly specify them.

Differential Revision: https://phabricator.services.mozilla.com/D3728

--HG--
extra : rebase_source : b708f382d8ea571d199c669bfed5b5a7ca9ffac4
extra : histedit_source : 7df6feb82088c8a5ca45dc28fe4d2b852c177fee
2018-08-18 21:06:32 -07:00
Kris Maglione 65c28aa0ad Bug 1484496: Part 2 - Add common base class for all nsISimpleEnumerator implementations. r=froydnj
In order to allow JS callers to use nsISimpleEnumerator instances with the JS
iteration protocol, we'll need to additional methods to every instance. Since
we currently have a large number of unrelated implementations, it would be
best if they could share the same implementation for the JS portion of the
protocol.

This patch adds a stub nsSimpleEnumerator base class, and updates all existing
implementations to inherit from it. A follow-up will add a new base interface
to this class, and implement the additional functionality required for JS
iteration.

Differential Revision: https://phabricator.services.mozilla.com/D3725

--HG--
extra : rebase_source : ad66d7b266856d5a750c772e4710679fab9434b1
extra : histedit_source : a83ebffbf2f0b191ba7de9007f73def6b9a955b8
2018-08-18 14:22:47 -07:00
Masayuki Nakano 5c3723acb2 Bug 1475461 - part 2: Make callers of PLDHashTable::Search() const methods if possible r=Ehsan
Some callers of PLDHashTable::Search() use const_cast, some others are not
const methods due to non-const PLDHashTable::Search().

This patch removes const_cast from the former and mark some methods of the
latter const.

MozReview-Commit-ID: C8ayoi7mXc1

--HG--
extra : rebase_source : 2cba0339756e3278ba6e5f0e8a11e68217a61d34
2018-07-13 19:01:53 +09:00
Masayuki Nakano bf9dea1dda Bug 1450882 - part 3: Create non-virtual methods to nsCommandParams and expose its header r=Ehsan
nsCommandParams is used internally but accessed via nsICommandParams.  For
such internal users, nsCommandParams should have non-virtual methods to
get/set values.

The new method names are similar to Preferences API for consistency with it.

MozReview-Commit-ID: FJwWMFzV9w

--HG--
extra : rebase_source : 649990ba827cd14503fd46dd647452d06acf6bf0
2018-07-10 18:48:43 +09:00
Masayuki Nakano 5a2332692a Bug 1450882 - part 2: Make nsICommandParams::GetCStringValue() and nsICommandParams::SetCStringValue() treat nsACString instead of char r=Ehsan
nsICommandParams::GetCStringValue() and nsICommandParams::SetCStringValue()
treat char.  However, this makes their callers complicated.  So, they should
be rewritten as treating nsACString.

MozReview-Commit-ID: DWO9veSyzyG

--HG--
extra : rebase_source : fbea13f6d7116ea1887434c0842b7768a7dc59ec
2018-07-10 18:04:46 +09:00
Masayuki Nakano f91fdd906b Bug 1450882 - part 1: Make nsICommandParams builtinclass r=Ehsan
nsICommandParams is not implemented with JS.  Therefore, we can make it
builtinclass.

MozReview-Commit-ID: Gutw79akyaJ

--HG--
extra : rebase_source : ef1093a82e74679c5a0be1163c602847aa2d8bda
2018-07-10 16:50:44 +09:00
Andi-Bogdan Postelnicu 88cc63910d Bug 1453795 - DOM - Initialize member fields in classes/ structures. r=peterv
--HG--
extra : rebase_source : 249fc26e50bded4e94f5effa4308af0f1e54b908
2018-06-16 17:21:46 +03:00
Chris Peterson 71422dcaa9 Bug 1457813 - Part 2: Replace non-asserting NS_PRECONDITIONs with MOZ_ASSERTs. r=froydnj
s/NS_PRECONDITION/MOZ_ASSERT/ and reindent

MozReview-Commit-ID: KuUsnVe2h8L

--HG--
extra : source : c14655ab3df2c9b1465dd8102b9d25683359a37b
2018-04-28 12:50:58 -07:00
Sebastian Hengst 0819f35e51 Backed out 4 changesets (bug 525063) on request from Andi. a=backout
Backed out changeset 516c4fb1e4b8 (bug 525063)
Backed out changeset 6ff8aaef2866 (bug 525063)
Backed out changeset bf13e4103150 (bug 525063)
Backed out changeset d7d2f08e051c (bug 525063)
2018-04-13 16:01:28 +03:00
Tristan Bourvon a3a77c0312 Bug 525063 - Initialize uninitialized class attributes in m-c. r=ehsan 2018-04-10 21:11:02 +02:00
Masayuki Nakano 4ce89d8f61 Bug 1369072 - part3: nsXBLPrototypeHandler::DispatchXBLCommand() should use controller of visible window r=smaug
With previous change, KeyboardEvent is dispatched even when invisible window
has focus.  However, nsRootWindow::GetControllerForCommand() returns controller
for focused window even when the window is invisible because it uses
nsFocusManager::GetFocusedDescendant() to retrieve focused window.

Perhaps, we can assume that users won't expect to do something with invisible
window when they type some keys.  Then, nsRootWindow::GetControllerForCommand()
should return controller for visible ancestor window if focused window is
invisible.

This patch makes nsFocusManager::GetFocusedDescendant() can return only visible
descendants.  However, it already has a bool argument.  Therefore, it should
have a flag instead of adding new flag.  Most changes of this patch is replacing
its callers.

Then, nsRootWindow::GetControllerForCommand() and nsRootWindow::GetControllers()
should have a bool flag if it should return controller(s) for visible window.
This patch adds a bool flag for it.  Fortunately, the interface isn't scriptable.

Finally, this patch makes nsXBLPrototypeHandler::DispatchXBLCommand() and
EventStateManager::DoContentCommandEvent() retrieve controller for visible
window since they are always handles user input.

MozReview-Commit-ID: GygttTHuKRm

--HG--
extra : rebase_source : 1341273c4606298cb9b890b9312d9f5c8a75d144
2017-09-07 22:54:49 +09:00
Mats Palmgren 966b2d65f8 Bug 1372268 - Use LookupForAdd instead of Get+Put to avoid unnecessary hashtable lookups. r=froydnj
MozReview-Commit-ID: 1WVLTschGsj
2017-06-14 16:11:22 +02:00