Commit Graph

204 Commits

Author SHA1 Message Date
Nicholas Nethercote
723f585d9c Bug 1386600 - Change nsIStringBundle methods to return |AString| instead of |wstring|. r=emk,sr=dbaron.
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.
2017-08-04 14:40:52 +10:00
Kartikaya Gupta
14424677af Bug 1384233 - Remove SizePrintfMacros.h. r=froydnj
We have a minimum requirement of VS 2015 for Windows builds, which supports
the z length modifier for format specifiers. So we don't need SizePrintfMacros.h
any more, and can just use %zu and friends directly everywhere.

MozReview-Commit-ID: 6s78RvPFMzv
2017-07-26 16:03:57 -04:00
Marco Bonardo
6dd1b175e4 Bug 1275878 - Part 2: Replace places-will-close-connection notification with a shutdown blocker. r=adw
MozReview-Commit-ID: A2sn2OreX4K
2016-05-19 23:50:27 +02:00
Kit Cambridge
db04d478e3 Bug 1380740 - Remove remaining visit title fallbacks for untitled bookmarks. r=mak
MozReview-Commit-ID: 1f4HMWzxXat
2017-07-13 19:08:40 -07: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
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
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
Sebastian Hengst
abe396c7e4 Backed out changeset c0fd6c0590be (bug 1360872) for unused parentId at toolkit/components/places/Bookmarks.jsm:461. r=backout 2017-06-30 00:16:35 +02:00
Kit Cambridge
b7762eb7c6 Bug 1360872 - Return empty strings for null bookmark titles. r=mak
MozReview-Commit-ID: Dd2sEfYvnBt
2017-06-06 14:37:22 -07:00
Mark Banner
ba4d4411e0 Bug 1119282 - Update most browser/components/places browser mochitests to pass with async Places transations and fix some async transaction issues. r=mak
MozReview-Commit-ID: Lc5oWCx1onJ
2017-06-27 15:08:31 -07:00
Sebastian Hengst
8b43bd5f49 Backed out changeset 5659f6c9a7c5 (bug 1119282) 2017-06-29 04:00:21 +02:00
Mark Banner
eed8ed50c3 Bug 1119282 - Update most browser/components/places browser mochitests to pass with async Places transations and fix some async transaction issues. r=mak
MozReview-Commit-ID: Lc5oWCx1onJ
2017-06-27 15:08:31 -07:00
Mats Palmgren
5cc0bc1086 Bug 1376471 - Just use Put rather than Get+Remove+Put when an entry already exist. r=froydnj
MozReview-Commit-ID: EQDSF4mkQZ3
2017-06-28 01:03:17 +02:00
Bill McCloskey
ce42826bdf Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-26 14:19:58 -07:00
Carsten "Tomcat" Book
238bf154d5 Backed out changeset 4f6302a98ae4 (bug 1372405) 2017-06-21 13:59:26 +02:00
Bill McCloskey
67e8af4720 Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-20 21:44:11 -07:00
Carsten "Tomcat" Book
bbe9441993 Backed out changeset 9846de3bd954 (bug 1372405) 2017-06-20 08:27:02 +02:00
Bill McCloskey
f69608368b Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-19 22:25:47 -07:00
Marco Bonardo
165e65df87 Bug 977177 - Don't expire root domain icons with history, and don't associate pages to them. r=adw
Root domain icons should be retained as far as possible, and only expired when
a domain is removed from the database. We do that through the moz_hosts trigger.
Additionally, since we return root domain icons without the need for a direct
association, we can save a lot of database space and performance by not storing
associations at all for root domain icons.
This has some downsides, since we don't exactly know if the page was really
associated with that root icon or not, but the perf gains are far superior.
Note that we still create associations during migration, since it would be too
expensive to examine every single url to figure out if it's a root domain icon.

MozReview-Commit-ID: 3mlfcOV8ixC
2017-03-30 15:16:41 +02:00
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
fdcc7c5e61 Bug 1306276 - Deprecate History RemovePage and RemovePages. r=standard8
MozReview-Commit-ID: 3NSaXKy1hP3
2017-03-22 12:44:54 +01:00
Gijs Kruitbosch
d20be8849c Bug 1344282 - prep: add a makeGuid method to nsINavHistory, r=mak
MozReview-Commit-ID: JKIjtcqyTzc
2017-03-13 22:22:57 +00: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
Makoto Kato
bf51f8490b Bug 1225696 - Part 2. Use DateTimeFormat instead of dateFormat.properties. r=mak
MozReview-Commit-ID: 9ufUVeppwHk
2017-02-20 14:22:21 +09: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
Wes Kocher
a64f15cdaf Merge inbound to central, a=merge
MozReview-Commit-ID: 4mN7daXzULJ
2017-02-08 16:08:42 -08:00
Mark Banner
fe9a1d4b65 Bug 1336233 - Fix intermittent failures in browser_multi_redirect_frecency.js by ensuring the idle service updates for frecency are ignored. r=mak
MozReview-Commit-ID: L8AgWOAGF9g
2017-02-06 14:16:20 +00:00
Zibi Braniecki
b6f0455ba8 Bug 1335983 - Migrate nsCollation::CreateCollection to use LocaleService::GetAppLocale. r=jfkthame
MozReview-Commit-ID: 5GEnL7Kihpj
2017-02-07 12:52:03 -08:00
Wes Kocher
49a736e0b6 Backed out 2 changesets (bug 1335983) for build bustage a=backout
Backed out changeset 5a9559ded976 (bug 1335983)
Backed out changeset de2b0d90e2da (bug 1335983)

MozReview-Commit-ID: 377KQDU1QqJ
2017-02-07 12:34:30 -08:00
Zibi Braniecki
347f170849 Bug 1335983 - Migrate nsCollation::CreateCollection to use LocaleService::GetAppLocale. r=jfkthame
MozReview-Commit-ID: bJVrVj2dAS
2017-02-06 14:57:09 -08:00
Sebastian Hengst
5426615a05 Backed out changeset 7fbc8eb28f78 (bug 1336233) for Windows build bustage at nsNavHistory.cpp(3100). r=backout on a CLOSED TREE 2017-02-07 17:41:54 +01:00
Mark Banner
7f49b57be1 Bug 1336233 - Fix intermittent failures in browser_multi_redirect_frecency.js by ensuring the idle service updates for frecency are ignored. r=mak
MozReview-Commit-ID: L8AgWOAGF9g
2017-02-06 14:16:20 +00:00
Valentin Gosu
ec0987de9c Bug 1275746 - nsNavHistory::AsciiHostNameFromHostString return empty string if host is empty r=mak
MozReview-Commit-ID: 3AKgNCXPKoU
2016-07-13 00:06:07 +03:00
Mark Banner
903e536db0 Bug 737836 - Don't rely on past visits for frecency calcuations for redirects. r=mak
MozReview-Commit-ID: GfgZSInN9Lv
2017-01-18 14:09:09 +00:00
Marco Bonardo
54a4b5def2 Bug 1318650 - Searching Places views by url became extremely slow. r=adw
MozReview-Commit-ID: 67SztEKHCn
2016-11-18 16:51:27 +01:00
Gerald Squelart
9a3fb4229e Bug 1316432 - Fix nsCOMPtr constructions&assignments from 0 - r=froydnj
Giving '0' (literal zero) to nsCOMPtr is now ambiguous, as both
nsCOMPtr(decltype(nullptr)) and nsCOMPtr(T*) could be used.
In any case, our coding standards mandate the use of 'nullptr' for pointers.
So I'm changing all zeroes into nullptr's where necessary.

MozReview-Commit-ID: LXiZTu87Ck6
2016-11-10 14:11:27 +11:00
Valentin Gosu
fff83d36a5 Bug 1305204 - (Part 1) Backout bug 1275746 a=backout
MozReview-Commit-ID: FtOalze9SdY
2016-10-23 14:24:41 +02: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
Carsten "Tomcat" Book
ce02c3ed29 merge mozilla-inbound to mozilla-central a=merge 2016-08-10 15:54:26 +02:00
Mohammed Habeeb
d79fa5cd5d Bug 1261313 - Remove RemoveVisitsByTimeframe API. r=adw
MozReview-Commit-ID: 8Ykvc2td2hx
2016-08-09 16:44:17 +05:30
Nicholas Nethercote
1f65390cc9 Bug 1293603 (part 2) - Make Run() declarations consistent. r=erahm.
This patch makes most Run() declarations in subclasses of nsIRunnable have the
same form: |NS_IMETHOD Run() override|.

As a result of these changes, I had to add |override| to a couple of other
functions to satisfy clang's -Winconsistent-missing-override warning.
2016-08-08 12:18:10 +10: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
Valentin Gosu
c2d9e3ed8e Bug 1275746 - nsNavHistory::AsciiHostNameFromHostString return empty string if host is empty r=mak
MozReview-Commit-ID: 3AKgNCXPKoU
2016-07-13 15:19:37 +03:00
Marco Bonardo
270696b2ca Bug 1283825 - Add a page-icon protocol to fetch the best icon for a url. r=adw
MozReview-Commit-ID: 3exDniH8Hkm
2016-06-30 18:17:44 +02: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
Nathan Froyd
b89e7ed3e4 Bug 1278925 - micro-optimize nsCOMArray appending with already_AddRefed AppendElement; r=erahm
In all of the places touched by this patch, the smart pointer we're
appending is about to become unused, so simply .forget()'ing its
reference into the appropriate nsCOMArray works just fine.
2016-06-20 18:38:10 -04: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