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

Side by Side Diff: content/common/content_param_traits_macros.h

Issue 2519273002: Fail when saving page as MHTML provides information about the cause. (Closed)
Patch Set: Addressed code review comments. Created 4 years 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 // Singly or Multiply-included shared traits file depending on circumstances. 5 // Singly or Multiply-included shared traits file depending on circumstances.
6 // This allows the use of IPC serialization macros in more than one IPC message 6 // This allows the use of IPC serialization macros in more than one IPC message
7 // file. 7 // file.
8 #ifndef CONTENT_COMMON_CONTENT_PARAM_TRAITS_MACROS_H_ 8 #ifndef CONTENT_COMMON_CONTENT_PARAM_TRAITS_MACROS_H_
9 #define CONTENT_COMMON_CONTENT_PARAM_TRAITS_MACROS_H_ 9 #define CONTENT_COMMON_CONTENT_PARAM_TRAITS_MACROS_H_
10 10
11 #include "content/common/content_export.h" 11 #include "content/common/content_export.h"
12 #include "content/common/download/mhtml_save_status.h"
12 #include "content/common/input/input_event_ack_state.h" 13 #include "content/common/input/input_event_ack_state.h"
13 #include "content/public/common/request_context_frame_type.h" 14 #include "content/public/common/request_context_frame_type.h"
14 #include "content/public/common/request_context_type.h" 15 #include "content/public/common/request_context_type.h"
15 #include "content/public/common/resource_type.h" 16 #include "content/public/common/resource_type.h"
16 #include "ipc/ipc_message_macros.h" 17 #include "ipc/ipc_message_macros.h"
17 #include "third_party/WebKit/public/platform/WebAddressSpace.h" 18 #include "third_party/WebKit/public/platform/WebAddressSpace.h"
18 #include "third_party/WebKit/public/platform/WebInputEvent.h" 19 #include "third_party/WebKit/public/platform/WebInputEvent.h"
19 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" 20 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h"
20 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" 21 #include "third_party/WebKit/public/web/WebCompositionUnderline.h"
21 #include "third_party/WebKit/public/web/WebContentSecurityPolicy.h" 22 #include "third_party/WebKit/public/web/WebContentSecurityPolicy.h"
22 #include "third_party/WebKit/public/web/WebSharedWorkerCreationContextType.h" 23 #include "third_party/WebKit/public/web/WebSharedWorkerCreationContextType.h"
23 #include "ui/gfx/gpu_memory_buffer.h" 24 #include "ui/gfx/gpu_memory_buffer.h"
24 25
25 #undef IPC_MESSAGE_EXPORT 26 #undef IPC_MESSAGE_EXPORT
26 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT 27 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT
27 28
28 IPC_ENUM_TRAITS_MAX_VALUE(content::InputEventAckState, 29 IPC_ENUM_TRAITS_MAX_VALUE(content::InputEventAckState,
29 content::INPUT_EVENT_ACK_STATE_MAX) 30 content::INPUT_EVENT_ACK_STATE_MAX)
30 IPC_ENUM_TRAITS_MAX_VALUE(content::ResourceType, 31 IPC_ENUM_TRAITS_MAX_VALUE(content::ResourceType,
31 content::RESOURCE_TYPE_LAST_TYPE - 1) 32 content::RESOURCE_TYPE_LAST_TYPE - 1)
32 IPC_ENUM_TRAITS_MAX_VALUE(content::RequestContextType, 33 IPC_ENUM_TRAITS_MAX_VALUE(content::RequestContextType,
33 content::REQUEST_CONTEXT_TYPE_LAST) 34 content::REQUEST_CONTEXT_TYPE_LAST)
34 IPC_ENUM_TRAITS_MAX_VALUE(content::RequestContextFrameType, 35 IPC_ENUM_TRAITS_MAX_VALUE(content::RequestContextFrameType,
35 content::REQUEST_CONTEXT_FRAME_TYPE_LAST) 36 content::REQUEST_CONTEXT_FRAME_TYPE_LAST)
37 IPC_ENUM_TRAITS_MAX_VALUE(
38 content::MhtmlSaveStatus,
39 static_cast<int>(content::MhtmlSaveStatus::STATUS_COUNT) - 1)
nasko 2016/11/23 18:07:34 Why the need for static casting? Can't we just def
carlosk 2016/11/23 20:08:40 Static casting is needed for the subtraction opera
nasko 2016/11/24 00:07:31 I prefer the compiler do the work for us, which me
carlosk 2016/11/24 00:21:11 Done.
36 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebContentSecurityPolicySource, 40 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebContentSecurityPolicySource,
37 blink::WebContentSecurityPolicySourceLast) 41 blink::WebContentSecurityPolicySourceLast)
38 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebContentSecurityPolicyType, 42 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebContentSecurityPolicyType,
39 blink::WebContentSecurityPolicyTypeLast) 43 blink::WebContentSecurityPolicyTypeLast)
40 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebAddressSpace, blink::WebAddressSpaceLast) 44 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebAddressSpace, blink::WebAddressSpaceLast)
41 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebSharedWorkerCreationContextType, 45 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebSharedWorkerCreationContextType,
42 blink::WebSharedWorkerCreationContextTypeLast) 46 blink::WebSharedWorkerCreationContextTypeLast)
43 IPC_ENUM_TRAITS_MIN_MAX_VALUE(blink::WebInputEvent::Type, 47 IPC_ENUM_TRAITS_MIN_MAX_VALUE(blink::WebInputEvent::Type,
44 blink::WebInputEvent::TypeFirst, 48 blink::WebInputEvent::TypeFirst,
45 blink::WebInputEvent::TypeLast) 49 blink::WebInputEvent::TypeLast)
46 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebPageVisibilityState, 50 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebPageVisibilityState,
47 blink::WebPageVisibilityStateLast) 51 blink::WebPageVisibilityStateLast)
48 52
49 IPC_STRUCT_TRAITS_BEGIN(blink::WebCompositionUnderline) 53 IPC_STRUCT_TRAITS_BEGIN(blink::WebCompositionUnderline)
50 IPC_STRUCT_TRAITS_MEMBER(startOffset) 54 IPC_STRUCT_TRAITS_MEMBER(startOffset)
51 IPC_STRUCT_TRAITS_MEMBER(endOffset) 55 IPC_STRUCT_TRAITS_MEMBER(endOffset)
52 IPC_STRUCT_TRAITS_MEMBER(color) 56 IPC_STRUCT_TRAITS_MEMBER(color)
53 IPC_STRUCT_TRAITS_MEMBER(thick) 57 IPC_STRUCT_TRAITS_MEMBER(thick)
54 IPC_STRUCT_TRAITS_MEMBER(backgroundColor) 58 IPC_STRUCT_TRAITS_MEMBER(backgroundColor)
55 IPC_STRUCT_TRAITS_END() 59 IPC_STRUCT_TRAITS_END()
56 60
57 #endif // CONTENT_COMMON_CONTENT_PARAM_TRAITS_MACROS_H_ 61 #endif // CONTENT_COMMON_CONTENT_PARAM_TRAITS_MACROS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698