sql: Feature flag for in-memory temporary storage.

This CL introduces SqlTempStoreMemory flag, which is intended to be
managed via Finch. When set, the flag causes sql::Database to run a
PRAGMA temp_store=MEMORY [1] query on every opened database.

This approach is intended to approximate the effect of building SQLite
with the SQLITE_TEMP_STORE=3 [2] macro, to measure the memory
consumption impact. Ideally, we'd test the macro directly, but //sql is
a core component of Chrome, so we can't load different versions of it
based on Finch.

[1] https://www.sqlite.org/pragma.html#pragma_temp_store
[2] https://www.sqlite.org/compile.html#temp_store

Bug: 875538
Change-Id: I537d90d763be1100503ed4bd2ada2ee19eb090bb
Reviewed-on: https://chromium-review.googlesource.com/1180530
Reviewed-by: Mark Pearson <[email protected]>
Reviewed-by: Chris Mumford <[email protected]>
Commit-Queue: Victor Costan <[email protected]>
Cr-Commit-Position: refs/heads/master@{#584652}
diff --git a/sql/sql_features.cc b/sql/sql_features.cc
new file mode 100644
index 0000000..c7cf33e
--- /dev/null
+++ b/sql/sql_features.cc
@@ -0,0 +1,23 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "sql/sql_features.h"
+
+namespace sql {
+
+namespace features {
+
+// SQLite databases only use RAM for temporary storage.
+//
+// Enabling this feature matches the SQLITE_TEMP_STORE=3 build option, which is
+// used on Android.
+//
+// TODO(pwnall): After the memory impact of the config change is assessed, land
+//               https://crrev.com/c/1146493 and remove this flag.
+const base::Feature kSqlTempStoreMemory{"SqlTempStoreMemory",
+                                        base::FEATURE_DISABLED_BY_DEFAULT};
+
+}  // namespace features
+
+}  // namespace sql