GetAppropriateMmapSize() is called to validate the database as
error-free before enabling memory-mapped mode. The validation status is
stored in the [meta] table, since new databases have no [meta] table it
previously defaulted to not turning on memory-mapping. Then on second
open the file would be validated.
This change uses the lack of [meta] table as a signal that the file is
new and should be safe to memory-map. Additionally the code creating
[meta] pre-populates that setting.
Additionally disable memory-mapped mode for databases which do not make
use of the [meta] table. This makes the existing settings explicit.
BUG=537742, 555578
TBR=rdevlin.cronin@chromium.org, michaeln@chromium.org, zea@chromium.org, sky@chromium.org
Review URL: https://codereview.chromium.org/1533703002
Cr-Commit-Position: refs/heads/master@{#365959}
The mmap mitigation for bug 537742 meant that the test wasn't running in
cases where mmap could potentially be enabled but wasn't enabled by
default. Change the test to instead run when the platform allows SQLite
mmap to be enabled.
Add a test to verify that mmap cannot be enabled in cases where it is
expected not to work, so that platforms must make an explicit decision
about whether to allow mmap.
BUG=537742, 554269
Review URL: https://codereview.chromium.org/1529693002
Cr-Commit-Position: refs/heads/master@{#365904}
The recent formatter alphebetizing change is causing a lot of noise in
code reviews. Figured it'd be worth a clean-up CL.
Exact command I ran:
find . -name "*.gn*" -exec gn format --in-place "{}" \;
TBR=ddorwin@chromium.org
BUG=554928
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1464873002
Cr-Commit-Position: refs/heads/master@{#360891}
The aim is to make scoped_ptr and std::unique_ptr functionally
identical so scoped_ptr can simply be a typedef.
BUG=554298
Review URL: https://codereview.chromium.org/1445003002
Cr-Commit-Position: refs/heads/master@{#360539}
GetUniqueStatement() and GetUntrackedStatement() attempt to be
pedantic about errors preparing statements, because often those errors
indicate either a syntax error in the SQL being prepared, or an error
with the database schema it is being prepared against. That makes
testing code against various other problems like corruption
challenging. This change attempts to restrict the flagged errors to
include fewer errors unrelated to the form of the SQL statement (or
schema).
Additionally, slightly improve the debug output for OnSqliteError()
for databases which haven't been tagged.
BUG=537742
Review URL: https://codereview.chromium.org/1434173003
Cr-Commit-Position: refs/heads/master@{#359452}
With regular I/O, filesystem corruption would cause SQLite to return
SQLITE_IOERR codes. With memory-mapping, filesystem errors can cause a
crash when accessed. There are databases with filesystem corruption,
this CL only enables memory-mapped I/O for parts of the database which
have been successfully read at some point using regular I/O.
BUG=537742
Review URL: https://codereview.chromium.org/1426743006
Cr-Commit-Position: refs/heads/master@{#358672}
SQLite implements a hint to request the databases be truncated or
expanded to multiples of a chunk size. This was originally implemented
to reduce filesystem fragmentation, and it also can improve performance
because file sizes don't vary as much.
For a memory-mapped database, it also reduces the number of calls to
adjust the memory map when the database size changes.
BUG=551108
Review URL: https://codereview.chromium.org/1402373007
Cr-Commit-Position: refs/heads/master@{#358121}
Recovery may be used to recover files with I/O errors, which would not
interact well with memory-mapped I/O.
[AFAICT, SQLite doesn't use memory-mapped I/O on temporary files, but as
of yet I don't see why this might be.]
BUG=551110
Review URL: https://codereview.chromium.org/1414563010
Cr-Commit-Position: refs/heads/master@{#358083}
Follow-up CL to crrev.com/1425793002. Adds an extra |name|
argument to the memory-infra RegisterDumpProvider methods.
This allow to see the names of the dump providers in the trace
and diagnose dump providers getting stuck or taking more time
than usual.
No further behavioral change is introduced by this CL.
BUG=547764
TBR=xhwang@chromium.org,simonhatch@chromium.org,jochen@chromium.org,shess@chromium.org,piman@chromium.org
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1406213005
Cr-Commit-Position: refs/heads/master@{#357089}
The ThumbnailDatabase error handler attempts to capture generic data
about the error, which is then uploaded for diagnostics with
DumpWithoutCrashing(). Database with errors which are not repaired
upload new dumps repeatedly. This change adds a tracking file alongside
the database file, which has the dual purpose of recording whether a
previous dump was attempted, and also verifying that files can be
created in the profile directory. If the profile directory is too
broken to create files, then diagnostic data is unlikely to inform a
fix.
BUG=543321,362505,526614,240396
Review URL: https://codereview.chromium.org/1393393007
Cr-Commit-Position: refs/heads/master@{#355632}
The process-wide memory usage statistics of sqlite library is added to
chrome://tracing. The memory usage of sqlite library is mainly through
sqlite_malloc. The total usage of the process is recorded by
sqlite3_memory_used() api. This CL also adds per-connection memory
usage to tracing. Each connection uses memory for cache, schema and
statement, and these usages are recorded. sqlit3_malloc uses malloc
internally to allocate memory. So, thie memory is traced as
sub-allocation from system_allocator(malloc).
This CL lets us keep track of sqlite memory usage in chrome telemetry.
BUG=466141
Review URL: https://codereview.chromium.org/1327063002
Cr-Commit-Position: refs/heads/master@{#353549}
This is a redo of https://codereview.chromium.org/1245873002c6649f2e01
with fix for Official build.
Further reduce the boilerplate in .isolate files and is necessary to add debug
symbols, to be done in a follow up.
Slightly accelerate ninja file parsing by blacklisting more extensions.
sbox_validation_tests wasn't run on Windows since
https://codereview.chromium.org/1212003003/ (~2 months ago). Thankfully this CL
uncovered this copy-paste error.
TBR=jam@chromium.org
BUG=98637
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1320793004
Cr-Commit-Position: refs/heads/master@{#347912}
Further reduce the boilerplate in .isolate files and is necessary to add debug
symbols, to be done in a follow up.
Slightly accelerate ninja file parsing by blacklisting more extensions.
sbox_validation_tests wasn't run on Windows since
https://codereview.chromium.org/1212003003/ (~2 months ago). Thankfully this CL
uncovered this copy-paste error.
TBR=jam@chromium.org
BUG=98637
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1245873002
Cr-Commit-Position: refs/heads/master@{#347027}
Reason for revert:
Suspected of breaking chromium.webkit Mac builders, see https://code.google.com/p/chromium/issues/detail?id=526208
Summary:
Incompatible library version: httpd requires version 9.0.0 or later, but libsqlite3.dylib provides version 0.0.0
/b/build/slave/WebKit_Mac10_6__dbg_/build/src/out/Debug/libsqlite3.dylib seems to be used instead of expected/intended /usr/lib/libsqlite3.dylib
Original issue's description:
> [sqlite] Respect the gyp and gn component switch.
>
> SQLITE_API is the existing mechanism SQLite provides, and is used in
> preference to inventing a new SQLITE_EXPORT symbol (like
> sql/sql_export.h and other examples).
>
> CoreServices.framework is necessary on OSX because of the Time Machine
> patch.
>
> Remove sql/proxy.{h,cc}, which was necessary to work around SQLite
> linking statically into both component shlibs and unit test executables.
>
> [Relanding https://codereview.chromium.org/1322463002/ ]
>
> BUG=489444
> TBR=michaeln@chromium.org, thakis@chromium.org, brettw@chromium.org
>
> Committed: https://crrev.com/f71db5c36625ff00feb8283028631303ae5caa7c
> Cr-Commit-Position: refs/heads/master@{#346536}
TBR=michaeln@chromium.org,thakis@chromium.org,brettw@chromium.org,shess@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=489444
Review URL: https://codereview.chromium.org/1325833003
Cr-Commit-Position: refs/heads/master@{#346615}
SQLITE_API is the existing mechanism SQLite provides, and is used in
preference to inventing a new SQLITE_EXPORT symbol (like
sql/sql_export.h and other examples).
CoreServices.framework is necessary on OSX because of the Time Machine
patch.
Remove sql/proxy.{h,cc}, which was necessary to work around SQLite
linking statically into both component shlibs and unit test executables.
[Relanding https://codereview.chromium.org/1322463002/ ]
BUG=489444
TBR=michaeln@chromium.org, thakis@chromium.org, brettw@chromium.org
Review URL: https://codereview.chromium.org/1306863006
Cr-Commit-Position: refs/heads/master@{#346536}
Reason for revert:
ARRGH! win8_chromium_gn_dgb is still broken.
Original issue's description:
> [sqlite] Respect the gyp and gn component switch.
>
> SQLITE_API is the existing mechanism SQLite provides, and is used in
> preference to inventing a new SQLITE_EXPORT symbol (like
> sql/sql_export.h and other examples).
>
> CoreServices.framework is necessary on OSX because of the Time Machine
> patch.
>
> Remove sql/proxy.{h,cc}, which was necessary to work around SQLite
> linking statically into both component shlibs and unit test executables.
>
> [Relanding https://codereview.chromium.org/1322463002/ ]
>
> BUG=489444
> TBR=michaeln@chromium.org, thakis@chromium.org
>
> Committed: https://crrev.com/02ce712af589a5b722ebbf5c2fffb3e0d4849963
> Cr-Commit-Position: refs/heads/master@{#346212}
TBR=michaeln@chromium.org,thakis@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=489444
Review URL: https://codereview.chromium.org/1307363007
Cr-Commit-Position: refs/heads/master@{#346213}
SQLITE_API is the existing mechanism SQLite provides, and is used in
preference to inventing a new SQLITE_EXPORT symbol (like
sql/sql_export.h and other examples).
CoreServices.framework is necessary on OSX because of the Time Machine
patch.
Remove sql/proxy.{h,cc}, which was necessary to work around SQLite
linking statically into both component shlibs and unit test executables.
[Relanding https://codereview.chromium.org/1322463002/ ]
BUG=489444
TBR=michaeln@chromium.org, thakis@chromium.org
Review URL: https://codereview.chromium.org/1325513002
Cr-Commit-Position: refs/heads/master@{#346212}
Reason for revert:
Broken build on the Builder: Win x64 GN (dbg).
Failure example: http://build.chromium.org/p/chromium.win/builders/Win%20x64%20GN%20%28dbg%29/builds/8549
Original issue's description:
> [sqlite] Respect the gyp and gn component switch.
>
> SQLITE_API is the existing mechanism SQLite provides, and is used in
> preference to inventing a new SQLITE_EXPORT symbol (like
> sql/sql_export.h and other examples).
>
> CoreServices.framework is necessary on OSX because of the Time Machine
> patch.
>
> Remove sql/proxy.{h,cc}, which was necessary to work around SQLite
> linking statically into both component shlibs and unit test executables.
>
> BUG=489444
>
> Committed: https://crrev.com/4ec68d9ad2d3e0c74967a17946c8bf7ed4450f73
> Cr-Commit-Position: refs/heads/master@{#346151}
TBR=michaeln@chromium.org,shess@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=489444
Review URL: https://codereview.chromium.org/1324523004
Cr-Commit-Position: refs/heads/master@{#346179}
SQLITE_API is the existing mechanism SQLite provides, and is used in
preference to inventing a new SQLITE_EXPORT symbol (like
sql/sql_export.h and other examples).
CoreServices.framework is necessary on OSX because of the Time Machine
patch.
Remove sql/proxy.{h,cc}, which was necessary to work around SQLite
linking statically into both component shlibs and unit test executables.
BUG=489444
Review URL: https://codereview.chromium.org/1322463002
Cr-Commit-Position: refs/heads/master@{#346151}
Previously landed 10-minute, 1-hour, and 1-day histograms. Based on
those I expect 1-week to get around 20% worse.
BUG=489784
Review URL: https://codereview.chromium.org/1316493006
Cr-Commit-Position: refs/heads/master@{#345366}
This will be used to track improvements occuring from enabling
memory-mapped I/O.
BUG=489784
Review URL: https://codereview.chromium.org/1283033004
Cr-Commit-Position: refs/heads/master@{#343100}
Remove StringToLowerASCII. This removes the template and makes a consistent call that can take a string piece.
http_response_headers.cc in HttpResponseHeaders::RemoveHeaderLine there seemed to be a bug where it did
std::string old_header_name_lowercase(name);
where it actually meant
std::string old_header_name_lowercase(old_header_name);
I fixed this.
There were a number of cases where url.host() or url.scheme() was passed to ToLowerASCII. These are already guaranteed lower-case, so I removed the call.
There were a number of cases in net that did return ToLowerASCII().c_str() when the return type is a std::string, which is unnecessary and wasteful. I removed the c_str() call.
NOPRESUBMIT=true
(for touching code with wstrings)
Review URL: https://codereview.chromium.org/1282363003
Cr-Commit-Position: refs/heads/master@{#342869}
Currently, GetHistogramSamplesSinceCreation can return null if no histogram was generated. But that depends also on tests run prior to the current test. This CL changes this to returning empty samples instead, so that independently of previously run tests, the current test always gets the same response even if it does not generate any histograms.
BUG=473689
Review URL: https://codereview.chromium.org/1264123002
Cr-Commit-Position: refs/heads/master@{#341498}