Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Unified Diff: sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart

Issue 23681003: added library-level description for dart:indexed_db (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: incorporated seth's comments Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart
diff --git a/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart b/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart
index 44b179e74b25353297e8ab6613077a5b22a4b542..1a026b0f1e19b9492b5c7fc5c523c776291ff990 100644
--- a/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart
+++ b/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart
@@ -1,3 +1,59 @@
+/**
+ * A client-side key-value store with support for indexes.
+ *
+ * Many browsers provide an indexed database,
+ * which web apps can use to store data in the client.
+ * Client-side storage provides apps with
+ * off-line functionality, better performance,
+ * and the ability to cache the app's state between invocations.
+ * To find out which browsers support indexed database,
+ * refer to [Can I Use?](http://caniuse.com/#feat=indexeddb)
+ *
+ * In an indexed database each record is identified by a unique index or key,
+ * making data retrieval speedy.
+ * You can store large amounts of structured data,
sethladd 2013/08/29 08:16:13 what does "large amounts" mean? That feels sales p
mem 2013/08/29 11:12:35 Done.
+ * such as images, arrays, maps, and objects using IndexedDB.
sethladd 2013/08/29 08:16:13 are we sure about objects? I'm not sure we can sto
mem 2013/08/29 11:12:35 Done.
+ * The standard does not specify size limits for individual data items
+ * or for the database itself, but browsers may impose storage limits.
+ *
+ * The classes in this library provide an interface
+ * to the browser's indexed database, if it has one.
+ * To use this library in your code:
+ *
+ * import 'dart:indexed_db';
+ *
+ * A web app can determine if the browser has an
+ * indexed database with [IdbFactory.supported]:
+ *
+ * if (IdbFactory.supported)
+ * // Use indexeddb.
+ * else
+ * // Find an alternative.
+ *
+ * Open an indexed database using the `indexedDB` object
+ * provided by the top-level [Window] object for the app.
+ * For example:
+ *
+ * Future open() {
+ * return window.indexedDB.open('myIndexedDB',
+ * version: 1,
+ * onUpgradeNeeded: /* Initalize the database. */ )
+ * .then( /* Load data from the database. */ );
+ * }
+ *
sethladd 2013/08/29 08:16:13 since you show opening... are you going to add fin
mem 2013/08/29 11:12:35 Yup. We'll add it later. Adjust the wording so it'
+ * ## Other resources
sethladd 2013/08/29 08:16:13 How about linking to http://docs.webplatform.org/w
mem 2013/08/29 11:12:35 And to lawndart. Done On 2013/08/29 08:16:13, set
+ *
+ * Other client-side data stores include:
+ *
+ * * [Window.localStorage]—a
+ * basic mechanism in which data is stored as a [Map].
+ *
+ * * [dart:web_sql]—a database that can be queried with SQL.
+ *
+ * For a tutorial about using the indexed_db library,
+ * check out
+ * [Use IndexedDB](https://www.dartlang.org/docs/tutorials/indexeddb/).
+ */
library dart.dom.indexed_db;
import 'dart:async';
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tools/dom/templates/html/dart2js/indexed_db_dart2js.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698