Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Side by Side Diff: chrome/common/common_param_traits.h

Issue 9447084: Refactor Pickle Read methods to use higher performance PickleIterator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compile (racing with incoming CLs) Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/automation_messages.cc ('k') | chrome/common/common_param_traits.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_COMMON_COMMON_PARAM_TRAITS_H_ 5 #ifndef CHROME_COMMON_COMMON_PARAM_TRAITS_H_
6 #define CHROME_COMMON_COMMON_PARAM_TRAITS_H_ 6 #define CHROME_COMMON_COMMON_PARAM_TRAITS_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "chrome/common/content_settings.h" 11 #include "chrome/common/content_settings.h"
12 #include "ipc/ipc_param_traits.h" 12 #include "ipc/ipc_param_traits.h"
13 13
14 class PickleIterator;
15
14 namespace IPC { 16 namespace IPC {
15 17
16 class Message; 18 class Message;
17 19
18 template <> 20 template <>
19 struct ParamTraits<ContentSetting> { 21 struct ParamTraits<ContentSetting> {
20 typedef ContentSetting param_type; 22 typedef ContentSetting param_type;
21 static void Write(Message* m, const param_type& p); 23 static void Write(Message* m, const param_type& p);
22 static bool Read(const Message* m, void** iter, param_type* p); 24 static bool Read(const Message* m, PickleIterator* iter, param_type* p);
23 static void Log(const param_type& p, std::string* l); 25 static void Log(const param_type& p, std::string* l);
24 }; 26 };
25 27
26 template <> 28 template <>
27 struct ParamTraits<ContentSettingsType> { 29 struct ParamTraits<ContentSettingsType> {
28 typedef ContentSettingsType param_type; 30 typedef ContentSettingsType param_type;
29 static void Write(Message* m, const param_type& p); 31 static void Write(Message* m, const param_type& p);
30 static bool Read(const Message* m, void** iter, param_type* p); 32 static bool Read(const Message* m, PickleIterator* iter, param_type* p);
31 static void Log(const param_type& p, std::string* l); 33 static void Log(const param_type& p, std::string* l);
32 }; 34 };
33 35
34 } // namespace IPC 36 } // namespace IPC
35 37
36 #endif // CHROME_COMMON_COMMON_PARAM_TRAITS_H_ 38 #endif // CHROME_COMMON_COMMON_PARAM_TRAITS_H_
OLDNEW
« no previous file with comments | « chrome/common/automation_messages.cc ('k') | chrome/common/common_param_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698