summaryrefslogtreecommitdiffstats
path: root/chrome/common/common_param_traits.h
diff options
context:
space:
mode:
authorsatish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-06 11:52:32 +0000
committersatish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-06 11:52:32 +0000
commitd8683e366ade2f3af7200785c1acdab7b09d0c40 (patch)
tree4f50a2f86333214a67ae8b41d64158ec3b9150dc /chrome/common/common_param_traits.h
parent32d0269681eff5f46290cafa99511f5733757884 (diff)
downloadchromium_src-d8683e366ade2f3af7200785c1acdab7b09d0c40.zip
chromium_src-d8683e366ade2f3af7200785c1acdab7b09d0c40.tar.gz
chromium_src-d8683e366ade2f3af7200785c1acdab7b09d0c40.tar.bz2
Revert 61608 - On Windows, create a new TransportDIB::Handle struct which includes the file
mapping HANDLE and the source process ID. Duplicating the handle for the remote process is done in TransportDIB::Map, instead of in various #ifdefs scattered across the code. Also on windows, remove the struct for the TransportDIB::Id which contained both the sequence number and the HANDLE and replace it with just the sequence number. Fix ThumbnailGenerator by mapping the TransportDIB on Windows and adding a method to duplicate the file mapping handle before sending across the channel. BUG=none TEST=none Review URL: http://codereview.chromium.org/3305020 BUG=58128 TBR=kkania@chromium.org Review URL: http://codereview.chromium.org/3596008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61624 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/common_param_traits.h')
-rw-r--r--chrome/common/common_param_traits.h35
1 files changed, 10 insertions, 25 deletions
diff --git a/chrome/common/common_param_traits.h b/chrome/common/common_param_traits.h
index 27a86d1..a2c5dca 100644
--- a/chrome/common/common_param_traits.h
+++ b/chrome/common/common_param_traits.h
@@ -12,10 +12,6 @@
#define CHROME_COMMON_COMMON_PARAM_TRAITS_H_
#pragma once
-#if defined(OS_WIN)
-#include <windows.h>
-#endif
-
#include <vector>
#include "app/surface/transport_dib.h"
@@ -242,33 +238,22 @@ struct ParamTraits<webkit_glue::WebApplicationInfo> {
#if defined(OS_WIN)
-template <>
-struct ParamTraits<TransportDIB::Handle> {
- typedef TransportDIB::Handle param_type;
+template<>
+struct ParamTraits<TransportDIB::Id> {
+ typedef TransportDIB::Id param_type;
static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.section());
- WriteParam(m, p.owner_id());
- WriteParam(m, p.should_dup_on_map());
+ WriteParam(m, p.handle);
+ WriteParam(m, p.sequence_num);
}
static bool Read(const Message* m, void** iter, param_type* r) {
- HANDLE section;
- base::ProcessId owner_id;
- bool should_dup_on_map;
- bool success = ReadParam(m, iter, &section) &&
- ReadParam(m, iter, &owner_id) &&
- ReadParam(m, iter, &should_dup_on_map);
- if (success) {
- *r = TransportDIB::Handle(section, owner_id, should_dup_on_map);
- }
- return success;
+ return (ReadParam(m, iter, &r->handle) &&
+ ReadParam(m, iter, &r->sequence_num));
}
static void Log(const param_type& p, std::string* l) {
- l->append("TransportDIB::Handle(");
- LogParam(p.section(), l);
- l->append(", ");
- LogParam(p.owner_id(), l);
+ l->append("TransportDIB(");
+ LogParam(p.handle, l);
l->append(", ");
- LogParam(p.should_dup_on_map(), l);
+ LogParam(p.sequence_num, l);
l->append(")");
}
};