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

Unified Diff: chrome/browser/extensions/api/runtime/runtime_api.cc

Issue 10082019: Have LazyBackgroundTaskQueue notify consumers when the transient page fails to (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_event_router.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/runtime/runtime_api.cc
diff --git a/chrome/browser/extensions/api/runtime/runtime_api.cc b/chrome/browser/extensions/api/runtime/runtime_api.cc
index 544e064ac42b18472f5194d805a70753b8a680f2..9e6998ec67cbf8361a5ebe14f9db71aed7d0bfa9 100644
--- a/chrome/browser/extensions/api/runtime/runtime_api.cc
+++ b/chrome/browser/extensions/api/runtime/runtime_api.cc
@@ -17,6 +17,7 @@ namespace {
const char kOnInstalledEvent[] = "experimental.runtime.onInstalled";
const char kNoBackgroundPageError[] = "You do not have a background page.";
+const char kPageLoadError[] = "Background page failed to load.";
}
@@ -56,8 +57,13 @@ bool RuntimeGetBackgroundPageFunction::RunImpl() {
return true;
}
-void RuntimeGetBackgroundPageFunction::OnPageLoaded(ExtensionHost*) {
- SendResponse(true);
+void RuntimeGetBackgroundPageFunction::OnPageLoaded(ExtensionHost* host) {
+ if (host) {
+ SendResponse(true);
+ } else {
+ error_ = kPageLoadError;
+ SendResponse(false);
+ }
}
} // namespace extensions
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_event_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698