Add new certificateProvider extension API.
[chromium-blink-merge.git] / chrome / common / content_settings_pattern_serializer.cc
blobaf36d567153c5e72476de951c572f100c15c50ff
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"
10 // static
11 void ContentSettingsPatternSerializer::WriteToMessage(
12 const ContentSettingsPattern& pattern,
13 IPC::Message* m) {
14 IPC::WriteParam(m, pattern.is_valid_);
15 IPC::WriteParam(m, pattern.parts_);
18 // static
19 bool ContentSettingsPatternSerializer::ReadFromMessage(
20 const IPC::Message* m,
21 base::PickleIterator* iter,
22 ContentSettingsPattern* pattern) {
23 DCHECK(pattern);
24 return IPC::ReadParam(m, iter, &pattern->is_valid_) &&
25 IPC::ReadParam(m, iter, &pattern->parts_);