| OLD | NEW |
| 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 shared by more than one child process. | 9 // specializations for types that are shared by more than one child process. |
| 10 | 10 |
| 11 #ifndef CHROME_COMMON_COMMON_PARAM_TRAITS_H_ | 11 #ifndef CHROME_COMMON_COMMON_PARAM_TRAITS_H_ |
| 12 #define CHROME_COMMON_COMMON_PARAM_TRAITS_H_ | 12 #define CHROME_COMMON_COMMON_PARAM_TRAITS_H_ |
| 13 #pragma once | 13 #pragma once |
| 14 | 14 |
| 15 #include "app/surface/transport_dib.h" | 15 #include "app/surface/transport_dib.h" |
| 16 #include "base/file_util.h" | 16 #include "base/file_util.h" |
| 17 #include "base/platform_file.h" | |
| 18 #include "base/ref_counted.h" | 17 #include "base/ref_counted.h" |
| 19 #include "chrome/common/content_settings.h" | 18 #include "chrome/common/content_settings.h" |
| 20 #include "chrome/common/page_zoom.h" | 19 #include "chrome/common/page_zoom.h" |
| 21 #include "ipc/ipc_message_utils.h" | 20 #include "ipc/ipc_message_utils.h" |
| 22 #include "printing/native_metafile.h" | 21 #include "printing/native_metafile.h" |
| 23 // !!! WARNING: DO NOT ADD NEW WEBKIT DEPENDENCIES !!! | 22 // !!! WARNING: DO NOT ADD NEW WEBKIT DEPENDENCIES !!! |
| 24 // | 23 // |
| 25 // That means don't add #includes to any file in 'webkit/' or | 24 // That means don't add #includes to any file in 'webkit/' or |
| 26 // 'third_party/WebKit/'. Chrome Frame and NACL build parts of base/ and | 25 // 'third_party/WebKit/'. Chrome Frame and NACL build parts of base/ and |
| 27 // chrome/common/ for a mini-library that doesn't depend on webkit. | 26 // chrome/common/ for a mini-library that doesn't depend on webkit. |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 | 279 |
| 281 template <> | 280 template <> |
| 282 struct ParamTraits<printing::NativeMetafile> { | 281 struct ParamTraits<printing::NativeMetafile> { |
| 283 typedef printing::NativeMetafile param_type; | 282 typedef printing::NativeMetafile param_type; |
| 284 static void Write(Message* m, const param_type& p); | 283 static void Write(Message* m, const param_type& p); |
| 285 static bool Read(const Message* m, void** iter, param_type* r); | 284 static bool Read(const Message* m, void** iter, param_type* r); |
| 286 static void Log(const param_type& p, std::string* l); | 285 static void Log(const param_type& p, std::string* l); |
| 287 }; | 286 }; |
| 288 | 287 |
| 289 template <> | 288 template <> |
| 290 struct ParamTraits<base::PlatformFileInfo> { | |
| 291 typedef base::PlatformFileInfo param_type; | |
| 292 static void Write(Message* m, const param_type& p); | |
| 293 static bool Read(const Message* m, void** iter, param_type* r); | |
| 294 static void Log(const param_type& p, std::string* l); | |
| 295 }; | |
| 296 | |
| 297 // Traits for base::PlatformFileError | |
| 298 template <> | |
| 299 struct SimilarTypeTraits<base::PlatformFileError> { | |
| 300 typedef int Type; | |
| 301 }; | |
| 302 | |
| 303 template <> | |
| 304 struct ParamTraits<printing::PrinterCapsAndDefaults> { | 289 struct ParamTraits<printing::PrinterCapsAndDefaults> { |
| 305 typedef printing::PrinterCapsAndDefaults param_type; | 290 typedef printing::PrinterCapsAndDefaults param_type; |
| 306 static void Write(Message* m, const param_type& p); | 291 static void Write(Message* m, const param_type& p); |
| 307 static bool Read(const Message* m, void** iter, param_type* r); | 292 static bool Read(const Message* m, void** iter, param_type* r); |
| 308 static void Log(const param_type& p, std::string* l); | 293 static void Log(const param_type& p, std::string* l); |
| 309 }; | 294 }; |
| 310 | 295 |
| 311 } // namespace IPC | 296 } // namespace IPC |
| 312 | 297 |
| 313 #endif // CHROME_COMMON_COMMON_PARAM_TRAITS_H_ | 298 #endif // CHROME_COMMON_COMMON_PARAM_TRAITS_H_ |
| OLD | NEW |