OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2017 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 CHROME_COMMON_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_PARAM_TRAITS_H_ |
| 6 #define CHROME_COMMON_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_PARAM_TRAITS_H_ |
| 7 |
| 8 #include "chrome/common/page_load_metrics/page_load_metrics.mojom.h" |
| 9 #include "ipc/ipc_message_utils.h" |
| 10 |
| 11 namespace IPC { |
| 12 |
| 13 // mojom::PageLoadTiming contains child mojom structs, which are stored in |
| 14 // mojo::StructPtr<>s. IPC doesn't have ParamTraits for mojo::StructPtr<>, so we |
| 15 // provide custom ParamTraits for PageLoadTiming here. This is temporary while |
| 16 // we run a field trial to verify there are no metric regressions due to |
| 17 // migrating to mojo, and will be removed once the field trial is complete and |
| 18 // shows expected results. |
| 19 template <> |
| 20 struct ParamTraits<page_load_metrics::mojom::PageLoadTiming> { |
| 21 typedef page_load_metrics::mojom::PageLoadTiming param_type; |
| 22 static void GetSize(base::PickleSizer* s, const param_type& p); |
| 23 static void Write(base::Pickle* m, const param_type& p); |
| 24 static bool Read(const base::Pickle* m, |
| 25 base::PickleIterator* iter, |
| 26 param_type* p); |
| 27 static void Log(const param_type& p, std::string* l); |
| 28 }; |
| 29 |
| 30 } // namespace IPC |
| 31 |
| 32 #endif // CHROME_COMMON_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_PARAM_TRAITS_H_ |
OLD | NEW |