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

Side by Side Diff: ipc/ipc_message_utils.cc

Issue 145303002: Convert Media Galleries to use base::File (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 11 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 | « ipc/ipc_message_utils.h ('k') | ipc/ipc_platform_file.h » ('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 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 548
549 void ParamTraits<base::NullableString16>::Log(const param_type& p, 549 void ParamTraits<base::NullableString16>::Log(const param_type& p,
550 std::string* l) { 550 std::string* l) {
551 l->append("("); 551 l->append("(");
552 LogParam(p.string(), l); 552 LogParam(p.string(), l);
553 l->append(", "); 553 l->append(", ");
554 LogParam(p.is_null(), l); 554 LogParam(p.is_null(), l);
555 l->append(")"); 555 l->append(")");
556 } 556 }
557 557
558 void ParamTraits<base::PlatformFileInfo>::Write(Message* m, 558 void ParamTraits<base::File::Info>::Write(Message* m,
559 const param_type& p) { 559 const param_type& p) {
560 WriteParam(m, p.size); 560 WriteParam(m, p.size);
561 WriteParam(m, p.is_directory); 561 WriteParam(m, p.is_directory);
562 WriteParam(m, p.last_modified.ToDoubleT()); 562 WriteParam(m, p.last_modified.ToDoubleT());
563 WriteParam(m, p.last_accessed.ToDoubleT()); 563 WriteParam(m, p.last_accessed.ToDoubleT());
564 WriteParam(m, p.creation_time.ToDoubleT()); 564 WriteParam(m, p.creation_time.ToDoubleT());
565 } 565 }
566 566
567 bool ParamTraits<base::PlatformFileInfo>::Read(const Message* m, 567 bool ParamTraits<base::File::Info>::Read(const Message* m,
568 PickleIterator* iter, 568 PickleIterator* iter,
569 param_type* p) { 569 param_type* p) {
570 double last_modified; 570 double last_modified;
571 double last_accessed; 571 double last_accessed;
572 double creation_time; 572 double creation_time;
573 bool result = 573 bool result =
574 ReadParam(m, iter, &p->size) && 574 ReadParam(m, iter, &p->size) &&
575 ReadParam(m, iter, &p->is_directory) && 575 ReadParam(m, iter, &p->is_directory) &&
576 ReadParam(m, iter, &last_modified) && 576 ReadParam(m, iter, &last_modified) &&
577 ReadParam(m, iter, &last_accessed) && 577 ReadParam(m, iter, &last_accessed) &&
578 ReadParam(m, iter, &creation_time); 578 ReadParam(m, iter, &creation_time);
579 if (result) { 579 if (result) {
580 p->last_modified = base::Time::FromDoubleT(last_modified); 580 p->last_modified = base::Time::FromDoubleT(last_modified);
581 p->last_accessed = base::Time::FromDoubleT(last_accessed); 581 p->last_accessed = base::Time::FromDoubleT(last_accessed);
582 p->creation_time = base::Time::FromDoubleT(creation_time); 582 p->creation_time = base::Time::FromDoubleT(creation_time);
583 } 583 }
584 return result; 584 return result;
585 } 585 }
586 586
587 void ParamTraits<base::PlatformFileInfo>::Log(const param_type& p, 587 void ParamTraits<base::File::Info>::Log(const param_type& p,
588 std::string* l) { 588 std::string* l) {
589 l->append("("); 589 l->append("(");
590 LogParam(p.size, l); 590 LogParam(p.size, l);
591 l->append(","); 591 l->append(",");
592 LogParam(p.is_directory, l); 592 LogParam(p.is_directory, l);
593 l->append(","); 593 l->append(",");
594 LogParam(p.last_modified.ToDoubleT(), l); 594 LogParam(p.last_modified.ToDoubleT(), l);
595 l->append(","); 595 l->append(",");
596 LogParam(p.last_accessed.ToDoubleT(), l); 596 LogParam(p.last_accessed.ToDoubleT(), l);
597 l->append(","); 597 l->append(",");
598 LogParam(p.creation_time.ToDoubleT(), l); 598 LogParam(p.creation_time.ToDoubleT(), l);
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 return result; 823 return result;
824 } 824 }
825 825
826 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { 826 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) {
827 l->append("<MSG>"); 827 l->append("<MSG>");
828 } 828 }
829 829
830 #endif // OS_WIN 830 #endif // OS_WIN
831 831
832 } // namespace IPC 832 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_message_utils.h ('k') | ipc/ipc_platform_file.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698