| Index: third_party/WebKit/Source/modules/indexeddb/IDBStructTraits.cpp
|
| diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBStructTraits.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBStructTraits.cpp
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..735439743228912cefbeab4315d03130b75780b1
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/modules/indexeddb/IDBStructTraits.cpp
|
| @@ -0,0 +1,42 @@
|
| +// Copyright 2016 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 "IDBStructTraits.h"
|
| +
|
| +using indexed_db::mojom::blink::DataLoss;
|
| +
|
| +namespace mojo {
|
| +
|
| +DataLoss EnumTraits<DataLoss, blink::WebIDBDataLoss>::ToMojom(
|
| + blink::WebIDBDataLoss input)
|
| +{
|
| + switch (input) {
|
| + case blink::WebIDBDataLossNone:
|
| + return DataLoss::None;
|
| + case blink::WebIDBDataLossTotal:
|
| + return DataLoss::Total;
|
| + }
|
| +
|
| + NOTREACHED();
|
| + return DataLoss::None;
|
| +}
|
| +
|
| +bool EnumTraits<DataLoss, blink::WebIDBDataLoss>::FromMojom(
|
| + DataLoss input,
|
| + blink::WebIDBDataLoss* output)
|
| +{
|
| + switch (input) {
|
| + case DataLoss::None:
|
| + *output = blink::WebIDBDataLossNone;
|
| + return true;
|
| + case DataLoss::Total:
|
| + *output = blink::WebIDBDataLossTotal;
|
| + return true;
|
| + }
|
| +
|
| + NOTREACHED();
|
| + return false;
|
| +}
|
| +
|
| +} // namespace mojo
|
|
|