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)), |