summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorzverre@yandex-team.ru <zverre@yandex-team.ru@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-09 13:35:58 +0000
committerzverre@yandex-team.ru <zverre@yandex-team.ru@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-09 13:35:58 +0000
commit12a46832039868de4466ec286a3c5942be7b74da (patch)
tree3ce9f21f6ad7e081268f614510b94930f4ebaac0 /chrome/browser
parent7e1de9858cfe4dc01fb7881097258d458918b3d1 (diff)
downloadchromium_src-12a46832039868de4466ec286a3c5942be7b74da.zip
chromium_src-12a46832039868de4466ec286a3c5942be7b74da.tar.gz
chromium_src-12a46832039868de4466ec286a3c5942be7b74da.tar.bz2
We have a problem in the process on destroying WebContentsImpl because
each WebContentsObserver first NULLs its web_contents_ pointer and performs cleanup code after that. This could work if we guaranteed that every WebContentsObserver doesn't directly or indirectly affect any other WebContentsObserver. But actually WebContentsObservers can do anything and also affect each other. And if one WebContentsObserver already NULLed its web_contents_ pointer (e.g. ZoomController) other WebContentsObserver (e.g. InterstitialPageImpl) calls it (indirectly in this case) we have problems and result depends on ordering of WebContentsObservers in the list of observers. The solution splits that process into two phases. First we let each WebContentsObserver to perform their cleanup code and at that point they can freely call each other, we completely don't care about the ordering. We can call this phase as untrusted phase because we deal with some cleanup code that can do anything. After that we make second pass and NULL each web_contents_ pointer and this phase is trusted because we call only private implementation of WebContentsObserver that we definitely can trust. BUG=363564 Review URL: https://codereview.chromium.org/257153003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269264 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/android/shortcut_helper.cc2
-rw-r--r--chrome/browser/android/shortcut_helper.h3
-rw-r--r--chrome/browser/apps/ephemeral_app_launcher.cc3
-rw-r--r--chrome/browser/apps/ephemeral_app_launcher.h3
-rw-r--r--chrome/browser/autofill/content_autofill_driver_browsertest.cc13
-rw-r--r--chrome/browser/chromeos/file_manager/app_installer.cc5
-rw-r--r--chrome/browser/download/download_request_limiter.cc6
-rw-r--r--chrome/browser/download/download_request_limiter.h3
-rw-r--r--chrome/browser/extensions/active_tab_permission_granter.cc3
-rw-r--r--chrome/browser/extensions/active_tab_permission_granter.h3
-rw-r--r--chrome/browser/extensions/api/desktop_capture/desktop_capture_api.cc3
-rw-r--r--chrome/browser/extensions/api/desktop_capture/desktop_capture_api.h3
-rw-r--r--chrome/browser/extensions/api/web_navigation/web_navigation_api.cc6
-rw-r--r--chrome/browser/extensions/api/web_navigation/web_navigation_api.h2
-rw-r--r--chrome/browser/extensions/extension_view_host.cc2
-rw-r--r--chrome/browser/extensions/script_executor.cc2
-rw-r--r--chrome/browser/extensions/webstore_inline_installer.cc3
-rw-r--r--chrome/browser/extensions/webstore_inline_installer.h3
-rw-r--r--chrome/browser/guest_view/guest_view_manager.cc2
-rw-r--r--chrome/browser/guest_view/web_view/web_view_guest.cc4
-rw-r--r--chrome/browser/guest_view/web_view/web_view_guest.h3
-rw-r--r--chrome/browser/history/history_tab_helper.cc5
-rw-r--r--chrome/browser/history/history_tab_helper.h2
-rw-r--r--chrome/browser/infobars/infobar_service.cc4
-rw-r--r--chrome/browser/infobars/infobar_service.h3
-rw-r--r--chrome/browser/media/media_stream_capture_indicator.cc4
-rw-r--r--chrome/browser/media_galleries/media_file_system_registry.cc7
-rw-r--r--chrome/browser/policy/policy_browsertest.cc6
-rw-r--r--chrome/browser/prerender/prerender_manager.cc3
-rw-r--r--chrome/browser/prerender/prerender_manager.h3
-rw-r--r--chrome/browser/printing/background_printing_manager.cc7
-rw-r--r--chrome/browser/printing/print_dialog_cloud.cc2
-rw-r--r--chrome/browser/printing/print_preview_dialog_controller_browsertest.cc2
-rw-r--r--chrome/browser/safe_browsing/client_side_detection_host.cc3
-rw-r--r--chrome/browser/safe_browsing/client_side_detection_host.h2
-rw-r--r--chrome/browser/task_manager/web_contents_resource_provider.cc4
-rw-r--r--chrome/browser/translate/translate_tab_helper.cc3
-rw-r--r--chrome/browser/translate/translate_tab_helper.h3
-rw-r--r--chrome/browser/ui/android/infobars/auto_login_prompter.cc2
-rw-r--r--chrome/browser/ui/android/infobars/auto_login_prompter.h3
-rw-r--r--chrome/browser/ui/ash/launcher/browser_status_monitor.cc13
-rw-r--r--chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc3
-rw-r--r--chrome/browser/ui/auto_login_infobar_delegate.cc6
-rw-r--r--chrome/browser/ui/autofill/autofill_popup_controller_interactive_uitest.cc18
-rw-r--r--chrome/browser/ui/autofill/tab_autofill_manager_delegate.cc3
-rw-r--r--chrome/browser/ui/autofill/tab_autofill_manager_delegate.h3
-rw-r--r--chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc2
-rw-r--r--chrome/browser/ui/browser_browsertest.cc2
-rw-r--r--chrome/browser/ui/cocoa/hung_renderer_controller.mm2
-rw-r--r--chrome/browser/ui/omnibox/omnibox_navigation_observer.cc3
-rw-r--r--chrome/browser/ui/omnibox/omnibox_navigation_observer.h3
-rw-r--r--chrome/browser/ui/panels/panel_host.cc2
-rw-r--r--chrome/browser/ui/panels/panel_host.h3
-rw-r--r--chrome/browser/ui/passwords/manage_passwords_bubble_model.cc21
-rw-r--r--chrome/browser/ui/passwords/manage_passwords_bubble_model.h5
-rw-r--r--chrome/browser/ui/passwords/manage_passwords_ui_controller.cc5
-rw-r--r--chrome/browser/ui/passwords/manage_passwords_ui_controller.h3
-rw-r--r--chrome/browser/ui/sync/one_click_signin_helper.cc5
-rw-r--r--chrome/browser/ui/sync/one_click_signin_sync_observer.cc5
-rw-r--r--chrome/browser/ui/sync/one_click_signin_sync_observer.h2
-rw-r--r--chrome/browser/ui/tab_contents/core_tab_helper.cc2
-rw-r--r--chrome/browser/ui/tab_contents/core_tab_helper.h3
-rw-r--r--chrome/browser/ui/tabs/tab_strip_model.cc11
-rw-r--r--chrome/browser/ui/tabs/tab_strip_model_unittest.cc2
-rw-r--r--chrome/browser/ui/views/frame/browser_view_browsertest.cc3
-rw-r--r--chrome/browser/ui/views/hung_renderer_view.cc3
-rw-r--r--chrome/browser/ui/views/hung_renderer_view.h2
-rw-r--r--chrome/browser/ui/views/translate/translate_bubble_view.cc3
-rw-r--r--chrome/browser/ui/views/translate/translate_bubble_view.h3
-rw-r--r--chrome/browser/ui/website_settings/permission_bubble_manager.cc5
-rw-r--r--chrome/browser/ui/website_settings/permission_bubble_manager.h3
-rw-r--r--chrome/browser/ui/webui/constrained_web_dialog_ui_browsertest.cc2
72 files changed, 115 insertions, 181 deletions
diff --git a/chrome/browser/android/shortcut_helper.cc b/chrome/browser/android/shortcut_helper.cc
index 4539402..7a010b1 100644
--- a/chrome/browser/android/shortcut_helper.cc
+++ b/chrome/browser/android/shortcut_helper.cc
@@ -114,7 +114,7 @@ bool ShortcutBuilder::OnMessageReceived(const IPC::Message& message) {
return handled;
}
-void ShortcutBuilder::WebContentsDestroyed(content::WebContents* web_contents) {
+void ShortcutBuilder::WebContentsDestroyed() {
Destroy();
}
diff --git a/chrome/browser/android/shortcut_helper.h b/chrome/browser/android/shortcut_helper.h
index 4be5c30..9e4e13c 100644
--- a/chrome/browser/android/shortcut_helper.h
+++ b/chrome/browser/android/shortcut_helper.h
@@ -57,8 +57,7 @@ class ShortcutBuilder : public content::WebContentsObserver {
// WebContentsObserver
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
- virtual void WebContentsDestroyed(content::WebContents* web_contents)
- OVERRIDE;
+ virtual void WebContentsDestroyed() OVERRIDE;
private:
void Destroy();
diff --git a/chrome/browser/apps/ephemeral_app_launcher.cc b/chrome/browser/apps/ephemeral_app_launcher.cc
index 82111ef..d0f4c70 100644
--- a/chrome/browser/apps/ephemeral_app_launcher.cc
+++ b/chrome/browser/apps/ephemeral_app_launcher.cc
@@ -252,8 +252,7 @@ void EphemeralAppLauncher::CompleteInstall(const std::string& error) {
// WebstoreStandaloneInstaller to support this cleanly.
}
-void EphemeralAppLauncher::WebContentsDestroyed(
- content::WebContents* web_contents) {
+void EphemeralAppLauncher::WebContentsDestroyed() {
AbortInstall();
}
diff --git a/chrome/browser/apps/ephemeral_app_launcher.h b/chrome/browser/apps/ephemeral_app_launcher.h
index baefed5..a68d611 100644
--- a/chrome/browser/apps/ephemeral_app_launcher.h
+++ b/chrome/browser/apps/ephemeral_app_launcher.h
@@ -90,8 +90,7 @@ class EphemeralAppLauncher : public extensions::WebstoreStandaloneInstaller,
virtual void CompleteInstall(const std::string& error) OVERRIDE;
// content::WebContentsObserver implementation.
- virtual void WebContentsDestroyed(
- content::WebContents* web_contents) OVERRIDE;
+ virtual void WebContentsDestroyed() OVERRIDE;
// ExtensionRegistryObserver implementation.
virtual void OnExtensionLoaded(
diff --git a/chrome/browser/autofill/content_autofill_driver_browsertest.cc b/chrome/browser/autofill/content_autofill_driver_browsertest.cc
index d452e1e..1df9234 100644
--- a/chrome/browser/autofill/content_autofill_driver_browsertest.cc
+++ b/chrome/browser/autofill/content_autofill_driver_browsertest.cc
@@ -81,20 +81,19 @@ class ContentAutofillDriverBrowserTest : public InProcessBrowserTest,
virtual ~ContentAutofillDriverBrowserTest() {}
virtual void SetUpOnMainThread() OVERRIDE {
- web_contents_ = browser()->tab_strip_model()->GetActiveWebContents();
- ASSERT_TRUE(web_contents_ != NULL);
- Observe(web_contents_);
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
+ ASSERT_TRUE(web_contents != NULL);
+ Observe(web_contents);
AutofillManager::RegisterProfilePrefs(manager_delegate_.GetPrefRegistry());
autofill_driver_.reset(
- new TestContentAutofillDriver(web_contents_, &manager_delegate_));
+ new TestContentAutofillDriver(web_contents, &manager_delegate_));
}
// Normally the WebContents will automatically delete the driver, but here
// the driver is owned by this test, so we have to manually destroy.
- virtual void WebContentsDestroyed(content::WebContents* web_contents)
- OVERRIDE {
- DCHECK_EQ(web_contents_, web_contents);
+ virtual void WebContentsDestroyed() OVERRIDE {
autofill_driver_.reset();
}
diff --git a/chrome/browser/chromeos/file_manager/app_installer.cc b/chrome/browser/chromeos/file_manager/app_installer.cc
index 40c90cd..637bc2f 100644
--- a/chrome/browser/chromeos/file_manager/app_installer.cc
+++ b/chrome/browser/chromeos/file_manager/app_installer.cc
@@ -27,9 +27,8 @@ class AppInstaller::WebContentsObserver
protected:
// content::WebContentsObserver implementation.
- virtual void WebContentsDestroyed(
- content::WebContents* web_contents) OVERRIDE {
- parent_->OnWebContentsDestroyed(web_contents);
+ virtual void WebContentsDestroyed() OVERRIDE {
+ parent_->OnWebContentsDestroyed(web_contents());
}
private:
diff --git a/chrome/browser/download/download_request_limiter.cc b/chrome/browser/download/download_request_limiter.cc
index 9431b79..504af77 100644
--- a/chrome/browser/download/download_request_limiter.cc
+++ b/chrome/browser/download/download_request_limiter.cc
@@ -110,14 +110,12 @@ void DownloadRequestLimiter::TabDownloadState::DidGetUserGesture() {
}
}
-void DownloadRequestLimiter::TabDownloadState::WebContentsDestroyed(
- content::WebContents* web_contents) {
+void DownloadRequestLimiter::TabDownloadState::WebContentsDestroyed() {
// Tab closed, no need to handle closing the dialog as it's owned by the
// WebContents.
NotifyCallbacks(false);
- // Note that web_contents() is NULL at this point.
- host_->Remove(this, web_contents);
+ host_->Remove(this, web_contents());
// WARNING: We've been deleted.
}
diff --git a/chrome/browser/download/download_request_limiter.h b/chrome/browser/download/download_request_limiter.h
index 4ecf370..83552ed 100644
--- a/chrome/browser/download/download_request_limiter.h
+++ b/chrome/browser/download/download_request_limiter.h
@@ -112,8 +112,7 @@ class DownloadRequestLimiter
// Invoked when a user gesture occurs (mouse click, enter or space). This
// may result in invoking Remove on DownloadRequestLimiter.
virtual void DidGetUserGesture() OVERRIDE;
- virtual void WebContentsDestroyed(
- content::WebContents* web_contents) OVERRIDE;
+ virtual void WebContentsDestroyed() OVERRIDE;
// Asks the user if they really want to allow the download.
// See description above CanDownloadOnIOThread for details on lifetime of
diff --git a/chrome/browser/extensions/active_tab_permission_granter.cc b/chrome/browser/extensions/active_tab_permission_granter.cc
index ef87525..1a67167 100644
--- a/chrome/browser/extensions/active_tab_permission_granter.cc
+++ b/chrome/browser/extensions/active_tab_permission_granter.cc
@@ -83,8 +83,7 @@ void ActiveTabPermissionGranter::DidNavigateMainFrame(
ClearActiveExtensionsAndNotify();
}
-void ActiveTabPermissionGranter::WebContentsDestroyed(
- content::WebContents* web_contents) {
+void ActiveTabPermissionGranter::WebContentsDestroyed() {
ClearActiveExtensionsAndNotify();
}
diff --git a/chrome/browser/extensions/active_tab_permission_granter.h b/chrome/browser/extensions/active_tab_permission_granter.h
index bf51ed0..4945915 100644
--- a/chrome/browser/extensions/active_tab_permission_granter.h
+++ b/chrome/browser/extensions/active_tab_permission_granter.h
@@ -45,8 +45,7 @@ class ActiveTabPermissionGranter
virtual void DidNavigateMainFrame(
const content::LoadCommittedDetails& details,
const content::FrameNavigateParams& params) OVERRIDE;
- virtual void WebContentsDestroyed(content::WebContents* web_contents)
- OVERRIDE;
+ virtual void WebContentsDestroyed() OVERRIDE;
// extensions::ExtensionRegistryObserver implementation.
virtual void OnExtensionUnloaded(content::BrowserContext* browser_context,
diff --git a/chrome/browser/extensions/api/desktop_capture/desktop_capture_api.cc b/chrome/browser/extensions/api/desktop_capture/desktop_capture_api.cc
index 8398736..57d1133 100644
--- a/chrome/browser/extensions/api/desktop_capture/desktop_capture_api.cc
+++ b/chrome/browser/extensions/api/desktop_capture/desktop_capture_api.cc
@@ -215,8 +215,7 @@ bool DesktopCaptureChooseDesktopMediaFunction::RunAsync() {
return true;
}
-void DesktopCaptureChooseDesktopMediaFunction::WebContentsDestroyed(
- content::WebContents* web_contents) {
+void DesktopCaptureChooseDesktopMediaFunction::WebContentsDestroyed() {
Cancel();
}
diff --git a/chrome/browser/extensions/api/desktop_capture/desktop_capture_api.h b/chrome/browser/extensions/api/desktop_capture/desktop_capture_api.h
index 6a8d19b..7c3af4b 100644
--- a/chrome/browser/extensions/api/desktop_capture/desktop_capture_api.h
+++ b/chrome/browser/extensions/api/desktop_capture/desktop_capture_api.h
@@ -52,8 +52,7 @@ class DesktopCaptureChooseDesktopMediaFunction
virtual bool RunAsync() OVERRIDE;
// content::WebContentsObserver overrides.
- virtual void WebContentsDestroyed(
- content::WebContents* web_contents) OVERRIDE;
+ virtual void WebContentsDestroyed() OVERRIDE;
void OnPickerDialogResults(content::DesktopMediaID source);
diff --git a/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc b/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc
index 26e86ad..392d749 100644
--- a/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc
+++ b/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc
@@ -646,10 +646,10 @@ void WebNavigationTabObserver::FrameDetached(
navigation_state_.FrameDetached(frame_id);
}
-void WebNavigationTabObserver::WebContentsDestroyed(content::WebContents* tab) {
- g_tab_observer.Get().erase(tab);
+void WebNavigationTabObserver::WebContentsDestroyed() {
+ g_tab_observer.Get().erase(web_contents());
registrar_.RemoveAll();
- SendErrorEvents(tab, NULL, FrameNavigationState::FrameID());
+ SendErrorEvents(web_contents(), NULL, FrameNavigationState::FrameID());
}
void WebNavigationTabObserver::SendErrorEvents(
diff --git a/chrome/browser/extensions/api/web_navigation/web_navigation_api.h b/chrome/browser/extensions/api/web_navigation/web_navigation_api.h
index d3aaf76..f0e144d 100644
--- a/chrome/browser/extensions/api/web_navigation/web_navigation_api.h
+++ b/chrome/browser/extensions/api/web_navigation/web_navigation_api.h
@@ -105,7 +105,7 @@ class WebNavigationTabObserver
int64 source_frame_num) OVERRIDE;
virtual void FrameDetached(content::RenderViewHost* render_view_host,
int64 frame_num) OVERRIDE;
- virtual void WebContentsDestroyed(content::WebContents* tab) OVERRIDE;
+ virtual void WebContentsDestroyed() OVERRIDE;
private:
explicit WebNavigationTabObserver(content::WebContents* web_contents);
diff --git a/chrome/browser/extensions/extension_view_host.cc b/chrome/browser/extensions/extension_view_host.cc
index b5ace6b..12afacc 100644
--- a/chrome/browser/extensions/extension_view_host.cc
+++ b/chrome/browser/extensions/extension_view_host.cc
@@ -42,7 +42,7 @@ class ExtensionViewHost::AssociatedWebContentsObserver
virtual ~AssociatedWebContentsObserver() {}
// content::WebContentsObserver:
- virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE {
+ virtual void WebContentsDestroyed() OVERRIDE {
// Deleting |this| from here is safe.
host_->SetAssociatedWebContents(NULL);
}
diff --git a/chrome/browser/extensions/script_executor.cc b/chrome/browser/extensions/script_executor.cc
index 45f6fc5..6ff22d8 100644
--- a/chrome/browser/extensions/script_executor.cc
+++ b/chrome/browser/extensions/script_executor.cc
@@ -64,7 +64,7 @@ class Handler : public content::WebContentsObserver {
return true;
}
- virtual void WebContentsDestroyed(content::WebContents* tab) OVERRIDE {
+ virtual void WebContentsDestroyed() OVERRIDE {
base::ListValue val;
callback_.Run(kRendererDestroyed, -1, GURL(std::string()), val);
delete this;
diff --git a/chrome/browser/extensions/webstore_inline_installer.cc b/chrome/browser/extensions/webstore_inline_installer.cc
index 0d0b897..f857f94 100644
--- a/chrome/browser/extensions/webstore_inline_installer.cc
+++ b/chrome/browser/extensions/webstore_inline_installer.cc
@@ -158,8 +158,7 @@ bool WebstoreInlineInstaller::CheckRequestorPermitted(
// Private implementation.
//
-void WebstoreInlineInstaller::WebContentsDestroyed(
- content::WebContents* web_contents) {
+void WebstoreInlineInstaller::WebContentsDestroyed() {
AbortInstall();
}
diff --git a/chrome/browser/extensions/webstore_inline_installer.h b/chrome/browser/extensions/webstore_inline_installer.h
index 59fcb40a..33b278d 100644
--- a/chrome/browser/extensions/webstore_inline_installer.h
+++ b/chrome/browser/extensions/webstore_inline_installer.h
@@ -58,8 +58,7 @@ class WebstoreInlineInstaller
private:
// content::WebContentsObserver interface implementation.
- virtual void WebContentsDestroyed(
- content::WebContents* web_contents) OVERRIDE;
+ virtual void WebContentsDestroyed() OVERRIDE;
// Checks whether the install is initiated by a page in a verified site
// (which is at least a domain, but can also have a port or a path).
diff --git a/chrome/browser/guest_view/guest_view_manager.cc b/chrome/browser/guest_view/guest_view_manager.cc
index a1aaf5f..2db79a2 100644
--- a/chrome/browser/guest_view/guest_view_manager.cc
+++ b/chrome/browser/guest_view/guest_view_manager.cc
@@ -48,7 +48,7 @@ class GuestWebContentsObserver
delete this;
}
- virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE {
+ virtual void WebContentsDestroyed() OVERRIDE {
delete this;
}
diff --git a/chrome/browser/guest_view/web_view/web_view_guest.cc b/chrome/browser/guest_view/web_view/web_view_guest.cc
index d18130f..b29d103 100644
--- a/chrome/browser/guest_view/web_view/web_view_guest.cc
+++ b/chrome/browser/guest_view/web_view/web_view_guest.cc
@@ -791,14 +791,14 @@ void WebViewGuest::DidStopLoading(content::RenderViewHost* render_view_host) {
DispatchEvent(new GuestViewBase::Event(webview::kEventLoadStop, args.Pass()));
}
-void WebViewGuest::WebContentsDestroyed(WebContents* web_contents) {
+void WebViewGuest::WebContentsDestroyed() {
// Clean up custom context menu items for this guest.
extensions::MenuManager* menu_manager = extensions::MenuManager::Get(
Profile::FromBrowserContext(browser_context()));
menu_manager->RemoveAllContextItems(extensions::MenuItem::ExtensionKey(
embedder_extension_id(), view_instance_id()));
- RemoveWebViewFromExtensionRendererState(web_contents);
+ RemoveWebViewFromExtensionRendererState(web_contents());
}
void WebViewGuest::UserAgentOverrideSet(const std::string& user_agent) {
diff --git a/chrome/browser/guest_view/web_view/web_view_guest.h b/chrome/browser/guest_view/web_view/web_view_guest.h
index 8898aa3..37557bf 100644
--- a/chrome/browser/guest_view/web_view/web_view_guest.h
+++ b/chrome/browser/guest_view/web_view/web_view_guest.h
@@ -264,8 +264,7 @@ class WebViewGuest : public GuestView<WebViewGuest>,
content::RenderViewHost* render_view_host) OVERRIDE;
virtual void DidStopLoading(
content::RenderViewHost* render_view_host) OVERRIDE;
- virtual void WebContentsDestroyed(
- content::WebContents* web_contents) OVERRIDE;
+ virtual void WebContentsDestroyed() OVERRIDE;
virtual void UserAgentOverrideSet(const std::string& user_agent) OVERRIDE;
// Called after the load handler is called in the guest's main frame.
diff --git a/chrome/browser/history/history_tab_helper.cc b/chrome/browser/history/history_tab_helper.cc
index 03ccc81..948811b 100644
--- a/chrome/browser/history/history_tab_helper.cc
+++ b/chrome/browser/history/history_tab_helper.cc
@@ -153,10 +153,9 @@ HistoryService* HistoryTabHelper::GetHistoryService() {
Profile::IMPLICIT_ACCESS);
}
-void HistoryTabHelper::WebContentsDestroyed(WebContents* tab) {
+void HistoryTabHelper::WebContentsDestroyed() {
// We update the history for this URL.
- // The content returned from web_contents() has been destroyed by now.
- // We need to use tab value directly.
+ WebContents* tab = web_contents();
Profile* profile = Profile::FromBrowserContext(tab->GetBrowserContext());
if (profile->IsOffTheRecord())
return;
diff --git a/chrome/browser/history/history_tab_helper.h b/chrome/browser/history/history_tab_helper.h
index 65c21ad..c6372b4 100644
--- a/chrome/browser/history/history_tab_helper.h
+++ b/chrome/browser/history/history_tab_helper.h
@@ -51,7 +51,7 @@ class HistoryTabHelper : public content::WebContentsObserver,
const content::FrameNavigateParams& params) OVERRIDE;
virtual void TitleWasSet(content::NavigationEntry* entry,
bool explicit_set) OVERRIDE;
- virtual void WebContentsDestroyed(content::WebContents* tab) OVERRIDE;
+ virtual void WebContentsDestroyed() OVERRIDE;
// Helper function to return the history service. May return NULL.
HistoryService* GetHistoryService();
diff --git a/chrome/browser/infobars/infobar_service.cc b/chrome/browser/infobars/infobar_service.cc
index 3d03544..030035b 100644
--- a/chrome/browser/infobars/infobar_service.cc
+++ b/chrome/browser/infobars/infobar_service.cc
@@ -107,11 +107,11 @@ void InfoBarService::NavigationEntryCommitted(
OnNavigation(NavigationDetailsFromLoadCommittedDetails(load_details));
}
-void InfoBarService::WebContentsDestroyed(content::WebContents* web_contents) {
+void InfoBarService::WebContentsDestroyed() {
// The WebContents is going away; be aggressively paranoid and delete
// ourselves lest other parts of the system attempt to add infobars or use
// us otherwise during the destruction.
- web_contents->RemoveUserData(UserDataKey());
+ web_contents()->RemoveUserData(UserDataKey());
// That was the equivalent of "delete this". This object is now destroyed;
// returning from this function is the only safe thing to do.
}
diff --git a/chrome/browser/infobars/infobar_service.h b/chrome/browser/infobars/infobar_service.h
index 39cca9a..a90305b 100644
--- a/chrome/browser/infobars/infobar_service.h
+++ b/chrome/browser/infobars/infobar_service.h
@@ -62,8 +62,7 @@ class InfoBarService : public infobars::InfoBarManager,
virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE;
virtual void NavigationEntryCommitted(
const content::LoadCommittedDetails& load_details) OVERRIDE;
- virtual void WebContentsDestroyed(
- content::WebContents* web_contents) OVERRIDE;
+ virtual void WebContentsDestroyed() OVERRIDE;
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
// Message handlers.
diff --git a/chrome/browser/media/media_stream_capture_indicator.cc b/chrome/browser/media/media_stream_capture_indicator.cc
index 24d9292..244a645 100644
--- a/chrome/browser/media/media_stream_capture_indicator.cc
+++ b/chrome/browser/media/media_stream_capture_indicator.cc
@@ -161,8 +161,8 @@ class MediaStreamCaptureIndicator::WebContentsDeviceUsage
private:
// content::WebContentsObserver overrides.
- virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE {
- indicator_->UnregisterWebContents(web_contents);
+ virtual void WebContentsDestroyed() OVERRIDE {
+ indicator_->UnregisterWebContents(web_contents());
delete this;
}
diff --git a/chrome/browser/media_galleries/media_file_system_registry.cc b/chrome/browser/media_galleries/media_file_system_registry.cc
index 08cecd1..a53ed2b 100644
--- a/chrome/browser/media_galleries/media_file_system_registry.cc
+++ b/chrome/browser/media_galleries/media_file_system_registry.cc
@@ -85,7 +85,7 @@ class RPHReferenceManager {
private:
// content::WebContentsObserver
- virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE;
+ virtual void WebContentsDestroyed() OVERRIDE;
virtual void NavigationEntryCommitted(
const content::LoadCommittedDetails& load_details) OVERRIDE;
@@ -155,9 +155,8 @@ RPHReferenceManager::RPHWebContentsObserver::RPHWebContentsObserver(
manager_(manager) {
}
-void RPHReferenceManager::RPHWebContentsObserver::WebContentsDestroyed(
- WebContents* web_contents) {
- manager_->OnWebContentsDestroyedOrNavigated(web_contents);
+void RPHReferenceManager::RPHWebContentsObserver::WebContentsDestroyed() {
+ manager_->OnWebContentsDestroyedOrNavigated(web_contents());
}
void RPHReferenceManager::RPHWebContentsObserver::NavigationEntryCommitted(
diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc
index 08e397f..fca167e 100644
--- a/chrome/browser/policy/policy_browsertest.cc
+++ b/chrome/browser/policy/policy_browsertest.cc
@@ -497,8 +497,7 @@ class WebContentsLoadedOrDestroyedWatcher
void Wait();
// Overridden WebContentsObserver methods.
- virtual void WebContentsDestroyed(
- content::WebContents* web_contents) OVERRIDE;
+ virtual void WebContentsDestroyed() OVERRIDE;
virtual void DidStopLoading(
content::RenderViewHost* render_view_host) OVERRIDE;
@@ -520,8 +519,7 @@ void WebContentsLoadedOrDestroyedWatcher::Wait() {
message_loop_runner_->Run();
}
-void WebContentsLoadedOrDestroyedWatcher::WebContentsDestroyed(
- content::WebContents* web_contents) {
+void WebContentsLoadedOrDestroyedWatcher::WebContentsDestroyed() {
message_loop_runner_->Quit();
}
diff --git a/chrome/browser/prerender/prerender_manager.cc b/chrome/browser/prerender/prerender_manager.cc
index aa615b1..d36a502 100644
--- a/chrome/browser/prerender/prerender_manager.cc
+++ b/chrome/browser/prerender/prerender_manager.cc
@@ -1118,8 +1118,7 @@ void PrerenderManager::PendingSwap::DidFailProvisionalLoad(
prerender_data_->ClearPendingSwap();
}
-void PrerenderManager::PendingSwap::WebContentsDestroyed(
- content::WebContents* web_contents) {
+void PrerenderManager::PendingSwap::WebContentsDestroyed() {
prerender_data_->ClearPendingSwap();
}
diff --git a/chrome/browser/prerender/prerender_manager.h b/chrome/browser/prerender/prerender_manager.h
index 87d8b11..6861b7b 100644
--- a/chrome/browser/prerender/prerender_manager.h
+++ b/chrome/browser/prerender/prerender_manager.h
@@ -477,8 +477,7 @@ class PrerenderManager : public base::SupportsWeakPtr<PrerenderManager>,
int error_code,
const base::string16& error_description,
content::RenderViewHost* render_view_host) OVERRIDE;
- virtual void WebContentsDestroyed(content::WebContents* web_contents)
- OVERRIDE;
+ virtual void WebContentsDestroyed() OVERRIDE;
private:
void RecordEvent(PrerenderEvent event) const;
diff --git a/chrome/browser/printing/background_printing_manager.cc b/chrome/browser/printing/background_printing_manager.cc
index 4a29c65..1e5c58d 100644
--- a/chrome/browser/printing/background_printing_manager.cc
+++ b/chrome/browser/printing/background_printing_manager.cc
@@ -28,7 +28,7 @@ class BackgroundPrintingManager::Observer
private:
virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE;
- virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE;
+ virtual void WebContentsDestroyed() OVERRIDE;
BackgroundPrintingManager* manager_;
};
@@ -43,9 +43,8 @@ void BackgroundPrintingManager::Observer::RenderProcessGone(
base::TerminationStatus status) {
manager_->DeletePreviewContents(web_contents());
}
-void BackgroundPrintingManager::Observer::WebContentsDestroyed(
- WebContents* web_contents) {
- manager_->DeletePreviewContents(web_contents);
+void BackgroundPrintingManager::Observer::WebContentsDestroyed() {
+ manager_->DeletePreviewContents(web_contents());
}
BackgroundPrintingManager::BackgroundPrintingManager() {
diff --git a/chrome/browser/printing/print_dialog_cloud.cc b/chrome/browser/printing/print_dialog_cloud.cc
index 2a44102..5dbc2b55 100644
--- a/chrome/browser/printing/print_dialog_cloud.cc
+++ b/chrome/browser/printing/print_dialog_cloud.cc
@@ -150,7 +150,7 @@ class SignInObserver : public content::WebContentsObserver {
}
}
- virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE {
+ virtual void WebContentsDestroyed() OVERRIDE {
delete this;
}
diff --git a/chrome/browser/printing/print_preview_dialog_controller_browsertest.cc b/chrome/browser/printing/print_preview_dialog_controller_browsertest.cc
index 1c769f4..c18b999 100644
--- a/chrome/browser/printing/print_preview_dialog_controller_browsertest.cc
+++ b/chrome/browser/printing/print_preview_dialog_controller_browsertest.cc
@@ -91,7 +91,7 @@ class PrintPreviewDialogDestroyedObserver : public WebContentsObserver {
private:
// content::WebContentsObserver implementation.
- virtual void WebContentsDestroyed(WebContents* contents) OVERRIDE {
+ virtual void WebContentsDestroyed() OVERRIDE {
dialog_destroyed_ = true;
}
diff --git a/chrome/browser/safe_browsing/client_side_detection_host.cc b/chrome/browser/safe_browsing/client_side_detection_host.cc
index c07a773..ad77670 100644
--- a/chrome/browser/safe_browsing/client_side_detection_host.cc
+++ b/chrome/browser/safe_browsing/client_side_detection_host.cc
@@ -479,8 +479,7 @@ bool ClientSideDetectionHost::DidPageReceiveSafeBrowsingMatch() const {
return entry->GetExtraData(kSafeBrowsingMatchKey, &value);
}
-void ClientSideDetectionHost::WebContentsDestroyed(WebContents* tab) {
- DCHECK(tab);
+void ClientSideDetectionHost::WebContentsDestroyed() {
// Tell any pending classification request that it is being canceled.
if (classification_request_.get()) {
classification_request_->Cancel();
diff --git a/chrome/browser/safe_browsing/client_side_detection_host.h b/chrome/browser/safe_browsing/client_side_detection_host.h
index 1db9f29..24ca81c 100644
--- a/chrome/browser/safe_browsing/client_side_detection_host.h
+++ b/chrome/browser/safe_browsing/client_side_detection_host.h
@@ -67,7 +67,7 @@ class ClientSideDetectionHost : public content::WebContentsObserver,
explicit ClientSideDetectionHost(content::WebContents* tab);
// From content::WebContentsObserver.
- virtual void WebContentsDestroyed(content::WebContents* tab) OVERRIDE;
+ virtual void WebContentsDestroyed() OVERRIDE;
// Used for testing.
void set_safe_browsing_managers(
diff --git a/chrome/browser/task_manager/web_contents_resource_provider.cc b/chrome/browser/task_manager/web_contents_resource_provider.cc
index b29dd88..2fb79f1 100644
--- a/chrome/browser/task_manager/web_contents_resource_provider.cc
+++ b/chrome/browser/task_manager/web_contents_resource_provider.cc
@@ -51,8 +51,8 @@ class TaskManagerWebContentsObserver : public content::WebContentsObserver {
provider_->RemoveFromTaskManager(web_contents());
}
- virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE {
- provider_->RemoveFromTaskManager(web_contents);
+ virtual void WebContentsDestroyed() OVERRIDE {
+ provider_->RemoveFromTaskManager(web_contents());
provider_->DeleteObserver(this); // Deletes |this|.
}
diff --git a/chrome/browser/translate/translate_tab_helper.cc b/chrome/browser/translate/translate_tab_helper.cc
index 9af958f7..5ecd089f 100644
--- a/chrome/browser/translate/translate_tab_helper.cc
+++ b/chrome/browser/translate/translate_tab_helper.cc
@@ -301,8 +301,7 @@ void TranslateTabHelper::DidNavigateAnyFrame(
translate_driver_.DidNavigate(details);
}
-void TranslateTabHelper::WebContentsDestroyed(
- content::WebContents* web_contents) {
+void TranslateTabHelper::WebContentsDestroyed() {
// Translation process can be interrupted.
// Destroying the TranslateManager now guarantees that it never has to deal
// with NULL WebContents.
diff --git a/chrome/browser/translate/translate_tab_helper.h b/chrome/browser/translate/translate_tab_helper.h
index d4195f4..10fb138 100644
--- a/chrome/browser/translate/translate_tab_helper.h
+++ b/chrome/browser/translate/translate_tab_helper.h
@@ -108,8 +108,7 @@ class TranslateTabHelper
virtual void DidNavigateAnyFrame(
const content::LoadCommittedDetails& details,
const content::FrameNavigateParams& params) OVERRIDE;
- virtual void WebContentsDestroyed(
- content::WebContents* web_contents) OVERRIDE;
+ virtual void WebContentsDestroyed() OVERRIDE;
// Initiates translation once the page is finished loading.
void InitiateTranslation(const std::string& page_lang, int attempt);
diff --git a/chrome/browser/ui/android/infobars/auto_login_prompter.cc b/chrome/browser/ui/android/infobars/auto_login_prompter.cc
index 2cc1f24..7d50998 100644
--- a/chrome/browser/ui/android/infobars/auto_login_prompter.cc
+++ b/chrome/browser/ui/android/infobars/auto_login_prompter.cc
@@ -97,7 +97,7 @@ void AutoLoginPrompter::DidStopLoading(
delete this;
}
-void AutoLoginPrompter::WebContentsDestroyed(WebContents* web_contents) {
+void AutoLoginPrompter::WebContentsDestroyed() {
// The WebContents was destroyed before the navigation completed.
delete this;
}
diff --git a/chrome/browser/ui/android/infobars/auto_login_prompter.h b/chrome/browser/ui/android/infobars/auto_login_prompter.h
index d55eb67..bfeb290 100644
--- a/chrome/browser/ui/android/infobars/auto_login_prompter.h
+++ b/chrome/browser/ui/android/infobars/auto_login_prompter.h
@@ -53,8 +53,7 @@ class AutoLoginPrompter : public content::WebContentsObserver {
virtual void DidStopLoading(
content::RenderViewHost* render_view_host) OVERRIDE;
- virtual void WebContentsDestroyed(
- content::WebContents* web_contents) OVERRIDE;
+ virtual void WebContentsDestroyed() OVERRIDE;
// Add the infobar to the WebContents, if it's still needed.
void AddInfoBarToWebContents();
diff --git a/chrome/browser/ui/ash/launcher/browser_status_monitor.cc b/chrome/browser/ui/ash/launcher/browser_status_monitor.cc
index f10792c..36b1935 100644
--- a/chrome/browser/ui/ash/launcher/browser_status_monitor.cc
+++ b/chrome/browser/ui/ash/launcher/browser_status_monitor.cc
@@ -60,14 +60,11 @@ class BrowserStatusMonitor::LocalWebContentsObserver
monitor_->SetShelfIDForBrowserWindowContents(browser, web_contents());
}
- virtual void WebContentsDestroyed(
- content::WebContents* web_content) OVERRIDE {
- if (web_content == web_contents()) {
- // We can only come here when there was a non standard termination like
- // an app got un-installed while running, etc.
- monitor_->WebContentsDestroyed(web_content);
- // |this| is gone now.
- }
+ virtual void WebContentsDestroyed() OVERRIDE {
+ // We can only come here when there was a non standard termination like
+ // an app got un-installed while running, etc.
+ monitor_->WebContentsDestroyed(web_contents());
+ // |this| is gone now.
}
private:
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc
index b0b4a01..887cf81 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc
@@ -683,8 +683,7 @@ class WebContentsDestroyedWatcher : public content::WebContentsObserver {
private:
// Overridden WebContentsObserver methods.
- virtual void WebContentsDestroyed(
- content::WebContents* web_contents) OVERRIDE {
+ virtual void WebContentsDestroyed() OVERRIDE {
message_loop_runner_->Quit();
}
diff --git a/chrome/browser/ui/auto_login_infobar_delegate.cc b/chrome/browser/ui/auto_login_infobar_delegate.cc
index 1149029..62dffb6 100644
--- a/chrome/browser/ui/auto_login_infobar_delegate.cc
+++ b/chrome/browser/ui/auto_login_infobar_delegate.cc
@@ -63,8 +63,7 @@ class AutoLoginRedirector : public UbertokenConsumer,
virtual void OnUbertokenFailure(const GoogleServiceAuthError& error) OVERRIDE;
// Implementation of content::WebContentsObserver
- virtual void WebContentsDestroyed(
- content::WebContents* web_contents) OVERRIDE;
+ virtual void WebContentsDestroyed() OVERRIDE;
// Redirect tab to MergeSession URL, logging the user in and navigating
// to the desired page.
@@ -97,8 +96,7 @@ AutoLoginRedirector::AutoLoginRedirector(
AutoLoginRedirector::~AutoLoginRedirector() {
}
-void AutoLoginRedirector::WebContentsDestroyed(
- content::WebContents* web_contents) {
+void AutoLoginRedirector::WebContentsDestroyed() {
// The WebContents that started this has been destroyed. The request must be
// cancelled and this object must be deleted.
ubertoken_fetcher_.reset();
diff --git a/chrome/browser/ui/autofill/autofill_popup_controller_interactive_uitest.cc b/chrome/browser/ui/autofill/autofill_popup_controller_interactive_uitest.cc
index fd4573f..9b8f81b 100644
--- a/chrome/browser/ui/autofill/autofill_popup_controller_interactive_uitest.cc
+++ b/chrome/browser/ui/autofill/autofill_popup_controller_interactive_uitest.cc
@@ -72,31 +72,27 @@ class AutofillPopupControllerBrowserTest
virtual ~AutofillPopupControllerBrowserTest() {}
virtual void SetUpOnMainThread() OVERRIDE {
- web_contents_ = browser()->tab_strip_model()->GetActiveWebContents();
- ASSERT_TRUE(web_contents_ != NULL);
- Observe(web_contents_);
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
+ ASSERT_TRUE(web_contents != NULL);
+ Observe(web_contents);
ContentAutofillDriver* driver =
- ContentAutofillDriver::FromWebContents(web_contents_);
+ ContentAutofillDriver::FromWebContents(web_contents);
autofill_external_delegate_.reset(
new TestAutofillExternalDelegate(
- web_contents_,
+ web_contents,
driver->autofill_manager(),
driver));
}
// Normally the WebContents will automatically delete the delegate, but here
// the delegate is owned by this test, so we have to manually destroy.
- virtual void WebContentsDestroyed(content::WebContents* web_contents)
- OVERRIDE {
- DCHECK_EQ(web_contents_, web_contents);
-
+ virtual void WebContentsDestroyed() OVERRIDE {
autofill_external_delegate_.reset();
}
protected:
- content::WebContents* web_contents_;
-
scoped_ptr<TestAutofillExternalDelegate> autofill_external_delegate_;
};
diff --git a/chrome/browser/ui/autofill/tab_autofill_manager_delegate.cc b/chrome/browser/ui/autofill/tab_autofill_manager_delegate.cc
index 2b9fccc..0e1c45d 100644
--- a/chrome/browser/ui/autofill/tab_autofill_manager_delegate.cc
+++ b/chrome/browser/ui/autofill/tab_autofill_manager_delegate.cc
@@ -167,8 +167,7 @@ void TabAutofillManagerDelegate::HideRequestAutocompleteDialog() {
dialog_controller_->Hide();
}
-void TabAutofillManagerDelegate::WebContentsDestroyed(
- content::WebContents* web_contents) {
+void TabAutofillManagerDelegate::WebContentsDestroyed() {
HideAutofillPopup();
}
diff --git a/chrome/browser/ui/autofill/tab_autofill_manager_delegate.h b/chrome/browser/ui/autofill/tab_autofill_manager_delegate.h
index 3b3a3f0..6c48706 100644
--- a/chrome/browser/ui/autofill/tab_autofill_manager_delegate.h
+++ b/chrome/browser/ui/autofill/tab_autofill_manager_delegate.h
@@ -70,8 +70,7 @@ class TabAutofillManagerDelegate
const base::string16& profile_full_name) OVERRIDE;
// content::WebContentsObserver implementation.
- virtual void WebContentsDestroyed(
- content::WebContents* web_contents) OVERRIDE;
+ virtual void WebContentsDestroyed() OVERRIDE;
// Exposed for testing.
AutofillDialogController* GetDialogControllerForTesting() {
diff --git a/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc b/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc
index 5b275b1..bc21ac4 100644
--- a/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc
+++ b/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc
@@ -81,7 +81,7 @@ class CloseObserver : public content::WebContentsObserver {
close_loop_.Run();
}
- virtual void WebContentsDestroyed(WebContents* contents) OVERRIDE {
+ virtual void WebContentsDestroyed() OVERRIDE {
close_loop_.Quit();
}
diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc
index 89015cb..96cf626 100644
--- a/chrome/browser/ui/browser_browsertest.cc
+++ b/chrome/browser/ui/browser_browsertest.cc
@@ -631,7 +631,7 @@ class RedirectObserver : public content::WebContentsObserver {
params_ = params;
}
- virtual void WebContentsDestroyed(WebContents* contents) OVERRIDE {
+ virtual void WebContentsDestroyed() OVERRIDE {
// Make sure we don't close the tab while the observer is in scope.
// See http://crbug.com/314036.
FAIL() << "WebContents closed during navigation (http://crbug.com/314036).";
diff --git a/chrome/browser/ui/cocoa/hung_renderer_controller.mm b/chrome/browser/ui/cocoa/hung_renderer_controller.mm
index 524e5b4..5035873 100644
--- a/chrome/browser/ui/cocoa/hung_renderer_controller.mm
+++ b/chrome/browser/ui/cocoa/hung_renderer_controller.mm
@@ -51,7 +51,7 @@ class WebContentsObserverBridge : public content::WebContentsObserver {
virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE {
[controller_ renderProcessGone];
}
- virtual void WebContentsDestroyed(WebContents* tab) OVERRIDE {
+ virtual void WebContentsDestroyed() OVERRIDE {
[controller_ renderProcessGone];
}
diff --git a/chrome/browser/ui/omnibox/omnibox_navigation_observer.cc b/chrome/browser/ui/omnibox/omnibox_navigation_observer.cc
index 9e5a44a..51a19b7 100644
--- a/chrome/browser/ui/omnibox/omnibox_navigation_observer.cc
+++ b/chrome/browser/ui/omnibox/omnibox_navigation_observer.cc
@@ -108,8 +108,7 @@ void OmniboxNavigationObserver::NavigationEntryCommitted(
OnAllLoadingFinished(); // deletes |this|!
}
-void OmniboxNavigationObserver::WebContentsDestroyed(
- content::WebContents* web_contents) {
+void OmniboxNavigationObserver::WebContentsDestroyed() {
delete this;
}
diff --git a/chrome/browser/ui/omnibox/omnibox_navigation_observer.h b/chrome/browser/ui/omnibox/omnibox_navigation_observer.h
index 8253173..0b80411 100644
--- a/chrome/browser/ui/omnibox/omnibox_navigation_observer.h
+++ b/chrome/browser/ui/omnibox/omnibox_navigation_observer.h
@@ -82,8 +82,7 @@ class OmniboxNavigationObserver : public content::NotificationObserver,
content::NavigationController::ReloadType reload_type) OVERRIDE;
virtual void NavigationEntryCommitted(
const content::LoadCommittedDetails& load_details) OVERRIDE;
- virtual void WebContentsDestroyed(
- content::WebContents* web_contents) OVERRIDE;
+ virtual void WebContentsDestroyed() OVERRIDE;
// net::URLFetcherDelegate:
virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE;
diff --git a/chrome/browser/ui/panels/panel_host.cc b/chrome/browser/ui/panels/panel_host.cc
index 9d8bbd3..670ae73 100644
--- a/chrome/browser/ui/panels/panel_host.cc
+++ b/chrome/browser/ui/panels/panel_host.cc
@@ -208,7 +208,7 @@ void PanelHost::RenderProcessGone(base::TerminationStatus status) {
CloseContents(web_contents_.get());
}
-void PanelHost::WebContentsDestroyed(content::WebContents* web_contents) {
+void PanelHost::WebContentsDestroyed() {
// Web contents should only be destroyed by us.
CHECK(!web_contents_.get());
diff --git a/chrome/browser/ui/panels/panel_host.h b/chrome/browser/ui/panels/panel_host.h
index 217d228..3277c3b 100644
--- a/chrome/browser/ui/panels/panel_host.h
+++ b/chrome/browser/ui/panels/panel_host.h
@@ -80,8 +80,7 @@ class PanelHost : public content::WebContentsDelegate,
virtual void RenderViewCreated(
content::RenderViewHost* render_view_host) OVERRIDE;
virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE;
- virtual void WebContentsDestroyed(
- content::WebContents* web_contents) OVERRIDE;
+ virtual void WebContentsDestroyed() OVERRIDE;
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
// extensions::ExtensionFunctionDispatcher::Delegate overrides.
diff --git a/chrome/browser/ui/passwords/manage_passwords_bubble_model.cc b/chrome/browser/ui/passwords/manage_passwords_bubble_model.cc
index 96e9e62..6eca416 100644
--- a/chrome/browser/ui/passwords/manage_passwords_bubble_model.cc
+++ b/chrome/browser/ui/passwords/manage_passwords_bubble_model.cc
@@ -19,12 +19,11 @@ using content::WebContents;
ManagePasswordsBubbleModel::ManagePasswordsBubbleModel(
content::WebContents* web_contents)
: content::WebContentsObserver(web_contents),
- web_contents_(web_contents),
display_disposition_(
password_manager::metrics_util::AUTOMATIC_WITH_PASSWORD_PENDING),
dismissal_reason_(password_manager::metrics_util::NOT_DISPLAYED) {
ManagePasswordsUIController* controller =
- ManagePasswordsUIController::FromWebContents(web_contents_);
+ ManagePasswordsUIController::FromWebContents(web_contents);
// TODO(mkwst): Reverse this logic. The controller should populate the model
// directly rather than the model pulling from the controller. Perhaps like
@@ -83,7 +82,7 @@ void ManagePasswordsBubbleModel::OnNopeClicked() {
void ManagePasswordsBubbleModel::OnNeverForThisSiteClicked() {
dismissal_reason_ = password_manager::metrics_util::CLICKED_NEVER;
ManagePasswordsUIController* manage_passwords_ui_controller =
- ManagePasswordsUIController::FromWebContents(web_contents_);
+ ManagePasswordsUIController::FromWebContents(web_contents());
manage_passwords_ui_controller->NeverSavePassword();
state_ = password_manager::ui::BLACKLIST_STATE;
}
@@ -91,7 +90,7 @@ void ManagePasswordsBubbleModel::OnNeverForThisSiteClicked() {
void ManagePasswordsBubbleModel::OnUnblacklistClicked() {
dismissal_reason_ = password_manager::metrics_util::CLICKED_UNBLACKLIST;
ManagePasswordsUIController* manage_passwords_ui_controller =
- ManagePasswordsUIController::FromWebContents(web_contents_);
+ ManagePasswordsUIController::FromWebContents(web_contents());
manage_passwords_ui_controller->UnblacklistSite();
state_ = password_manager::ui::MANAGE_STATE;
}
@@ -99,7 +98,7 @@ void ManagePasswordsBubbleModel::OnUnblacklistClicked() {
void ManagePasswordsBubbleModel::OnSaveClicked() {
dismissal_reason_ = password_manager::metrics_util::CLICKED_SAVE;
ManagePasswordsUIController* manage_passwords_ui_controller =
- ManagePasswordsUIController::FromWebContents(web_contents_);
+ ManagePasswordsUIController::FromWebContents(web_contents());
manage_passwords_ui_controller->SavePassword();
state_ = password_manager::ui::MANAGE_STATE;
}
@@ -110,17 +109,17 @@ void ManagePasswordsBubbleModel::OnDoneClicked() {
void ManagePasswordsBubbleModel::OnManageLinkClicked() {
dismissal_reason_ = password_manager::metrics_util::CLICKED_MANAGE;
- ManagePasswordsUIController::FromWebContents(web_contents_)
+ ManagePasswordsUIController::FromWebContents(web_contents())
->NavigateToPasswordManagerSettingsPage();
}
void ManagePasswordsBubbleModel::OnPasswordAction(
const autofill::PasswordForm& password_form,
PasswordAction action) {
- if (!web_contents_)
+ if (!web_contents())
return;
Profile* profile =
- Profile::FromBrowserContext(web_contents_->GetBrowserContext());
+ Profile::FromBrowserContext(web_contents()->GetBrowserContext());
password_manager::PasswordStore* password_store =
PasswordStoreFactory::GetForProfile(profile, Profile::EXPLICIT_ACCESS)
.get();
@@ -130,9 +129,3 @@ void ManagePasswordsBubbleModel::OnPasswordAction(
else
password_store->AddLogin(password_form);
}
-
-void ManagePasswordsBubbleModel::WebContentsDestroyed(
- content::WebContents* web_contents) {
- // The WebContents have been destroyed.
- web_contents_ = NULL;
-}
diff --git a/chrome/browser/ui/passwords/manage_passwords_bubble_model.h b/chrome/browser/ui/passwords/manage_passwords_bubble_model.h
index 1fc6c68..e6ae6aa 100644
--- a/chrome/browser/ui/passwords/manage_passwords_bubble_model.h
+++ b/chrome/browser/ui/passwords/manage_passwords_bubble_model.h
@@ -89,11 +89,6 @@ class ManagePasswordsBubbleModel : public content::WebContentsObserver {
#endif
private:
- // content::WebContentsObserver
- virtual void WebContentsDestroyed(
- content::WebContents* web_contents) OVERRIDE;
-
- content::WebContents* web_contents_;
password_manager::ui::State state_;
base::string16 title_;
autofill::PasswordForm pending_credentials_;
diff --git a/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc b/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
index 3b192d9..00378fa 100644
--- a/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
+++ b/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
@@ -81,10 +81,9 @@ void ManagePasswordsUIController::OnBlacklistBlockedAutofill(
UpdateBubbleAndIconVisibility();
}
-void ManagePasswordsUIController::WebContentsDestroyed(
- content::WebContents* web_contents) {
+void ManagePasswordsUIController::WebContentsDestroyed() {
password_manager::PasswordStore* password_store =
- GetPasswordStore(web_contents);
+ GetPasswordStore(web_contents());
if (password_store)
password_store->RemoveObserver(this);
}
diff --git a/chrome/browser/ui/passwords/manage_passwords_ui_controller.h b/chrome/browser/ui/passwords/manage_passwords_ui_controller.h
index 35977d4..eed1a64 100644
--- a/chrome/browser/ui/passwords/manage_passwords_ui_controller.h
+++ b/chrome/browser/ui/passwords/manage_passwords_ui_controller.h
@@ -115,8 +115,7 @@ class ManagePasswordsUIController
virtual void DidNavigateMainFrame(
const content::LoadCommittedDetails& details,
const content::FrameNavigateParams& params) OVERRIDE;
- virtual void WebContentsDestroyed(
- content::WebContents* web_contents) OVERRIDE;
+ virtual void WebContentsDestroyed() OVERRIDE;
// Set by OnPasswordSubmitted() when the user submits a form containing login
// information. If the user responds to a subsequent "Do you want to save
diff --git a/chrome/browser/ui/sync/one_click_signin_helper.cc b/chrome/browser/ui/sync/one_click_signin_helper.cc
index fceb3e6..7e4fdfe 100644
--- a/chrome/browser/ui/sync/one_click_signin_helper.cc
+++ b/chrome/browser/ui/sync/one_click_signin_helper.cc
@@ -426,7 +426,7 @@ class CurrentHistoryCleaner : public content::WebContentsObserver {
virtual ~CurrentHistoryCleaner();
// content::WebContentsObserver:
- virtual void WebContentsDestroyed(content::WebContents* contents) OVERRIDE;
+ virtual void WebContentsDestroyed() OVERRIDE;
virtual void DidCommitProvisionalLoadForFrame(
int64 frame_id,
const base::string16& frame_unique_name,
@@ -479,8 +479,7 @@ void CurrentHistoryCleaner::DidCommitProvisionalLoadForFrame(
}
}
-void CurrentHistoryCleaner::WebContentsDestroyed(
- content::WebContents* contents) {
+void CurrentHistoryCleaner::WebContentsDestroyed() {
delete this; // Failure.
}
diff --git a/chrome/browser/ui/sync/one_click_signin_sync_observer.cc b/chrome/browser/ui/sync/one_click_signin_sync_observer.cc
index 376baeb..96c45c5 100644
--- a/chrome/browser/ui/sync/one_click_signin_sync_observer.cc
+++ b/chrome/browser/ui/sync/one_click_signin_sync_observer.cc
@@ -51,9 +51,8 @@ OneClickSigninSyncObserver::OneClickSigninSyncObserver(
OneClickSigninSyncObserver::~OneClickSigninSyncObserver() {}
-void OneClickSigninSyncObserver::WebContentsDestroyed(
- content::WebContents* web_contents) {
- ProfileSyncService* sync_service = GetSyncService(web_contents);
+void OneClickSigninSyncObserver::WebContentsDestroyed() {
+ ProfileSyncService* sync_service = GetSyncService(web_contents());
if (sync_service)
sync_service->RemoveObserver(this);
diff --git a/chrome/browser/ui/sync/one_click_signin_sync_observer.h b/chrome/browser/ui/sync/one_click_signin_sync_observer.h
index 7d53a77..23dca83 100644
--- a/chrome/browser/ui/sync/one_click_signin_sync_observer.h
+++ b/chrome/browser/ui/sync/one_click_signin_sync_observer.h
@@ -31,7 +31,7 @@ class OneClickSigninSyncObserver : public content::WebContentsObserver,
private:
// content::WebContentsObserver:
- virtual void WebContentsDestroyed(content::WebContents* contents) OVERRIDE;
+ virtual void WebContentsDestroyed() OVERRIDE;
// ProfileSyncServiceObserver:
virtual void OnStateChanged() OVERRIDE;
diff --git a/chrome/browser/ui/tab_contents/core_tab_helper.cc b/chrome/browser/ui/tab_contents/core_tab_helper.cc
index 99f93b2..d30bbaf 100644
--- a/chrome/browser/ui/tab_contents/core_tab_helper.cc
+++ b/chrome/browser/ui/tab_contents/core_tab_helper.cc
@@ -150,7 +150,7 @@ void CoreTabHelper::WasShown() {
web_contents()->GetRenderProcessHost()->GetID());
}
-void CoreTabHelper::WebContentsDestroyed(WebContents* web_contents) {
+void CoreTabHelper::WebContentsDestroyed() {
// OnCloseStarted isn't called in unit tests.
if (!close_start_time_.is_null()) {
bool fast_tab_close_enabled = CommandLine::ForCurrentProcess()->HasSwitch(
diff --git a/chrome/browser/ui/tab_contents/core_tab_helper.h b/chrome/browser/ui/tab_contents/core_tab_helper.h
index a5ca820..e01482b 100644
--- a/chrome/browser/ui/tab_contents/core_tab_helper.h
+++ b/chrome/browser/ui/tab_contents/core_tab_helper.h
@@ -59,8 +59,7 @@ class CoreTabHelper : public content::WebContentsObserver,
virtual void DidStartLoading(
content::RenderViewHost* render_view_host) OVERRIDE;
virtual void WasShown() OVERRIDE;
- virtual void WebContentsDestroyed(
- content::WebContents* web_contents) OVERRIDE;
+ virtual void WebContentsDestroyed() OVERRIDE;
virtual void BeforeUnloadFired(const base::TimeTicks& proceed_time) OVERRIDE;
virtual void BeforeUnloadDialogCancelled() OVERRIDE;
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
diff --git a/chrome/browser/ui/tabs/tab_strip_model.cc b/chrome/browser/ui/tabs/tab_strip_model.cc
index 06ac829..098d89d 100644
--- a/chrome/browser/ui/tabs/tab_strip_model.cc
+++ b/chrome/browser/ui/tabs/tab_strip_model.cc
@@ -73,7 +73,7 @@ class CloseTracker {
private:
// WebContentsObserver:
- virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE {
+ virtual void WebContentsDestroyed() OVERRIDE {
parent_->OnWebContentsDestroyed(this);
}
@@ -161,7 +161,7 @@ class TabStripModel::WebContentsData : public content::WebContentsObserver {
private:
// Make sure that if someone deletes this WebContents out from under us, it
// is properly removed from the tab strip.
- virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE;
+ virtual void WebContentsDestroyed() OVERRIDE;
// The WebContents being tracked by this WebContentsData. The
// WebContentsObserver does keep a reference, but when the WebContents is
@@ -224,13 +224,12 @@ void TabStripModel::WebContentsData::SetWebContents(WebContents* contents) {
Observe(contents);
}
-void TabStripModel::WebContentsData::WebContentsDestroyed(
- WebContents* web_contents) {
- DCHECK_EQ(contents_, web_contents);
+void TabStripModel::WebContentsData::WebContentsDestroyed() {
+ DCHECK_EQ(contents_, web_contents());
// Note that we only detach the contents here, not close it - it's
// already been closed. We just want to undo our bookkeeping.
- int index = tab_strip_model_->GetIndexOfWebContents(web_contents);
+ int index = tab_strip_model_->GetIndexOfWebContents(web_contents());
DCHECK_NE(TabStripModel::kNoTab, index);
tab_strip_model_->DetachWebContentsAt(index);
}
diff --git a/chrome/browser/ui/tabs/tab_strip_model_unittest.cc b/chrome/browser/ui/tabs/tab_strip_model_unittest.cc
index 4c43196..1bbfaea 100644
--- a/chrome/browser/ui/tabs/tab_strip_model_unittest.cc
+++ b/chrome/browser/ui/tabs/tab_strip_model_unittest.cc
@@ -58,7 +58,7 @@ class DeleteWebContentsOnDestroyedObserver
tab_strip_(tab_strip) {
}
- virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE {
+ virtual void WebContentsDestroyed() OVERRIDE {
WebContents* tab_to_delete = tab_to_delete_;
tab_to_delete_ = NULL;
TabStripModel* tab_strip_to_delete = tab_strip_;
diff --git a/chrome/browser/ui/views/frame/browser_view_browsertest.cc b/chrome/browser/ui/views/frame/browser_view_browsertest.cc
index 236e774..e573e1b 100644
--- a/chrome/browser/ui/views/frame/browser_view_browsertest.cc
+++ b/chrome/browser/ui/views/frame/browser_view_browsertest.cc
@@ -26,8 +26,7 @@ class TestWebContentsObserver : public content::WebContentsObserver {
other_(other) {}
virtual ~TestWebContentsObserver() {}
- virtual void WebContentsDestroyed(
- content::WebContents* web_contents) OVERRIDE {
+ virtual void WebContentsDestroyed() OVERRIDE {
other_->NotifyNavigationStateChanged(
content::INVALIDATE_TYPE_URL | content::INVALIDATE_TYPE_LOAD);
}
diff --git a/chrome/browser/ui/views/hung_renderer_view.cc b/chrome/browser/ui/views/hung_renderer_view.cc
index bb9b873..5f3242a 100644
--- a/chrome/browser/ui/views/hung_renderer_view.cc
+++ b/chrome/browser/ui/views/hung_renderer_view.cc
@@ -155,8 +155,7 @@ void HungPagesTableModel::WebContentsObserverImpl::RenderProcessGone(
model_->TabDestroyed(this);
}
-void HungPagesTableModel::WebContentsObserverImpl::WebContentsDestroyed(
- WebContents* tab) {
+void HungPagesTableModel::WebContentsObserverImpl::WebContentsDestroyed() {
model_->TabDestroyed(this);
}
diff --git a/chrome/browser/ui/views/hung_renderer_view.h b/chrome/browser/ui/views/hung_renderer_view.h
index 2f4c945..2f661af 100644
--- a/chrome/browser/ui/views/hung_renderer_view.h
+++ b/chrome/browser/ui/views/hung_renderer_view.h
@@ -75,7 +75,7 @@ class HungPagesTableModel : public ui::TableModel, public views::TableGrouper {
// WebContentsObserver overrides:
virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE;
- virtual void WebContentsDestroyed(content::WebContents* tab) OVERRIDE;
+ virtual void WebContentsDestroyed() OVERRIDE;
private:
HungPagesTableModel* model_;
diff --git a/chrome/browser/ui/views/translate/translate_bubble_view.cc b/chrome/browser/ui/views/translate/translate_bubble_view.cc
index ba6c6bd..2608055 100644
--- a/chrome/browser/ui/views/translate/translate_bubble_view.cc
+++ b/chrome/browser/ui/views/translate/translate_bubble_view.cc
@@ -261,8 +261,7 @@ void TranslateBubbleView::LinkClicked(views::Link* source, int event_flags) {
HandleLinkClicked(static_cast<LinkID>(source->id()));
}
-void TranslateBubbleView::WebContentsDestroyed(
- content::WebContents* web_contents) {
+void TranslateBubbleView::WebContentsDestroyed() {
GetWidget()->CloseNow();
}
diff --git a/chrome/browser/ui/views/translate/translate_bubble_view.h b/chrome/browser/ui/views/translate/translate_bubble_view.h
index 39d066b..91b38a37 100644
--- a/chrome/browser/ui/views/translate/translate_bubble_view.h
+++ b/chrome/browser/ui/views/translate/translate_bubble_view.h
@@ -70,8 +70,7 @@ class TranslateBubbleView : public views::BubbleDelegateView,
virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE;
// content::WebContentsObserver method.
- virtual void WebContentsDestroyed(content::WebContents* web_contents)
- OVERRIDE;
+ virtual void WebContentsDestroyed() OVERRIDE;
// Returns the current view state.
TranslateBubbleModel::ViewState GetViewState() const;
diff --git a/chrome/browser/ui/website_settings/permission_bubble_manager.cc b/chrome/browser/ui/website_settings/permission_bubble_manager.cc
index 9eec3bb..8816cee 100644
--- a/chrome/browser/ui/website_settings/permission_bubble_manager.cc
+++ b/chrome/browser/ui/website_settings/permission_bubble_manager.cc
@@ -234,8 +234,7 @@ void PermissionBubbleManager::NavigationEntryCommitted(
}
}
-void PermissionBubbleManager::WebContentsDestroyed(
- content::WebContents* web_contents) {
+void PermissionBubbleManager::WebContentsDestroyed() {
// If the web contents has been destroyed, treat the bubble as cancelled.
CancelPendingQueue();
FinalizeBubble();
@@ -243,7 +242,7 @@ void PermissionBubbleManager::WebContentsDestroyed(
// The WebContents is going away; be aggressively paranoid and delete
// ourselves lest other parts of the system attempt to add permission bubbles
// or use us otherwise during the destruction.
- web_contents->RemoveUserData(UserDataKey());
+ web_contents()->RemoveUserData(UserDataKey());
// That was the equivalent of "delete this". This object is now destroyed;
// returning from this function is the only safe thing to do.
}
diff --git a/chrome/browser/ui/website_settings/permission_bubble_manager.h b/chrome/browser/ui/website_settings/permission_bubble_manager.h
index 767037e..2e0eafc 100644
--- a/chrome/browser/ui/website_settings/permission_bubble_manager.h
+++ b/chrome/browser/ui/website_settings/permission_bubble_manager.h
@@ -74,8 +74,7 @@ class PermissionBubbleManager
// they will be finalized as if canceled by the user.
virtual void NavigationEntryCommitted(
const content::LoadCommittedDetails& details) OVERRIDE;
- virtual void WebContentsDestroyed(
- content::WebContents* web_contents) OVERRIDE;
+ virtual void WebContentsDestroyed() OVERRIDE;
// PermissionBubbleView::Delegate:
virtual void ToggleAccept(int request_index, bool new_value) OVERRIDE;
diff --git a/chrome/browser/ui/webui/constrained_web_dialog_ui_browsertest.cc b/chrome/browser/ui/webui/constrained_web_dialog_ui_browsertest.cc
index 9890575..ba8e0e5 100644
--- a/chrome/browser/ui/webui/constrained_web_dialog_ui_browsertest.cc
+++ b/chrome/browser/ui/webui/constrained_web_dialog_ui_browsertest.cc
@@ -33,7 +33,7 @@ class ConstrainedWebDialogBrowserTestObserver
bool contents_destroyed() { return contents_destroyed_; }
private:
- virtual void WebContentsDestroyed(WebContents* tab) OVERRIDE {
+ virtual void WebContentsDestroyed() OVERRIDE {
contents_destroyed_ = true;
}