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

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

Issue 7064052: Revert 88142 to fix sync_integration_tests offline. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 6 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 | « chrome/browser/extensions/extension_install_ui.cc ('k') | chrome/browser/history/history.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_tabs_module.cc
===================================================================
--- chrome/browser/extensions/extension_tabs_module.cc (revision 88158)
+++ chrome/browser/extensions/extension_tabs_module.cc (working copy)
@@ -123,19 +123,6 @@
return keys::kWindowTypeValueNormal;
}
-bool IsCrashURL(const GURL& url) {
- // GURL does not parse about: URL hosts, so compare against these entire URLs.
- if (url == GURL(chrome::kAboutBrowserCrash) ||
- url == GURL(chrome::kAboutCrashURL))
- return true;
-
- // Catch any crash-like URL here.
- return ((url.SchemeIs(chrome::kAboutScheme) ||
- url.SchemeIs(chrome::kChromeUIScheme)) &&
- (url.host() == chrome::kChromeUIBrowserCrashHost ||
- url.host() == chrome::kChromeUICrashHost));
-}
-
} // namespace
int ExtensionTabUtil::GetWindowId(const Browser* browser) {
@@ -415,16 +402,20 @@
keys::kInvalidUrlError, *i);
return false;
}
- // Don't let the extension crash the browser or renderers.
- if (IsCrashURL(url)) {
- error_ = keys::kNoCrashBrowserError;
- return false;
- }
urls.push_back(url);
}
}
}
+ // Don't let the extension crash the browser or renderers.
+ GURL browser_crash(chrome::kAboutBrowserCrash);
+ GURL renderer_crash(chrome::kAboutCrashURL);
+ if (std::find(urls.begin(), urls.end(), browser_crash) != urls.end() ||
+ std::find(urls.begin(), urls.end(), renderer_crash) != urls.end()) {
+ error_ = keys::kNoCrashBrowserError;
+ return false;
+ }
+
// Look for optional tab id.
if (args) {
int tab_id;
@@ -755,7 +746,8 @@
}
// Don't let extensions crash the browser or renderers.
- if (IsCrashURL(url)) {
+ if (url == GURL(chrome::kAboutBrowserCrash) ||
+ url == GURL(chrome::kAboutCrashURL)) {
error_ = keys::kNoCrashBrowserError;
return false;
}
@@ -871,7 +863,7 @@
// -title
// -favIconUrl
- // Navigate the tab to a new location if the url is different.
+ // Navigate the tab to a new location if the url different.
std::string url_string;
if (update_props->HasKey(keys::kUrlKey)) {
EXTENSION_FUNCTION_VALIDATE(update_props->GetString(
@@ -885,7 +877,8 @@
}
// Don't let the extension crash the browser or renderers.
- if (IsCrashURL(url)) {
+ if (url == GURL(chrome::kAboutBrowserCrash) ||
+ url == GURL(chrome::kAboutCrashURL)) {
error_ = keys::kNoCrashBrowserError;
return false;
}
« no previous file with comments | « chrome/browser/extensions/extension_install_ui.cc ('k') | chrome/browser/history/history.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698