Revert of r22559.

This caused an easily reproducible crash:

1. Start with a fresh profile
2. Navigate to google.com
3. Restart
4. Navigate to google.com
5. crash

The change from pass-by-value to pass-by-ref in
fav_icon_helper.* seems to be to blame, but I can't see it
right off.

[email protected]

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22595 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index da9fbd5..a8e90043 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -1844,7 +1844,7 @@
 // TODO(brettw) change this to accept GURLs when history supports it
 void AutomationProvider::OnRedirectQueryComplete(
     HistoryService::Handle request_handle,
-    const GURL& from_url,
+    GURL from_url,
     bool success,
     history::RedirectList* redirects) {
   DCHECK(request_handle == redirect_query_);
diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h
index 8b171b7..0d9b08c2 100644
--- a/chrome/browser/automation/automation_provider.h
+++ b/chrome/browser/automation/automation_provider.h
@@ -466,7 +466,7 @@
   // Callback for history redirect queries.
   virtual void OnRedirectQueryComplete(
       HistoryService::Handle request_handle,
-      const GURL& from_url,
+      GURL from_url,
       bool success,
       history::RedirectList* redirects);
 
diff --git a/chrome/browser/bookmarks/bookmark_model.cc b/chrome/browser/bookmarks/bookmark_model.cc
index e9573ac0..9bcc8c34 100644
--- a/chrome/browser/bookmarks/bookmark_model.cc
+++ b/chrome/browser/bookmarks/bookmark_model.cc
@@ -636,7 +636,7 @@
     bool know_favicon,
     scoped_refptr<RefCountedBytes> data,
     bool expired,
-    const GURL& icon_url) {
+    GURL icon_url) {
   SkBitmap fav_icon;
   BookmarkNode* node =
       load_consumer_.GetClientData(
diff --git a/chrome/browser/bookmarks/bookmark_model.h b/chrome/browser/bookmarks/bookmark_model.h
index 113715947..8da3bcd 100644
--- a/chrome/browser/bookmarks/bookmark_model.h
+++ b/chrome/browser/bookmarks/bookmark_model.h
@@ -371,7 +371,7 @@
       bool know_favicon,
       scoped_refptr<RefCountedBytes> data,
       bool expired,
-      const GURL& icon_url);
+      GURL icon_url);
 
   // Invoked from the node to load the favicon. Requests the favicon from the
   // history service.
diff --git a/chrome/browser/dom_ui/dom_ui_favicon_source.cc b/chrome/browser/dom_ui/dom_ui_favicon_source.cc
index 8f77134..bb7b9f0 100644
--- a/chrome/browser/dom_ui/dom_ui_favicon_source.cc
+++ b/chrome/browser/dom_ui/dom_ui_favicon_source.cc
@@ -42,7 +42,7 @@
     bool know_favicon,
     scoped_refptr<RefCountedBytes> data,
     bool expired,
-    const GURL& icon_url) {
+    GURL icon_url) {
   HistoryService* hs =
       profile_->GetHistoryService(Profile::EXPLICIT_ACCESS);
   int request_id = cancelable_consumer_.GetClientData(hs, request_handle);
diff --git a/chrome/browser/dom_ui/dom_ui_favicon_source.h b/chrome/browser/dom_ui/dom_ui_favicon_source.h
index b33f0e5..42d770c 100644
--- a/chrome/browser/dom_ui/dom_ui_favicon_source.h
+++ b/chrome/browser/dom_ui/dom_ui_favicon_source.h
@@ -37,7 +37,7 @@
                               bool know_favicon,
                               scoped_refptr<RefCountedBytes> data,
                               bool expired,
-                              const GURL& url);
+                              GURL url);
 
  private:
   Profile* profile_;
diff --git a/chrome/browser/fav_icon_helper.cc b/chrome/browser/fav_icon_helper.cc
index a984ed1..564c262b 100644
--- a/chrome/browser/fav_icon_helper.cc
+++ b/chrome/browser/fav_icon_helper.cc
@@ -155,7 +155,7 @@
     bool know_favicon,
     scoped_refptr<RefCountedBytes> data,
     bool expired,
-    const GURL& icon_url) {
+    GURL icon_url) {
   NavigationEntry* entry = GetEntry();
   if (!entry)
     return;
@@ -226,7 +226,7 @@
     bool know_favicon,
     scoped_refptr<RefCountedBytes> data,
     bool expired,
-    const GURL& icon_url) {
+    GURL icon_url) {
   NavigationEntry* entry = GetEntry();
   if (!entry)
     return;
diff --git a/chrome/browser/fav_icon_helper.h b/chrome/browser/fav_icon_helper.h
index 1cb1fa0..adbcaf0 100644
--- a/chrome/browser/fav_icon_helper.h
+++ b/chrome/browser/fav_icon_helper.h
@@ -120,7 +120,7 @@
                                   bool know_favicon,
                                   scoped_refptr<RefCountedBytes> data,
                                   bool expired,
-                                  const GURL& icon_url);
+                                  GURL icon_url);
 
   // If the favicon has expired, asks the renderer to download the favicon.
   // Otherwise asks history to update the mapping between page url and icon
@@ -132,7 +132,7 @@
                      bool know_favicon,
                      scoped_refptr<RefCountedBytes> data,
                      bool expired,
-                     const GURL& icon_url);
+                     GURL icon_url);
 
   // Schedules a download for the specified entry. This adds the request to
   // download_requests_.
diff --git a/chrome/browser/gtk/list_store_favicon_loader.cc b/chrome/browser/gtk/list_store_favicon_loader.cc
index eff00a5e..5a34dd06 100644
--- a/chrome/browser/gtk/list_store_favicon_loader.cc
+++ b/chrome/browser/gtk/list_store_favicon_loader.cc
@@ -57,11 +57,8 @@
 }
 
 void ListStoreFavIconLoader::OnGotFavIcon(
-    HistoryService::Handle handle,
-    bool know_fav_icon,
-    scoped_refptr<RefCountedBytes> image_data,
-    bool is_expired,
-    const GURL& icon_url) {
+    HistoryService::Handle handle, bool know_fav_icon,
+    scoped_refptr<RefCountedBytes> image_data, bool is_expired, GURL icon_url) {
   GtkTreeIter iter;
   if (!GetRowByFavIconHandle(handle, &iter))
     return;
diff --git a/chrome/browser/gtk/list_store_favicon_loader.h b/chrome/browser/gtk/list_store_favicon_loader.h
index 69d6ae9..935c0f7 100644
--- a/chrome/browser/gtk/list_store_favicon_loader.h
+++ b/chrome/browser/gtk/list_store_favicon_loader.h
@@ -35,11 +35,9 @@
                              GtkTreeIter* result_iter);
 
   // Callback from HistoryService:::GetFavIconForURL
-  void OnGotFavIcon(HistoryService::Handle handle,
-                    bool know_fav_icon,
-                    scoped_refptr<RefCountedBytes> image_data,
-                    bool is_expired,
-                    const GURL& icon_url);
+  void OnGotFavIcon(HistoryService::Handle handle, bool know_fav_icon,
+                    scoped_refptr<RefCountedBytes> image_data, bool is_expired,
+                    GURL icon_url);
 
   // The list store we are loading favicons into.
   GtkListStore* list_store_;
diff --git a/chrome/browser/history/history.h b/chrome/browser/history/history.h
index caac179..0643139f 100644
--- a/chrome/browser/history/history.h
+++ b/chrome/browser/history/history.h
@@ -270,8 +270,8 @@
   // some reason, success will additionally be false. If the given page
   // has redirected to multiple destinations, this will pick a random one.
   typedef Callback4<Handle,
-                    const GURL&,  // from_url
-                    bool,         // success
+                    GURL,  // from_url
+                    bool,  // success
                     history::RedirectList*>::Type
       QueryRedirectsCallback;
 
@@ -356,7 +356,7 @@
                     bool,                            // know_favicon
                     scoped_refptr<RefCountedBytes>,  // data
                     bool,                            // expired
-                    const GURL&>::Type               // url of the favicon
+                    GURL>::Type                      // url of the favicon
       FavIconDataCallback;
 
   // Requests the favicon. FavIconConsumer is notified
diff --git a/chrome/browser/history/history_unittest.cc b/chrome/browser/history/history_unittest.cc
index 8d153d8..23463440 100644
--- a/chrome/browser/history/history_unittest.cc
+++ b/chrome/browser/history/history_unittest.cc
@@ -240,7 +240,7 @@
 
   // Callback for QueryRedirects.
   void OnRedirectQueryComplete(HistoryService::Handle handle,
-                               const GURL& url,
+                               GURL url,
                                bool success,
                                history::RedirectList* redirects) {
     redirect_query_success_ = success;
diff --git a/chrome/browser/jumplist.cc b/chrome/browser/jumplist.cc
index 6ea210ec..fcf39e6 100644
--- a/chrome/browser/jumplist.cc
+++ b/chrome/browser/jumplist.cc
@@ -709,7 +709,7 @@
     bool know_favicon,
     scoped_refptr<RefCountedBytes> data,
     bool expired,
-    const GURL& icon_url) {
+    GURL icon_url) {
   // Attach the received data to the ShellLinkItem object.
   // This data will be decoded by JumpListUpdateTask.
   if (know_favicon && data.get() && !data->data.empty())
diff --git a/chrome/browser/jumplist.h b/chrome/browser/jumplist.h
index 824e1ac..e1074821 100644
--- a/chrome/browser/jumplist.h
+++ b/chrome/browser/jumplist.h
@@ -159,7 +159,7 @@
                               bool know_favicon,
                               scoped_refptr<RefCountedBytes> data,
                               bool expired,
-                              const GURL& icon_url);
+                              GURL icon_url);
 
  private:
   // Our consumers for HistoryService.
diff --git a/chrome/browser/possible_url_model.cc b/chrome/browser/possible_url_model.cc
index 1c7a1ea..795755f 100644
--- a/chrome/browser/possible_url_model.cc
+++ b/chrome/browser/possible_url_model.cc
@@ -166,7 +166,7 @@
     bool fav_icon_available,
     scoped_refptr<RefCountedBytes> data,
     bool expired,
-    const GURL& icon_url) {
+    GURL icon_url) {
   if (profile_) {
     HistoryService* hs =
         profile_->GetHistoryService(Profile::EXPLICIT_ACCESS);
diff --git a/chrome/browser/possible_url_model.h b/chrome/browser/possible_url_model.h
index 582506d..4a688fe 100644
--- a/chrome/browser/possible_url_model.h
+++ b/chrome/browser/possible_url_model.h
@@ -51,7 +51,7 @@
                                   bool fav_icon_available,
                                   scoped_refptr<RefCountedBytes> data,
                                   bool expired,
-                                  const GURL& icon_url);
+                                  GURL icon_url);
 
   virtual void SetObserver(TableModelObserver* observer) {
     observer_ = observer;
diff --git a/chrome/browser/search_engines/template_url_table_model.cc b/chrome/browser/search_engines/template_url_table_model.cc
index 7b2dd65e..97c6525 100644
--- a/chrome/browser/search_engines/template_url_table_model.cc
+++ b/chrome/browser/search_engines/template_url_table_model.cc
@@ -97,7 +97,7 @@
       bool know_favicon,
       scoped_refptr<RefCountedBytes> data,
       bool expired,
-      const GURL& icon_url) {
+      GURL icon_url) {
     load_state_ = LOADED;
     if (know_favicon && data.get() &&
         PNGDecoder::Decode(&data->data, &fav_icon_)) {
diff --git a/chrome/browser/thumbnail_store.cc b/chrome/browser/thumbnail_store.cc
index 94e3e90..4f30c62c 100644
--- a/chrome/browser/thumbnail_store.cc
+++ b/chrome/browser/thumbnail_store.cc
@@ -156,7 +156,7 @@
 
 void ThumbnailStore::OnRedirectsForURLAvailable(
     HistoryService::Handle handle,
-    const GURL& url,
+    GURL url,
     bool success,
     history::RedirectList* redirects) {
   if (!success)
diff --git a/chrome/browser/thumbnail_store.h b/chrome/browser/thumbnail_store.h
index aaa03ce..143cbce 100644
--- a/chrome/browser/thumbnail_store.h
+++ b/chrome/browser/thumbnail_store.h
@@ -117,7 +117,7 @@
   // will be called with url=C and redirects = {B -> A}.  This information gets
   // inserted into the RedirectMap as A => {B -> C}.
   void OnRedirectsForURLAvailable(HistoryService::Handle handle,
-                                  const GURL& url,
+                                  GURL url,
                                   bool success,
                                   history::RedirectList* redirects);
 
diff --git a/chrome/browser/views/options/general_page_view.cc b/chrome/browser/views/options/general_page_view.cc
index f8c1dce..e99444d 100644
--- a/chrome/browser/views/options/general_page_view.cc
+++ b/chrome/browser/views/options/general_page_view.cc
@@ -106,7 +106,7 @@
                     bool know_fav_icon,
                     scoped_refptr<RefCountedBytes> image_data,
                     bool is_expired,
-                    const GURL& icon_url);
+                    GURL icon_url);
 
   // Returns the entry whose fav_icon_handle matches handle and sets entry_index
   // to the index of the entry.
@@ -230,7 +230,7 @@
     bool know_fav_icon,
     scoped_refptr<RefCountedBytes> image_data,
     bool is_expired,
-    const GURL& icon_url) {
+    GURL icon_url) {
   int entry_index;
   Entry* entry = GetEntryByLoadHandle(handle, &entry_index);
   DCHECK(entry);