// Copyright 2016 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_READING_LIST_CORE_READING_LIST_ENTRY_H_ #define COMPONENTS_READING_LIST_CORE_READING_LIST_ENTRY_H_ #include <string> #include "base/files/file_path.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_refptr.h" #include "base/time/time.h" #include "net/base/backoff_entry.h" #include "url/gurl.h" namespace reading_list { class ReadingListLocal; // The different ways a reading list entry is added. // |ADDED_VIA_CURRENT_APP| is when the entry was added by the user from within // the current instance of the app. // |ADDED_VIA_EXTENSION| is when the entry was added via the share extension. // |ADDED_VIA_SYNC| is when the entry was added with sync. enum EntrySource { … }; } // namespace reading_list namespace sync_pb { class ReadingListSpecifics; } // namespace sync_pb class ReadingListEntry; // An entry in the reading list. The URL is a unique identifier for an entry, as // such it should not be empty and is the only thing considered when comparing // entries. // A word about timestamp usage in this class: // - The backing store uses int64 values to code timestamps. We use internally // the same type to avoid useless conversions. This values represent the // number of micro seconds since Jan 1st 1970. // - As most timestamp are used to sort entries, operations on int64_t are // faster than operations on base::Time. So Getter return the int64_t values. // - However, to ensure all the conversions are done the same way, and because // the Now time is alway retrieved using base::Time::Now(), all the timestamp // parameter are passed as base::Time. These parameters are internally // converted in int64_t. class ReadingListEntry : public base::RefCounted<ReadingListEntry> { … }; #endif // COMPONENTS_READING_LIST_CORE_READING_LIST_ENTRY_H_