| Index: chrome/browser/extensions/api/bookmarks/bookmarks_api.cc
|
| diff --git a/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc b/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc
|
| index b4022e607ddcae228829a718529a9fae8b003084..344bf101ab4ba23150ca73711669d31ec34dab84 100644
|
| --- a/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc
|
| +++ b/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc
|
| @@ -921,81 +921,6 @@ class BookmarkIdMapper : public BookmarkBucketMapper<int64> {
|
| }
|
| };
|
|
|
| -// Builds heuristics for all BookmarkFunctions using specialized BucketMappers.
|
| -class BookmarksQuotaLimitFactory {
|
| - public:
|
| - // For id-based bookmark functions.
|
| - template <class FunctionType>
|
| - static void Build(QuotaLimitHeuristics* heuristics) {
|
| - BuildWithMappers(heuristics, new BookmarkIdMapper<FunctionType>(),
|
| - new BookmarkIdMapper<FunctionType>());
|
| - }
|
| -
|
| - // For bookmarks.create.
|
| - static void BuildForCreate(QuotaLimitHeuristics* heuristics,
|
| - BrowserContext* context) {
|
| - BuildWithMappers(heuristics,
|
| - new CreateBookmarkBucketMapper(context),
|
| - new CreateBookmarkBucketMapper(context));
|
| - }
|
| -
|
| - // For bookmarks.remove.
|
| - static void BuildForRemove(QuotaLimitHeuristics* heuristics,
|
| - BrowserContext* context) {
|
| - BuildWithMappers(heuristics,
|
| - new RemoveBookmarksBucketMapper(context),
|
| - new RemoveBookmarksBucketMapper(context));
|
| - }
|
| -
|
| - private:
|
| - static void BuildWithMappers(QuotaLimitHeuristics* heuristics,
|
| - BucketMapper* short_mapper, BucketMapper* long_mapper) {
|
| - const Config kSustainedLimitConfig = {
|
| - // See bookmarks.json for current value.
|
| - bookmarks::MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE,
|
| - TimeDelta::FromMinutes(1)
|
| - };
|
| - heuristics->push_back(new SustainedLimit(
|
| - TimeDelta::FromMinutes(10),
|
| - kSustainedLimitConfig,
|
| - short_mapper,
|
| - "MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE"));
|
| -
|
| - const Config kTimedLimitConfig = {
|
| - // See bookmarks.json for current value.
|
| - bookmarks::MAX_WRITE_OPERATIONS_PER_HOUR,
|
| - TimeDelta::FromHours(1)
|
| - };
|
| - heuristics->push_back(new TimedLimit(
|
| - kTimedLimitConfig,
|
| - long_mapper,
|
| - "MAX_WRITE_OPERATIONS_PER_HOUR"));
|
| - }
|
| -
|
| - DISALLOW_IMPLICIT_CONSTRUCTORS(BookmarksQuotaLimitFactory);
|
| -};
|
| -
|
| -// And finally, building the individual heuristics for each function.
|
| -void BookmarksRemoveFunction::GetQuotaLimitHeuristics(
|
| - QuotaLimitHeuristics* heuristics) const {
|
| - BookmarksQuotaLimitFactory::BuildForRemove(heuristics, GetProfile());
|
| -}
|
| -
|
| -void BookmarksMoveFunction::GetQuotaLimitHeuristics(
|
| - QuotaLimitHeuristics* heuristics) const {
|
| - BookmarksQuotaLimitFactory::Build<BookmarksMoveFunction>(heuristics);
|
| -}
|
| -
|
| -void BookmarksUpdateFunction::GetQuotaLimitHeuristics(
|
| - QuotaLimitHeuristics* heuristics) const {
|
| - BookmarksQuotaLimitFactory::Build<BookmarksUpdateFunction>(heuristics);
|
| -}
|
| -
|
| -void BookmarksCreateFunction::GetQuotaLimitHeuristics(
|
| - QuotaLimitHeuristics* heuristics) const {
|
| - BookmarksQuotaLimitFactory::BuildForCreate(heuristics, GetProfile());
|
| -}
|
| -
|
| BookmarksIOFunction::BookmarksIOFunction() {}
|
|
|
| BookmarksIOFunction::~BookmarksIOFunction() {
|
|
|