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

Unified Diff: content/public/common/common_param_traits.cc

Issue 10577040: Generate param traits even when shared by mutliple message files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/common/common_param_traits.h ('k') | content/public/common/common_param_traits_macros.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/common/common_param_traits.cc
===================================================================
--- content/public/common/common_param_traits.cc (revision 143430)
+++ content/public/common/common_param_traits.cc (working copy)
@@ -70,76 +70,6 @@
l->append(p.spec());
}
-void ParamTraits<ResourceType::Type>::Write(Message* m, const param_type& p) {
- m->WriteInt(p);
-}
-
-bool ParamTraits<ResourceType::Type>::Read(const Message* m,
- PickleIterator* iter,
- param_type* p) {
- int type;
- if (!m->ReadInt(iter, &type) || !ResourceType::ValidType(type))
- return false;
- *p = ResourceType::FromInt(type);
- return true;
-}
-
-void ParamTraits<ResourceType::Type>::Log(const param_type& p, std::string* l) {
- std::string type;
- switch (p) {
- case ResourceType::MAIN_FRAME:
- type = "MAIN_FRAME";
- break;
- case ResourceType::SUB_FRAME:
- type = "SUB_FRAME";
- break;
- case ResourceType::STYLESHEET:
- type = "STYLESHEET";
- break;
- case ResourceType::SCRIPT:
- type = "SCRIPT";
- break;
- case ResourceType::IMAGE:
- type = "IMAGE";
- break;
- case ResourceType::FONT_RESOURCE:
- type = "FONT_RESOURCE";
- break;
- case ResourceType::SUB_RESOURCE:
- type = "SUB_RESOURCE";
- break;
- case ResourceType::OBJECT:
- type = "OBJECT";
- break;
- case ResourceType::MEDIA:
- type = "MEDIA";
- break;
- case ResourceType::WORKER:
- type = "WORKER";
- break;
- case ResourceType::SHARED_WORKER:
- type = "SHARED_WORKER";
- break;
- case ResourceType::PREFETCH:
- type = "PREFETCH";
- break;
- case ResourceType::PRERENDER:
- type = "PRERENDER";
- break;
- case ResourceType::FAVICON:
- type = "FAVICON";
- break;
- case ResourceType::XHR:
- type = "XHR";
- break;
- default:
- type = "UNKNOWN";
- break;
- }
-
- LogParam(type, l);
-}
-
void ParamTraits<net::URLRequestStatus>::Write(Message* m,
const param_type& p) {
WriteParam(m, static_cast<int>(p.status()));
@@ -553,39 +483,25 @@
l->append("<SkBitmap>");
}
-void ParamTraits<content::ConsoleMessageLevel>::Write(Message* m,
- const param_type& p) {
- m->WriteInt(static_cast<int>(p));
-}
+} // namespace IPC
-bool ParamTraits<content::ConsoleMessageLevel>::Read(const Message* m,
- PickleIterator* iter,
- param_type* p) {
- int type;
- if (!m->ReadInt(iter, &type))
- return false;
- *p = static_cast<param_type>(type);
- return true;
-}
+// Generate param traits write methods.
+#include "ipc/param_traits_write_macros.h"
+namespace IPC {
+#undef CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_MACROS_H_
+#include "content/public/common/common_param_traits_macros.h"
+} // namespace IPC
-void ParamTraits<content::ConsoleMessageLevel>::Log(const param_type& p,
- std::string* l) {
- std::string level;
- switch (p) {
- case content::CONSOLE_MESSAGE_LEVEL_TIP:
- level = "CONSOLE_MESSAGE_LEVEL_TIP";
- break;
- case content::CONSOLE_MESSAGE_LEVEL_LOG:
- level = "CONSOLE_MESSAGE_LEVEL_LOG";
- break;
- case content::CONSOLE_MESSAGE_LEVEL_WARNING:
- level = "CONSOLE_MESSAGE_LEVEL_WARNING";
- break;
- case content::CONSOLE_MESSAGE_LEVEL_ERROR:
- level = "CONSOLE_MESSAGE_LEVEL_ERROR";
- break;
- }
- LogParam(level, l);
-}
+// Generate param traits read methods.
+#include "ipc/param_traits_read_macros.h"
+namespace IPC {
+#undef CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_MACROS_H_
+#include "content/public/common/common_param_traits_macros.h"
+} // namespace IPC
+// Generate param traits log methods.
+#include "ipc/param_traits_log_macros.h"
+namespace IPC {
+#undef CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_MACROS_H_
+#include "content/public/common/common_param_traits_macros.h"
} // namespace IPC
« no previous file with comments | « content/public/common/common_param_traits.h ('k') | content/public/common/common_param_traits_macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698