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

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

Issue 6840044: Size reduction: halve npchrome_frame.dll via code motion. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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/common_param_traits.h ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2011 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.
4
5 #include "chrome/common/common_param_traits.h"
6
7 #include "ipc/ipc_message.h"
8 #include "ipc/ipc_message_utils.h"
9
10 namespace IPC {
11
12 void ParamTraits<ContentSetting>::Write(Message* m, const param_type& p) {
13 m->WriteInt(static_cast<int>(p));
14 }
15
16 bool ParamTraits<ContentSetting>::Read(const Message* m, void** iter,
17 param_type* p) {
18 int type;
19 if (!m->ReadInt(iter, &type))
20 return false;
21 *p = static_cast<param_type>(type);
22 return true;
23 }
24
25 void ParamTraits<ContentSetting>::Log(const param_type& p, std::string* l) {
26 std::string content_setting;
27 switch (p) {
28 case CONTENT_SETTING_DEFAULT:
29 content_setting = "CONTENT_SETTING_DEFAULT";
30 break;
31 case CONTENT_SETTING_ALLOW:
32 content_setting = "CONTENT_SETTING_ALLOW";
33 break;
34 case CONTENT_SETTING_BLOCK:
35 content_setting = "CONTENT_SETTING_BLOCK";
36 break;
37 case CONTENT_SETTING_ASK:
38 content_setting = "CONTENT_SETTING_ASK";
39 break;
40 case CONTENT_SETTING_SESSION_ONLY:
41 content_setting = "CONTENT_SETTING_SESSION_ONLY";
42 break;
43 default:
44 content_setting = "UNKNOWN";
45 break;
46 }
47 LogParam(content_setting, l);
48 }
49
50 void ParamTraits<ContentSettingsType>::Write(Message* m, const param_type& p) {
51 m->WriteInt(static_cast<int>(p));
52 }
53
54 bool ParamTraits<ContentSettingsType>::Read(const Message* m, void** iter,
55 param_type* p) {
56 int type;
57 if (!m->ReadInt(iter, &type))
58 return false;
59 *p = static_cast<param_type>(type);
60 return true;
61 }
62
63 void ParamTraits<ContentSettingsType>::Log(const param_type& p,
64 std::string* l) {
65 std::string setting_type;
66 switch (p) {
67 case CONTENT_SETTINGS_TYPE_DEFAULT:
68 setting_type = "CONTENT_SETTINGS_TYPE_DEFAULT";
69 break;
70 case CONTENT_SETTINGS_TYPE_COOKIES:
71 setting_type = "CONTENT_SETTINGS_TYPE_COOKIES";
72 break;
73 case CONTENT_SETTINGS_TYPE_IMAGES:
74 setting_type = "CONTENT_SETTINGS_TYPE_IMAGES";
75 break;
76 case CONTENT_SETTINGS_TYPE_JAVASCRIPT:
77 setting_type = "CONTENT_SETTINGS_TYPE_JAVASCRIPT";
78 break;
79 case CONTENT_SETTINGS_TYPE_PLUGINS:
80 setting_type = "CONTENT_SETTINGS_TYPE_PLUGINS";
81 break;
82 case CONTENT_SETTINGS_TYPE_POPUPS:
83 setting_type = "CONTENT_SETTINGS_TYPE_POPUPS";
84 break;
85 case CONTENT_SETTINGS_TYPE_GEOLOCATION:
86 setting_type = "CONTENT_SETTINGS_TYPE_GEOLOCATION";
87 break;
88 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS:
89 setting_type = "CONTENT_SETTINGS_TYPE_NOTIFICATIONS";
90 break;
91 case CONTENT_SETTINGS_TYPE_PRERENDER:
92 setting_type = "CONTENT_SETTINGS_TYPE_PRERENDER";
93 break;
94 default:
95 setting_type = "UNKNOWN";
96 break;
97 }
98 LogParam(setting_type, l);
99 }
100
101 } // namespace IPC
OLDNEW
« no previous file with comments | « chrome/common/common_param_traits.h ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698