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

Side by Side Diff: components/reading_list/ios/reading_list_store.cc

Issue 2558183004: Add merge rules for first read time (Closed)
Patch Set: =0 Created 4 years 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "components/reading_list/ios/reading_list_store.h" 5 #include "components/reading_list/ios/reading_list_store.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "components/reading_list/ios/proto/reading_list.pb.h" 10 #include "components/reading_list/ios/proto/reading_list.pb.h"
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 rhs.update_time_us() < lhs.update_time_us()) { 435 rhs.update_time_us() < lhs.update_time_us()) {
436 return false; 436 return false;
437 } 437 }
438 if (rhs.update_time_us() == lhs.update_time_us()) { 438 if (rhs.update_time_us() == lhs.update_time_us()) {
439 if ((rhs.status() == sync_pb::ReadingListSpecifics::UNSEEN && 439 if ((rhs.status() == sync_pb::ReadingListSpecifics::UNSEEN &&
440 lhs.status() != sync_pb::ReadingListSpecifics::UNSEEN) || 440 lhs.status() != sync_pb::ReadingListSpecifics::UNSEEN) ||
441 (rhs.status() == sync_pb::ReadingListSpecifics::UNREAD && 441 (rhs.status() == sync_pb::ReadingListSpecifics::UNREAD &&
442 lhs.status() == sync_pb::ReadingListSpecifics::READ)) 442 lhs.status() == sync_pb::ReadingListSpecifics::READ))
443 return false; 443 return false;
444 } 444 }
445 if (rhs.creation_time_us() == lhs.creation_time_us()) {
446 if (rhs.first_read_time_us() == 0 && lhs.first_read_time_us() != 0) {
447 return false;
448 }
449 if (rhs.first_read_time_us() > lhs.first_read_time_us() &&
450 lhs.first_read_time_us() != 0) {
451 return false;
452 }
453 }
445 return true; 454 return true;
446 } 455 }
OLDNEW
« no previous file with comments | « components/reading_list/ios/reading_list_store.h ('k') | components/reading_list/ios/reading_list_store_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698