Skip to content

Commit

Permalink
Optimize GetExtensionOrAppIDByURL
Browse files Browse the repository at this point in the history
When the function reaches this point in the code, then
url.SchemeIs(kExtensionScheme) was false.
So the condition will remain false in GetExtensionOrAppByURL,
which makes this method equivalent to GetHostedAppByURL.
Save some cycles by calling GetHostedAppByURL directly.

Contributed by Rob Wu <rob@robwu.nl>

BUG=

Review URL: https://codereview.chromium.org/167493003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251811 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
rob@robwu.nl committed Feb 18, 2014
1 parent ee400fb commit 810fee6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion extensions/common/extension_set.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ std::string ExtensionSet::GetExtensionOrAppIDByURL(const GURL& url) const {
if (url.SchemeIs(kExtensionScheme))
return url.host();

const Extension* extension = GetExtensionOrAppByURL(url);
const Extension* extension = GetHostedAppByURL(url);
if (!extension)
return std::string();

Expand Down

0 comments on commit 810fee6

Please sign in to comment.