Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 1164717 - Flatten storage/src/ directory. r=mak
Browse files Browse the repository at this point in the history
  • Loading branch information
poiru committed May 19, 2015
1 parent a401f68 commit 6f3606c
Show file tree
Hide file tree
Showing 58 changed files with 73 additions and 79 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 3 additions & 1 deletion storage/build/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ FAIL_ON_WARNINGS = True

FINAL_LIBRARY = 'xul'

LOCAL_INCLUDES += ['../src']
LOCAL_INCLUDES += [
'..',
]

CXXFLAGS += CONFIG['SQLITE_CFLAGS']
67 changes: 66 additions & 1 deletion storage/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

DIRS += ['src', 'build']
DIRS += ['build']

TEST_DIRS += ['test']

Expand Down Expand Up @@ -46,5 +46,70 @@ EXPORTS.mozilla += [
# storage.h file too.
EXPORTS.mozilla.storage += [
'StatementCache.h',
'Variant.h',
'Variant_inl.h',
]
# SEE ABOVE NOTE!

UNIFIED_SOURCES += [
'FileSystemModule.cpp',
'mozStorageArgValueArray.cpp',
'mozStorageAsyncStatement.cpp',
'mozStorageAsyncStatementExecution.cpp',
'mozStorageAsyncStatementJSHelper.cpp',
'mozStorageAsyncStatementParams.cpp',
'mozStorageBindingParamsArray.cpp',
'mozStorageError.cpp',
'mozStoragePrivateHelpers.cpp',
'mozStorageResultSet.cpp',
'mozStorageRow.cpp',
'mozStorageService.cpp',
'mozStorageSQLFunctions.cpp',
'mozStorageStatement.cpp',
'mozStorageStatementJSHelper.cpp',
'mozStorageStatementParams.cpp',
'mozStorageStatementRow.cpp',
'SQLCollations.cpp',
'StorageBaseStatementInternal.cpp',
'TelemetryVFS.cpp',
'VacuumManager.cpp',
]

# These files need to be built separately because they #include variantToSQLiteT_impl.h.
SOURCES += [
'mozStorageBindingParams.cpp',
'mozStorageConnection.cpp',
]

FAIL_ON_WARNINGS = True

FINAL_LIBRARY = 'xul'

# Don't use the jemalloc allocator on Android, because we can't guarantee
# that Gecko will configure sqlite before it is first used (bug 730495).
#
# Don't use the jemalloc allocator when using system sqlite. Linked in libraries
# (such as NSS) might trigger an initialization of sqlite and allocation
# of memory using the default allocator, prior to the storage service
# registering its allocator, causing memory management failures (bug 938730).
# However, this is not an issue if both the jemalloc allocator and the default
# allocator are the same thing.
#
# Note: On Windows our sqlite build assumes we use jemalloc. If you disable
# MOZ_STORAGE_MEMORY on Windows, you will also need to change the "ifdef
# MOZ_MEMORY" options in db/sqlite3/src/Makefile.in.
if CONFIG['MOZ_MEMORY'] and (not CONFIG['MOZ_NATIVE_SQLITE']
or CONFIG['MOZ_NATIVE_JEMALLOC']):
if CONFIG['OS_TARGET'] != 'Android':
DEFINES['MOZ_STORAGE_MEMORY'] = True

# This is the default value. If we ever change it when compiling sqlite, we
# will need to change it here as well.
DEFINES['SQLITE_MAX_LIKE_PATTERN_LENGTH'] = 50000

LOCAL_INCLUDES += [
'/db/sqlite3/src',
'/dom/base',
]

CXXFLAGS += CONFIG['SQLITE_CFLAGS']
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
73 changes: 0 additions & 73 deletions storage/src/moz.build

This file was deleted.

2 changes: 1 addition & 1 deletion storage/test/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if CONFIG['MOZ_DEBUG'] and CONFIG['OS_ARCH'] not in ('WINNT', 'Darwin'):
])

LOCAL_INCLUDES += [
'../src',
'..',
]

FAIL_ON_WARNINGS = True
Expand Down
2 changes: 1 addition & 1 deletion storage/test/unit/test_statement_wrapper_automatically.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function run_test()
setup();

// function JSValStorageStatementBinder in
// storage/src/mozStorageStatementParams.cpp tells us that the following types
// storage/mozStorageStatementParams.cpp tells us that the following types
// and only the following types are valid as statement parameters:
var vals = [
1337, // int
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion toolkit/components/places/UnifiedComplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -1572,7 +1572,7 @@ UnifiedComplete.prototype = {
// Autocomplete often fallbacks to a table scan due to lack of text
// indices. A larger cache helps reducing IO and improving performance.
// The value used here is larger than the default Storage value defined
// as MAX_CACHE_SIZE_BYTES in storage/src/mozStorageConnection.cpp.
// as MAX_CACHE_SIZE_BYTES in storage/mozStorageConnection.cpp.
yield conn.execute("PRAGMA cache_size = -6144"); // 6MiB

yield SwitchToTabStorage.initDatabase(conn);
Expand Down
2 changes: 1 addition & 1 deletion toolkit/components/places/nsPlacesAutoComplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ function nsPlacesAutoComplete()

// Autocomplete often fallbacks to a table scan due to lack of text indices.
// In such cases a larger cache helps reducing IO. The default Storage
// value is MAX_CACHE_SIZE_BYTES in storage/src/mozStorageConnection.cpp.
// value is MAX_CACHE_SIZE_BYTES in storage/mozStorageConnection.cpp.
let stmt = db.createAsyncStatement("PRAGMA cache_size = -6144"); // 6MiB
stmt.executeAsync();
stmt.finalize();
Expand Down

0 comments on commit 6f3606c

Please sign in to comment.