OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/common/background_fetch/background_fetch_struct_traits.h" | 5 #include "content/common/background_fetch/background_fetch_struct_traits.h" |
6 | 6 |
| 7 #include "content/common/service_worker/service_worker_messages.h" |
7 #include "mojo/public/cpp/bindings/array_data_view.h" | 8 #include "mojo/public/cpp/bindings/array_data_view.h" |
8 | 9 |
9 namespace mojo { | 10 namespace mojo { |
10 | 11 |
11 // static | 12 // static |
12 bool StructTraits<blink::mojom::BackgroundFetchOptionsDataView, | 13 bool StructTraits<blink::mojom::BackgroundFetchOptionsDataView, |
13 content::BackgroundFetchOptions>:: | 14 content::BackgroundFetchOptions>:: |
14 Read(blink::mojom::BackgroundFetchOptionsDataView data, | 15 Read(blink::mojom::BackgroundFetchOptionsDataView data, |
15 content::BackgroundFetchOptions* options) { | 16 content::BackgroundFetchOptions* options) { |
16 if (!data.ReadIcons(&options->icons) || !data.ReadTitle(&options->title)) | 17 if (!data.ReadIcons(&options->icons) || !data.ReadTitle(&options->title)) |
(...skipping 12 matching lines...) Expand all Loading... |
29 !data.ReadIcons(®istration->icons) || | 30 !data.ReadIcons(®istration->icons) || |
30 !data.ReadTitle(®istration->title)) { | 31 !data.ReadTitle(®istration->title)) { |
31 return false; | 32 return false; |
32 } | 33 } |
33 | 34 |
34 registration->total_download_size = data.total_download_size(); | 35 registration->total_download_size = data.total_download_size(); |
35 return true; | 36 return true; |
36 } | 37 } |
37 | 38 |
38 // static | 39 // static |
| 40 bool StructTraits<content::mojom::BackgroundFetchSettledFetchDataView, |
| 41 content::BackgroundFetchSettledFetch>:: |
| 42 Read(content::mojom::BackgroundFetchSettledFetchDataView data, |
| 43 content::BackgroundFetchSettledFetch* fetch) { |
| 44 return data.ReadRequest(&fetch->request) && |
| 45 data.ReadResponse(&fetch->response); |
| 46 } |
| 47 |
| 48 // static |
39 bool StructTraits< | 49 bool StructTraits< |
40 blink::mojom::IconDefinitionDataView, | 50 blink::mojom::IconDefinitionDataView, |
41 content::IconDefinition>::Read(blink::mojom::IconDefinitionDataView data, | 51 content::IconDefinition>::Read(blink::mojom::IconDefinitionDataView data, |
42 content::IconDefinition* definition) { | 52 content::IconDefinition* definition) { |
43 return data.ReadSrc(&definition->src) && data.ReadSizes(&definition->sizes) && | 53 return data.ReadSrc(&definition->src) && data.ReadSizes(&definition->sizes) && |
44 data.ReadType(&definition->type); | 54 data.ReadType(&definition->type); |
45 } | 55 } |
46 | 56 |
47 } // namespace mojo | 57 } // namespace mojo |
OLD | NEW |