Commit Graph

63 Commits

Author SHA1 Message Date
Sylvestre Ledru
e5a134f73a Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset
2018-11-30 11:46:48 +01:00
Boris Zbarsky
951cf5c0c5 Bug 1507540 part 6. Make nsIVariant's "type" a notxpcom attribute. r=froydnj 2018-11-19 20:20:05 -05:00
Nicholas Nethercote
95b6af20be Bug 1489047 - Remove C++ support for, and testing of, the XPIDL DOMString type. r=nika 2018-09-06 18:03:18 +10:00
Nicholas Nethercote
cd127441a0 Bug 1486690 - Remove unnecessary checks after moz_xmalloc() calls. r=glandium
There are surprisingly many of them.

(Plus a couple of unnecessary checks after `new` calls that were nearby.)
2018-08-28 15:56:01 +10:00
Mark Banner
c8678bad41 Bug 1387446 - Remove nsIAnnotationService.getAnnotationsWithName. r=lina
Depends on D4062

Differential Revision: https://phabricator.services.mozilla.com/D4063
2018-08-23 17:12:46 +00:00
Mark Banner
5861cadd7d Bug 1480049 - Remove nsIAnnotationService::getPageAnnotation. r=mak
This changes the meta data cache in DownloadHistory to store a copy of the meta data throughout the session, to avoid the need for async lookups when updating the UI.

Differential Revision: https://phabricator.services.mozilla.com/D2597
2018-08-23 09:59:50 +00:00
Mark Banner
ec2d7fc44f Bug 1479722 - Remove nsIAnnotationService::setPageAnnotation and removePageAnnotation. r=mak
Depends on D2582

Differential Revision: https://phabricator.services.mozilla.com/D2583
2018-08-01 09:47:24 +00:00
Mark Banner
5c90a2398b Bug 1479764 - Remove nsIAnnotationObserver and annotation notifications. r=mak,lina
MozReview-Commit-ID: I9nNefvgch9

Differential Revision: https://phabricator.services.mozilla.com/D2565
2018-07-31 21:34:42 +00:00
Mark Banner
6dd0e6e414 Bug 1479053 - Remove unused/unnecessary methods from nsIAnnotationService. r=mak
MozReview-Commit-ID: I9qq71RLXYH

Depends on D2473

Differential Revision: https://phabricator.services.mozilla.com/D2474
2018-07-31 11:40:55 +00:00
Mark Banner
252f81d228 Bug 1479053 - Remove nsIAnnotationObserver::onPageAnnotationSet/Removed. r=mak
MozReview-Commit-ID: JkUhtuV1fvU

Differential Revision: https://phabricator.services.mozilla.com/D2473
2018-07-31 11:40:52 +00:00
Marco Bonardo
f164e2cd33 Bug 1475558 - Remove annotations expiration policies to speed up expiration and removals. r=Standard8
Remove expiration policies from annotations, keeping only EXPIRE_NEVER. Remove all the code handling expiration of those. Fix tests to pass proper arguments.

Differential Revision: https://phabricator.services.mozilla.com/D2128
2018-07-25 16:40:30 +00:00
Mark Banner
6fe4c8734c Bug 1475245 - Remove some unused/test-only functions on nsIAnnotationService. r=mak
MozReview-Commit-ID: LIIvA0eCpDI

Differential Revision: https://phabricator.services.mozilla.com/D2098
2018-07-12 14:48:17 +00:00
Mark Banner
9055c0fac7 Bug 1450223 - Remove unnecessary synchronous annotation lookups from the places context menu. r=mak
MozReview-Commit-ID: Ck2eaeVAjXs
2018-03-29 15:49:39 +01:00
Mark Banner
0d7a6a636a Bug 1047819 - Remove unused nsIAnnotationService::copyPageAnnotations/copyItemAnnotations. r=mak
MozReview-Commit-ID: nIsuDReLoZ
2018-03-29 10:24:39 +01:00
Mark Banner
756e51bc89 Bug 1047819 - Add an extra parameter to nsIAnnotationService.getItemAnnotationInfo to avoid an extra sync database lookup in PlacesUtils.getAnnotationsForItem. r=mak
MozReview-Commit-ID: FXncB1TRFXw
2018-03-28 21:05:27 +01:00
Kit Cambridge
8767b96115 Bug 1417101 - Remove the annotation observer from the bookmarks service. r=mak
Since `SetItemAnnotation` already queries `moz_bookmarks`, we can fetch
and pass the changed bookmark's info directly to
`nsNavBookmarks::NotifyItemChanged`, without going through the anno
observer.

This patch refactors the internal `Set*` methods to receive an optional
`BookmarkData` for item annotation changes, and fire `OnItemChanged`
notifications after notifying anno observers. `NotifyItemChanged` also
updates the bookmark's last modified time if requested.

MozReview-Commit-ID: Hz5qiOmAjsD
2017-11-16 16:49:03 -08:00
Noemi Erli
3f6bbbe3de Backed out changeset e0eab399db59 (bug 1417101) for Static errors in toolkit/components/places/target r=backout on a CLOSED TREE 2017-11-18 02:48:42 +02:00
Kit Cambridge
8c11514fef Bug 1417101 - Remove the annotation observer from the bookmarks service. r=mak
Since `SetItemAnnotation` already queries `moz_bookmarks`, we can fetch
and pass the changed bookmark's info directly to
`nsNavBookmarks::NotifyItemChanged`, without going through the anno
observer.

This patch refactors the internal `Set*` methods to pass an optional
`BookmarkData` from `SetItemAnnotation`, and fire `OnItemChanged`
notifications after notifying anno observers. `NotifyItemChanged` also
updates the bookmark's last modified time if requested.

MozReview-Commit-ID: Hz5qiOmAjsD
2017-11-16 16:49:03 -08:00
Mark Banner
f3d066d2c6 Bug 1405317 - When inserting trees of bookmarks, avoid updating the last modified date when marking annotations. r=mak
MozReview-Commit-ID: Ik8DKwtiXoM
2017-10-03 21:18:10 +01: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
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
Kit Cambridge
1817f9012b Bug 1314084 - Implement nsIAnnotationService::getObservers. r=mak
MozReview-Commit-ID: 42y8d1fbfJO
2016-10-31 11:13:14 -07: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
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
Nathan Froyd
023e3d5c3f Bug 1153267 - part 1 - use smart-pointer .forget() instead of NS_ADDREF+assign; r=ehsan 2015-03-31 10:03:49 -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
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
Benoit Jacob
029e0e533d Bug 1028588 - Fix dangerous public destructors in toolkit/ - r=ehsan 2014-06-23 18:40:02 -04:00
Victor Porof
298ca2ed1b Bug 1007203 - Always add categories when pushing to the pseudostack, r=djvj 2014-05-23 17:12:29 -04:00
Birunthan Mohanathas
eeb9aaaa94 Bug 900908 - Part 3: Change uses of numbered macros in nsIClassInfoImpl.h/nsISupportsImpl.h to the variadic variants. r=froydnj 2014-04-27 03:06:00 -04:00
Ehsan Akhgari
68bfe70f09 Bug 927728 - Part 1: Replace PRUnichar with char16_t; r=roc
This patch was automatically generated by the following script:

#!/bin/bash
# Command to convert PRUnichar to char16_t

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*modules/libmar*" \
       ! -wholename "*/.hg*" \
       ! -wholename "obj-ff-dbg*" \
       ! -name prtypes.h \
       ! -name Char16.h \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert PRUnichar char16_t
2014-01-04 10:02:17 -05:00
Birunthan Mohanathas
88a0348924 Bug 713082 - Part 2: Rename Util.h to ArrayUtils.h. r=Waldo 2013-12-08 21:52:54 -05:00
Asaf Romano
d22bebd8c5 Bug 895839 - Remove support for binary annotations. r=mak. sr=gavin. 2013-08-03 14:06:47 +03:00
Benoit Girard
f4b3710284 Bug 851611 - Part 3: Rename headers. r=jrmuizel 2013-03-18 15:25:50 +01:00
Benoit Girard
4146042cfd Bug 851611 - Part 2: Update profiler calls. r=jrmuizel 2013-03-16 00:47:02 -04:00
Ed Morley
90c9bf415e Backed out changeset c75481a07302 (bug 851611) 2013-03-18 14:10:35 +00:00
Ed Morley
627fcd7895 Backed out changeset d195190adc48 (bug 851611) 2013-03-18 14:10:30 +00:00
Benoit Girard
0b880319f3 Bug 851611 - Part 3: Rename headers. r=jrmuizel 2013-03-18 14:41:02 +01:00
Benoit Girard
6d0dfa5b89 Bug 851611 - Part 2: Update profiler calls. r=jrmuizel 2013-03-16 00:47:02 -04:00
Marco Bonardo
483ca518f6 Bug 838349 - Fix bogus use of assertions in Places
r=trivial
2013-02-06 02:37:07 +01:00
Ehsan Akhgari
5ab06de081 Bug 817477 - Remove support for global private browsing mode; r=jdm,glandium 2013-01-29 13:12:13 -05:00
Marco Bonardo
90839931b0 Bug 822710 (part 1) - Implement a new getAnnotationsHavingName method.
r=Mano sr=gavin
2012-12-21 15:19:04 +01:00
Josh Matthews
e77a3bf92a Bug 723005 - Remove all checks for global privacy status in history-related code, and add them to callers when appropriate. r=mak sr=gavin 2012-02-18 01:40:10 -05:00
Randell Jesup
3b4961b603 Bug 773151: Convert nsCAutoString->nsAutoCString CLOSED TREE r=bsmedberg 2012-09-01 22:35:17 -04:00
Ehsan Akhgari
243c878d26 Bug 579517 - Part 1: Automated conversion of NSPR numeric types to stdint types in Gecko; r=bsmedberg
This patch was generated by a script.  Here's the source of the script for
future reference:

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "obj-ff-dbg*" \
       ! -name nsXPCOMCID.h \
       ! -name prtypes.h \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert PRInt8 int8_t
convert PRUint8 uint8_t
convert PRInt16 int16_t
convert PRUint16 uint16_t
convert PRInt32 int32_t
convert PRUint32 uint32_t
convert PRInt64 int64_t
convert PRUint64 uint64_t

convert PRIntn int
convert PRUintn unsigned

convert PRSize size_t

convert PROffset32 int32_t
convert PROffset64 int64_t

convert PRPtrdiff ptrdiff_t

convert PRFloat64 double
2012-08-22 11:56:38 -04:00
Aryeh Gregor
8b4a23fc4c Bug 777292 part 2 - Change all nsnull to nullptr 2012-07-30 17:20:58 +03:00