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

Side by Side Diff: chrome/browser/extensions/lazy_background_task_queue.h

Issue 23537019: Don't try to load an event page to fire an event if the browser is shutting down. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/extensions/lazy_background_task_queue.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_EXTENSIONS_LAZY_BACKGROUND_TASK_QUEUE_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_LAZY_BACKGROUND_TASK_QUEUE_H_
6 #define CHROME_BROWSER_EXTENSIONS_LAZY_BACKGROUND_TASK_QUEUE_H_ 6 #define CHROME_BROWSER_EXTENSIONS_LAZY_BACKGROUND_TASK_QUEUE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 24 matching lines...) Expand all
35 35
36 // Returns true if the task should be added to the queue (that is, if the 36 // Returns true if the task should be added to the queue (that is, if the
37 // extension has a lazy background page that isn't ready yet). If the 37 // extension has a lazy background page that isn't ready yet). If the
38 // extension has a lazy background page that is being suspended this method 38 // extension has a lazy background page that is being suspended this method
39 // cancels that suspension. 39 // cancels that suspension.
40 bool ShouldEnqueueTask(Profile* profile, const Extension* extension); 40 bool ShouldEnqueueTask(Profile* profile, const Extension* extension);
41 41
42 // Adds a task to the queue for a given extension. If this is the first 42 // Adds a task to the queue for a given extension. If this is the first
43 // task added for the extension, its lazy background page will be loaded. 43 // task added for the extension, its lazy background page will be loaded.
44 // The task will be called either when the page is loaded, or when the 44 // The task will be called either when the page is loaded, or when the
45 // page fails to load for some reason (e.g. a crash). In the latter case, 45 // page fails to load for some reason (e.g. a crash or browser
46 // the ExtensionHost parameter is NULL. 46 // shutdown). In the latter case, the ExtensionHost parameter is NULL.
47 void AddPendingTask( 47 void AddPendingTask(
48 Profile* profile, 48 Profile* profile,
49 const std::string& extension_id, 49 const std::string& extension_id,
50 const PendingTask& task); 50 const PendingTask& task);
51 51
52 private: 52 private:
53 // A map between an extension_id,Profile pair and the queue of tasks pending 53 // A map between an extension_id,Profile pair and the queue of tasks pending
54 // the load of its background page. 54 // the load of its background page.
55 typedef std::string ExtensionID; 55 typedef std::string ExtensionID;
56 typedef std::pair<Profile*, ExtensionID> PendingTasksKey; 56 typedef std::pair<Profile*, ExtensionID> PendingTasksKey;
(...skipping 14 matching lines...) Expand all
71 const Extension* extension); 71 const Extension* extension);
72 72
73 Profile* profile_; 73 Profile* profile_;
74 content::NotificationRegistrar registrar_; 74 content::NotificationRegistrar registrar_;
75 PendingTasksMap pending_tasks_; 75 PendingTasksMap pending_tasks_;
76 }; 76 };
77 77
78 } // namespace extensions 78 } // namespace extensions
79 79
80 #endif // CHROME_BROWSER_EXTENSIONS_LAZY_BACKGROUND_TASK_QUEUE_H_ 80 #endif // CHROME_BROWSER_EXTENSIONS_LAZY_BACKGROUND_TASK_QUEUE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/lazy_background_task_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698