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

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

Issue 1619363002: Add compile time checks against longs being used in IPC structs on 32 bit Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: one more per Dmitry Created 4 years, 10 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
OLDNEW
1 // Copyright (c) 2012 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 // Multiply-included file, no traditional include guard. 5 // Multiply-included file, no traditional include guard.
6 #include <stdint.h> 6 #include <stdint.h>
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 namespace IPC { 47 namespace IPC {
48 48
49 template <> 49 template <>
50 struct ParamTraits<ContentSettingsPattern> { 50 struct ParamTraits<ContentSettingsPattern> {
51 typedef ContentSettingsPattern param_type; 51 typedef ContentSettingsPattern param_type;
52 static void Write(Message* m, const param_type& p); 52 static void Write(Message* m, const param_type& p);
53 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); 53 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
54 static void Log(const param_type& p, std::string* l); 54 static void Log(const param_type& p, std::string* l);
55 }; 55 };
56 56
57 // Manual traits since this struct uses size_t and it's in Blink, so avoid
58 // changing Blink due to IPC differences.
59 template <>
60 struct ParamTraits<blink::WebCache::UsageStats> {
61 typedef blink::WebCache::UsageStats param_type;
62 static void Write(Message* m, const param_type& u);
63 static bool Read(const Message* m, base::PickleIterator* iter, param_type* u);
64 static void Log(const param_type& p, std::string* l);
65 };
66
57 } // namespace IPC 67 } // namespace IPC
58 68
59 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ 69 #endif // CHROME_COMMON_RENDER_MESSAGES_H_
60 70
61 #define IPC_MESSAGE_START ChromeMsgStart 71 #define IPC_MESSAGE_START ChromeMsgStart
62 72
63 IPC_ENUM_TRAITS_MAX_VALUE(ChromeViewHostMsg_GetPluginInfo_Status, 73 IPC_ENUM_TRAITS_MAX_VALUE(ChromeViewHostMsg_GetPluginInfo_Status,
64 ChromeViewHostMsg_GetPluginInfo_Status::kUnauthorized) 74 ChromeViewHostMsg_GetPluginInfo_Status::kUnauthorized)
65 IPC_ENUM_TRAITS_MAX_VALUE(OmniboxFocusChangeReason, 75 IPC_ENUM_TRAITS_MAX_VALUE(OmniboxFocusChangeReason,
66 OMNIBOX_FOCUS_CHANGE_REASON_LAST) 76 OMNIBOX_FOCUS_CHANGE_REASON_LAST)
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 IPC_STRUCT_TRAITS_MEMBER(section_border_color) 163 IPC_STRUCT_TRAITS_MEMBER(section_border_color)
154 IPC_STRUCT_TRAITS_MEMBER(theme_id) 164 IPC_STRUCT_TRAITS_MEMBER(theme_id)
155 IPC_STRUCT_TRAITS_MEMBER(image_horizontal_alignment) 165 IPC_STRUCT_TRAITS_MEMBER(image_horizontal_alignment)
156 IPC_STRUCT_TRAITS_MEMBER(image_vertical_alignment) 166 IPC_STRUCT_TRAITS_MEMBER(image_vertical_alignment)
157 IPC_STRUCT_TRAITS_MEMBER(image_tiling) 167 IPC_STRUCT_TRAITS_MEMBER(image_tiling)
158 IPC_STRUCT_TRAITS_MEMBER(image_height) 168 IPC_STRUCT_TRAITS_MEMBER(image_height)
159 IPC_STRUCT_TRAITS_MEMBER(has_attribution) 169 IPC_STRUCT_TRAITS_MEMBER(has_attribution)
160 IPC_STRUCT_TRAITS_MEMBER(logo_alternate) 170 IPC_STRUCT_TRAITS_MEMBER(logo_alternate)
161 IPC_STRUCT_TRAITS_END() 171 IPC_STRUCT_TRAITS_END()
162 172
163 IPC_STRUCT_TRAITS_BEGIN(blink::WebCache::UsageStats)
164 IPC_STRUCT_TRAITS_MEMBER(minDeadCapacity)
165 IPC_STRUCT_TRAITS_MEMBER(maxDeadCapacity)
166 IPC_STRUCT_TRAITS_MEMBER(capacity)
167 IPC_STRUCT_TRAITS_MEMBER(liveSize)
168 IPC_STRUCT_TRAITS_MEMBER(deadSize)
169 IPC_STRUCT_TRAITS_END()
170
171 IPC_ENUM_TRAITS_MAX_VALUE(NTPLoggingEventType, 173 IPC_ENUM_TRAITS_MAX_VALUE(NTPLoggingEventType,
172 NTP_EVENT_TYPE_LAST) 174 NTP_EVENT_TYPE_LAST)
173 175
174 IPC_ENUM_TRAITS_MAX_VALUE(WebApplicationInfo::MobileCapable, 176 IPC_ENUM_TRAITS_MAX_VALUE(WebApplicationInfo::MobileCapable,
175 WebApplicationInfo::MOBILE_CAPABLE_APPLE) 177 WebApplicationInfo::MOBILE_CAPABLE_APPLE)
176 178
177 IPC_STRUCT_TRAITS_BEGIN(WebApplicationInfo::IconInfo) 179 IPC_STRUCT_TRAITS_BEGIN(WebApplicationInfo::IconInfo)
178 IPC_STRUCT_TRAITS_MEMBER(url) 180 IPC_STRUCT_TRAITS_MEMBER(url)
179 IPC_STRUCT_TRAITS_MEMBER(width) 181 IPC_STRUCT_TRAITS_MEMBER(width)
180 IPC_STRUCT_TRAITS_MEMBER(height) 182 IPC_STRUCT_TRAITS_MEMBER(height)
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 585
584 // Record a sample string to a Rappor metric. 586 // Record a sample string to a Rappor metric.
585 IPC_MESSAGE_CONTROL2(ChromeViewHostMsg_RecordRappor, 587 IPC_MESSAGE_CONTROL2(ChromeViewHostMsg_RecordRappor,
586 std::string /* metric */, 588 std::string /* metric */,
587 std::string /* sample */) 589 std::string /* sample */)
588 590
589 // Record a domain and registry of a url to a Rappor metric. 591 // Record a domain and registry of a url to a Rappor metric.
590 IPC_MESSAGE_CONTROL2(ChromeViewHostMsg_RecordRapporURL, 592 IPC_MESSAGE_CONTROL2(ChromeViewHostMsg_RecordRapporURL,
591 std::string /* metric */, 593 std::string /* metric */,
592 GURL /* sample url */) 594 GURL /* sample url */)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698