diff options
author | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-29 23:14:02 +0000 |
---|---|---|
committer | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-29 23:14:02 +0000 |
commit | 9adb9693e8a90bb63be325dbb5d3391f47f839ba (patch) | |
tree | 555765afd7bc851de6f3a2bf4a35151435d58d77 /chrome/browser/tab_contents/tab_contents.cc | |
parent | 5b5a5c976aead85a87ced0847c068012d3979cae (diff) | |
download | chromium_src-9adb9693e8a90bb63be325dbb5d3391f47f839ba.zip chromium_src-9adb9693e8a90bb63be325dbb5d3391f47f839ba.tar.gz chromium_src-9adb9693e8a90bb63be325dbb5d3391f47f839ba.tar.bz2 |
Part 3 of immutable Extension refactor.
Make ExtensionsService hold const Extension pointers only. This ensures that
extensions can't be modified after they're created, and lets us share them
between threads.
BUG=56558
TEST=no functional change
Review URL: http://codereview.chromium.org/4138006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64517 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents/tab_contents.cc')
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index 4e5e9b5..288b5b6 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -587,7 +587,7 @@ RenderProcessHost* TabContents::GetRenderProcessHost() const { return render_manager_.current_host()->process(); } -void TabContents::SetExtensionApp(Extension* extension) { +void TabContents::SetExtensionApp(const Extension* extension) { DCHECK(!extension || extension->GetFullLaunchURL().is_valid()); extension_app_ = extension; @@ -605,7 +605,7 @@ void TabContents::SetExtensionAppById(const std::string& extension_app_id) { ExtensionsService* extension_service = profile()->GetExtensionsService(); if (extension_service && extension_service->is_ready()) { - Extension* extension = + const Extension* extension = extension_service->GetExtensionById(extension_app_id, false); if (extension) SetExtensionApp(extension); @@ -3157,7 +3157,7 @@ void TabContents::Observe(NotificationType type, } } -void TabContents::UpdateExtensionAppIcon(Extension* extension) { +void TabContents::UpdateExtensionAppIcon(const Extension* extension) { extension_app_icon_.reset(); if (extension) { @@ -3174,12 +3174,12 @@ void TabContents::UpdateExtensionAppIcon(Extension* extension) { } } -Extension* TabContents::GetExtensionContaining(const GURL& url) { +const Extension* TabContents::GetExtensionContaining(const GURL& url) { ExtensionsService* extensions_service = profile()->GetExtensionsService(); if (!extensions_service) return NULL; - Extension* extension = extensions_service->GetExtensionByURL(url); + const Extension* extension = extensions_service->GetExtensionByURL(url); return extension ? extension : extensions_service->GetExtensionByWebExtent(url); } |