| Index: chrome/common/content_settings_pattern_serializer.cc
|
| diff --git a/chrome/common/content_settings_pattern_serializer.cc b/chrome/common/content_settings_pattern_serializer.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..7bf2c2f37770a9c0ed5aeb2a4413ba0862b4fd39
|
| --- /dev/null
|
| +++ b/chrome/common/content_settings_pattern_serializer.cc
|
| @@ -0,0 +1,26 @@
|
| +// Copyright (c) 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "chrome/common/content_settings_pattern_serializer.h"
|
| +
|
| +#include "chrome/common/content_settings_pattern.h"
|
| +#include "chrome/common/render_messages.h"
|
| +
|
| +// static
|
| +void ContentSettingsPatternSerializer::WriteToMessage(
|
| + const ContentSettingsPattern& pattern,
|
| + IPC::Message* m) {
|
| + IPC::WriteParam(m, pattern.is_valid_);
|
| + IPC::WriteParam(m, pattern.parts_);
|
| +}
|
| +
|
| +// static
|
| +bool ContentSettingsPatternSerializer::ReadFromMessage(
|
| + const IPC::Message* m,
|
| + PickleIterator* iter,
|
| + ContentSettingsPattern* pattern) {
|
| + DCHECK(pattern);
|
| + return IPC::ReadParam(m, iter, &pattern->is_valid_) &&
|
| + IPC::ReadParam(m, iter, &pattern->parts_);
|
| +}
|
|
|