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

Side by Side Diff: components/enhanced_bookmarks/bookmark_image_service.h

Issue 588233002: Fix lifetime of EnhancedBookmarkModel & BookmarkImageService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation of unittests Created 6 years, 2 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
« no previous file with comments | « no previous file | components/enhanced_bookmarks/bookmark_image_service.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef COMPONENTS_ENHANCED_BOOKMARKS_BOOKMARK_IMAGE_SERVICE_H_ 4 #ifndef COMPONENTS_ENHANCED_BOOKMARKS_BOOKMARK_IMAGE_SERVICE_H_
5 #define COMPONENTS_ENHANCED_BOOKMARKS_BOOKMARK_IMAGE_SERVICE_H_ 5 #define COMPONENTS_ENHANCED_BOOKMARKS_BOOKMARK_IMAGE_SERVICE_H_
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/singleton.h" 9 #include "base/memory/singleton.h"
10 #include "components/bookmarks/browser/bookmark_model_observer.h" 10 #include "components/bookmarks/browser/bookmark_model_observer.h"
(...skipping 20 matching lines...) Expand all
31 EnhancedBookmarkModel* enhanced_bookmark_model, 31 EnhancedBookmarkModel* enhanced_bookmark_model,
32 scoped_refptr<base::SequencedWorkerPool> pool); 32 scoped_refptr<base::SequencedWorkerPool> pool);
33 BookmarkImageService(scoped_ptr<ImageStore> store, 33 BookmarkImageService(scoped_ptr<ImageStore> store,
34 EnhancedBookmarkModel* enhanced_bookmark_model, 34 EnhancedBookmarkModel* enhanced_bookmark_model,
35 scoped_refptr<base::SequencedWorkerPool> pool); 35 scoped_refptr<base::SequencedWorkerPool> pool);
36 36
37 virtual ~BookmarkImageService(); 37 virtual ~BookmarkImageService();
38 38
39 typedef base::Callback<void(const gfx::Image&, const GURL& url)> Callback; 39 typedef base::Callback<void(const gfx::Image&, const GURL& url)> Callback;
40 40
41 // KeyedService:
42 virtual void Shutdown() OVERRIDE;
43
41 // Returns a salient image for a URL. This may trigger a network request for 44 // Returns a salient image for a URL. This may trigger a network request for
42 // the image if the image was not retrieved before and if a bookmark node has 45 // the image if the image was not retrieved before and if a bookmark node has
43 // a URL for this salient image available. The image (which may be empty) is 46 // a URL for this salient image available. The image (which may be empty) is
44 // sent via the callback. The callback may be called synchronously if it is 47 // sent via the callback. The callback may be called synchronously if it is
45 // possible. The callback is always triggered on the main thread. 48 // possible. The callback is always triggered on the main thread.
46 void SalientImageForUrl(const GURL& page_url, Callback callback); 49 void SalientImageForUrl(const GURL& page_url, Callback callback);
47 50
48 // BookmarkModelObserver methods. 51 // BookmarkModelObserver methods.
49 virtual void BookmarkNodeRemoved(BookmarkModel* model, 52 virtual void BookmarkNodeRemoved(BookmarkModel* model,
50 const BookmarkNode* parent, 53 const BookmarkNode* parent,
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 GURL previous_url_; 163 GURL previous_url_;
161 164
162 // The worker pool to enqueue the store requests onto. 165 // The worker pool to enqueue the store requests onto.
163 scoped_refptr<base::SequencedWorkerPool> pool_; 166 scoped_refptr<base::SequencedWorkerPool> pool_;
164 DISALLOW_COPY_AND_ASSIGN(BookmarkImageService); 167 DISALLOW_COPY_AND_ASSIGN(BookmarkImageService);
165 }; 168 };
166 169
167 } // namespace enhanced_bookmarks 170 } // namespace enhanced_bookmarks
168 171
169 #endif // COMPONENTS_ENHANCED_BOOKMARKS_BOOKMARK_IMAGE_SERVICE_H_ 172 #endif // COMPONENTS_ENHANCED_BOOKMARKS_BOOKMARK_IMAGE_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | components/enhanced_bookmarks/bookmark_image_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698