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

Side by Side Diff: content/common/indexed_db/indexed_db_database_error_struct_traits.h

Issue 2320213004: Port IndexedDB open() and database callbacks to Mojo. (Closed)
Patch Set: Make DatabaseClient an associated interface. Created 4 years, 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_COMMON_INDEXED_DB_INDEXED_DB_DATABASE_ERROR_STRUCT_TRAITS_H_
6 #define CONTENT_COMMON_INDEXED_DB_INDEXED_DB_DATABASE_ERROR_STRUCT_TRAITS_H_
7
8 #include "content/common/indexed_db/indexed_db_database_error.h"
9 #include "third_party/WebKit/public/platform/modules/indexeddb/indexed_db.mojom. h"
10
11 namespace mojo {
12
13 template <>
14 struct StructTraits<indexed_db::mojom::ErrorInfoDataView,
15 content::IndexedDBDatabaseError> {
16 static int16_t code(const content::IndexedDBDatabaseError& error) {
17 return error.code();
18 }
19 static const base::string16& message(
20 const content::IndexedDBDatabaseError& error) {
21 return error.message();
22 }
23
24 static bool Read(indexed_db::mojom::ErrorInfoDataView data,
25 content::IndexedDBDatabaseError* out) {
26 base::string16 message;
27 if (!data.ReadMessage(&message))
28 return false;
29
30 *out = content::IndexedDBDatabaseError(data.code(), message);
31 return true;
32 }
33 };
34
35 } // namespace mojo
36
37 #endif // CONTENT_COMMON_INDEXED_DB_INDEXED_DB_DATABASE_ERROR_STRUCT_TRAITS_H_
OLDNEW
« no previous file with comments | « content/common/indexed_db/indexed_db_database_error.cc ('k') | content/common/indexed_db/indexed_db_error_info.typemap » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698