summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-29 22:47:57 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-29 22:47:57 +0000
commit8519b3024db0eb1a78fa06cb7aef2fefb89d8aef (patch)
treeb943f126ab0fa52fc753153eddc5b0035f4d486a /chrome/common
parentbdf4206fe44fe56f1430d5c7d4d64abf3377b964 (diff)
downloadchromium_src-8519b3024db0eb1a78fa06cb7aef2fefb89d8aef.zip
chromium_src-8519b3024db0eb1a78fa06cb7aef2fefb89d8aef.tar.gz
chromium_src-8519b3024db0eb1a78fa06cb7aef2fefb89d8aef.tar.bz2
Revert 43005 - Adds ability for ImageLoadingTracker to cache images.
BUG=none TEST=none Review URL: http://codereview.chromium.org/1251011 TBR=sky@chromium.org Review URL: http://codereview.chromium.org/1526003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43008 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/extensions/extension.cc22
-rw-r--r--chrome/common/extensions/extension.h13
-rw-r--r--chrome/common/extensions/extension_extent.cc2
-rw-r--r--chrome/common/extensions/extension_extent.h2
4 files changed, 2 insertions, 37 deletions
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index 7deff53..98a2f84 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -1474,28 +1474,6 @@ void Extension::SetBackgroundPageReady() {
NotificationService::NoDetails());
}
-void Extension::SetCachedImage(const ExtensionResource& source,
- const SkBitmap& image) {
- DCHECK(source.extension_root() == path()); // The resource must come from
- // this extension.
- image_cache_[source.relative_path()] = image;
-
-}
-bool Extension::HasCachedImage(const ExtensionResource& source) {
- DCHECK(source.extension_root() == path()); // The resource must come from
- // this extension.
- return image_cache_.find(source.relative_path()) != image_cache_.end();
-}
-
-SkBitmap Extension::GetCachedImage(const ExtensionResource& source) {
- DCHECK(source.extension_root() == path()); // The resource must come from
- // this extension.
- ImageCache::iterator i = image_cache_.find(source.relative_path());
- if (i == image_cache_.end())
- return SkBitmap();
- return i->second;
-}
-
ExtensionResource Extension::GetIconPath(Icons icon) {
std::map<int, std::string>::const_iterator iter = icons_.find(icon);
if (iter == icons_.end())
diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h
index f4c797e..0129858 100644
--- a/chrome/common/extensions/extension.h
+++ b/chrome/common/extensions/extension.h
@@ -21,7 +21,6 @@
#include "chrome/common/extensions/url_pattern.h"
#include "googleurl/src/gurl.h"
#include "testing/gtest/include/gtest/gtest_prod.h"
-#include "third_party/skia/include/core/SkBitmap.h"
// Represents a Chrome extension.
class Extension {
@@ -324,16 +323,7 @@ class Extension {
bool being_upgraded() const { return being_upgraded_; }
void set_being_upgraded(bool value) { being_upgraded_ = value; }
- // Image cache related methods. These are only valid on the UI thread and
- // not maintained by this class. See ImageLoadingTracker for usage.
- void SetCachedImage(const ExtensionResource& source,
- const SkBitmap& image);
- bool HasCachedImage(const ExtensionResource& source);
- SkBitmap GetCachedImage(const ExtensionResource& source);
-
private:
- typedef std::map<FilePath, SkBitmap> ImageCache;
-
// Helper method that loads a UserScript object from a
// dictionary in the content_script list of the manifest.
bool LoadUserScriptHelper(const DictionaryValue* content_script,
@@ -488,9 +478,6 @@ class Extension {
// The type of container to launch into.
LaunchContainer launch_container_;
- // Cached images for this extension. This maps from the relative_path of the
- // resource to the cached image.
- ImageCache image_cache_;
// Runtime data:
diff --git a/chrome/common/extensions/extension_extent.cc b/chrome/common/extensions/extension_extent.cc
index 3fbb994..310673e 100644
--- a/chrome/common/extensions/extension_extent.cc
+++ b/chrome/common/extensions/extension_extent.cc
@@ -6,7 +6,7 @@
#include "base/string_util.h"
-bool ExtensionExtent::ContainsURL(const GURL& url) const {
+bool ExtensionExtent::ContainsURL(const GURL& url) {
if (!url.is_valid())
return false;
diff --git a/chrome/common/extensions/extension_extent.h b/chrome/common/extensions/extension_extent.h
index 187303d..76670ab 100644
--- a/chrome/common/extensions/extension_extent.h
+++ b/chrome/common/extensions/extension_extent.h
@@ -20,7 +20,7 @@ class ExtensionExtent {
const GURL& origin() const { return origin_; }
void set_origin(const GURL& val) { origin_ = val; }
- bool ContainsURL(const GURL& url) const;
+ bool ContainsURL(const GURL& url);
private:
// The security origin (scheme+host+port) of the extent.