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

Unified Diff: extensions/browser/extension_function_dispatcher.cc

Issue 798103002: Possible fix for ExtensionFunctionDispatcher::DispatchWithCallbackInternal. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/extension_function_dispatcher.cc
diff --git a/extensions/browser/extension_function_dispatcher.cc b/extensions/browser/extension_function_dispatcher.cc
index b3f3043b09ff0e0b8d6bd814790dc46b0492e327..31d1e490b7e3e03f0acc2a34c5319c83c431e865 100644
--- a/extensions/browser/extension_function_dispatcher.cc
+++ b/extensions/browser/extension_function_dispatcher.cc
@@ -378,6 +378,9 @@ void ExtensionFunctionDispatcher::DispatchWithCallbackInternal(
return;
}
+ // Fetch the ProcessManager before |this| is possibly invalidated.
+ ProcessManager* process_manager = ProcessManager::Get(browser_context_);
+
ExtensionSystem* extension_system = ExtensionSystem::Get(browser_context_);
QuotaService* quota = extension_system->quota_service();
std::string violation_error = quota->Assess(extension->id(),
@@ -410,7 +413,7 @@ void ExtensionFunctionDispatcher::DispatchWithCallbackInternal(
// now, largely for simplicity's sake. This is OK because currently, only
// the webRequest API uses IOThreadExtensionFunction, and that API is not
// compatible with lazy background pages.
- ProcessManager::Get(browser_context_)->IncrementLazyKeepaliveCount(extension);
+ process_manager->IncrementLazyKeepaliveCount(extension);
}
void ExtensionFunctionDispatcher::OnExtensionFunctionCompleted(
« 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