summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--base/memory/ref_counted_memory.cc4
-rw-r--r--base/memory/ref_counted_memory.h5
-rw-r--r--chrome/browser/bookmarks/bookmark_html_writer.cc3
-rw-r--r--chrome/browser/bookmarks/bookmark_html_writer.h5
-rw-r--r--chrome/browser/extensions/extension_web_ui.cc2
-rw-r--r--chrome/browser/favicon/favicon_handler.cc2
-rw-r--r--chrome/browser/favicon/favicon_handler.h7
-rw-r--r--chrome/browser/history/expire_history_backend_unittest.cc2
-rw-r--r--chrome/browser/history/history.cc3
-rw-r--r--chrome/browser/history/history_backend.cc2
-rw-r--r--chrome/browser/history/history_backend.h2
-rw-r--r--chrome/browser/history/history_types.h2
-rw-r--r--chrome/browser/history/thumbnail_database.cc7
-rw-r--r--chrome/browser/history/thumbnail_database.h4
-rw-r--r--chrome/browser/history/top_sites.cc3
-rw-r--r--chrome/browser/history/top_sites.h8
-rw-r--r--chrome/browser/history/top_sites_cache.cc5
-rw-r--r--chrome/browser/history/top_sites_cache.h4
-rw-r--r--chrome/browser/history/top_sites_unittest.cc26
-rw-r--r--chrome/browser/jumplist_win.h6
-rw-r--r--chrome/browser/themes/browser_theme_pack.cc10
-rw-r--r--chrome/browser/themes/browser_theme_pack.h6
-rw-r--r--chrome/browser/themes/theme_service.cc4
-rw-r--r--chrome/browser/themes/theme_service.h2
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm2
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view_unittest.mm2
-rw-r--r--chrome/browser/ui/cocoa/download/background_theme.h2
-rw-r--r--chrome/browser/ui/cocoa/download/background_theme.mm4
-rw-r--r--chrome/browser/ui/webui/bookmarks_ui.cc2
-rw-r--r--chrome/browser/ui/webui/bookmarks_ui.h4
-rw-r--r--chrome/browser/ui/webui/chrome_url_data_manager.cc9
-rw-r--r--chrome/browser/ui/webui/chrome_url_data_manager.h9
-rw-r--r--chrome/browser/ui/webui/chrome_url_data_manager_backend.cc8
-rw-r--r--chrome/browser/ui/webui/chrome_url_data_manager_backend.h9
-rw-r--r--chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc4
-rw-r--r--chrome/browser/ui/webui/chrome_web_ui_controller_factory.h5
-rw-r--r--chrome/browser/ui/webui/chrome_web_ui_data_source_unittest.cc4
-rw-r--r--chrome/browser/ui/webui/chromeos/register_page_ui.cc2
-rw-r--r--chrome/browser/ui/webui/conflicts_ui.cc7
-rw-r--r--chrome/browser/ui/webui/conflicts_ui.h6
-rw-r--r--chrome/browser/ui/webui/crashes_ui.cc2
-rw-r--r--chrome/browser/ui/webui/crashes_ui.h6
-rw-r--r--chrome/browser/ui/webui/downloads_ui.cc2
-rw-r--r--chrome/browser/ui/webui/downloads_ui.h6
-rw-r--r--chrome/browser/ui/webui/extensions/extension_icon_source.cc2
-rw-r--r--chrome/browser/ui/webui/favicon_source.cc2
-rw-r--r--chrome/browser/ui/webui/favicon_source.h4
-rw-r--r--chrome/browser/ui/webui/flags_ui.cc2
-rw-r--r--chrome/browser/ui/webui/flags_ui.h7
-rw-r--r--chrome/browser/ui/webui/flash_ui.cc2
-rw-r--r--chrome/browser/ui/webui/flash_ui.h6
-rw-r--r--chrome/browser/ui/webui/history_ui.cc2
-rw-r--r--chrome/browser/ui/webui/history_ui.h4
-rw-r--r--chrome/browser/ui/webui/ntp/favicon_webui_handler.cc2
-rw-r--r--chrome/browser/ui/webui/ntp/favicon_webui_handler.h4
-rw-r--r--chrome/browser/ui/webui/ntp/new_tab_ui.cc2
-rw-r--r--chrome/browser/ui/webui/ntp/ntp_resource_cache.cc4
-rw-r--r--chrome/browser/ui/webui/ntp/ntp_resource_cache.h15
-rw-r--r--chrome/browser/ui/webui/ntp/ntp_resource_cache_android.cc4
-rw-r--r--chrome/browser/ui/webui/ntp/thumbnail_source.cc5
-rw-r--r--chrome/browser/ui/webui/ntp/thumbnail_source.h9
-rw-r--r--chrome/browser/ui/webui/options2/options_ui2.cc4
-rw-r--r--chrome/browser/ui/webui/options2/options_ui2.h2
-rw-r--r--chrome/browser/ui/webui/plugins_ui.cc2
-rw-r--r--chrome/browser/ui/webui/plugins_ui.h7
-rw-r--r--chrome/browser/ui/webui/sessions_ui.cc2
-rw-r--r--chrome/browser/ui/webui/sessions_ui.h6
-rw-r--r--chrome/browser/ui/webui/theme_source.cc3
-rw-r--r--chrome/browser/ui/webui/theme_source.h7
-rw-r--r--chrome/browser/ui/webui/theme_source_unittest.cc2
-rw-r--r--chrome/browser/ui/webui/web_ui_util.cc2
-rw-r--r--ui/base/resource/resource_bundle.cc2
-rw-r--r--ui/base/theme_provider.h7
-rw-r--r--ui/gfx/color_analysis.cc10
-rw-r--r--ui/gfx/color_analysis.h21
-rw-r--r--ui/views/widget/default_theme_provider.cc2
-rw-r--r--ui/views/widget/default_theme_provider.h2
77 files changed, 216 insertions, 160 deletions
diff --git a/base/memory/ref_counted_memory.cc b/base/memory/ref_counted_memory.cc
index 59d141d..9bcde32 100644
--- a/base/memory/ref_counted_memory.cc
+++ b/base/memory/ref_counted_memory.cc
@@ -6,12 +6,12 @@
#include "base/logging.h"
+namespace base {
+
RefCountedMemory::RefCountedMemory() {}
RefCountedMemory::~RefCountedMemory() {}
-namespace base {
-
const unsigned char* RefCountedStaticMemory::front() const {
return data_;
}
diff --git a/base/memory/ref_counted_memory.h b/base/memory/ref_counted_memory.h
index c9170f5..9c863c6 100644
--- a/base/memory/ref_counted_memory.h
+++ b/base/memory/ref_counted_memory.h
@@ -13,8 +13,7 @@
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
-// TODO(erg): The contents of this file should be in a namespace. This would
-// require touching >100 files in chrome/ though.
+namespace base {
// A generic interface to memory. This object is reference counted because one
// of its two subclasses own the data they carry, and we need to have
@@ -35,8 +34,6 @@ class BASE_EXPORT RefCountedMemory
virtual ~RefCountedMemory();
};
-namespace base {
-
// An implementation of RefCountedMemory, where the ref counting does not
// matter.
class BASE_EXPORT RefCountedStaticMemory : public RefCountedMemory {
diff --git a/chrome/browser/bookmarks/bookmark_html_writer.cc b/chrome/browser/bookmarks/bookmark_html_writer.cc
index 7dfe7ef..aa6d7b0 100644
--- a/chrome/browser/bookmarks/bookmark_html_writer.cc
+++ b/chrome/browser/bookmarks/bookmark_html_writer.cc
@@ -10,6 +10,7 @@
#include "base/callback.h"
#include "base/file_path.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/ref_counted_memory.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop.h"
#include "base/platform_file.h"
@@ -261,7 +262,7 @@ class Writer : public base::RefCountedThreadSafe<Writer> {
BookmarkFaviconFetcher::URLFaviconMap::iterator itr =
favicons_map_->find(url_string);
if (itr != favicons_map_->end()) {
- scoped_refptr<RefCountedMemory> data(itr->second.get());
+ scoped_refptr<base::RefCountedMemory> data(itr->second.get());
std::string favicon_data;
favicon_data.assign(reinterpret_cast<const char*>(data->front()),
data->size());
diff --git a/chrome/browser/bookmarks/bookmark_html_writer.h b/chrome/browser/bookmarks/bookmark_html_writer.h
index 6342281..7016ddc 100644
--- a/chrome/browser/bookmarks/bookmark_html_writer.h
+++ b/chrome/browser/bookmarks/bookmark_html_writer.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -35,7 +35,8 @@ class BookmarksExportObserver {
class BookmarkFaviconFetcher: public content::NotificationObserver {
public:
// Map of URL and corresponding favicons.
- typedef std::map<std::string, scoped_refptr<RefCountedMemory> > URLFaviconMap;
+ typedef std::map<std::string, scoped_refptr<base::RefCountedMemory> >
+ URLFaviconMap;
BookmarkFaviconFetcher(Profile* profile,
const FilePath& path,
diff --git a/chrome/browser/extensions/extension_web_ui.cc b/chrome/browser/extensions/extension_web_ui.cc
index 0a7951d..809e9df 100644
--- a/chrome/browser/extensions/extension_web_ui.cc
+++ b/chrome/browser/extensions/extension_web_ui.cc
@@ -109,7 +109,7 @@ class ExtensionWebUIImageLoadingTracker : public ImageLoadingTracker::Observer {
// Forwards the result on the request. If no favicon was available then
// |icon_data| may be backed by NULL. Once the result has been forwarded the
// instance is deleted.
- void ForwardResult(scoped_refptr<RefCountedMemory> icon_data) {
+ void ForwardResult(scoped_refptr<base::RefCountedMemory> icon_data) {
history::FaviconData favicon;
favicon.known_icon = icon_data.get() != NULL && icon_data->size() > 0;
favicon.image_data = icon_data;
diff --git a/chrome/browser/favicon/favicon_handler.cc b/chrome/browser/favicon/favicon_handler.cc
index c24f94f..8aef33a 100644
--- a/chrome/browser/favicon/favicon_handler.cc
+++ b/chrome/browser/favicon/favicon_handler.cc
@@ -221,7 +221,7 @@ void FaviconHandler::SetFavicon(
}
void FaviconHandler::UpdateFavicon(NavigationEntry* entry,
- scoped_refptr<RefCountedMemory> data) {
+ scoped_refptr<base::RefCountedMemory> data) {
scoped_ptr<gfx::Image> image(gfx::ImageFromPNGEncodedData(data->front(),
data->size()));
UpdateFavicon(entry, image.get());
diff --git a/chrome/browser/favicon/favicon_handler.h b/chrome/browser/favicon/favicon_handler.h
index 3397c35..71489ae 100644
--- a/chrome/browser/favicon/favicon_handler.h
+++ b/chrome/browser/favicon/favicon_handler.h
@@ -22,9 +22,12 @@
class FaviconHandlerDelegate;
class Profile;
-class RefCountedMemory;
class SkBitmap;
+namespace base {
+class RefCountedMemory;
+}
+
namespace content {
class NavigationEntry;
}
@@ -234,7 +237,7 @@ class FaviconHandler {
// If the WebContents has a delegate, it is notified of the new favicon
// (INVALIDATE_FAVICON).
void UpdateFavicon(content::NavigationEntry* entry,
- scoped_refptr<RefCountedMemory> data);
+ scoped_refptr<base::RefCountedMemory> data);
void UpdateFavicon(content::NavigationEntry* entry, const gfx::Image* image);
// If the image is not already at its preferred size, scales the image such
diff --git a/chrome/browser/history/expire_history_backend_unittest.cc b/chrome/browser/history/expire_history_backend_unittest.cc
index ab2d570..2432562 100644
--- a/chrome/browser/history/expire_history_backend_unittest.cc
+++ b/chrome/browser/history/expire_history_backend_unittest.cc
@@ -339,7 +339,7 @@ bool ExpireHistoryTest::HasThumbnail(URLID url_id) {
if (!main_db_->GetURLRow(url_id, &info))
return false;
GURL url = info.url();
- scoped_refptr<RefCountedMemory> data;
+ scoped_refptr<base::RefCountedMemory> data;
return top_sites_->GetPageThumbnail(url, &data);
}
diff --git a/chrome/browser/history/history.cc b/chrome/browser/history/history.cc
index 46a4d2d..f869296 100644
--- a/chrome/browser/history/history.cc
+++ b/chrome/browser/history/history.cc
@@ -510,7 +510,8 @@ void HistoryService::SetFavicon(const GURL& page_url,
ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::SetFavicon,
page_url, icon_url,
- scoped_refptr<RefCountedMemory>(new base::RefCountedBytes(image_data)),
+ scoped_refptr<base::RefCountedMemory>(
+ new base::RefCountedBytes(image_data)),
icon_type);
}
diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc
index 5c4367c..5095ef3 100644
--- a/chrome/browser/history/history_backend.cc
+++ b/chrome/browser/history/history_backend.cc
@@ -1941,7 +1941,7 @@ void HistoryBackend::GetFaviconForID(scoped_refptr<GetFaviconRequest> request,
void HistoryBackend::SetFavicon(
const GURL& page_url,
const GURL& icon_url,
- scoped_refptr<RefCountedMemory> data,
+ scoped_refptr<base::RefCountedMemory> data,
IconType icon_type) {
DCHECK(data.get());
if (!thumbnail_db_.get() || !db_.get())
diff --git a/chrome/browser/history/history_backend.h b/chrome/browser/history/history_backend.h
index c55e84a..d4e7fa0 100644
--- a/chrome/browser/history/history_backend.h
+++ b/chrome/browser/history/history_backend.h
@@ -257,7 +257,7 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>,
void SetFavicon(const GURL& page_url,
const GURL& icon_url,
- scoped_refptr<RefCountedMemory> data,
+ scoped_refptr<base::RefCountedMemory> data,
IconType icon_type);
void UpdateFaviconMappingAndFetch(scoped_refptr<GetFaviconRequest> request,
diff --git a/chrome/browser/history/history_types.h b/chrome/browser/history/history_types.h
index b29588d..49aa867 100644
--- a/chrome/browser/history/history_types.h
+++ b/chrome/browser/history/history_types.h
@@ -768,7 +768,7 @@ struct FaviconData {
bool known_icon;
// The bits of image.
- scoped_refptr<RefCountedMemory> image_data;
+ scoped_refptr<base::RefCountedMemory> image_data;
// Indicates whether image is expired.
bool expired;
diff --git a/chrome/browser/history/thumbnail_database.cc b/chrome/browser/history/thumbnail_database.cc
index 45e623c..0397f96 100644
--- a/chrome/browser/history/thumbnail_database.cc
+++ b/chrome/browser/history/thumbnail_database.cc
@@ -365,9 +365,10 @@ bool ThumbnailDatabase::ThumbnailScoreForId(URLID id,
return true;
}
-bool ThumbnailDatabase::SetFavicon(URLID icon_id,
- scoped_refptr<RefCountedMemory> icon_data,
- base::Time time) {
+bool ThumbnailDatabase::SetFavicon(
+ URLID icon_id,
+ scoped_refptr<base::RefCountedMemory> icon_data,
+ base::Time time) {
DCHECK(icon_id);
sql::Statement statement(db_.GetCachedStatement(SQL_FROM_HERE,
"UPDATE favicons SET image_data=?, last_updated=? WHERE id=?"));
diff --git a/chrome/browser/history/thumbnail_database.h b/chrome/browser/history/thumbnail_database.h
index 94e878d..d0fb9d8 100644
--- a/chrome/browser/history/thumbnail_database.h
+++ b/chrome/browser/history/thumbnail_database.h
@@ -18,11 +18,11 @@
#include "sql/statement.h"
class FilePath;
-class RefCountedMemory;
struct ThumbnailScore;
class SkBitmap;
namespace base {
+class RefCountedMemory;
class Time;
}
@@ -105,7 +105,7 @@ class ThumbnailDatabase {
// The time indicates the access time, and is used to detect when the favicon
// should be refreshed.
bool SetFavicon(FaviconID icon_id,
- scoped_refptr<RefCountedMemory> icon_data,
+ scoped_refptr<base::RefCountedMemory> icon_data,
base::Time time);
// Sets the time the favicon was last updated.
diff --git a/chrome/browser/history/top_sites.cc b/chrome/browser/history/top_sites.cc
index 0648415..9dab604 100644
--- a/chrome/browser/history/top_sites.cc
+++ b/chrome/browser/history/top_sites.cc
@@ -11,6 +11,7 @@
#include "base/bind_helpers.h"
#include "base/logging.h"
#include "base/md5.h"
+#include "base/memory/ref_counted_memory.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "base/values.h"
@@ -241,7 +242,7 @@ void TopSites::GetMostVisitedURLs(CancelableRequestConsumer* consumer,
}
bool TopSites::GetPageThumbnail(const GURL& url,
- scoped_refptr<RefCountedMemory>* bytes) {
+ scoped_refptr<base::RefCountedMemory>* bytes) {
// WARNING: this may be invoked on any thread.
{
base::AutoLock lock(lock_);
diff --git a/chrome/browser/history/top_sites.h b/chrome/browser/history/top_sites.h
index e709055..5963a37 100644
--- a/chrome/browser/history/top_sites.h
+++ b/chrome/browser/history/top_sites.h
@@ -15,7 +15,6 @@
#include "base/callback.h"
#include "base/gtest_prod_util.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/ref_counted_memory.h"
#include "base/synchronization/lock.h"
#include "base/time.h"
#include "base/timer.h"
@@ -31,6 +30,11 @@
class FilePath;
class Profile;
+namespace base {
+class RefCountedBytes;
+class RefCountedMemory;
+}
+
namespace history {
class TopSitesCache;
@@ -78,7 +82,7 @@ class TopSites
// As this method may be invoked on any thread the ref count needs to be
// incremented before this method returns, so this takes a scoped_refptr*.
bool GetPageThumbnail(const GURL& url,
- scoped_refptr<RefCountedMemory>* bytes);
+ scoped_refptr<base::RefCountedMemory>* bytes);
// Get a thumbnail score for a given page. Returns true iff we have the
// thumbnail score. This may be invoked on any thread. The score will
diff --git a/chrome/browser/history/top_sites_cache.cc b/chrome/browser/history/top_sites_cache.cc
index b5c5ae3..95150fc 100644
--- a/chrome/browser/history/top_sites_cache.cc
+++ b/chrome/browser/history/top_sites_cache.cc
@@ -28,8 +28,9 @@ Images* TopSitesCache::GetImage(const GURL& url) {
return &images_[GetCanonicalURL(url)];
}
-bool TopSitesCache::GetPageThumbnail(const GURL& url,
- scoped_refptr<RefCountedMemory>* bytes) {
+bool TopSitesCache::GetPageThumbnail(
+ const GURL& url,
+ scoped_refptr<base::RefCountedMemory>* bytes) {
std::map<GURL, Images>::const_iterator found =
images_.find(GetCanonicalURL(url));
if (found != images_.end()) {
diff --git a/chrome/browser/history/top_sites_cache.h b/chrome/browser/history/top_sites_cache.h
index 1101a13..3d9b0e8 100644
--- a/chrome/browser/history/top_sites_cache.h
+++ b/chrome/browser/history/top_sites_cache.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -36,7 +36,7 @@ class TopSitesCache {
// thumbnail for the specified url. It is possible for a URL to be in TopSites
// but not have an thumbnail.
bool GetPageThumbnail(const GURL& url,
- scoped_refptr<RefCountedMemory>* bytes);
+ scoped_refptr<base::RefCountedMemory>* bytes);
// Fetches the thumbnail score for the specified url. Returns true if
// there is a thumbnail score for the specified url.
diff --git a/chrome/browser/history/top_sites_unittest.cc b/chrome/browser/history/top_sites_unittest.cc
index 016a556..bdfd045 100644
--- a/chrome/browser/history/top_sites_unittest.cc
+++ b/chrome/browser/history/top_sites_unittest.cc
@@ -114,14 +114,15 @@ class TopSitesQuerier {
// Extracts the data from |t1| into a SkBitmap. This is intended for usage of
// thumbnail data, which is stored as jpgs.
-SkBitmap ExtractThumbnail(const RefCountedMemory& t1) {
+SkBitmap ExtractThumbnail(const base::RefCountedMemory& t1) {
scoped_ptr<SkBitmap> image(gfx::JPEGCodec::Decode(t1.front(),
t1.size()));
return image.get() ? *image : SkBitmap();
}
// Returns true if t1 and t2 contain the same data.
-bool ThumbnailsAreEqual(RefCountedMemory* t1, RefCountedMemory* t2) {
+bool ThumbnailsAreEqual(base::RefCountedMemory* t1,
+ base::RefCountedMemory* t2) {
if (!t1 || !t2)
return false;
if (t1->size() != t2->size())
@@ -158,7 +159,7 @@ class TopSitesTest : public HistoryUnitTestBase {
// Gets the thumbnail for |url| from TopSites.
SkBitmap GetThumbnail(const GURL& url) {
- scoped_refptr<RefCountedMemory> data;
+ scoped_refptr<base::RefCountedMemory> data;
return top_sites()->GetPageThumbnail(url, &data) ?
ExtractThumbnail(*data.get()) : SkBitmap();
}
@@ -271,7 +272,8 @@ class TopSitesTest : public HistoryUnitTestBase {
}
// Returns true if the thumbnail equals the specified bytes.
- bool ThumbnailEqualsBytes(const gfx::Image& image, RefCountedMemory* bytes) {
+ bool ThumbnailEqualsBytes(const gfx::Image& image,
+ base::RefCountedMemory* bytes) {
scoped_refptr<base::RefCountedBytes> encoded_image;
gfx::Image copy(image); // EncodeBitmap() doesn't accept const images.
TopSites::EncodeBitmap(&copy, &encoded_image);
@@ -539,7 +541,7 @@ TEST_F(TopSitesTest, ThumbnailRemoved) {
EXPECT_TRUE(top_sites()->SetPageThumbnail(url, &thumbnail, medium_score));
// Make sure the thumbnail was actually set.
- scoped_refptr<RefCountedMemory> result;
+ scoped_refptr<base::RefCountedMemory> result;
EXPECT_TRUE(top_sites()->GetPageThumbnail(url, &result));
EXPECT_TRUE(ThumbnailEqualsBytes(thumbnail, result.get()));
@@ -569,7 +571,7 @@ TEST_F(TopSitesTest, GetPageThumbnail) {
gfx::Image thumbnail(CreateBitmap(SK_ColorWHITE));
ThumbnailScore score(0.5, true, true, base::Time::Now());
- scoped_refptr<RefCountedMemory> result;
+ scoped_refptr<base::RefCountedMemory> result;
EXPECT_TRUE(top_sites()->SetPageThumbnail(url1.url, &thumbnail, score));
EXPECT_TRUE(top_sites()->GetPageThumbnail(url1.url, &result));
@@ -643,7 +645,7 @@ TEST_F(TopSitesTest, SaveToDB) {
EXPECT_EQ(asdf_title, querier.urls()[0].title);
ASSERT_NO_FATAL_FAILURE(ContainsPrepopulatePages(querier, 1));
- scoped_refptr<RefCountedMemory> read_data;
+ scoped_refptr<base::RefCountedMemory> read_data;
EXPECT_TRUE(top_sites()->GetPageThumbnail(asdf_url, &read_data));
EXPECT_TRUE(ThumbnailEqualsBytes(tmp_bitmap, read_data.get()));
}
@@ -708,7 +710,7 @@ TEST_F(TopSitesTest, RealDatabase) {
EXPECT_EQ(asdf_title, querier.urls()[0].title);
ASSERT_NO_FATAL_FAILURE(ContainsPrepopulatePages(querier, 1));
- scoped_refptr<RefCountedMemory> read_data;
+ scoped_refptr<base::RefCountedMemory> read_data;
EXPECT_TRUE(top_sites()->GetPageThumbnail(asdf_url, &read_data));
EXPECT_TRUE(ThumbnailEqualsBytes(asdf_thumbnail, read_data.get()));
}
@@ -733,7 +735,7 @@ TEST_F(TopSitesTest, RealDatabase) {
RefreshTopSitesAndRecreate();
{
- scoped_refptr<RefCountedMemory> read_data;
+ scoped_refptr<base::RefCountedMemory> read_data;
TopSitesQuerier querier;
querier.QueryTopSites(top_sites(), false);
@@ -762,7 +764,7 @@ TEST_F(TopSitesTest, RealDatabase) {
medium_score));
RefreshTopSitesAndRecreate();
{
- scoped_refptr<RefCountedMemory> read_data;
+ scoped_refptr<base::RefCountedMemory> read_data;
EXPECT_TRUE(top_sites()->GetPageThumbnail(google3_url, &read_data));
EXPECT_TRUE(ThumbnailEqualsBytes(weewar_bitmap, read_data.get()));
}
@@ -782,7 +784,7 @@ TEST_F(TopSitesTest, RealDatabase) {
// Check that the thumbnail was updated.
RefreshTopSitesAndRecreate();
{
- scoped_refptr<RefCountedMemory> read_data;
+ scoped_refptr<base::RefCountedMemory> read_data;
EXPECT_TRUE(top_sites()->GetPageThumbnail(google3_url, &read_data));
EXPECT_FALSE(ThumbnailEqualsBytes(weewar_bitmap, read_data.get()));
EXPECT_TRUE(ThumbnailEqualsBytes(green_bitmap, read_data.get()));
@@ -1046,7 +1048,7 @@ TEST_F(TopSitesTest, AddTemporaryThumbnail) {
medium_score));
// We shouldn't get the thumnail back though (the url isn't in to sites yet).
- scoped_refptr<RefCountedMemory> out;
+ scoped_refptr<base::RefCountedMemory> out;
EXPECT_FALSE(top_sites()->GetPageThumbnail(unknown_url, &out));
// But we should be able to get the temporary page thumbnail score.
ThumbnailScore out_score;
diff --git a/chrome/browser/jumplist_win.h b/chrome/browser/jumplist_win.h
index 5f4787a..f60a209 100644
--- a/chrome/browser/jumplist_win.h
+++ b/chrome/browser/jumplist_win.h
@@ -52,7 +52,7 @@ class ShellLinkItem : public base::RefCountedThreadSafe<ShellLinkItem> {
const std::wstring& title() const { return title_; }
const std::wstring& icon() const { return icon_; }
int index() const { return index_; }
- scoped_refptr<RefCountedMemory> data() const { return data_; }
+ scoped_refptr<base::RefCountedMemory> data() const { return data_; }
void SetArguments(const std::wstring& arguments) {
arguments_ = arguments;
@@ -68,7 +68,7 @@ class ShellLinkItem : public base::RefCountedThreadSafe<ShellLinkItem> {
favicon_ = favicon;
}
- void SetIconData(scoped_refptr<RefCountedMemory> data) {
+ void SetIconData(scoped_refptr<base::RefCountedMemory> data) {
data_ = data;
}
@@ -80,7 +80,7 @@ class ShellLinkItem : public base::RefCountedThreadSafe<ShellLinkItem> {
std::wstring arguments_;
std::wstring title_;
std::wstring icon_;
- scoped_refptr<RefCountedMemory> data_;
+ scoped_refptr<base::RefCountedMemory> data_;
int index_;
bool favicon_;
diff --git a/chrome/browser/themes/browser_theme_pack.cc b/chrome/browser/themes/browser_theme_pack.cc
index 42797d4..29efdf8 100644
--- a/chrome/browser/themes/browser_theme_pack.cc
+++ b/chrome/browser/themes/browser_theme_pack.cc
@@ -287,7 +287,7 @@ const int kPreloadIDs[] = {
};
// Returns a piece of memory with the contents of the file |path|.
-RefCountedMemory* ReadFileData(const FilePath& path) {
+base::RefCountedMemory* ReadFileData(const FilePath& path) {
if (!path.empty()) {
net::FileStream file(NULL);
int flags = base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ;
@@ -529,7 +529,7 @@ const gfx::Image* BrowserThemePack::GetImageNamed(int idr_id) const {
if (image_iter != loaded_images_.end())
return image_iter->second;
- scoped_refptr<RefCountedMemory> memory;
+ scoped_refptr<base::RefCountedMemory> memory;
if (data_pack_.get()) {
memory = data_pack_->GetStaticMemory(prs_id);
} else {
@@ -558,8 +558,8 @@ const gfx::Image* BrowserThemePack::GetImageNamed(int idr_id) const {
return NULL;
}
-RefCountedMemory* BrowserThemePack::GetRawData(int idr_id) const {
- RefCountedMemory* memory = NULL;
+base::RefCountedMemory* BrowserThemePack::GetRawData(int idr_id) const {
+ base::RefCountedMemory* memory = NULL;
int prs_id = GetPersistentIDByIDR(idr_id);
if (prs_id != -1) {
@@ -871,7 +871,7 @@ bool BrowserThemePack::LoadRawBitmapsTo(
for (FilePathMap::const_iterator it = file_paths.begin();
it != file_paths.end(); ++it) {
- scoped_refptr<RefCountedMemory> raw_data(ReadFileData(it->second));
+ scoped_refptr<base::RefCountedMemory> raw_data(ReadFileData(it->second));
if (!raw_data.get()) {
LOG(ERROR) << "Could not load theme image";
return false;
diff --git a/chrome/browser/themes/browser_theme_pack.h b/chrome/browser/themes/browser_theme_pack.h
index 1a4bf9f..1a5e648 100644
--- a/chrome/browser/themes/browser_theme_pack.h
+++ b/chrome/browser/themes/browser_theme_pack.h
@@ -18,7 +18,6 @@
#include "ui/gfx/color_utils.h"
class FilePath;
-class RefCountedMemory;
namespace ui {
class DataPack;
}
@@ -27,6 +26,7 @@ class Image;
}
namespace base {
class DictionaryValue;
+class RefCountedMemory;
}
// An optimized representation of a theme, backed by a mmapped DataPack.
@@ -87,7 +87,7 @@ class BrowserThemePack : public base::RefCountedThreadSafe<
// Returns the raw PNG encoded data for IDR_THEME_NTP_*. This method is only
// supposed to work for the NTP attribution and background resources.
- RefCountedMemory* GetRawData(int id) const;
+ base::RefCountedMemory* GetRawData(int id) const;
// Whether this theme provides an image for |id|.
bool HasCustomImage(int id) const;
@@ -104,7 +104,7 @@ class BrowserThemePack : public base::RefCountedThreadSafe<
typedef std::map<int, const gfx::Image*> ImageCache;
// The raw PNG memory associated with a certain id.
- typedef std::map<int, scoped_refptr<RefCountedMemory> > RawImages;
+ typedef std::map<int, scoped_refptr<base::RefCountedMemory> > RawImages;
// The type passed to ui::DataPack::WritePack.
typedef std::map<uint16, base::StringPiece> RawDataForWriting;
diff --git a/chrome/browser/themes/theme_service.cc b/chrome/browser/themes/theme_service.cc
index c0225bd..e5628e4 100644
--- a/chrome/browser/themes/theme_service.cc
+++ b/chrome/browser/themes/theme_service.cc
@@ -309,14 +309,14 @@ bool ThemeService::HasCustomImage(int id) const {
return false;
}
-RefCountedMemory* ThemeService::GetRawData(int id) const {
+base::RefCountedMemory* ThemeService::GetRawData(int id) const {
// Check to see whether we should substitute some images.
int ntp_alternate;
GetDisplayProperty(NTP_LOGO_ALTERNATE, &ntp_alternate);
if (id == IDR_PRODUCT_LOGO && ntp_alternate != 0)
id = IDR_PRODUCT_LOGO_WHITE;
- RefCountedMemory* data = NULL;
+ base::RefCountedMemory* data = NULL;
if (theme_pack_.get())
data = theme_pack_->GetRawData(id);
if (!data)
diff --git a/chrome/browser/themes/theme_service.h b/chrome/browser/themes/theme_service.h
index dd5f4dc..f49bead 100644
--- a/chrome/browser/themes/theme_service.h
+++ b/chrome/browser/themes/theme_service.h
@@ -160,7 +160,7 @@ class ThemeService : public base::NonThreadSafe,
virtual bool GetDisplayProperty(int id, int* result) const OVERRIDE;
virtual bool ShouldUseNativeFrame() const OVERRIDE;
virtual bool HasCustomImage(int id) const OVERRIDE;
- virtual RefCountedMemory* GetRawData(int id) const OVERRIDE;
+ virtual base::RefCountedMemory* GetRawData(int id) const OVERRIDE;
#if defined(OS_MACOSX)
virtual NSImage* GetNSImageNamed(int id, bool allow_default) const OVERRIDE;
virtual NSColor* GetNSImageColorNamed(int id,
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm
index f63f659..a1a0985 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm
@@ -194,7 +194,7 @@ class FakeTheme : public ui::ThemeProvider {
virtual bool GetDisplayProperty(int id, int* result) const { return false; }
virtual bool ShouldUseNativeFrame() const { return false; }
virtual bool HasCustomImage(int id) const { return false; }
- virtual RefCountedMemory* GetRawData(int id) const { return NULL; }
+ virtual base::RefCountedMemory* GetRawData(int id) const { return NULL; }
virtual NSImage* GetNSImageNamed(int id, bool allow_default) const {
return nil;
}
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view_unittest.mm
index ba1cc8b..6b4654f 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view_unittest.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view_unittest.mm
@@ -33,7 +33,7 @@ class MockThemeProvider : public ui::ThemeProvider {
MOCK_CONST_METHOD2(GetDisplayProperty, bool(int, int*));
MOCK_CONST_METHOD0(ShouldUseNativeFrame, bool());
MOCK_CONST_METHOD1(HasCustomImage, bool(int));
- MOCK_CONST_METHOD1(GetRawData, RefCountedMemory*(int));
+ MOCK_CONST_METHOD1(GetRawData, base::RefCountedMemory*(int));
// OSX stuff
MOCK_CONST_METHOD2(GetNSImageNamed, NSImage*(int, bool));
diff --git a/chrome/browser/ui/cocoa/download/background_theme.h b/chrome/browser/ui/cocoa/download/background_theme.h
index bb21de2..e9d4bd7 100644
--- a/chrome/browser/ui/cocoa/download/background_theme.h
+++ b/chrome/browser/ui/cocoa/download/background_theme.h
@@ -22,7 +22,7 @@ class BackgroundTheme : public ui::ThemeProvider {
virtual bool GetDisplayProperty(int id, int* result) const OVERRIDE;
virtual bool ShouldUseNativeFrame() const OVERRIDE;
virtual bool HasCustomImage(int id) const OVERRIDE;
- virtual RefCountedMemory* GetRawData(int id) const OVERRIDE;
+ virtual base::RefCountedMemory* GetRawData(int id) const OVERRIDE;
virtual NSImage* GetNSImageNamed(int id, bool allow_default) const OVERRIDE;
virtual NSColor* GetNSImageColorNamed(int id,
bool allow_default) const OVERRIDE;
diff --git a/chrome/browser/ui/cocoa/download/background_theme.mm b/chrome/browser/ui/cocoa/download/background_theme.mm
index 1becbab..af4dc7c 100644
--- a/chrome/browser/ui/cocoa/download/background_theme.mm
+++ b/chrome/browser/ui/cocoa/download/background_theme.mm
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -47,7 +47,7 @@ bool BackgroundTheme::HasCustomImage(int id) const {
return false;
}
-RefCountedMemory* BackgroundTheme::GetRawData(int id) const {
+base::RefCountedMemory* BackgroundTheme::GetRawData(int id) const {
return NULL;
}
diff --git a/chrome/browser/ui/webui/bookmarks_ui.cc b/chrome/browser/ui/webui/bookmarks_ui.cc
index 84e01b5..8154368 100644
--- a/chrome/browser/ui/webui/bookmarks_ui.cc
+++ b/chrome/browser/ui/webui/bookmarks_ui.cc
@@ -68,7 +68,7 @@ BookmarksUI::BookmarksUI(content::WebUI* web_ui) : WebUIController(web_ui) {
}
// static
-RefCountedMemory* BookmarksUI::GetFaviconResourceBytes() {
+base::RefCountedMemory* BookmarksUI::GetFaviconResourceBytes() {
return ResourceBundle::GetSharedInstance().
LoadDataResourceBytes(IDR_BOOKMARKS_FAVICON);
}
diff --git a/chrome/browser/ui/webui/bookmarks_ui.h b/chrome/browser/ui/webui/bookmarks_ui.h
index 146033b..62b64b7 100644
--- a/chrome/browser/ui/webui/bookmarks_ui.h
+++ b/chrome/browser/ui/webui/bookmarks_ui.h
@@ -11,7 +11,9 @@
#include "chrome/browser/ui/webui/chrome_url_data_manager.h"
#include "content/public/browser/web_ui_controller.h"
+namespace base {
class RefCountedMemory;
+}
// This class provides the source for chrome://bookmarks/
class BookmarksUIHTMLSource : public ChromeURLDataManager::DataSource {
@@ -37,7 +39,7 @@ class BookmarksUI : public content::WebUIController {
public:
explicit BookmarksUI(content::WebUI* web_ui);
- static RefCountedMemory* GetFaviconResourceBytes();
+ static base::RefCountedMemory* GetFaviconResourceBytes();
private:
DISALLOW_COPY_AND_ASSIGN(BookmarksUI);
diff --git a/chrome/browser/ui/webui/chrome_url_data_manager.cc b/chrome/browser/ui/webui/chrome_url_data_manager.cc
index 0d19d3a..2d36e45 100644
--- a/chrome/browser/ui/webui/chrome_url_data_manager.cc
+++ b/chrome/browser/ui/webui/chrome_url_data_manager.cc
@@ -130,10 +130,11 @@ ChromeURLDataManager::DataSource::DataSource(const std::string& source_name,
ChromeURLDataManager::DataSource::~DataSource() {
}
-void ChromeURLDataManager::DataSource::SendResponse(int request_id,
- RefCountedMemory* bytes) {
+void ChromeURLDataManager::DataSource::SendResponse(
+ int request_id,
+ base::RefCountedMemory* bytes) {
// Take a ref-pointer on entry so byte->Release() will always get called.
- scoped_refptr<RefCountedMemory> bytes_ptr(bytes);
+ scoped_refptr<base::RefCountedMemory> bytes_ptr(bytes);
if (IsScheduledForDeletion(this)) {
// We're scheduled for deletion. Servicing the request would result in
// this->AddRef being invoked, even though the ref count is 0 and 'this' is
@@ -194,7 +195,7 @@ void ChromeURLDataManager::DataSource::SetFontAndTextDirection(
void ChromeURLDataManager::DataSource::SendResponseOnIOThread(
int request_id,
- scoped_refptr<RefCountedMemory> bytes) {
+ scoped_refptr<base::RefCountedMemory> bytes) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (backend_)
backend_->DataAvailable(request_id, bytes);
diff --git a/chrome/browser/ui/webui/chrome_url_data_manager.h b/chrome/browser/ui/webui/chrome_url_data_manager.h
index 7c3b4cc..98671be 100644
--- a/chrome/browser/ui/webui/chrome_url_data_manager.h
+++ b/chrome/browser/ui/webui/chrome_url_data_manager.h
@@ -18,10 +18,10 @@
class ChromeURLDataManagerBackend;
class MessageLoop;
class Profile;
-class RefCountedMemory;
namespace base {
class DictionaryValue;
+class RefCountedMemory;
}
// To serve dynamic data off of chrome: URLs, implement the
@@ -82,7 +82,7 @@ class ChromeURLDataManager : public ProfileKeyedService {
// Report that a request has resulted in the data |bytes|.
// If the request can't be satisfied, pass NULL for |bytes| to indicate
// the request is over.
- virtual void SendResponse(int request_id, RefCountedMemory* bytes);
+ virtual void SendResponse(int request_id, base::RefCountedMemory* bytes);
// Returns the MessageLoop on which the DataSource wishes to have
// StartDataRequest called to handle the request for |path|. If the
@@ -120,8 +120,9 @@ class ChromeURLDataManager : public ProfileKeyedService {
// SendResponse invokes this on the IO thread. Notifies the backend to
// handle the actual work of sending the data.
- virtual void SendResponseOnIOThread(int request_id,
- scoped_refptr<RefCountedMemory> bytes);
+ virtual void SendResponseOnIOThread(
+ int request_id,
+ scoped_refptr<base::RefCountedMemory> bytes);
// The name of this source.
// E.g., for favicons, this could be "favicon", which results in paths for
diff --git a/chrome/browser/ui/webui/chrome_url_data_manager_backend.cc b/chrome/browser/ui/webui/chrome_url_data_manager_backend.cc
index 2abda1b..838f541 100644
--- a/chrome/browser/ui/webui/chrome_url_data_manager_backend.cc
+++ b/chrome/browser/ui/webui/chrome_url_data_manager_backend.cc
@@ -175,7 +175,7 @@ class URLRequestChromeJob : public net::URLRequestJob {
// Called by ChromeURLDataManager to notify us that the data blob is ready
// for us.
- void DataAvailable(RefCountedMemory* bytes);
+ void DataAvailable(base::RefCountedMemory* bytes);
void SetMimeType(const std::string& mime_type) {
mime_type_ = mime_type;
@@ -193,7 +193,7 @@ class URLRequestChromeJob : public net::URLRequestJob {
void CompleteRead(net::IOBuffer* buf, int buf_size, int* bytes_read);
// The actual data we're serving. NULL until it's been fetched.
- scoped_refptr<RefCountedMemory> data_;
+ scoped_refptr<base::RefCountedMemory> data_;
// The current offset into the data that we're handing off to our
// callers via the Read interfaces.
int data_offset_;
@@ -256,7 +256,7 @@ void URLRequestChromeJob::GetResponseInfo(net::HttpResponseInfo* info) {
AddContentSecurityPolicyHeader(request_->url(), info->headers);
}
-void URLRequestChromeJob::DataAvailable(RefCountedMemory* bytes) {
+void URLRequestChromeJob::DataAvailable(base::RefCountedMemory* bytes) {
TRACE_EVENT_ASYNC_END0("browser", "DataManager:Request", this);
if (bytes) {
// The request completed, and we have all the data.
@@ -454,7 +454,7 @@ void ChromeURLDataManagerBackend::RemoveRequest(URLRequestChromeJob* job) {
}
void ChromeURLDataManagerBackend::DataAvailable(RequestID request_id,
- RefCountedMemory* bytes) {
+ base::RefCountedMemory* bytes) {
// Forward this data on to the pending net::URLRequest, if it exists.
PendingRequestMap::iterator i = pending_requests_.find(request_id);
if (i != pending_requests_.end()) {
diff --git a/chrome/browser/ui/webui/chrome_url_data_manager_backend.h b/chrome/browser/ui/webui/chrome_url_data_manager_backend.h
index 5fa7772..74e7df2 100644
--- a/chrome/browser/ui/webui/chrome_url_data_manager_backend.h
+++ b/chrome/browser/ui/webui/chrome_url_data_manager_backend.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -17,9 +17,12 @@
class ChromeURLDataManagerBackend;
class GURL;
-class RefCountedMemory;
class URLRequestChromeJob;
+namespace base {
+class RefCountedMemory;
+}
+
namespace net {
class URLRequest;
class URLRequestJob;
@@ -44,7 +47,7 @@ class ChromeURLDataManagerBackend {
void AddDataSource(ChromeURLDataManager::DataSource* source);
// DataSource invokes this. Sends the data to the URLRequest.
- void DataAvailable(RequestID request_id, RefCountedMemory* bytes);
+ void DataAvailable(RequestID request_id, base::RefCountedMemory* bytes);
static net::URLRequestJob* Factory(net::URLRequest* request,
const std::string& scheme);
diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
index 23e432a..3cd6c72 100644
--- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
+++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
@@ -438,7 +438,7 @@ void ChromeWebUIControllerFactory::GetFaviconForURL(
ExtensionWebUI::GetFaviconForURL(profile, request, url);
} else {
history::FaviconData favicon;
- favicon.image_data = scoped_refptr<RefCountedMemory>(
+ favicon.image_data = scoped_refptr<base::RefCountedMemory>(
GetFaviconResourceBytes(url));
favicon.known_icon = favicon.image_data.get() != NULL &&
favicon.image_data->size() > 0;
@@ -459,7 +459,7 @@ ChromeWebUIControllerFactory::ChromeWebUIControllerFactory() {
ChromeWebUIControllerFactory::~ChromeWebUIControllerFactory() {
}
-RefCountedMemory* ChromeWebUIControllerFactory::GetFaviconResourceBytes(
+base::RefCountedMemory* ChromeWebUIControllerFactory::GetFaviconResourceBytes(
const GURL& page_url) const {
// The bookmark manager is a chrome extension, so we have to check for it
// before we check for extension scheme.
diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.h b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.h
index 1632bef..7ebc813 100644
--- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.h
+++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.h
@@ -13,7 +13,10 @@
#include "chrome/browser/favicon/favicon_service.h"
class Profile;
+
+namespace base {
class RefCountedMemory;
+}
class ChromeWebUIControllerFactory : public content::WebUIControllerFactory {
public:
@@ -49,7 +52,7 @@ class ChromeWebUIControllerFactory : public content::WebUIControllerFactory {
// Gets the data for the favicon for a WebUI page. Returns NULL if the WebUI
// does not have a favicon.
- RefCountedMemory* GetFaviconResourceBytes(const GURL& page_url) const;
+ base::RefCountedMemory* GetFaviconResourceBytes(const GURL& page_url) const;
DISALLOW_COPY_AND_ASSIGN(ChromeWebUIControllerFactory);
};
diff --git a/chrome/browser/ui/webui/chrome_web_ui_data_source_unittest.cc b/chrome/browser/ui/webui/chrome_web_ui_data_source_unittest.cc
index a5e4e32..4ec91f3 100644
--- a/chrome/browser/ui/webui/chrome_web_ui_data_source_unittest.cc
+++ b/chrome/browser/ui/webui/chrome_web_ui_data_source_unittest.cc
@@ -29,13 +29,13 @@ class MockChromeWebUIDataSource : public ChromeWebUIDataSource {
}
// Store response for later comparisons.
- virtual void SendResponse(int request_id, RefCountedMemory* data) {
+ virtual void SendResponse(int request_id, base::RefCountedMemory* data) {
result_request_id_ = request_id;
result_data_ = data;
}
int result_request_id_;
- scoped_refptr<RefCountedMemory> result_data_;
+ scoped_refptr<base::RefCountedMemory> result_data_;
private:
virtual ~MockChromeWebUIDataSource() {}
diff --git a/chrome/browser/ui/webui/chromeos/register_page_ui.cc b/chrome/browser/ui/webui/chromeos/register_page_ui.cc
index a5bbd82..394a928 100644
--- a/chrome/browser/ui/webui/chromeos/register_page_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/register_page_ui.cc
@@ -165,7 +165,7 @@ void RegisterPageUIHTMLSource::StartDataRequest(const std::string& path,
return;
}
- scoped_refptr<RefCountedMemory> html_bytes(
+ scoped_refptr<base::RefCountedMemory> html_bytes(
ResourceBundle::GetSharedInstance().LoadDataResourceBytes(
IDR_HOST_REGISTRATION_PAGE_HTML));
diff --git a/chrome/browser/ui/webui/conflicts_ui.cc b/chrome/browser/ui/webui/conflicts_ui.cc
index 984c326..75c1816 100644
--- a/chrome/browser/ui/webui/conflicts_ui.cc
+++ b/chrome/browser/ui/webui/conflicts_ui.cc
@@ -171,9 +171,10 @@ ConflictsUI::ConflictsUI(content::WebUI* web_ui) : WebUIController(web_ui) {
}
// static
-RefCountedMemory* ConflictsUI::GetFaviconResourceBytes() {
- return static_cast<RefCountedMemory*>(ResourceBundle::GetSharedInstance().
- LoadDataResourceBytes(IDR_CONFLICT_FAVICON));
+base::RefCountedMemory* ConflictsUI::GetFaviconResourceBytes() {
+ return static_cast<base::RefCountedMemory*>(
+ ResourceBundle::GetSharedInstance().LoadDataResourceBytes(
+ IDR_CONFLICT_FAVICON));
}
#endif
diff --git a/chrome/browser/ui/webui/conflicts_ui.h b/chrome/browser/ui/webui/conflicts_ui.h
index 8a402ae..0b243ac 100644
--- a/chrome/browser/ui/webui/conflicts_ui.h
+++ b/chrome/browser/ui/webui/conflicts_ui.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -10,14 +10,16 @@
#if defined(OS_WIN)
+namespace base {
class RefCountedMemory;
+}
// The Web UI handler for about:conflicts.
class ConflictsUI : public content::WebUIController {
public:
explicit ConflictsUI(content::WebUI* web_ui);
- static RefCountedMemory* GetFaviconResourceBytes();
+ static base::RefCountedMemory* GetFaviconResourceBytes();
private:
DISALLOW_COPY_AND_ASSIGN(ConflictsUI);
diff --git a/chrome/browser/ui/webui/crashes_ui.cc b/chrome/browser/ui/webui/crashes_ui.cc
index e1cda04..1c3c6c5 100644
--- a/chrome/browser/ui/webui/crashes_ui.cc
+++ b/chrome/browser/ui/webui/crashes_ui.cc
@@ -169,7 +169,7 @@ CrashesUI::CrashesUI(content::WebUI* web_ui) : WebUIController(web_ui) {
}
// static
-RefCountedMemory* CrashesUI::GetFaviconResourceBytes() {
+base::RefCountedMemory* CrashesUI::GetFaviconResourceBytes() {
return ResourceBundle::GetSharedInstance().
LoadDataResourceBytes(IDR_SAD_FAVICON);
}
diff --git a/chrome/browser/ui/webui/crashes_ui.h b/chrome/browser/ui/webui/crashes_ui.h
index 9eeb940..db6ce4f 100644
--- a/chrome/browser/ui/webui/crashes_ui.h
+++ b/chrome/browser/ui/webui/crashes_ui.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -8,13 +8,15 @@
#include "content/public/browser/web_ui_controller.h"
+namespace base {
class RefCountedMemory;
+}
class CrashesUI : public content::WebUIController {
public:
explicit CrashesUI(content::WebUI* web_ui);
- static RefCountedMemory* GetFaviconResourceBytes();
+ static base::RefCountedMemory* GetFaviconResourceBytes();
// Whether crash reporting has been enabled.
static bool CrashReportingEnabled();
diff --git a/chrome/browser/ui/webui/downloads_ui.cc b/chrome/browser/ui/webui/downloads_ui.cc
index cefaefc..efc035b 100644
--- a/chrome/browser/ui/webui/downloads_ui.cc
+++ b/chrome/browser/ui/webui/downloads_ui.cc
@@ -101,7 +101,7 @@ DownloadsUI::DownloadsUI(content::WebUI* web_ui) : WebUIController(web_ui) {
}
// static
-RefCountedMemory* DownloadsUI::GetFaviconResourceBytes() {
+base::RefCountedMemory* DownloadsUI::GetFaviconResourceBytes() {
return ResourceBundle::GetSharedInstance().
LoadDataResourceBytes(IDR_DOWNLOADS_FAVICON);
}
diff --git a/chrome/browser/ui/webui/downloads_ui.h b/chrome/browser/ui/webui/downloads_ui.h
index 9e10f02..21d8dfe 100644
--- a/chrome/browser/ui/webui/downloads_ui.h
+++ b/chrome/browser/ui/webui/downloads_ui.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -8,13 +8,15 @@
#include "content/public/browser/web_ui_controller.h"
+namespace base {
class RefCountedMemory;
+}
class DownloadsUI : public content::WebUIController {
public:
explicit DownloadsUI(content::WebUI* web_ui);
- static RefCountedMemory* GetFaviconResourceBytes();
+ static base::RefCountedMemory* GetFaviconResourceBytes();
private:
DISALLOW_COPY_AND_ASSIGN(DownloadsUI);
diff --git a/chrome/browser/ui/webui/extensions/extension_icon_source.cc b/chrome/browser/ui/webui/extensions/extension_icon_source.cc
index 0dfb7e3..a8bbec6 100644
--- a/chrome/browser/ui/webui/extensions/extension_icon_source.cc
+++ b/chrome/browser/ui/webui/extensions/extension_icon_source.cc
@@ -31,7 +31,7 @@
namespace {
-scoped_refptr<RefCountedMemory> BitmapToMemory(const SkBitmap* image) {
+scoped_refptr<base::RefCountedMemory> BitmapToMemory(const SkBitmap* image) {
base::RefCountedBytes* image_bytes = new base::RefCountedBytes;
gfx::PNGCodec::EncodeBGRASkBitmap(*image, false, &image_bytes->data());
return image_bytes;
diff --git a/chrome/browser/ui/webui/favicon_source.cc b/chrome/browser/ui/webui/favicon_source.cc
index f63e68a..4a1b3c0 100644
--- a/chrome/browser/ui/webui/favicon_source.cc
+++ b/chrome/browser/ui/webui/favicon_source.cc
@@ -143,7 +143,7 @@ void FaviconSource::OnFaviconDataAvailable(
}
void FaviconSource::SendDefaultResponse(int request_id) {
- RefCountedMemory* bytes = NULL;
+ base::RefCountedMemory* bytes = NULL;
if (request_size_map_[request_id] == 32) {
if (!default_favicon_large_.get()) {
default_favicon_large_ =
diff --git a/chrome/browser/ui/webui/favicon_source.h b/chrome/browser/ui/webui/favicon_source.h
index 3e0f2ec..7b982f3 100644
--- a/chrome/browser/ui/webui/favicon_source.h
+++ b/chrome/browser/ui/webui/favicon_source.h
@@ -70,9 +70,9 @@ class FaviconSource : public ChromeURLDataManager::DataSource {
// Raw PNG representation of the favicon to show when the favicon
// database doesn't have a favicon for a webpage.
// 16x16
- scoped_refptr<RefCountedMemory> default_favicon_;
+ scoped_refptr<base::RefCountedMemory> default_favicon_;
// 32x32
- scoped_refptr<RefCountedMemory> default_favicon_large_;
+ scoped_refptr<base::RefCountedMemory> default_favicon_large_;
// The history::IconTypes of icon that this FaviconSource handles.
int icon_types_;
diff --git a/chrome/browser/ui/webui/flags_ui.cc b/chrome/browser/ui/webui/flags_ui.cc
index 3115800..2e7da67 100644
--- a/chrome/browser/ui/webui/flags_ui.cc
+++ b/chrome/browser/ui/webui/flags_ui.cc
@@ -167,7 +167,7 @@ FlagsUI::FlagsUI(content::WebUI* web_ui) : WebUIController(web_ui) {
}
// static
-RefCountedMemory* FlagsUI::GetFaviconResourceBytes() {
+base::RefCountedMemory* FlagsUI::GetFaviconResourceBytes() {
return ResourceBundle::GetSharedInstance().
LoadDataResourceBytes(IDR_FLAGS);
}
diff --git a/chrome/browser/ui/webui/flags_ui.h b/chrome/browser/ui/webui/flags_ui.h
index a74044d..e5eaa03 100644
--- a/chrome/browser/ui/webui/flags_ui.h
+++ b/chrome/browser/ui/webui/flags_ui.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -9,13 +9,16 @@
#include "content/public/browser/web_ui_controller.h"
class PrefService;
+
+namespace base {
class RefCountedMemory;
+}
class FlagsUI : public content::WebUIController {
public:
explicit FlagsUI(content::WebUI* web_ui);
- static RefCountedMemory* GetFaviconResourceBytes();
+ static base::RefCountedMemory* GetFaviconResourceBytes();
static void RegisterPrefs(PrefService* prefs);
private:
diff --git a/chrome/browser/ui/webui/flash_ui.cc b/chrome/browser/ui/webui/flash_ui.cc
index 1b219de..aa8d49e 100644
--- a/chrome/browser/ui/webui/flash_ui.cc
+++ b/chrome/browser/ui/webui/flash_ui.cc
@@ -380,7 +380,7 @@ FlashUI::FlashUI(content::WebUI* web_ui) : WebUIController(web_ui) {
}
// static
-RefCountedMemory* FlashUI::GetFaviconResourceBytes() {
+base::RefCountedMemory* FlashUI::GetFaviconResourceBytes() {
// Use the default icon for now.
return NULL;
}
diff --git a/chrome/browser/ui/webui/flash_ui.h b/chrome/browser/ui/webui/flash_ui.h
index 47126ef..410c5c8 100644
--- a/chrome/browser/ui/webui/flash_ui.h
+++ b/chrome/browser/ui/webui/flash_ui.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -8,14 +8,16 @@
#include "content/public/browser/web_ui_controller.h"
+namespace base {
class RefCountedMemory;
+}
// The Web UI handler for about:flash.
class FlashUI : public content::WebUIController {
public:
explicit FlashUI(content::WebUI* web_ui);
- static RefCountedMemory* GetFaviconResourceBytes();
+ static base::RefCountedMemory* GetFaviconResourceBytes();
private:
DISALLOW_COPY_AND_ASSIGN(FlashUI);
diff --git a/chrome/browser/ui/webui/history_ui.cc b/chrome/browser/ui/webui/history_ui.cc
index 073c2f1..5c6adce 100644
--- a/chrome/browser/ui/webui/history_ui.cc
+++ b/chrome/browser/ui/webui/history_ui.cc
@@ -483,7 +483,7 @@ const GURL HistoryUI::GetHistoryURLWithSearchText(const string16& text) {
}
// static
-RefCountedMemory* HistoryUI::GetFaviconResourceBytes() {
+base::RefCountedMemory* HistoryUI::GetFaviconResourceBytes() {
return ResourceBundle::GetSharedInstance().
LoadDataResourceBytes(IDR_HISTORY_FAVICON);
}
diff --git a/chrome/browser/ui/webui/history_ui.h b/chrome/browser/ui/webui/history_ui.h
index 3690633..5e1911b 100644
--- a/chrome/browser/ui/webui/history_ui.h
+++ b/chrome/browser/ui/webui/history_ui.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -86,7 +86,7 @@ class HistoryUI : public content::WebUIController {
// Return the URL for a given search term.
static const GURL GetHistoryURLWithSearchText(const string16& text);
- static RefCountedMemory* GetFaviconResourceBytes();
+ static base::RefCountedMemory* GetFaviconResourceBytes();
private:
DISALLOW_COPY_AND_ASSIGN(HistoryUI);
diff --git a/chrome/browser/ui/webui/ntp/favicon_webui_handler.cc b/chrome/browser/ui/webui/ntp/favicon_webui_handler.cc
index 8235b7d..7286db9 100644
--- a/chrome/browser/ui/webui/ntp/favicon_webui_handler.cc
+++ b/chrome/browser/ui/webui/ntp/favicon_webui_handler.cc
@@ -33,7 +33,7 @@ StringValue* SkColorToCss(SkColor color) {
}
base::StringValue* GetDominantColorCssString(
- scoped_refptr<RefCountedMemory> png) {
+ scoped_refptr<base::RefCountedMemory> png) {
color_utils::GridSampler sampler;
SkColor color = color_utils::CalculateKMeanColorOfPNG(png, 100, 665, sampler);
return SkColorToCss(color);
diff --git a/chrome/browser/ui/webui/ntp/favicon_webui_handler.h b/chrome/browser/ui/webui/ntp/favicon_webui_handler.h
index aea2a4f..211ccd1 100644
--- a/chrome/browser/ui/webui/ntp/favicon_webui_handler.h
+++ b/chrome/browser/ui/webui/ntp/favicon_webui_handler.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -55,7 +55,7 @@ class FaviconWebUIHandler : public content::WebUIMessageHandler {
// Raw PNG representation of the favicon to show when the favicon
// database doesn't have a favicon for a webpage.
- scoped_refptr<RefCountedMemory> default_favicon_;
+ scoped_refptr<base::RefCountedMemory> default_favicon_;
// Manage retrieval of icons from apps.
scoped_ptr<ExtensionIconColorManager> app_icon_color_manager_;
diff --git a/chrome/browser/ui/webui/ntp/new_tab_ui.cc b/chrome/browser/ui/webui/ntp/new_tab_ui.cc
index 23bd633..eab4387 100644
--- a/chrome/browser/ui/webui/ntp/new_tab_ui.cc
+++ b/chrome/browser/ui/webui/ntp/new_tab_ui.cc
@@ -409,7 +409,7 @@ void NewTabUI::NewTabHTMLSource::StartDataRequest(const std::string& path,
return;
}
- scoped_refptr<RefCountedMemory> html_bytes(
+ scoped_refptr<base::RefCountedMemory> html_bytes(
NTPResourceCacheFactory::GetForProfile(profile_)->
GetNewTabHTML(is_incognito));
diff --git a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
index c317b7d..3a19642 100644
--- a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
+++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
@@ -212,7 +212,7 @@ bool NTPResourceCache::NewTabCacheNeedsRefresh() {
return false;
}
-RefCountedMemory* NTPResourceCache::GetNewTabHTML(bool is_incognito) {
+base::RefCountedMemory* NTPResourceCache::GetNewTabHTML(bool is_incognito) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (is_incognito) {
if (!new_tab_incognito_html_.get())
@@ -228,7 +228,7 @@ RefCountedMemory* NTPResourceCache::GetNewTabHTML(bool is_incognito) {
new_tab_html_.get();
}
-RefCountedMemory* NTPResourceCache::GetNewTabCSS(bool is_incognito) {
+base::RefCountedMemory* NTPResourceCache::GetNewTabCSS(bool is_incognito) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (is_incognito) {
if (!new_tab_incognito_css_.get())
diff --git a/chrome/browser/ui/webui/ntp/ntp_resource_cache.h b/chrome/browser/ui/webui/ntp/ntp_resource_cache.h
index 6fd3c8b..bb9baf9 100644
--- a/chrome/browser/ui/webui/ntp/ntp_resource_cache.h
+++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache.h
@@ -16,7 +16,10 @@
#include "content/public/browser/notification_registrar.h"
class Profile;
+
+namespace base {
class RefCountedMemory;
+}
// This class keeps a cache of NTP resources (HTML and CSS) so we don't have to
// regenerate them all the time.
@@ -26,8 +29,8 @@ class NTPResourceCache : public content::NotificationObserver,
explicit NTPResourceCache(Profile* profile);
virtual ~NTPResourceCache();
- RefCountedMemory* GetNewTabHTML(bool is_incognito);
- RefCountedMemory* GetNewTabCSS(bool is_incognito);
+ base::RefCountedMemory* GetNewTabHTML(bool is_incognito);
+ base::RefCountedMemory* GetNewTabCSS(bool is_incognito);
// content::NotificationObserver interface.
virtual void Observe(int type,
@@ -38,7 +41,7 @@ class NTPResourceCache : public content::NotificationObserver,
Profile* profile_;
void CreateNewTabHTML();
- scoped_refptr<RefCountedMemory> new_tab_html_;
+ scoped_refptr<base::RefCountedMemory> new_tab_html_;
// Helper to determine if the resource cache should be invalidated.
// This is called on every page load, and can be used to check values that
@@ -51,12 +54,12 @@ class NTPResourceCache : public content::NotificationObserver,
string16 GetSyncTypeMessage();
void CreateNewTabIncognitoHTML();
- scoped_refptr<RefCountedMemory> new_tab_incognito_html_;
+ scoped_refptr<base::RefCountedMemory> new_tab_incognito_html_;
void CreateNewTabIncognitoCSS();
- scoped_refptr<RefCountedMemory> new_tab_incognito_css_;
+ scoped_refptr<base::RefCountedMemory> new_tab_incognito_css_;
void CreateNewTabCSS();
- scoped_refptr<RefCountedMemory> new_tab_css_;
+ scoped_refptr<base::RefCountedMemory> new_tab_css_;
content::NotificationRegistrar registrar_;
PrefChangeRegistrar pref_change_registrar_;
diff --git a/chrome/browser/ui/webui/ntp/ntp_resource_cache_android.cc b/chrome/browser/ui/webui/ntp/ntp_resource_cache_android.cc
index 09e925d..db8d468 100644
--- a/chrome/browser/ui/webui/ntp/ntp_resource_cache_android.cc
+++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache_android.cc
@@ -34,7 +34,7 @@ NTPResourceCache::NTPResourceCache(Profile* profile) : profile_(profile) {}
NTPResourceCache::~NTPResourceCache() {}
-RefCountedMemory* NTPResourceCache::GetNewTabHTML(bool is_incognito) {
+base::RefCountedMemory* NTPResourceCache::GetNewTabHTML(bool is_incognito) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// Android uses same html/css for incognito NTP and normal NTP
if (!new_tab_html_.get())
@@ -42,7 +42,7 @@ RefCountedMemory* NTPResourceCache::GetNewTabHTML(bool is_incognito) {
return new_tab_html_.get();
}
-RefCountedMemory* NTPResourceCache::GetNewTabCSS(bool is_incognito) {
+base::RefCountedMemory* NTPResourceCache::GetNewTabCSS(bool is_incognito) {
// This is used for themes, which are not currently supported on Android.
NOTIMPLEMENTED();
return NULL;
diff --git a/chrome/browser/ui/webui/ntp/thumbnail_source.cc b/chrome/browser/ui/webui/ntp/thumbnail_source.cc
index 51f6de0..3229bb9 100644
--- a/chrome/browser/ui/webui/ntp/thumbnail_source.cc
+++ b/chrome/browser/ui/webui/ntp/thumbnail_source.cc
@@ -1,10 +1,11 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/webui/ntp/thumbnail_source.h"
#include "base/callback.h"
+#include "base/memory/ref_counted_memory.h"
#include "chrome/browser/history/top_sites.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/url_constants.h"
@@ -24,7 +25,7 @@ ThumbnailSource::~ThumbnailSource() {
void ThumbnailSource::StartDataRequest(const std::string& path,
bool is_incognito,
int request_id) {
- scoped_refptr<RefCountedMemory> data;
+ scoped_refptr<base::RefCountedMemory> data;
if (top_sites_->GetPageThumbnail(GURL(path), &data)) {
// We have the thumbnail.
SendResponse(request_id, data.get());
diff --git a/chrome/browser/ui/webui/ntp/thumbnail_source.h b/chrome/browser/ui/webui/ntp/thumbnail_source.h
index 9b86f19..52e0b8e 100644
--- a/chrome/browser/ui/webui/ntp/thumbnail_source.h
+++ b/chrome/browser/ui/webui/ntp/thumbnail_source.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -10,11 +10,14 @@
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/ref_counted_memory.h"
#include "chrome/browser/ui/webui/chrome_url_data_manager.h"
class Profile;
+namespace base {
+class RefCountedMemory;
+}
+
namespace history {
class TopSites;
}
@@ -44,7 +47,7 @@ class ThumbnailSource : public ChromeURLDataManager::DataSource {
// Raw PNG representation of the thumbnail to show when the thumbnail
// database doesn't have a thumbnail for a webpage.
- scoped_refptr<RefCountedMemory> default_thumbnail_;
+ scoped_refptr<base::RefCountedMemory> default_thumbnail_;
// TopSites.
scoped_refptr<history::TopSites> top_sites_;
diff --git a/chrome/browser/ui/webui/options2/options_ui2.cc b/chrome/browser/ui/webui/options2/options_ui2.cc
index 404c6f2..63f9c1a 100644
--- a/chrome/browser/ui/webui/options2/options_ui2.cc
+++ b/chrome/browser/ui/webui/options2/options_ui2.cc
@@ -137,7 +137,7 @@ OptionsUIHTMLSource::OptionsUIHTMLSource(DictionaryValue* localized_strings)
void OptionsUIHTMLSource::StartDataRequest(const std::string& path,
bool is_incognito,
int request_id) {
- scoped_refptr<RefCountedMemory> response_bytes;
+ scoped_refptr<base::RefCountedMemory> response_bytes;
SetFontAndTextDirection(localized_strings_.get());
if (path == kLocalizedStringsFile) {
@@ -352,7 +352,7 @@ void OptionsUI::ProcessAutocompleteSuggestions(
}
// static
-RefCountedMemory* OptionsUI::GetFaviconResourceBytes() {
+base::RefCountedMemory* OptionsUI::GetFaviconResourceBytes() {
return ResourceBundle::GetSharedInstance().
LoadDataResourceBytes(IDR_SETTINGS_FAVICON);
}
diff --git a/chrome/browser/ui/webui/options2/options_ui2.h b/chrome/browser/ui/webui/options2/options_ui2.h
index 9cbf0c7..f45fb8e 100644
--- a/chrome/browser/ui/webui/options2/options_ui2.h
+++ b/chrome/browser/ui/webui/options2/options_ui2.h
@@ -110,7 +110,7 @@ class OptionsUI : public content::WebUIController,
const AutocompleteResult& autocompleteResult,
base::ListValue * const suggestions);
- static RefCountedMemory* GetFaviconResourceBytes();
+ static base::RefCountedMemory* GetFaviconResourceBytes();
// Overridden from OptionsPageUIHandlerHost:
virtual void InitializeHandlers() OVERRIDE;
diff --git a/chrome/browser/ui/webui/plugins_ui.cc b/chrome/browser/ui/webui/plugins_ui.cc
index 47ee017..38d2bf5 100644
--- a/chrome/browser/ui/webui/plugins_ui.cc
+++ b/chrome/browser/ui/webui/plugins_ui.cc
@@ -480,7 +480,7 @@ PluginsUI::PluginsUI(content::WebUI* web_ui) : WebUIController(web_ui) {
}
// static
-RefCountedMemory* PluginsUI::GetFaviconResourceBytes() {
+base::RefCountedMemory* PluginsUI::GetFaviconResourceBytes() {
return ResourceBundle::GetSharedInstance().
LoadDataResourceBytes(IDR_PLUGIN);
}
diff --git a/chrome/browser/ui/webui/plugins_ui.h b/chrome/browser/ui/webui/plugins_ui.h
index 4ed8443..9f5758c 100644
--- a/chrome/browser/ui/webui/plugins_ui.h
+++ b/chrome/browser/ui/webui/plugins_ui.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -9,13 +9,16 @@
#include "content/public/browser/web_ui_controller.h"
class PrefService;
+
+namespace base {
class RefCountedMemory;
+}
class PluginsUI : public content::WebUIController {
public:
explicit PluginsUI(content::WebUI* web_ui);
- static RefCountedMemory* GetFaviconResourceBytes();
+ static base::RefCountedMemory* GetFaviconResourceBytes();
static void RegisterUserPrefs(PrefService* prefs);
private:
diff --git a/chrome/browser/ui/webui/sessions_ui.cc b/chrome/browser/ui/webui/sessions_ui.cc
index d4424a0..3743b31 100644
--- a/chrome/browser/ui/webui/sessions_ui.cc
+++ b/chrome/browser/ui/webui/sessions_ui.cc
@@ -268,7 +268,7 @@ SessionsUI::SessionsUI(content::WebUI* web_ui) : WebUIController(web_ui) {
}
// static
-RefCountedMemory* SessionsUI::GetFaviconResourceBytes() {
+base::RefCountedMemory* SessionsUI::GetFaviconResourceBytes() {
return ResourceBundle::GetSharedInstance().
LoadDataResourceBytes(IDR_HISTORY_FAVICON);
}
diff --git a/chrome/browser/ui/webui/sessions_ui.h b/chrome/browser/ui/webui/sessions_ui.h
index edc5747..5bdaaa9 100644
--- a/chrome/browser/ui/webui/sessions_ui.h
+++ b/chrome/browser/ui/webui/sessions_ui.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -8,13 +8,15 @@
#include "content/public/browser/web_ui_controller.h"
+namespace base {
class RefCountedMemory;
+}
class SessionsUI : public content::WebUIController {
public:
explicit SessionsUI(content::WebUI* web_ui);
- static RefCountedMemory* GetFaviconResourceBytes();
+ static base::RefCountedMemory* GetFaviconResourceBytes();
private:
DISALLOW_COPY_AND_ASSIGN(SessionsUI);
diff --git a/chrome/browser/ui/webui/theme_source.cc b/chrome/browser/ui/webui/theme_source.cc
index b125bc7..2c2a59b 100644
--- a/chrome/browser/ui/webui/theme_source.cc
+++ b/chrome/browser/ui/webui/theme_source.cc
@@ -113,7 +113,8 @@ void ThemeSource::SendThemeBitmap(int request_id, int resource_id) {
ui::ThemeProvider* tp = ThemeServiceFactory::GetForProfile(profile_);
DCHECK(tp);
- scoped_refptr<RefCountedMemory> image_data(tp->GetRawData(resource_id));
+ scoped_refptr<base::RefCountedMemory> image_data(tp->GetRawData(
+ resource_id));
SendResponse(request_id, image_data);
} else {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
diff --git a/chrome/browser/ui/webui/theme_source.h b/chrome/browser/ui/webui/theme_source.h
index c8fd72d..9e6c30e 100644
--- a/chrome/browser/ui/webui/theme_source.h
+++ b/chrome/browser/ui/webui/theme_source.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -11,7 +11,10 @@
#include "chrome/browser/ui/webui/chrome_url_data_manager.h"
class Profile;
+
+namespace base {
class RefCountedMemory;
+}
class ThemeSource : public ChromeURLDataManager::DataSource {
public:
@@ -41,7 +44,7 @@ class ThemeSource : public ChromeURLDataManager::DataSource {
Profile* profile_;
// We grab the CSS early so we don't have to go back to the UI thread later.
- scoped_refptr<RefCountedMemory> css_bytes_;
+ scoped_refptr<base::RefCountedMemory> css_bytes_;
DISALLOW_COPY_AND_ASSIGN(ThemeSource);
};
diff --git a/chrome/browser/ui/webui/theme_source_unittest.cc b/chrome/browser/ui/webui/theme_source_unittest.cc
index ef5f154..0cd311e 100644
--- a/chrome/browser/ui/webui/theme_source_unittest.cc
+++ b/chrome/browser/ui/webui/theme_source_unittest.cc
@@ -24,7 +24,7 @@ class MockThemeSource : public ThemeSource {
result_data_size_(0) {
}
- virtual void SendResponse(int request_id, RefCountedMemory* data) {
+ virtual void SendResponse(int request_id, base::RefCountedMemory* data) {
result_data_size_ = data ? data->size() : 0;
result_request_id_ = request_id;
}
diff --git a/chrome/browser/ui/webui/web_ui_util.cc b/chrome/browser/ui/webui/web_ui_util.cc
index 3ec5bd9..4ef88e0 100644
--- a/chrome/browser/ui/webui/web_ui_util.cc
+++ b/chrome/browser/ui/webui/web_ui_util.cc
@@ -33,7 +33,7 @@ std::string GetImageDataUrlFromResource(int res) {
ResourceBundle::GetSharedInstance().LoadDataResourceBytes(res);
if (!icon_data)
return std::string();
- scoped_refptr<RefCountedMemory> raw_icon(icon_data);
+ scoped_refptr<base::RefCountedMemory> raw_icon(icon_data);
std::string str_url;
str_url.insert(str_url.end(),
raw_icon->front(),
diff --git a/ui/base/resource/resource_bundle.cc b/ui/base/resource/resource_bundle.cc
index 4c5a50b..24c0560 100644
--- a/ui/base/resource/resource_bundle.cc
+++ b/ui/base/resource/resource_bundle.cc
@@ -377,7 +377,7 @@ void ResourceBundle::LoadFontsIfNecessary() {
SkBitmap* ResourceBundle::LoadBitmap(const ResourceHandle& data_handle,
int resource_id) {
- scoped_refptr<RefCountedMemory> memory(
+ scoped_refptr<base::RefCountedMemory> memory(
data_handle.GetStaticMemory(resource_id));
if (!memory)
return NULL;
diff --git a/ui/base/theme_provider.h b/ui/base/theme_provider.h
index 1a5c9980..82037d70 100644
--- a/ui/base/theme_provider.h
+++ b/ui/base/theme_provider.h
@@ -25,9 +25,12 @@ typedef struct _GdkColor GdkColor;
typedef struct _GdkPixbuf GdkPixbuf;
#endif // OS_*
-class RefCountedMemory;
class SkBitmap;
+namespace base {
+class RefCountedMemory;
+}
+
namespace ui {
////////////////////////////////////////////////////////////////////////////////
@@ -65,7 +68,7 @@ class UI_EXPORT ThemeProvider {
// Reads the image data from the theme file into the specified vector. Only
// valid for un-themed resources and the themed IDR_THEME_NTP_* in most
// implementations of ThemeProvider. Returns NULL on error.
- virtual RefCountedMemory* GetRawData(int id) const = 0;
+ virtual base::RefCountedMemory* GetRawData(int id) const = 0;
#if defined(OS_MACOSX) && !defined(TOOLKIT_VIEWS)
// Gets the NSImage with the specified |id|.
diff --git a/ui/gfx/color_analysis.cc b/ui/gfx/color_analysis.cc
index d552723..e5031ee 100644
--- a/ui/gfx/color_analysis.cc
+++ b/ui/gfx/color_analysis.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -157,12 +157,12 @@ int GridSampler::GetSample(int width, int height) {
}
SkColor CalculateRecommendedBgColorForPNG(
- scoped_refptr<RefCountedMemory> png) {
+ scoped_refptr<base::RefCountedMemory> png) {
RandomSampler sampler;
return CalculateRecommendedBgColorForPNG(png, sampler);
}
-SkColor CalculateKMeanColorOfPNG(scoped_refptr<RefCountedMemory> png,
+SkColor CalculateKMeanColorOfPNG(scoped_refptr<base::RefCountedMemory> png,
uint32_t darkness_limit,
uint32_t brightness_limit) {
RandomSampler sampler;
@@ -171,7 +171,7 @@ SkColor CalculateKMeanColorOfPNG(scoped_refptr<RefCountedMemory> png,
}
SkColor CalculateRecommendedBgColorForPNG(
- scoped_refptr<RefCountedMemory> png,
+ scoped_refptr<base::RefCountedMemory> png,
KMeanImageSampler& sampler) {
return CalculateKMeanColorOfPNG(png,
kMinDarkness,
@@ -179,7 +179,7 @@ SkColor CalculateRecommendedBgColorForPNG(
sampler);
}
-SkColor CalculateKMeanColorOfPNG(scoped_refptr<RefCountedMemory> png,
+SkColor CalculateKMeanColorOfPNG(scoped_refptr<base::RefCountedMemory> png,
uint32_t darkness_limit,
uint32_t brightness_limit,
KMeanImageSampler& sampler) {
diff --git a/ui/gfx/color_analysis.h b/ui/gfx/color_analysis.h
index 7931b48..e61bbb3 100644
--- a/ui/gfx/color_analysis.h
+++ b/ui/gfx/color_analysis.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -57,10 +57,12 @@ class UI_EXPORT GridSampler : public KMeanImageSampler {
// color of the image, then the color is moved to HSV space so the saturation
// and luminance can be modified to move the color towards the white end of
// the spectrum. The color is then moved back to RGB space and returned.
-SkColor CalculateRecommendedBgColorForPNG(scoped_refptr<RefCountedMemory> png);
+SkColor CalculateRecommendedBgColorForPNG(
+ scoped_refptr<base::RefCountedMemory> png);
-SkColor CalculateRecommendedBgColorForPNG(scoped_refptr<RefCountedMemory> png,
- KMeanImageSampler& sampler);
+SkColor CalculateRecommendedBgColorForPNG(
+ scoped_refptr<base::RefCountedMemory> png,
+ KMeanImageSampler& sampler);
// Returns an SkColor that represents the calculated dominant color in the png.
// This uses a KMean clustering algorithm to find clusters of pixel colors in
@@ -99,14 +101,15 @@ SkColor CalculateRecommendedBgColorForPNG(scoped_refptr<RefCountedMemory> png,
// |darkness_limit| < SUM(R, G, B) < |brightness_limit|. Return that color.
// If no color fulfills that requirement return the color with the largest
// weight regardless of whether or not it fulfills the equation above.
-SkColor CalculateKMeanColorOfPNG(scoped_refptr<RefCountedMemory> png,
+SkColor CalculateKMeanColorOfPNG(scoped_refptr<base::RefCountedMemory> png,
uint32_t darkness_limit,
uint32_t brightness_limit);
-UI_EXPORT SkColor CalculateKMeanColorOfPNG(scoped_refptr<RefCountedMemory> png,
- uint32_t darkness_limit,
- uint32_t brightness_limit,
- KMeanImageSampler& sampler);
+UI_EXPORT SkColor CalculateKMeanColorOfPNG(
+ scoped_refptr<base::RefCountedMemory> png,
+ uint32_t darkness_limit,
+ uint32_t brightness_limit,
+ KMeanImageSampler& sampler);
} // namespace color_utils
diff --git a/ui/views/widget/default_theme_provider.cc b/ui/views/widget/default_theme_provider.cc
index 5096870..df33ee6 100644
--- a/ui/views/widget/default_theme_provider.cc
+++ b/ui/views/widget/default_theme_provider.cc
@@ -41,7 +41,7 @@ bool DefaultThemeProvider::HasCustomImage(int id) const {
return false;
}
-RefCountedMemory* DefaultThemeProvider::GetRawData(int id) const {
+base::RefCountedMemory* DefaultThemeProvider::GetRawData(int id) const {
return NULL;
}
diff --git a/ui/views/widget/default_theme_provider.h b/ui/views/widget/default_theme_provider.h
index cd975c3..c1df943 100644
--- a/ui/views/widget/default_theme_provider.h
+++ b/ui/views/widget/default_theme_provider.h
@@ -31,7 +31,7 @@ class VIEWS_EXPORT DefaultThemeProvider : public ui::ThemeProvider {
virtual bool GetDisplayProperty(int id, int* result) const OVERRIDE;
virtual bool ShouldUseNativeFrame() const OVERRIDE;
virtual bool HasCustomImage(int id) const OVERRIDE;
- virtual RefCountedMemory* GetRawData(int id) const OVERRIDE;
+ virtual base::RefCountedMemory* GetRawData(int id) const OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(DefaultThemeProvider);