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

Side by Side Diff: ipc/ipc_message_utils.cc

Issue 12381066: Add IPC handling for INVALID_HANDLE_VALUE on Win64 builds (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "ipc/ipc_message_utils.h" 5 #include "ipc/ipc_message_utils.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/nullable_string16.h" 10 #include "base/nullable_string16.h"
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 r->SetHeaderValues(static_cast<int32>(routing_id), type, flags); 746 r->SetHeaderValues(static_cast<int32>(routing_id), type, flags);
747 return r->WriteBytes(payload, payload_size); 747 return r->WriteBytes(payload, payload_size);
748 } 748 }
749 749
750 void ParamTraits<Message>::Log(const Message& p, std::string* l) { 750 void ParamTraits<Message>::Log(const Message& p, std::string* l) {
751 l->append("<IPC::Message>"); 751 l->append("<IPC::Message>");
752 } 752 }
753 753
754 #if defined(OS_WIN) 754 #if defined(OS_WIN)
755 // Note that HWNDs/HANDLE/HCURSOR/HACCEL etc are always 32 bits, even on 64 755 // Note that HWNDs/HANDLE/HCURSOR/HACCEL etc are always 32 bits, even on 64
756 // bit systems. 756 // bit systems. That's why we use the Windows macros to convert to 32 bits.
757 void ParamTraits<HANDLE>::Write(Message* m, const param_type& p) { 757 void ParamTraits<HANDLE>::Write(Message* m, const param_type& p) {
758 m->WriteUInt32(reinterpret_cast<uint32>(p)); 758 m->WriteInt(HandleToLong(p));
759 } 759 }
760 760
761 bool ParamTraits<HANDLE>::Read(const Message* m, PickleIterator* iter, 761 bool ParamTraits<HANDLE>::Read(const Message* m, PickleIterator* iter,
762 param_type* r) { 762 param_type* r) {
763 uint32 temp; 763 int32 temp;
764 if (!m->ReadUInt32(iter, &temp)) 764 if (!m->ReadInt(iter, &temp))
765 return false; 765 return false;
766 *r = reinterpret_cast<HANDLE>(temp); 766 *r = LongToHandle(temp);
767 return true; 767 return true;
768 } 768 }
769 769
770 void ParamTraits<HANDLE>::Log(const param_type& p, std::string* l) { 770 void ParamTraits<HANDLE>::Log(const param_type& p, std::string* l) {
771 l->append(StringPrintf("0x%X", p)); 771 l->append(StringPrintf("0x%X", p));
772 } 772 }
773 773
774 void ParamTraits<LOGFONT>::Write(Message* m, const param_type& p) { 774 void ParamTraits<LOGFONT>::Write(Message* m, const param_type& p) {
775 m->WriteData(reinterpret_cast<const char*>(&p), sizeof(LOGFONT)); 775 m->WriteData(reinterpret_cast<const char*>(&p), sizeof(LOGFONT));
776 } 776 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 return result; 814 return result;
815 } 815 }
816 816
817 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { 817 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) {
818 l->append("<MSG>"); 818 l->append("<MSG>");
819 } 819 }
820 820
821 #endif // OS_WIN 821 #endif // OS_WIN
822 822
823 } // namespace IPC 823 } // namespace IPC
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698