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

Side by Side Diff: ipc/ipc_message_utils.cc

Issue 1122153002: Fixit: Fork base::TimeTicks --> TimeTicks + ThreadTicks + TraceTicks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@FIXIT_timeclasses_1of2
Patch Set: REBASE after it passed CQ but did not commit to tree Created 5 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 unified diff | Download patch
« no previous file with comments | « ipc/ipc_message_utils.h ('k') | ppapi/shared_impl/ppb_trace_event_impl.cc » ('j') | 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/strings/nullable_string16.h" 10 #include "base/strings/nullable_string16.h"
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 if (ret) 653 if (ret)
654 *r = base::TimeTicks::FromInternalValue(value); 654 *r = base::TimeTicks::FromInternalValue(value);
655 655
656 return ret; 656 return ret;
657 } 657 }
658 658
659 void ParamTraits<base::TimeTicks>::Log(const param_type& p, std::string* l) { 659 void ParamTraits<base::TimeTicks>::Log(const param_type& p, std::string* l) {
660 ParamTraits<int64>::Log(p.ToInternalValue(), l); 660 ParamTraits<int64>::Log(p.ToInternalValue(), l);
661 } 661 }
662 662
663 void ParamTraits<base::TraceTicks>::Write(Message* m, const param_type& p) {
664 ParamTraits<int64>::Write(m, p.ToInternalValue());
665 }
666
667 bool ParamTraits<base::TraceTicks>::Read(const Message* m,
668 PickleIterator* iter,
669 param_type* r) {
670 int64 value;
671 bool ret = ParamTraits<int64>::Read(m, iter, &value);
672 if (ret)
673 *r = base::TraceTicks::FromInternalValue(value);
674
675 return ret;
676 }
677
678 void ParamTraits<base::TraceTicks>::Log(const param_type& p, std::string* l) {
679 ParamTraits<int64>::Log(p.ToInternalValue(), l);
680 }
681
663 void ParamTraits<IPC::ChannelHandle>::Write(Message* m, const param_type& p) { 682 void ParamTraits<IPC::ChannelHandle>::Write(Message* m, const param_type& p) {
664 #if defined(OS_WIN) 683 #if defined(OS_WIN)
665 // On Windows marshalling pipe handle is not supported. 684 // On Windows marshalling pipe handle is not supported.
666 DCHECK(p.pipe.handle == NULL); 685 DCHECK(p.pipe.handle == NULL);
667 #endif // defined (OS_WIN) 686 #endif // defined (OS_WIN)
668 WriteParam(m, p.name); 687 WriteParam(m, p.name);
669 #if defined(OS_POSIX) 688 #if defined(OS_POSIX)
670 WriteParam(m, p.socket); 689 WriteParam(m, p.socket);
671 #endif 690 #endif
672 } 691 }
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 return result; 848 return result;
830 } 849 }
831 850
832 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { 851 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) {
833 l->append("<MSG>"); 852 l->append("<MSG>");
834 } 853 }
835 854
836 #endif // OS_WIN 855 #endif // OS_WIN
837 856
838 } // namespace IPC 857 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_message_utils.h ('k') | ppapi/shared_impl/ppb_trace_event_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698