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

Unified Diff: ios/chrome/browser/reading_list/reading_list_model.h

Issue 2507053005: Revert of Add Store+Sync to reading list. (Closed)
Patch Set: Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/reading_list/reading_list_model.h
diff --git a/ios/chrome/browser/reading_list/reading_list_model.h b/ios/chrome/browser/reading_list/reading_list_model.h
index 3b9bc28a9383248624ac7c5ca3e85dada6cadc83..28a8fe7a03f76c727c799647e2145091e759bf94 100644
--- a/ios/chrome/browser/reading_list/reading_list_model.h
+++ b/ios/chrome/browser/reading_list/reading_list_model.h
@@ -11,41 +11,29 @@
#include "base/callback.h"
#include "base/observer_list.h"
-#include "base/threading/non_thread_safe.h"
#include "ios/chrome/browser/reading_list/reading_list_entry.h"
#include "ios/chrome/browser/reading_list/reading_list_model_observer.h"
class GURL;
-class ReadingListEntry;
class ReadingListModel;
-class ReadingListStore;
-class ScopedReadingListBatchUpdate;
namespace ios {
class ChromeBrowserState;
-}
-
-namespace syncer {
-class ModelTypeSyncBridge;
}
// The reading list model contains two list of entries: one of unread urls, the
// other of read ones. This object should only be accessed from one thread
// (Usually the main thread). The observers callbacks are also sent on the main
// thread.
-class ReadingListModel : public base::NonThreadSafe {
+class ReadingListModel {
public:
class ScopedReadingListBatchUpdate;
-
// Returns true if the model finished loading. Until this returns true the
// reading list is not ready for use.
virtual bool loaded() const = 0;
// Returns true if the model is performing batch updates right now.
bool IsPerformingBatchUpdates() const;
-
- // Returns the ModelTypeSyncBridge responsible for handling sync message.
- virtual syncer::ModelTypeSyncBridge* GetModelTypeSyncBridge() = 0;
// Tells model to prepare for batch updates.
// This method is reentrant, i.e. several batch updates may take place at the
@@ -54,9 +42,6 @@
// batch update is performed. Deallocating this object will inform model that
// the batch update has completed.
std::unique_ptr<ScopedReadingListBatchUpdate> BeginBatchUpdates();
-
- // Creates a batch token that will freeze the model while in scope.
- virtual std::unique_ptr<ScopedReadingListBatchUpdate> CreateBatchToken();
// Returns the size of read and unread entries.
virtual size_t unread_size() const = 0;
@@ -74,10 +59,7 @@
virtual const ReadingListEntry& GetReadEntryAtIndex(size_t index) const = 0;
// Returns a specific entry. Returns null if the entry does not exist.
- // If |read| is not null and the entry is found, |*read| is the read status
- // of the entry.
- virtual const ReadingListEntry* GetEntryFromURL(const GURL& gurl,
- bool* read) const = 0;
+ virtual const ReadingListEntry* GetEntryFromURL(const GURL& gurl) const = 0;
// Synchronously calls the |callback| with entry associated with this |url|.
// Does nothing if there is no entry associated.
@@ -127,7 +109,7 @@
explicit ScopedReadingListBatchUpdate(ReadingListModel* model)
: model_(model) {}
- virtual ~ScopedReadingListBatchUpdate();
+ ~ScopedReadingListBatchUpdate() { model_->EndBatchUpdates(); }
private:
ReadingListModel* model_;
@@ -146,12 +128,6 @@
// ReadingListBatchUpdateToken dtor.
virtual void EndBatchUpdates();
- // Called when model is entering batch update mode.
- virtual void EnteringBatchUpdates();
-
- // Called when model is leaving batch update mode.
- virtual void LeavingBatchUpdates();
-
private:
unsigned int current_batch_updates_count_;
« no previous file with comments | « ios/chrome/browser/reading_list/reading_list_entry_unittest.cc ('k') | ios/chrome/browser/reading_list/reading_list_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698