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

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

Issue 6721021: Move a bunch of renderer->browser messages to content. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 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 // This file is used to define IPC::ParamTraits<> specializations for a number 5 // This file is used to define IPC::ParamTraits<> specializations for a number
6 // of types so that they can be serialized over IPC. IPC::ParamTraits<> 6 // of types so that they can be serialized over IPC. IPC::ParamTraits<>
7 // specializations for basic types (like int and std::string) and types in the 7 // specializations for basic types (like int and std::string) and types in the
8 // 'base' project can be found in ipc/ipc_message_utils.h. This file contains 8 // 'base' project can be found in ipc/ipc_message_utils.h. This file contains
9 // specializations for types that are used by the content code, and which need 9 // specializations for types that are used by the content code, and which need
10 // manual serialization code. This is usually because they're not structs with 10 // manual serialization code. This is usually because they're not structs with
(...skipping 11 matching lines...) Expand all
22 #include "ipc/ipc_message_utils.h" 22 #include "ipc/ipc_message_utils.h"
23 #include "net/base/ip_endpoint.h" 23 #include "net/base/ip_endpoint.h"
24 #include "net/url_request/url_request_status.h" 24 #include "net/url_request/url_request_status.h"
25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h"
27 #include "ui/gfx/native_widget_types.h" 27 #include "ui/gfx/native_widget_types.h"
28 #include "webkit/blob/blob_data.h" 28 #include "webkit/blob/blob_data.h"
29 #include "webkit/glue/npruntime_util.h" 29 #include "webkit/glue/npruntime_util.h"
30 #include "webkit/glue/resource_type.h" 30 #include "webkit/glue/resource_type.h"
31 #include "webkit/glue/webcursor.h" 31 #include "webkit/glue/webcursor.h"
32 #include "webkit/glue/window_open_disposition.h"
32 33
33 class SkBitmap; 34 class SkBitmap;
34 35
35 namespace gfx { 36 namespace gfx {
36 class Point; 37 class Point;
37 class Rect; 38 class Rect;
38 class Size; 39 class Size;
39 } // namespace gfx 40 } // namespace gfx
40 41
41 namespace net { 42 namespace net {
42 class HttpResponseHeaders; 43 class HttpResponseHeaders;
43 class HostPortPair; 44 class HostPortPair;
44 class UploadData; 45 class UploadData;
45 } 46 }
46 47
47 namespace webkit_glue { 48 namespace webkit_glue {
49 struct PasswordForm;
48 struct ResourceDevToolsInfo; 50 struct ResourceDevToolsInfo;
49 struct ResourceLoadTimingInfo; 51 struct ResourceLoadTimingInfo;
50 } 52 }
51 53
52 // Define the NPVariant_Param struct and its enum here since it needs manual 54 // Define the NPVariant_Param struct and its enum here since it needs manual
53 // serialization code. 55 // serialization code.
54 enum NPVariant_ParamEnum { 56 enum NPVariant_ParamEnum {
55 NPVARIANT_PARAM_VOID, 57 NPVARIANT_PARAM_VOID,
56 NPVARIANT_PARAM_NULL, 58 NPVARIANT_PARAM_NULL,
57 NPVARIANT_PARAM_BOOL, 59 NPVARIANT_PARAM_BOOL,
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 typedef SkBitmap param_type; 393 typedef SkBitmap param_type;
392 static void Write(Message* m, const param_type& p); 394 static void Write(Message* m, const param_type& p);
393 395
394 // Note: This function expects parameter |r| to be of type &SkBitmap since 396 // Note: This function expects parameter |r| to be of type &SkBitmap since
395 // r->SetConfig() and r->SetPixels() are called. 397 // r->SetConfig() and r->SetPixels() are called.
396 static bool Read(const Message* m, void** iter, param_type* r); 398 static bool Read(const Message* m, void** iter, param_type* r);
397 399
398 static void Log(const param_type& p, std::string* l); 400 static void Log(const param_type& p, std::string* l);
399 }; 401 };
400 402
403 template <>
404 struct SimilarTypeTraits<WindowOpenDisposition> {
405 typedef int Type;
406 };
407
408 template <>
409 struct ParamTraits<webkit_glue::PasswordForm> {
410 typedef webkit_glue::PasswordForm param_type;
411 static void Write(Message* m, const param_type& p);
412 static bool Read(const Message* m, void** iter, param_type* p);
413 static void Log(const param_type& p, std::string* l);
414 };
401 415
402 } // namespace IPC 416 } // namespace IPC
403 417
404 #endif // CONTENT_COMMON_COMMON_PARAM_TRAITS_H_ 418 #endif // CONTENT_COMMON_COMMON_PARAM_TRAITS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698