OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
3 // LICENSE file. | 3 // LICENSE file. |
4 // | 4 // |
5 // This file contains ParamTraits templates to support serialization of WebKit | 5 // This file contains ParamTraits templates to support serialization of WebKit |
6 // data types over IPC. | 6 // data types over IPC. |
7 // | 7 // |
8 // NOTE: IT IS IMPORTANT THAT ONLY POD (plain old data) TYPES ARE SERIALIZED. | 8 // NOTE: IT IS IMPORTANT THAT ONLY POD (plain old data) TYPES ARE SERIALIZED. |
9 // | 9 // |
10 // There are several reasons for this restrictions: | 10 // There are several reasons for this restrictions: |
11 // | 11 // |
12 // o We don't want inclusion of this file to imply linking to WebKit code. | 12 // o We don't want inclusion of this file to imply linking to WebKit code. |
13 // | 13 // |
14 // o Many WebKit structures are not thread-safe. WebString, for example, | 14 // o Many WebKit structures are not thread-safe. WebString, for example, |
15 // contains a reference counted buffer, which does not use thread-safe | 15 // contains a reference counted buffer, which does not use thread-safe |
16 // reference counting. If we allowed serializing WebString, then we may ru
n | 16 // reference counting. If we allowed serializing WebString, then we may ru
n |
17 // the risk of introducing subtle thread-safety bugs if people passed a | 17 // the risk of introducing subtle thread-safety bugs if people passed a |
18 // WebString across threads via PostTask(NewRunnableMethod(...)). | 18 // WebString across threads via PostTask(NewRunnableMethod(...)). |
19 // | 19 // |
20 // o The WebKit API has redundant types for strings, and we should avoid usin
g | 20 // o The WebKit API has redundant types for strings, and we should avoid usin
g |
21 // those beyond code that interfaces with the WebKit API. | 21 // those beyond code that interfaces with the WebKit API. |
22 | 22 |
23 #ifndef CHROME_COMMON_WEBKIT_PARAM_TRAITS_H_ | 23 #ifndef CHROME_COMMON_WEBKIT_PARAM_TRAITS_H_ |
24 #define CHROME_COMMON_WEBKIT_PARAM_TRAITS_H_ | 24 #define CHROME_COMMON_WEBKIT_PARAM_TRAITS_H_ |
25 | 25 |
26 #include "chrome/common/ipc_message_utils.h" | 26 #include "ipc/ipc_message_utils.h" |
27 #include "webkit/api/public/WebCache.h" | 27 #include "webkit/api/public/WebCache.h" |
28 #include "webkit/api/public/WebCompositionCommand.h" | 28 #include "webkit/api/public/WebCompositionCommand.h" |
29 #include "webkit/api/public/WebConsoleMessage.h" | 29 #include "webkit/api/public/WebConsoleMessage.h" |
30 #include "webkit/api/public/WebFindOptions.h" | 30 #include "webkit/api/public/WebFindOptions.h" |
31 #include "webkit/api/public/WebInputEvent.h" | 31 #include "webkit/api/public/WebInputEvent.h" |
32 #include "webkit/api/public/WebScreenInfo.h" | 32 #include "webkit/api/public/WebScreenInfo.h" |
33 #include "webkit/api/public/WebTextDirection.h" | 33 #include "webkit/api/public/WebTextDirection.h" |
34 | 34 |
35 namespace IPC { | 35 namespace IPC { |
36 | 36 |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 return true; | 298 return true; |
299 } | 299 } |
300 static void Log(const param_type& p, std::wstring* l) { | 300 static void Log(const param_type& p, std::wstring* l) { |
301 LogParam(static_cast<int>(p), l); | 301 LogParam(static_cast<int>(p), l); |
302 } | 302 } |
303 }; | 303 }; |
304 | 304 |
305 } // namespace IPC | 305 } // namespace IPC |
306 | 306 |
307 #endif // CHROME_COMMON_WEBKIT_PARAM_TRAITS_H_ | 307 #endif // CHROME_COMMON_WEBKIT_PARAM_TRAITS_H_ |
OLD | NEW |