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

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

Issue 10114015: Fix bug where transient pages would miss events dispatched while it was (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: yoyo Created 8 years, 8 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
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_EXTENSION_PROCESS_MANAGER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 void UnregisterRenderViewHost(content::RenderViewHost* render_view_host); 82 void UnregisterRenderViewHost(content::RenderViewHost* render_view_host);
83 83
84 // Returns all RenderViewHosts that are registered for the specified 84 // Returns all RenderViewHosts that are registered for the specified
85 // extension. 85 // extension.
86 std::set<content::RenderViewHost*> GetRenderViewHostsForExtension( 86 std::set<content::RenderViewHost*> GetRenderViewHostsForExtension(
87 const std::string& extension_id); 87 const std::string& extension_id);
88 88
89 // Returns true if |host| is managed by this process manager. 89 // Returns true if |host| is managed by this process manager.
90 bool HasExtensionHost(ExtensionHost* host) const; 90 bool HasExtensionHost(ExtensionHost* host) const;
91 91
92 // Returns true if the (lazy) background host for the given extension has
93 // already been sent the unload event and is shutting down.
94 bool IsBackgroundHostClosing(const std::string& extension_id);
95
92 // Getter and setter for the lazy background page's keepalive count. This is 96 // Getter and setter for the lazy background page's keepalive count. This is
93 // the count of how many outstanding "things" are keeping the page alive. 97 // the count of how many outstanding "things" are keeping the page alive.
94 // When this reaches 0, we will begin the process of shutting down the page. 98 // When this reaches 0, we will begin the process of shutting down the page.
95 // "Things" include pending events, resource loads, and API calls. 99 // "Things" include pending events, resource loads, and API calls.
96 int GetLazyKeepaliveCount(const Extension* extension); 100 int GetLazyKeepaliveCount(const Extension* extension);
97 int IncrementLazyKeepaliveCount(const Extension* extension); 101 int IncrementLazyKeepaliveCount(const Extension* extension);
98 int DecrementLazyKeepaliveCount(const Extension* extension); 102 int DecrementLazyKeepaliveCount(const Extension* extension);
99 103
100 // Handles a response to the ShouldUnload message, used for lazy background 104 // Handles a response to the ShouldUnload message, used for lazy background
101 // pages. 105 // pages.
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 // associated with a WebContents. This allows us to gather information that 178 // associated with a WebContents. This allows us to gather information that
175 // was not available when the host was first registered. 179 // was not available when the host was first registered.
176 void UpdateRegisteredRenderView(content::RenderViewHost* render_view_host); 180 void UpdateRegisteredRenderView(content::RenderViewHost* render_view_host);
177 181
178 BackgroundPageDataMap background_page_data_; 182 BackgroundPageDataMap background_page_data_;
179 183
180 DISALLOW_COPY_AND_ASSIGN(ExtensionProcessManager); 184 DISALLOW_COPY_AND_ASSIGN(ExtensionProcessManager);
181 }; 185 };
182 186
183 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ 187 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_message_service.cc ('k') | chrome/browser/extensions/extension_process_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698