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

Side by Side Diff: chrome/browser/sync/glue/extensions_activity_monitor.cc

Issue 2572853004: [MD Bookmarks] Fix segfault when calling chrome.bookmarks.remove(). (Closed)
Patch Set: Created 4 years 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 4
5 #include "chrome/browser/sync/glue/extensions_activity_monitor.h" 5 #include "chrome/browser/sync/glue/extensions_activity_monitor.h"
6 6
7 #include "components/sync/base/extensions_activity.h" 7 #include "components/sync/base/extensions_activity.h"
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 #include "extensions/features/features.h" 9 #include "extensions/features/features.h"
10 10
(...skipping 29 matching lines...) Expand all
40 40
41 void ExtensionsActivityMonitor::Observe( 41 void ExtensionsActivityMonitor::Observe(
42 int type, 42 int type,
43 const content::NotificationSource& source, 43 const content::NotificationSource& source,
44 const content::NotificationDetails& details) { 44 const content::NotificationDetails& details) {
45 #if BUILDFLAG(ENABLE_EXTENSIONS) 45 #if BUILDFLAG(ENABLE_EXTENSIONS)
46 DCHECK_CURRENTLY_ON(BrowserThread::UI); 46 DCHECK_CURRENTLY_ON(BrowserThread::UI);
47 DCHECK_EQ(extensions::NOTIFICATION_EXTENSION_BOOKMARKS_API_INVOKED, type); 47 DCHECK_EQ(extensions::NOTIFICATION_EXTENSION_BOOKMARKS_API_INVOKED, type);
48 const extensions::Extension* extension = 48 const extensions::Extension* extension =
49 content::Source<const extensions::Extension>(source).ptr(); 49 content::Source<const extensions::Extension>(source).ptr();
50 if (!extension)
51 return;
52
50 const extensions::BookmarksFunction* f = 53 const extensions::BookmarksFunction* f =
51 content::Details<const extensions::BookmarksFunction>(details).ptr(); 54 content::Details<const extensions::BookmarksFunction>(details).ptr();
52 switch (f->histogram_value()) { 55 switch (f->histogram_value()) {
53 case extensions::functions::BOOKMARKS_UPDATE: 56 case extensions::functions::BOOKMARKS_UPDATE:
54 case extensions::functions::BOOKMARKS_MOVE: 57 case extensions::functions::BOOKMARKS_MOVE:
55 case extensions::functions::BOOKMARKS_CREATE: 58 case extensions::functions::BOOKMARKS_CREATE:
56 case extensions::functions::BOOKMARKS_REMOVETREE: 59 case extensions::functions::BOOKMARKS_REMOVETREE:
57 case extensions::functions::BOOKMARKS_REMOVE: 60 case extensions::functions::BOOKMARKS_REMOVE:
58 extensions_activity_->UpdateRecord(extension->id()); 61 extensions_activity_->UpdateRecord(extension->id());
59 break; 62 break;
60 default: 63 default:
61 break; 64 break;
62 } 65 }
63 #endif 66 #endif
64 } 67 }
65 68
66 const scoped_refptr<syncer::ExtensionsActivity>& 69 const scoped_refptr<syncer::ExtensionsActivity>&
67 ExtensionsActivityMonitor::GetExtensionsActivity() { 70 ExtensionsActivityMonitor::GetExtensionsActivity() {
68 return extensions_activity_; 71 return extensions_activity_;
69 } 72 }
70 73
71 } // namespace browser_sync 74 } // namespace browser_sync
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698