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

Unified Diff: extensions/browser/process_manager.h

Issue 112663007: Test Keeping NaCl plugins used in app background pages alive when active. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix callbacks keeping reference to message loop Created 6 years, 12 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
Index: extensions/browser/process_manager.h
diff --git a/extensions/browser/process_manager.h b/extensions/browser/process_manager.h
index 8b48aab4abaee3a67d730c0c2957d85bda6e36d9..cc9177d7bb536e66602ce717e7d0fb92de191e55 100644
--- a/extensions/browser/process_manager.h
+++ b/extensions/browser/process_manager.h
@@ -121,6 +121,15 @@ class ProcessManager : public content::NotificationObserver {
// related SiteInstances.
content::BrowserContext* GetBrowserContext() const;
+ // Sets callbacks for testing keepalive impulse behavior. When callbacks
+ // return true they must be released to free refcounted resources.
yzshen1 2014/01/03 22:10:10 It seems there are two ways: 1) keep the void retu
scheib 2014/01/03 23:11:29 I've changed to having the tests clear the callbac
+ typedef base::Callback<bool(const std::string& extension_id)>
+ ImpulseCallbackForTesting;
+ void SetKeepaliveImpulseCallbackForTesting(
+ const ImpulseCallbackForTesting& callback);
+ void SetKeepaliveImpulseDecrementCallbackForTesting(
+ const ImpulseCallbackForTesting& callback);
+
protected:
// If |context| is incognito pass the master context as |original_context|.
// Otherwise pass the same context for both.
@@ -216,6 +225,9 @@ class ProcessManager : public content::NotificationObserver {
base::Callback<void(content::DevToolsAgentHost*, bool)> devtools_callback_;
+ ImpulseCallbackForTesting keepalive_impulse_callback_for_testing_;
+ ImpulseCallbackForTesting keepalive_impulse_decrement_callback_for_testing_;
+
base::WeakPtrFactory<ProcessManager> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(ProcessManager);

Powered by Google App Engine
This is Rietveld 408576698