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

Unified Diff: chrome/browser/extensions/script_badge_controller.cc

Issue 10855064: In ScriptBadgeController, don't CHECK for a valid page ID if there was an error, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/script_badge_controller.cc
diff --git a/chrome/browser/extensions/script_badge_controller.cc b/chrome/browser/extensions/script_badge_controller.cc
index 7b995e7d6ef1b86b41caab7aa74e9755baa8e593..87c0e891c9302df288f43e325459416a8b2b6d69 100644
--- a/chrome/browser/extensions/script_badge_controller.cc
+++ b/chrome/browser/extensions/script_badge_controller.cc
@@ -111,26 +111,25 @@ void ScriptBadgeController::OnExecuteScriptFinished(
int32 on_page_id,
const GURL& on_url,
const base::ListValue& script_results) {
+ if (!error.empty())
+ return;
+
int32 current_page_id = GetPageID();
- // Tracking down http://crbug.com/138323.
- if (current_page_id < 0) {
+ if (on_page_id == current_page_id) {
+ if (MarkExtensionExecuting(extension_id))
+ NotifyChange();
+ } else if (current_page_id < 0) {
+ // Tracking down http://crbug.com/138323.
std::string message = base::StringPrintf(
- "Expected a page ID of %d on URL \"%s\", but there was no navigation "
- "entry. Current URL is \"%s\", extension ID is %s.",
+ "Expected a page ID of %d but there was no navigation entry. "
+ "Extension ID is %s.",
on_page_id,
- on_url.spec().c_str(),
- tab_contents_->web_contents()->GetURL().spec().c_str(),
extension_id.c_str());
char buf[1024];
base::snprintf(buf, arraysize(buf), "%s", message.c_str());
CHECK(false) << message;
}
-
- if (error.empty() && on_page_id == current_page_id) {
- if (MarkExtensionExecuting(extension_id))
- NotifyChange();
- }
}
ExtensionService* ScriptBadgeController::GetExtensionService() {
@@ -193,24 +192,21 @@ void ScriptBadgeController::OnContentScriptsExecuting(
int32 on_page_id,
const GURL& on_url) {
int32 current_page_id = GetPageID();
+ if (on_page_id != current_page_id)
+ return;
- // Tracking down http://crbug.com/138323.
if (current_page_id < 0) {
+ // Tracking down http://crbug.com/138323.
std::string message = base::StringPrintf(
- "Expected a page ID of %d on URL \"%s\", but there was no navigation "
- "entry. Current URL is \"%s\", extension IDs are %s.",
+ "Expected a page ID of %d but there was no navigation entry. "
+ "Extension IDs are %s.",
on_page_id,
- on_url.spec().c_str(),
- tab_contents_->web_contents()->GetURL().spec().c_str(),
JoinExtensionIDs(extension_ids).c_str());
char buf[1024];
base::snprintf(buf, arraysize(buf), "%s", message.c_str());
CHECK(false) << message;
}
- if (on_page_id != current_page_id)
- return;
-
bool changed = false;
for (std::set<std::string>::const_iterator it = extension_ids.begin();
it != extension_ids.end(); ++it) {
« 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