Commit Graph

127 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
Marco Bonardo
c3c9c995c4 Bug 1380302 - Fix -Wmaybe-uninitialized warnings in Places. r=adw
MozReview-Commit-ID: 2HxDMhYzaib
2017-07-12 21:29:58 +02:00
Kit Cambridge
4a92ee05e5 Bug 1379412 - Don't fall back to the history visit title when fetching folder children. r=mak
MozReview-Commit-ID: 3ynWSLAPDZ3
2017-07-10 11:27:39 -07:00
Marco Bonardo
2e63b9b6bb Bug 1371677 - Delay the database connection in the history service as far as possible. r=adw
Makes initing Places services cheaper, by delaying the connection creation to the first time
it's actually needed.
Same way, delays reading the bookmark roots at the first time they are requested.
Deprecates the concept of lazy observers, since they are no more needed, we can just use addObserver.
Simplifies the startup path: always sends "places-init-complete" (both as a category and a topic) when
the connection starts and adds a "locked" database state when we can't get a working connection.
Makes PlacesCategoriesStarter register for the new category, since it's cheaper than being a bookmarks
observer.
Fixes a couple race conditions in keywords and expiration due to new startup timings.
Removes a test in test_keywords.js that is no more easily feasible, since it'd requires a pre-build
places.sqlite that should be kept up-to-date at every version.

MozReview-Commit-ID: 6ccPUZ651m0
2017-06-09 18:51:09 +02:00
Marco Bonardo
a380c4f53e Bug 1376929 - Fix places-related mochitests in chrome/ for async-transactions. r=standard8
MozReview-Commit-ID: ILrvOGzu1zo
2017-07-03 15:46:56 +02:00
Kit Cambridge
6850af47fe Bug 1360872 - Return empty strings for null bookmark titles. r=mak
MozReview-Commit-ID: Dd2sEfYvnBt
2017-06-06 14:37:22 -07:00
Nicholas Nethercote
a58025002f Bug 1375392 - Tweak the PROFILER_LABEL* macros. r=mstange.
This patch makes the following changes to the macros.

- Removes PROFILER_LABEL_FUNC. It's only suitable for use in functions outside
  classes, due to PROFILER_FUNCTION_NAME not getting class names, and it was
  mostly misused.

- Removes PROFILER_FUNCTION_NAME. It's no longer used, and __func__ is
  universally available now anyway.

- Combines the first two string literal arguments of PROFILER_LABEL and
  PROFILER_LABEL_DYNAMIC into a single argument. There was no good reason for
  them to be separate, and it forced a '::' in the label, which isn't always
  appropriate. Also, the meaning of the "name_space" argument was interpreted
  in an interesting variety of ways.

- Adds an "AUTO_" prefix to PROFILER_LABEL and PROFILER_LABEL_DYNAMIC, to make
  it clearer they construct RAII objects rather than just being function calls.
  (I myself have screwed up the scoping because of this in the past.)

- Fills in the 'js::ProfileEntry::Category::' qualifier within the macro, so
  the caller doesn't need to. This makes a *lot* more of the uses fit onto a
  single line.

The patch also makes the following changes to the macro uses (beyond those
required by the changes described above).

- Fixes a bunch of labels that had gotten out of sync with the name of the
  class and/or function that encloses them.

- Removes a useless PROFILER_LABEL use within a trivial scope in
  EventStateManager::DispatchMouseOrPointerEvent(). It clearly wasn't serving
  any useful purpose. It also serves as extra evidence that the AUTO_ prefix is
  a good idea.

- Tweaks DecodePool::SyncRunIf{Preferred,Possible} so that the labelling is
  done within them, instead of at their callsites, because that's a more
  standard way of doing things.
2017-06-22 17:08:53 +10:00
milindl
be4e0db09e Bug 653816 - returning only nontags for GetBookmarkIdsForURI and fixing consumers, r=mak
Most consumers of `GetBookmarkIdsForURI` already don't need tags, the only
consumer which does (`TaggingService`) has been changed to use a separate
database query.

MozReview-Commit-ID: LabjaA6Q0GF
2017-05-30 19:48:17 +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
Marco Bonardo
5de64a180b Bug 1344205 - Remove unsatisfied assertion on database page removals and protect removals from orphaning. r=standard8
Due to the asynchronous behavior of history, it's possible a race condition
causes a page to be used when it was about to be removed.
For example a bookmark to a page could be added between the point where we
decide the page is an orphan, and the point where we actually remove the page.
Notifications in such a case may be improperly ordered, and there is no cheap
way to guarantee we won't notify a removal in such a case.
Since applicable solutions would be too expensive (code and perf wise), for now
just remove the assertion we can't satisfy, and protect removals from possibly
creating unexpected orphans.
Testing this would require a special setup where we can guarantee thread
scheduling order, so for now this comes without a test. Regardless it's
basically only adding safety guards.

MozReview-Commit-ID: KYkaqAv8fCB
2017-03-23 17:51:52 +01: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
e90d95a3f9 Bug 1060419 - make AppendPrintf and nsPrintfCString use Printf.h, r=froydnj
MozReview-Commit-ID: 2E8FoiNxU8L
2016-12-14 09:32:21 -07: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
Edouard Oger
0d75eb845c Bug 1228827 - Sync correctly the bookmark separators positions. r=kitcambridge
MozReview-Commit-ID: 9nvZqIt2Xgu
2017-01-26 17:41:12 -05:00
Mayank Srivastav
14593b25d1 Bug 1329926 - Remove deprecated API getURIForKeyword and updated test cases for PlacesUtils.keywords.fetch(). r=mak 2017-01-16 19:59:19 +05:30
Kit Cambridge
fe81972bcd Bug 1258127 - Update nsNavBookmarksService (C++) to track sync changes. r=mak,rnewman
MozReview-Commit-ID: AV6Uyr2eMtA
2016-11-17 14:50:24 -08:00
Kit Cambridge
7a889a2eee Bug 1302901 - Create a Places mobile bookmarks root. r=mak
MozReview-Commit-ID: IESvIHCM2fK
2016-09-29 13:44:08 -07: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
Thomas Wisniewski
2f1accbc40 Bug 1305202 - Use NullString() more and remove superfluous Truncates(). r=smaug 2016-09-23 21:10:01 -04:00
Kit Cambridge
d56e34a294 Bug 1303405 - Ensure RemoveFolderTransaction::UndoTransaction passes the reinserted GUID to observers. r=mak
MozReview-Commit-ID: 5HpDKEmsjRW
2016-09-16 13:22:47 -07: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
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
4954ae4142 Bug 1277405: Clear Places observers at XPCOM shutdown. r=mak
MozReview-Commit-ID: 6JYMX7TXDLZ
2016-06-01 16:47:34 -07: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
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
a099491825 Bug 1189369, part 2 - Don't implicitly convert nsMaybeWeakPtr to an nsCOMPtr. r=mak
This is only used in a few places, and it obscures what is happening.
2015-08-04 13:55:01 -07:00
Birunthan Mohanathas
a29151dc87 Bug 1182996 - Fix and add missing namespace comments. rs=ehsan
The bulk of this commit was generated by running:

  run-clang-tidy.py \
    -checks='-*,llvm-namespace-comment' \
    -header-filter=^/.../mozilla-central/.* \
    -fix
2015-07-13 08:25:42 -07:00
Eric Rahm
ea4832ad70 Bug 1175249 - Silence warning about possibly slow query to moz_bookmarks. r=dietrich
Add comment ot disable potential slow query warning. The odds that more than one
bookmark for a URI is returned seems pretty low, the odds that there are enough
to warrant an index seems even lower.
2015-06-16 15:24:46 -07:00
Marco Bonardo
56240fe260 Bug 1140395 - Deprecate old keywords API. r=ttaubert 2015-05-05 15:40:09 +02: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
Marco Bonardo
9fe80d5e13 Bug 1125115 - Write a new keywords pseudo-API in PlacesUtils. r=ttaubert 2015-03-20 09:39:25 +01:00
Marco Bonardo
f973c09302 Bug 1125113 - Change the keywords schema associating them with uris. r=ttaubert 2015-03-20 09:39:20 +01:00
Nicholas Nethercote
0247de46d8 Bug 1127201 (attempt 2, part 1) - Replace most NS_ABORT_IF_FALSE calls with MOZ_ASSERT. r=Waldo. 2015-02-09 14:34:50 -08:00
Andrew McCreight
e048a7df33 Back out Bug 1127201 (part 2) for various problems. 2015-02-06 15:04:32 -08:00
Nicholas Nethercote
40ab0270d5 Bug 1127201 (part 2) - Convert all NS_ABORT_IF_FALSE calls to MOZ_ASSERT. r=Waldo. 2015-02-04 20:05:36 -08: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
Marco Bonardo
ffccd508db Backout ce637f8721d3 (bug 1083469) due to failures with old autocomplete enabled. a=bustage on CLOSED TREE 2014-11-27 00:00:23 +01:00
Marco Bonardo
7d56fd62a9 Bug 1083469 - Allow to use old keywords APIs along with Bookmarks.jsm r=mano 2014-11-24 00:51:32 +01:00
Tim Taubert
2e39e718f1 Bug 1083462 - Remove the bookmarks cache r=mak 2014-11-11 17:52:31 +01:00