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

Unified Diff: chrome/browser/extensions/api/bookmarks/bookmarks_api.cc

Issue 660513002: BookmarksFunction sending response after execution in all cases (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/api/bookmarks/bookmarks_api.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 51d7b7ffde5a525445d624591a81aed22924aaca..9eaac9130b0d3989e0b79e052d52c689912db85d 100644
--- a/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc
+++ b/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc
@@ -99,14 +99,7 @@ bool BookmarksFunction::RunAsync() {
return true;
}
- bool success = RunOnReady();
- if (success) {
- content::NotificationService::current()->Notify(
- extensions::NOTIFICATION_EXTENSION_BOOKMARKS_API_INVOKED,
- content::Source<const Extension>(extension()),
- content::Details<const BookmarksFunction>(this));
- }
- SendResponse(success);
+ RunAndSendResponse();
return true;
}
@@ -230,10 +223,21 @@ void BookmarksFunction::BookmarkModelChanged() {
void BookmarksFunction::BookmarkModelLoaded(BookmarkModel* model,
bool ids_reassigned) {
model->RemoveObserver(this);
- RunOnReady();
+ RunAndSendResponse();
tfarina 2014/10/16 19:08:25 I don't know if it is fine to send extensions::NOT
not at google - send to devlin 2014/10/16 19:40:21 Good point. It looks like this notification is us
Release(); // Balanced in RunOnReady().
}
+void BookmarksFunction::RunAndSendResponse() {
+ bool success = RunOnReady();
+ if (success) {
+ content::NotificationService::current()->Notify(
+ extensions::NOTIFICATION_EXTENSION_BOOKMARKS_API_INVOKED,
+ content::Source<const Extension>(extension()),
+ content::Details<const BookmarksFunction>(this));
+ }
+ SendResponse(success);
+}
+
BookmarkEventRouter::BookmarkEventRouter(Profile* profile)
: browser_context_(profile),
model_(BookmarkModelFactory::GetForProfile(profile)),
« no previous file with comments | « chrome/browser/extensions/api/bookmarks/bookmarks_api.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698