Commit Graph

121 Commits

Author SHA1 Message Date
Mark Banner
ccd88e40ed Bug 1371679 - Use skipDescendantsOnItemRemoval in nsNavHistoryResult to improve performance when deleting bookmark folders. r=mak
MozReview-Commit-ID: FaotgKVaEmH
2017-08-01 12:40:40 +01:00
Nicholas Nethercote
8b5bdf0867 Bug 1380227 - Avoid many UTF16toUTF8 and UTF8toUTF16 conversions in nsStringBundle. r=emk.
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.)
2017-07-12 15:13:37 +10:00
MilindL
1dd6c0123c Bug 1107364 - remove findNodeByDetails and maintain a map to fetch a node by details speedily, r=mak
This patch removes the interface/header/implementation.

This adds a Map to PlacesTreeView to maintain the relation between node
details and the nodes, based on changes in `this._rows` or on
node details changed events. The Map exists from node details
to nodes (not rows).

MozReview-Commit-ID: EUNiXNIB5rN
2017-06-08 20:51:51 +05:30
milindl
9c3cb28f03 Bug 1368754 - Change NodeHistoryDetailsChanged and NodeURIChanged to be called with old time,access count and uri, r=mak
Update interface and all instances where the method is called
to be called with the old values, since the new values are already
there as a part of the node, and thus redundant.

MozReview-Commit-ID: 5pcfJbg9tej
2017-05-30 23:46:59 +05:30
Marco Bonardo
c536e58644 Bug 977177 - Update favicons API consumers. r=adw
Updates consumers to the new behavior.
Some consumers are changed to use  the "page-icon:" protocol, since it's not
trivial to join the icons table and get a single result out of it. In most cases
the join would return multiple results since a page can have multiple icon payloads.
These consumers for now will return the biggest payload, bug 1347532 will fix
some of them to properly pass a #size=NN fragment.
Note that, even before, these were just "moz-anno:favicon:" uris, and the
payload had to be fetched from the database.
Some other consumers for now just fallback to the largest payload, by passing 0
to GetFaviconURLForPage.

The favicon optimization still happens on the main-thread, bug 1346139 will
handle that problem.

Most of the changes involve handling the modified IconData objects, that now
retain an array of payloads, rather than just one. But note that .ico files are
not yet split into single frames, due to imagelib missing APIs that will be handled
in bug 1337402.
The other changes involve fixing queries to properly join with the new tables.

Finally, note that thanks to the FOREIGN KEYS support, removing from moz_icons or
moz_pages_w_icons will also remove relations from moz_icons_to_pages.

The system only supports square icons, so icons are resized based on their larger side.

This doesn't include new tests, those will be in a following changeset.

MozReview-Commit-ID: JUkpquhpS8y
2016-09-28 16:14:30 +02:00
Gijs Kruitbosch
b381e8453b Bug 1341097 - part 3: don't dispatch oodles of titlechanged notifications for new history entries, r=mak
MozReview-Commit-ID: 7jHOcCQ5ZBb
2017-02-27 18:26:21 +00:00
Tom Tromey
48da5b7de4 Bug 1060419 - remove unneeded includes of prprf.h, r=froydnj
MozReview-Commit-ID: JifhpA3oOeH
2016-12-09 10:00:01 -10:00
Tom Schuster
a0c06fc064 Bug 1296401 - Implement simple chrome.bookmarks events, r=mak
MozReview-Commit-ID: IDAyDdBh9C4
2016-08-17 10:22:10 -04:00
Wes Kocher
acd22e8efa Merge inbound to m-c a=merge 2016-09-07 17:54:24 -07:00
Kit Cambridge
f6bc193610 Bug 1299338 - Replace ignoreAll with change source checks in the Sync bookmarks engine. r=markh
MozReview-Commit-ID: DAsTlQbFanK
2016-09-06 08:36:21 -07:00
Michael Layzell
d94ebb76e8 Bug 1301127 - Make nsNavHistoryFolderResultNode QueryInterface to mozIStorageStatementCallback, r=smaug
MozReview-Commit-ID: 5CPNIz3w4Iy
2016-09-07 14:46:27 -04:00
Nicholas Nethercote
887efe04d5 Bug 1299727 - Rename NS_WARN_IF_FALSE as NS_WARNING_ASSERTION. r=erahm.
The new name makes the sense of the condition much clearer. E.g. compare:

  NS_WARN_IF_FALSE(!rv.Failed());

with:

  NS_WARNING_ASSERTION(!rv.Failed());

The new name also makes it clearer that it only has effect in debug builds,
because that's standard for assertions.
2016-09-01 15:01:16 +10:00
Kit Cambridge
c9599d3a5e Bug 1285408 - Add change source tracking for bookmarks. r=markh
MozReview-Commit-ID: I6IWhMWR1bG
2016-08-11 13:13:22 -07:00
Nathan Froyd
539682a8fe Bug 1292301 - reduce reference-counting in Places; r=adw
By using nsCOMArray::Forget, we can pass the references we hold in an
nsCOMArray directly to the XPCOM caller, without having to go through an
extra cycle of AddRef/Release calls.  This way should be slightly faster
and it also results in smaller code.  Notice that we don't have to worry
about removing the OOM check in the places that use Forget(), because we
were already using moz_xmalloc to allocate the outparam array, and
moz_xmalloc aborts the process on OOM, just as Forget() does.

The nsNavHistoryFolderResultNode::GetQueries change is thrown in for fun.
2016-08-05 22:03:44 -04:00
Chris Peterson
6c0f810682 Bug 1277106 - Part 2: Expand MOZ_UTF16() strings to u"" string literals. r=Waldo 2016-07-20 22:03:25 -07:00
Marco Bonardo
8c84a82cf7 Bug 889561 - Reduce the size of places.sqlite by removing the url unique index from moz_places. r=adw
MozReview-Commit-ID: 2kxaXnUYIwT
2016-06-29 14:47:36 +02:00
Carsten "Tomcat" Book
7817a7f352 Backed out changeset ceff61c9fc5a (bug 889561) for frequent testfailures on pgo in /bookmarks/test_ 2016-06-29 13:54:51 +02:00
Marco Bonardo
81cc21d652 Bug 889561 - Reduce the size of places.sqlite by removing the url unique index from moz_places. r=adw
MozReview-Commit-ID: 2kxaXnUYIwT
2016-06-20 13:22:10 +02:00
Marco Bonardo
9370235d96 Bug 1277235 - add typed and visitCount to onVisit. r=adw
MozReview-Commit-ID: 3XfBCiOgyAu
2016-06-01 16:42:15 +02:00
Kris Maglione
bc973f9b6a Bug 1269398: Add visitType, visitId, and fromVisitId fields to history visit query results. r=mak
MozReview-Commit-ID: BCsztVsCH98
2016-05-13 13:47:24 -07:00
Kyle Huey
20d0dc7286 Bug 1259294: Part 2 - Use MOZ_ALWAYS_SUCCEEDS. r=froydnj 2016-03-28 10:28:15 -07:00
Marco Bonardo
a1da727ca8 Bug 1240013 - Crash in nsNavBookmarks::OnVisit by setting long location.hash. r=Yoric 2016-01-26 18:43:53 +01:00
Chris Peterson
58c673cb52 Bug 1236324 - Annotate intentional switch fallthroughs to suppress -Wimplicit-fallthrough warnings in toolkit/components/places/. r=mak
toolkit/components/places/Database.cpp:182:5: [-Wimplicit-fallthrough] unannotated fall-through between switch labels
toolkit/components/places/nsAnnotationService.cpp:215:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
toolkit/components/places/nsAnnotationService.cpp:227:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
toolkit/components/places/nsAnnotationService.cpp:297:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
toolkit/components/places/nsAnnotationService.cpp:309:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
toolkit/components/places/nsNavHistoryResult.cpp:2420:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
toolkit/components/places/nsNavHistoryResult.cpp:2446:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
toolkit/components/places/nsNavHistoryResult.cpp:2878:7 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
2015-11-22 13:59:54 -08:00
Nicholas Nethercote
c0e2d279a2 Bug 1187138 (part 4) - Replace nsBaseHashtable::Enumerate() calls in toolkit/ with iterators. r=froydnj. 2015-11-24 16:53:46 -08:00
Nathan Froyd
4e6d8f6705 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi
2015-10-18 01:24:48 -04:00
Marco Bonardo
bd650f47ab Bug 1150678 - Part 1: notify the old value in onItemChanged (only URI changes for now). r=ttaubert 2015-08-05 23:10:11 +02:00
Wes Kocher
37bf9a868e Backed out 2 changesets (bug 1150678) for xpcshell bustage
Backed out changeset 1c24d237080c (bug 1150678)
Backed out changeset 9f1f1e11ca37 (bug 1150678)
2015-08-05 16:24:58 -07:00
Marco Bonardo
1c0eadb6f7 Bug 1150678 - Part 1: notify the old value in onItemChanged (only URI changes for now). r=ttaubert 2015-08-05 23:10:11 +02:00
Andrew McCreight
1ac060e051 Bug 1189369, part 5 - Use the nice cycle collector macro template for nsNavHistoryResult. r=mak
Also, fix up the CC template so it works.
2015-08-04 13:55:01 -07:00
Andrew McCreight
706d040db4 Bug 1189369, part 1 - Remove trailing whitespace from some nsNavHistory* files. r=mak 2015-08-04 13:55:01 -07:00
Andrew McCreight
343830ddd2 Bug 1074416 - Don't AddRef or Release nav history result observers during CC traversal. r=smaug
Doing an AddRef or Release of a cycle collected object during CC
traversal can cause leaks. traverseResultObservers does this in two
places. First, it accidentally copies the array that is passed
in. Second, the GetValue() method that is being implicitly called in
the line with |aObservers.ElementAt(i);| does a QI.

This patch fixes the former problem by passing a reference. It fixes
the latter problem by returning the raw underlying pointer held by the
nsMaybeWeakPtrArray, which is what the CC wants anyways, because it
does not care about weak referents.
2015-07-29 20:36:00 -04:00
mchenryc
d0d004ee8b Bug 1163447 - Allow Places tree selectItems() to recurse into folder-shortcuts. r=mak 2015-06-04 13:02:00 -07:00
Mohamed Waleed
33af67854d Bug 1062894 - Avoid batching tag changes if number of changed tags is low. r=mak, ttaubert 2015-04-27 21:24:21 +02:00
Denis Volk
1872a62df8 Bug 1095098 - move do_QueryObject templates into their own header; r=froydnj 2015-04-15 12:47:03 -04:00
Mike Hommey
338d086ead Bug 1134920 - Use moz_xmalloc/moz_xrealloc/free instead of nsMemory::Alloc/Realloc/Free. r=nfroyd 2015-04-01 13:51:45 +09:00
Nathan Froyd
26a0b56c7a Bug 1142503 - don't use QueryInterface when the compiler can do the cast for us; r=ehsan
Calling QueryInterface with a statically known IID should typically not
be necessary.  In those cases where it's not, the compiler can do the
cast for us, though we have to supply the reference-counting that
QueryInterface would do.

In passing, several redundant null-checks for the result of |new T| have
been deleted.
2015-03-12 09:43:50 -04:00
Asaf Romano
bba5e8921d Bug 1107308 - Round dateAdded and lastModified values to milliseconds precision in places cpp components. r=mak 2014-12-04 14:09:48 -08:00
Asaf Romano
926ea4a18e Bug 1105866 - Implement folderShorcutNode.targetFolderGuid (guid version of folderShortcutNode.folderItemId). r=mak 2014-12-10 19:03:15 +02:00
Asaf Romano
af9f408732 Bug 1085291 - A bookmark node that is inserted by live-update code is missing bookmarkGuid value. r=mak (Relanding with the test file included this time). 2014-11-25 11:43:26 +02:00
Carsten "Tomcat" Book
4ac659e2c3 Backed out changeset 6db486ed2de1 (bug 1085291) for breaking Builds on a CLOSED TREE 2014-11-25 09:25:11 +01:00
Asaf Romano
b3ed43173e Bug 1085291 - A bookmark node that is inserted by live-update code is missing bookmarkGuid value. r=mak. 2014-11-25 09:06:37 +02:00
Marco Bonardo
77be050825 Bug 1095069 - Cannot copy or delete bookmarks from search results in library. r=mano 2014-11-13 10:19:19 +01:00
Asaf Romano
fbed712ada Bug 1068671 - folderReadOnly doesn't pertain to bookmarks or results. r=mak 2014-10-14 17:03:28 +03:00
Carsten "Tomcat" Book
720b2367b9 Backed out changeset b30d47d94a85 (bug 1068671) for bc1 test failures 2014-10-01 13:14:06 +02:00
Asaf Romano
ce0d37a700 Bug 1068671 - Remove 'read-only' folders support from places. r=mak 2014-10-01 12:19:06 +03:00
Nicholas Nethercote
663b82ea3b Bug 1050009 - Initialize pldhash tables with a length, not a capacity. r=roc.
* * *
imported patch rm-dummy-params
2014-08-06 06:31:21 -07:00
Daniel Holbert
4603496899 Bug 992670 part 3 - Comment out failing assertion, with reference to followup bug. r=mak 2014-08-06 22:40:37 -07:00
Birunthan Mohanathas
27d6126b64 Bug 992670 part 2 - Make all child insertions/removals non-temporary in nsNavHistoryContainerResultNode. r=mak 2014-08-06 22:40:36 -07:00
Birunthan Mohanathas
7cf1e3a5e4 Bug 992670 part 1 - Fix always true assertion condition in nsNavHistoryResult.cpp. r=mak 2014-08-06 22:40:35 -07:00
Hiroyuki Ikezoe
0dfebbe786 Bug 1010634 - Use Contains instead of NoIndex to avoid relocation error. r=briansmith 2014-06-01 18:30:00 -04:00