1 // Copyright (c) 2014 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.
5 #include "chrome/common/content_settings_pattern_serializer.h"
7 #include "chrome/common/render_messages.h"
8 #include "components/content_settings/core/common/content_settings_pattern.h"
11 void ContentSettingsPatternSerializer::WriteToMessage(
12 const ContentSettingsPattern
& pattern
,
14 IPC::WriteParam(m
, pattern
.is_valid_
);
15 IPC::WriteParam(m
, pattern
.parts_
);
19 bool ContentSettingsPatternSerializer::ReadFromMessage(
20 const IPC::Message
* m
,
22 ContentSettingsPattern
* pattern
) {
24 return IPC::ReadParam(m
, iter
, &pattern
->is_valid_
) &&
25 IPC::ReadParam(m
, iter
, &pattern
->parts_
);