Revert of Add field trial testing config for Windows and a PRESUBMIT (patchset #4...
[chromium-blink-merge.git] / chrome / common / content_settings_pattern_serializer.cc
blob612a96e4332d7d9f7afa047dd5c32d7837e62789
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 PickleIterator* iter,
22 ContentSettingsPattern* pattern) {
23 DCHECK(pattern);
24 return IPC::ReadParam(m, iter, &pattern->is_valid_) &&
25 IPC::ReadParam(m, iter, &pattern->parts_);