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_event_dispatcher.mojom.h" |
| 8 #include "content/common/service_worker/service_worker_messages.h" |
7 #include "mojo/public/cpp/bindings/array_data_view.h" | 9 #include "mojo/public/cpp/bindings/array_data_view.h" |
8 | 10 |
9 namespace mojo { | 11 namespace mojo { |
10 | 12 |
11 // static | 13 // static |
12 bool StructTraits<blink::mojom::BackgroundFetchOptionsDataView, | 14 bool StructTraits<blink::mojom::BackgroundFetchOptionsDataView, |
13 content::BackgroundFetchOptions>:: | 15 content::BackgroundFetchOptions>:: |
14 Read(blink::mojom::BackgroundFetchOptionsDataView data, | 16 Read(blink::mojom::BackgroundFetchOptionsDataView data, |
15 content::BackgroundFetchOptions* options) { | 17 content::BackgroundFetchOptions* options) { |
16 if (!data.ReadIcons(&options->icons) || !data.ReadTitle(&options->title)) | 18 if (!data.ReadIcons(&options->icons) || !data.ReadTitle(&options->title)) |
(...skipping 12 matching lines...) Expand all Loading... |
29 !data.ReadIcons(®istration->icons) || | 31 !data.ReadIcons(®istration->icons) || |
30 !data.ReadTitle(®istration->title)) { | 32 !data.ReadTitle(®istration->title)) { |
31 return false; | 33 return false; |
32 } | 34 } |
33 | 35 |
34 registration->total_download_size = data.total_download_size(); | 36 registration->total_download_size = data.total_download_size(); |
35 return true; | 37 return true; |
36 } | 38 } |
37 | 39 |
38 // static | 40 // static |
| 41 bool StructTraits<content::mojom::BackgroundFetchSettledFetchDataView, |
| 42 content::BackgroundFetchSettledFetch>:: |
| 43 Read(content::mojom::BackgroundFetchSettledFetchDataView data, |
| 44 content::BackgroundFetchSettledFetch* fetch) { |
| 45 return data.ReadRequest(&fetch->request) && |
| 46 data.ReadResponse(&fetch->response); |
| 47 } |
| 48 |
| 49 // static |
39 bool StructTraits< | 50 bool StructTraits< |
40 blink::mojom::IconDefinitionDataView, | 51 blink::mojom::IconDefinitionDataView, |
41 content::IconDefinition>::Read(blink::mojom::IconDefinitionDataView data, | 52 content::IconDefinition>::Read(blink::mojom::IconDefinitionDataView data, |
42 content::IconDefinition* definition) { | 53 content::IconDefinition* definition) { |
43 return data.ReadSrc(&definition->src) && data.ReadSizes(&definition->sizes) && | 54 return data.ReadSrc(&definition->src) && data.ReadSizes(&definition->sizes) && |
44 data.ReadType(&definition->type); | 55 data.ReadType(&definition->type); |
45 } | 56 } |
46 | 57 |
47 } // namespace mojo | 58 } // namespace mojo |
OLD | NEW |