summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-06 08:32:17 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-06 08:32:17 +0000
commit8de85a60ef3c615360d0c644f7f16f9a13103865 (patch)
tree0ac8ff6a33b4b70c868015fb50b16c08f92d5018
parent716984c61da9f5a8ac8158d122e50646081f5b6e (diff)
downloadchromium_src-8de85a60ef3c615360d0c644f7f16f9a13103865.zip
chromium_src-8de85a60ef3c615360d0c644f7f16f9a13103865.tar.gz
chromium_src-8de85a60ef3c615360d0c644f7f16f9a13103865.tar.bz2
Revert "Revert r31175 r31176 r31187"
The bustage seems to be a WebKit change upstream. It is not reverted in WebKit and merger. So bring the innocent change back in. TBR=jam TEST=green tree Review URL: http://codereview.chromium.org/375009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31214 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/autocomplete/autocomplete.h6
-rw-r--r--chrome/browser/autocomplete/autocomplete_unittest.cc2
-rw-r--r--chrome/browser/autocomplete/history_contents_provider.h2
-rw-r--r--chrome/browser/autocomplete/history_url_provider.h2
-rw-r--r--chrome/browser/autocomplete/keyword_provider.h2
-rw-r--r--chrome/browser/autocomplete/search_provider.h2
-rw-r--r--chrome/browser/automation/automation_extension_function.h2
-rw-r--r--chrome/browser/automation/automation_provider.h8
-rw-r--r--chrome/browser/automation/ui_controls_win.cc6
-rw-r--r--chrome/browser/bookmarks/bookmark_storage.h5
-rw-r--r--chrome/browser/browser_about_handler.cc3
-rw-r--r--chrome/browser/chromeos/version_loader.h4
-rw-r--r--chrome/browser/dom_ui/chrome_url_data_manager.h6
-rw-r--r--chrome/browser/dom_ui/dom_ui_favicon_source.h3
-rw-r--r--chrome/browser/dom_ui/dom_ui_theme_source.h3
-rw-r--r--chrome/browser/dom_ui/dom_ui_theme_source_unittest.cc3
-rw-r--r--chrome/browser/dom_ui/dom_ui_thumbnail_source.h2
-rw-r--r--chrome/browser/dom_ui/downloads_ui.cc2
-rw-r--r--chrome/browser/dom_ui/filebrowse_ui.cc2
-rw-r--r--chrome/browser/dom_ui/fileicon_source.h3
-rw-r--r--chrome/browser/dom_ui/history_ui.h2
-rw-r--r--chrome/browser/dom_ui/new_tab_ui.cc2
-rw-r--r--chrome/browser/dom_ui/new_tab_ui.h2
-rw-r--r--chrome/browser/dom_ui/print_ui.h2
-rw-r--r--chrome/browser/download/download_file.h5
-rw-r--r--chrome/browser/download/download_manager.h5
-rw-r--r--chrome/browser/download/download_request_manager.h4
-rw-r--r--chrome/browser/download/save_file_manager.h5
-rw-r--r--chrome/browser/download/save_package.h6
-rw-r--r--chrome/browser/extensions/extension_browser_actions_api.h5
-rw-r--r--chrome/browser/extensions/extension_devtools_manager.h4
-rw-r--r--chrome/browser/extensions/extension_disabled_infobar_delegate.cc7
-rw-r--r--chrome/browser/extensions/extension_function.h13
-rw-r--r--chrome/browser/extensions/extension_function_dispatcher.h6
-rw-r--r--chrome/browser/extensions/extension_i18n_api.h1
-rw-r--r--chrome/browser/extensions/extension_message_service.h5
-rw-r--r--chrome/browser/extensions/extension_page_actions_module.h10
-rw-r--r--chrome/browser/extensions/extension_tabs_module.h16
-rw-r--r--chrome/browser/extensions/extension_test_api.h4
-rw-r--r--chrome/browser/extensions/extension_toolstrip_api.h3
-rw-r--r--chrome/browser/extensions/extension_updater.cc5
-rw-r--r--chrome/browser/extensions/extension_updater.h4
-rw-r--r--chrome/browser/extensions/extensions_service.h11
-rw-r--r--chrome/browser/extensions/extensions_ui.h2
-rw-r--r--chrome/browser/extensions/file_reader.h4
-rw-r--r--chrome/browser/extensions/image_loading_tracker.h5
-rw-r--r--chrome/browser/extensions/pack_extension_job.h4
-rw-r--r--chrome/browser/extensions/sandboxed_extension_unpacker.h8
-rw-r--r--chrome/browser/extensions/user_script_listener.h4
-rw-r--r--chrome/browser/extensions/user_script_listener_unittest.cc3
-rw-r--r--chrome/browser/extensions/user_script_master.h10
-rw-r--r--chrome/browser/process_singleton_linux.cc10
-rw-r--r--chrome/browser/sync/sync_setup_wizard.cc4
53 files changed, 207 insertions, 42 deletions
diff --git a/chrome/browser/autocomplete/autocomplete.h b/chrome/browser/autocomplete/autocomplete.h
index 0416328..0193b8c 100644
--- a/chrome/browser/autocomplete/autocomplete.h
+++ b/chrome/browser/autocomplete/autocomplete.h
@@ -483,8 +483,6 @@ class AutocompleteProvider
name_(name) {
}
- virtual ~AutocompleteProvider();
-
// Invoked when the profile changes.
// NOTE: Do not access any previous Profile* at this point as it may have
// already been deleted.
@@ -538,6 +536,10 @@ class AutocompleteProvider
static size_t max_matches() { return max_matches_; }
protected:
+ friend class base::RefCountedThreadSafe<AutocompleteProvider>;
+
+ virtual ~AutocompleteProvider();
+
// Trims "http:" and up to two subsequent slashes from |url|. Returns the
// number of characters that were trimmed.
static size_t TrimHttpPrefix(std::wstring* url);
diff --git a/chrome/browser/autocomplete/autocomplete_unittest.cc b/chrome/browser/autocomplete/autocomplete_unittest.cc
index adff59c..0e8671a 100644
--- a/chrome/browser/autocomplete/autocomplete_unittest.cc
+++ b/chrome/browser/autocomplete/autocomplete_unittest.cc
@@ -35,6 +35,8 @@ class TestProvider : public AutocompleteProvider {
}
private:
+ ~TestProvider() {}
+
void Run();
void AddResults(int start_at, int num);
diff --git a/chrome/browser/autocomplete/history_contents_provider.h b/chrome/browser/autocomplete/history_contents_provider.h
index 49ca83e..18a4b36 100644
--- a/chrome/browser/autocomplete/history_contents_provider.h
+++ b/chrome/browser/autocomplete/history_contents_provider.h
@@ -49,6 +49,8 @@ class HistoryContentsProvider : public AutocompleteProvider {
static const size_t kMaxMatchCount = 50;
private:
+ ~HistoryContentsProvider() {}
+
void QueryComplete(HistoryService::Handle handle,
history::QueryResults* results);
diff --git a/chrome/browser/autocomplete/history_url_provider.h b/chrome/browser/autocomplete/history_url_provider.h
index b87a2e3..50f6ba7 100644
--- a/chrome/browser/autocomplete/history_url_provider.h
+++ b/chrome/browser/autocomplete/history_url_provider.h
@@ -177,6 +177,8 @@ class HistoryURLProvider : public AutocompleteProvider {
void QueryComplete(HistoryURLProviderParams* params_gets_deleted);
private:
+ ~HistoryURLProvider() {}
+
struct Prefix {
Prefix(std::wstring prefix, int num_components)
: prefix(prefix),
diff --git a/chrome/browser/autocomplete/keyword_provider.h b/chrome/browser/autocomplete/keyword_provider.h
index 6caa2b1..adf81d8 100644
--- a/chrome/browser/autocomplete/keyword_provider.h
+++ b/chrome/browser/autocomplete/keyword_provider.h
@@ -69,6 +69,8 @@ class KeywordProvider : public AutocompleteProvider {
bool minimal_changes);
private:
+ ~KeywordProvider() {}
+
// Extracts the keyword from |input| into |keyword|. Any remaining characters
// after the keyword are placed in |remaining_input|. Returns true if |input|
// is valid and has a keyword. This makes use of SplitKeywordFromInput to
diff --git a/chrome/browser/autocomplete/search_provider.h b/chrome/browser/autocomplete/search_provider.h
index f333c4f..f36c070 100644
--- a/chrome/browser/autocomplete/search_provider.h
+++ b/chrome/browser/autocomplete/search_provider.h
@@ -75,6 +75,8 @@ class SearchProvider : public AutocompleteProvider,
static const int kKeywordProviderURLFetcherID;
private:
+ ~SearchProvider() {}
+
// Manages the providers (TemplateURLs) used by SearchProvider. Two providers
// may be used:
// . The default provider. This corresponds to the user's default search
diff --git a/chrome/browser/automation/automation_extension_function.h b/chrome/browser/automation/automation_extension_function.h
index d6fac7d..ed57ca1 100644
--- a/chrome/browser/automation/automation_extension_function.h
+++ b/chrome/browser/automation/automation_extension_function.h
@@ -46,6 +46,8 @@ class AutomationExtensionFunction : public ExtensionFunction {
const std::string& target);
private:
+ ~AutomationExtensionFunction() {}
+
static bool enabled_;
std::string args_;
DISALLOW_COPY_AND_ASSIGN(AutomationExtensionFunction);
diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h
index dc540da..418c804 100644
--- a/chrome/browser/automation/automation_provider.h
+++ b/chrome/browser/automation/automation_provider.h
@@ -56,7 +56,6 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>,
public IPC::Message::Sender {
public:
explicit AutomationProvider(Profile* profile);
- virtual ~AutomationProvider();
Profile* profile() const { return profile_; }
@@ -131,6 +130,10 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>,
// Adds the external tab passed in to the tab tracker.
bool AddExternalTab(ExternalTabContainer* external_tab);
+ protected:
+ friend class base::RefCounted<AutomationProvider>;
+ virtual ~AutomationProvider();
+
private:
// IPC Message callbacks.
void CloseBrowser(int handle, IPC::Message* reply_message);
@@ -567,7 +570,6 @@ class TestingAutomationProvider : public AutomationProvider,
public NotificationObserver {
public:
explicit TestingAutomationProvider(Profile* profile);
- virtual ~TestingAutomationProvider();
// BrowserList::Observer implementation
// Called immediately after a browser is added to the list
@@ -580,6 +582,8 @@ class TestingAutomationProvider : public AutomationProvider,
virtual void OnChannelError();
private:
+ virtual ~TestingAutomationProvider();
+
virtual void Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details);
diff --git a/chrome/browser/automation/ui_controls_win.cc b/chrome/browser/automation/ui_controls_win.cc
index 29ca089..43e8b32 100644
--- a/chrome/browser/automation/ui_controls_win.cc
+++ b/chrome/browser/automation/ui_controls_win.cc
@@ -24,8 +24,6 @@ class InputDispatcher : public base::RefCounted<InputDispatcher> {
public:
InputDispatcher(Task* task, WPARAM message_waiting_for);
- ~InputDispatcher();
-
// Invoked from the hook. If mouse_message matches message_waiting_for_
// MatchingMessageFound is invoked.
void DispatchedMessage(WPARAM mouse_message);
@@ -35,6 +33,10 @@ class InputDispatcher : public base::RefCounted<InputDispatcher> {
void MatchingMessageFound();
private:
+ friend class base::RefCounted<InputDispatcher>;
+
+ ~InputDispatcher();
+
// Notifies the task and release this (which should delete it).
void NotifyTask();
diff --git a/chrome/browser/bookmarks/bookmark_storage.h b/chrome/browser/bookmarks/bookmark_storage.h
index d41b2c5..e3e1337 100644
--- a/chrome/browser/bookmarks/bookmark_storage.h
+++ b/chrome/browser/bookmarks/bookmark_storage.h
@@ -92,7 +92,6 @@ class BookmarkStorage : public NotificationObserver,
// Creates a BookmarkStorage for the specified model
BookmarkStorage(Profile* profile, BookmarkModel* model);
- ~BookmarkStorage();
// Loads the bookmarks into the model, notifying the model when done. This
// takes ownership of |details|. See LoadDetails for details.
@@ -109,6 +108,10 @@ class BookmarkStorage : public NotificationObserver,
virtual bool SerializeData(std::string* output);
private:
+ friend class base::RefCountedThreadSafe<BookmarkStorage>;
+
+ ~BookmarkStorage();
+
class LoadTask;
// Callback from backend with the results of the bookmark file.
diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc
index 21b166e..54bd4f0 100644
--- a/chrome/browser/browser_about_handler.cc
+++ b/chrome/browser/browser_about_handler.cc
@@ -112,7 +112,6 @@ class AboutSource : public ChromeURLDataManager::DataSource {
public:
// Creates our datasource.
AboutSource();
- virtual ~AboutSource();
// Called when the network layer has requested a resource underneath
// the path we registered.
@@ -126,6 +125,8 @@ class AboutSource : public ChromeURLDataManager::DataSource {
void FinishDataRequest(const std::string& html, int request_id);
private:
+ virtual ~AboutSource();
+
DISALLOW_COPY_AND_ASSIGN(AboutSource);
};
diff --git a/chrome/browser/chromeos/version_loader.h b/chrome/browser/chromeos/version_loader.h
index f118934..15c281f 100644
--- a/chrome/browser/chromeos/version_loader.h
+++ b/chrome/browser/chromeos/version_loader.h
@@ -53,6 +53,10 @@ class VersionLoader : public CancelableRequestProvider {
void GetVersion(scoped_refptr<GetVersionRequest> request);
private:
+ friend class base::RefCountedThreadSafe<Backend>;
+
+ ~Backend() {}
+
DISALLOW_COPY_AND_ASSIGN(Backend);
};
diff --git a/chrome/browser/dom_ui/chrome_url_data_manager.h b/chrome/browser/dom_ui/chrome_url_data_manager.h
index c159190..f553a3f 100644
--- a/chrome/browser/dom_ui/chrome_url_data_manager.h
+++ b/chrome/browser/dom_ui/chrome_url_data_manager.h
@@ -44,7 +44,6 @@ class ChromeURLDataManager {
DataSource(const std::string& source_name,
MessageLoop* message_loop)
: source_name_(source_name), message_loop_(message_loop) {}
- virtual ~DataSource() {}
// Sent by the DataManager to request data at |path|. The source should
// call SendResponse() when the data is available or if the request could
@@ -76,6 +75,11 @@ class ChromeURLDataManager {
static void SetFontAndTextDirection(DictionaryValue* localized_strings);
+ protected:
+ friend class base::RefCountedThreadSafe<DataSource>;
+
+ virtual ~DataSource() {}
+
private:
// The name of this source.
// E.g., for favicons, this could be "favicon", which results in paths for
diff --git a/chrome/browser/dom_ui/dom_ui_favicon_source.h b/chrome/browser/dom_ui/dom_ui_favicon_source.h
index 6556c39..0d42eaf 100644
--- a/chrome/browser/dom_ui/dom_ui_favicon_source.h
+++ b/chrome/browser/dom_ui/dom_ui_favicon_source.h
@@ -20,7 +20,6 @@ class Profile;
class DOMUIFavIconSource : public ChromeURLDataManager::DataSource {
public:
explicit DOMUIFavIconSource(Profile* profile);
- virtual ~DOMUIFavIconSource() { }
// Called when the network layer has requested a resource underneath
// the path we registered.
@@ -40,6 +39,8 @@ class DOMUIFavIconSource : public ChromeURLDataManager::DataSource {
GURL url);
private:
+ virtual ~DOMUIFavIconSource() {}
+
Profile* profile_;
CancelableRequestConsumerT<int, 0> cancelable_consumer_;
diff --git a/chrome/browser/dom_ui/dom_ui_theme_source.h b/chrome/browser/dom_ui/dom_ui_theme_source.h
index 65f83e7..f20d104 100644
--- a/chrome/browser/dom_ui/dom_ui_theme_source.h
+++ b/chrome/browser/dom_ui/dom_ui_theme_source.h
@@ -26,6 +26,9 @@ class DOMUIThemeSource : public ChromeURLDataManager::DataSource {
virtual MessageLoop* MessageLoopForRequestPath(const std::string& path) const;
+ protected:
+ virtual ~DOMUIThemeSource() {}
+
private:
// Populate new_tab_css_ and new_incognito_tab_css. These must be called
// from the UI thread because they involve profile and theme access.
diff --git a/chrome/browser/dom_ui/dom_ui_theme_source_unittest.cc b/chrome/browser/dom_ui/dom_ui_theme_source_unittest.cc
index f33bf27..09e98b2 100644
--- a/chrome/browser/dom_ui/dom_ui_theme_source_unittest.cc
+++ b/chrome/browser/dom_ui/dom_ui_theme_source_unittest.cc
@@ -26,6 +26,9 @@ class MockThemeSource : public DOMUIThemeSource {
int result_request_id_;
size_t result_data_size_;
+
+ private:
+ ~MockThemeSource() {}
};
class DOMUISourcesTest : public testing::Test {
diff --git a/chrome/browser/dom_ui/dom_ui_thumbnail_source.h b/chrome/browser/dom_ui/dom_ui_thumbnail_source.h
index 48f2879..03263b2 100644
--- a/chrome/browser/dom_ui/dom_ui_thumbnail_source.h
+++ b/chrome/browser/dom_ui/dom_ui_thumbnail_source.h
@@ -40,6 +40,8 @@ class DOMUIThumbnailSource : public ChromeURLDataManager::DataSource,
scoped_refptr<RefCountedBytes> data);
private:
+ ~DOMUIThumbnailSource() {}
+
// NotificationObserver implementation
virtual void Observe(NotificationType type,
const NotificationSource& source,
diff --git a/chrome/browser/dom_ui/downloads_ui.cc b/chrome/browser/dom_ui/downloads_ui.cc
index 39adf47e..5dff5b9 100644
--- a/chrome/browser/dom_ui/downloads_ui.cc
+++ b/chrome/browser/dom_ui/downloads_ui.cc
@@ -41,6 +41,8 @@ class DownloadsUIHTMLSource : public ChromeURLDataManager::DataSource {
}
private:
+ ~DownloadsUIHTMLSource() {}
+
DISALLOW_COPY_AND_ASSIGN(DownloadsUIHTMLSource);
};
diff --git a/chrome/browser/dom_ui/filebrowse_ui.cc b/chrome/browser/dom_ui/filebrowse_ui.cc
index 0a07074..182c20a 100644
--- a/chrome/browser/dom_ui/filebrowse_ui.cc
+++ b/chrome/browser/dom_ui/filebrowse_ui.cc
@@ -50,6 +50,8 @@ class FileBrowseUIHTMLSource : public ChromeURLDataManager::DataSource {
}
private:
+ ~FileBrowseUIHTMLSource() {}
+
DISALLOW_COPY_AND_ASSIGN(FileBrowseUIHTMLSource);
};
diff --git a/chrome/browser/dom_ui/fileicon_source.h b/chrome/browser/dom_ui/fileicon_source.h
index a13c207..a9f43d7 100644
--- a/chrome/browser/dom_ui/fileicon_source.h
+++ b/chrome/browser/dom_ui/fileicon_source.h
@@ -18,7 +18,6 @@ class GURL;
class FileIconSource : public ChromeURLDataManager::DataSource {
public:
explicit FileIconSource();
- virtual ~FileIconSource();
// Called when the network layer has requested a resource underneath
// the path we registered.
@@ -35,6 +34,8 @@ class FileIconSource : public ChromeURLDataManager::DataSource {
SkBitmap* icon);
private:
+ virtual ~FileIconSource();
+
CancelableRequestConsumerT<int, 0> cancelable_consumer_;
// Raw PNG representation of the favicon to show when the favicon
diff --git a/chrome/browser/dom_ui/history_ui.h b/chrome/browser/dom_ui/history_ui.h
index 3dc51c4..990c423 100644
--- a/chrome/browser/dom_ui/history_ui.h
+++ b/chrome/browser/dom_ui/history_ui.h
@@ -29,6 +29,8 @@ class HistoryUIHTMLSource : public ChromeURLDataManager::DataSource {
}
private:
+ ~HistoryUIHTMLSource() {}
+
DISALLOW_COPY_AND_ASSIGN(HistoryUIHTMLSource);
};
diff --git a/chrome/browser/dom_ui/new_tab_ui.cc b/chrome/browser/dom_ui/new_tab_ui.cc
index 10addde..9dd8dc84 100644
--- a/chrome/browser/dom_ui/new_tab_ui.cc
+++ b/chrome/browser/dom_ui/new_tab_ui.cc
@@ -144,6 +144,8 @@ class IncognitoTabHTMLSource : public ChromeURLDataManager::DataSource {
}
private:
+ ~IncognitoTabHTMLSource() {}
+
// Populate full_html_. This must be called from the UI thread because it
// involves profile access.
//
diff --git a/chrome/browser/dom_ui/new_tab_ui.h b/chrome/browser/dom_ui/new_tab_ui.h
index e4b494c..1feac2a 100644
--- a/chrome/browser/dom_ui/new_tab_ui.h
+++ b/chrome/browser/dom_ui/new_tab_ui.h
@@ -78,6 +78,8 @@ class NewTabUI : public DOMUI,
static bool first_run() { return first_run_; }
private:
+ ~NewTabHTMLSource() {}
+
// In case a file path to the new tab page was provided this tries to load
// the file and returns the file content if successful. This returns an
// empty string in case of failure.
diff --git a/chrome/browser/dom_ui/print_ui.h b/chrome/browser/dom_ui/print_ui.h
index 8443da4..508a6c4 100644
--- a/chrome/browser/dom_ui/print_ui.h
+++ b/chrome/browser/dom_ui/print_ui.h
@@ -31,6 +31,8 @@ class PrintUIHTMLSource : public ChromeURLDataManager::DataSource {
}
private:
+ ~PrintUIHTMLSource() {}
+
DISALLOW_COPY_AND_ASSIGN(PrintUIHTMLSource);
};
diff --git a/chrome/browser/download/download_file.h b/chrome/browser/download/download_file.h
index ef367ce..0705ffe 100644
--- a/chrome/browser/download/download_file.h
+++ b/chrome/browser/download/download_file.h
@@ -168,7 +168,6 @@ class DownloadFileManager
: public base::RefCountedThreadSafe<DownloadFileManager> {
public:
DownloadFileManager(ResourceDispatcherHost* rdh);
- ~DownloadFileManager();
// Called on shutdown on the UI thread.
void Shutdown();
@@ -234,6 +233,10 @@ class DownloadFileManager
static void DeleteFile(const FilePath& path);
private:
+ friend class base::RefCountedThreadSafe<DownloadFileManager>;
+
+ ~DownloadFileManager();
+
// Timer helpers for updating the UI about the current progress of a download.
void StartUpdateTimer();
void StopUpdateTimer();
diff --git a/chrome/browser/download/download_manager.h b/chrome/browser/download/download_manager.h
index 3974df6..30423ba 100644
--- a/chrome/browser/download/download_manager.h
+++ b/chrome/browser/download/download_manager.h
@@ -311,7 +311,6 @@ class DownloadManager : public base::RefCountedThreadSafe<DownloadManager>,
public:
DownloadManager();
- ~DownloadManager();
static void RegisterUserPrefs(PrefService* prefs);
@@ -465,6 +464,10 @@ class DownloadManager : public base::RefCountedThreadSafe<DownloadManager>,
int request_id);
private:
+ friend class base::RefCountedThreadSafe<DownloadManager>;
+
+ ~DownloadManager();
+
// Opens a download via the Windows shell.
void OpenDownloadInShell(const DownloadItem* download,
gfx::NativeView parent_window);
diff --git a/chrome/browser/download/download_request_manager.h b/chrome/browser/download/download_request_manager.h
index 8e120bb..2b03572 100644
--- a/chrome/browser/download/download_request_manager.h
+++ b/chrome/browser/download/download_request_manager.h
@@ -148,7 +148,6 @@ class DownloadRequestManager :
};
DownloadRequestManager();
- ~DownloadRequestManager();
// Returns the download status for a page. This does not change the state in
// anyway.
@@ -169,9 +168,12 @@ class DownloadRequestManager :
void OnUserGesture(TabContents* tab);
private:
+ friend class base::RefCountedThreadSafe<DownloadRequestManager>;
friend class DownloadRequestManagerTest;
friend class TabDownloadState;
+ ~DownloadRequestManager();
+
// For unit tests. If non-null this is used instead of creating a dialog.
class TestingDelegate {
public:
diff --git a/chrome/browser/download/save_file_manager.h b/chrome/browser/download/save_file_manager.h
index a77f052..ba470d1 100644
--- a/chrome/browser/download/save_file_manager.h
+++ b/chrome/browser/download/save_file_manager.h
@@ -80,7 +80,6 @@ class SaveFileManager
: public base::RefCountedThreadSafe<SaveFileManager> {
public:
SaveFileManager(ResourceDispatcherHost* rdh);
- ~SaveFileManager();
// Lifetime management.
void Shutdown();
@@ -144,6 +143,10 @@ class SaveFileManager
void RemoveSavedFileFromFileMap(const SaveIDList & save_ids);
private:
+ friend class base::RefCountedThreadSafe<SaveFileManager>;
+
+ ~SaveFileManager();
+
// A cleanup helper that runs on the file thread.
void OnShutdown();
diff --git a/chrome/browser/download/save_package.h b/chrome/browser/download/save_package.h
index a20f027..4d52864 100644
--- a/chrome/browser/download/save_package.h
+++ b/chrome/browser/download/save_package.h
@@ -94,8 +94,6 @@ class SavePackage : public base::RefCountedThreadSafe<SavePackage>,
const FilePath& file_full_path,
const FilePath& directory_full_path);
- ~SavePackage();
-
// Initialize the SavePackage. Returns true if it initializes properly.
// Need to make sure that this method must be called in the UI thread because
// using g_browser_process on a non-UI thread can cause crashes during
@@ -197,10 +195,14 @@ class SavePackage : public base::RefCountedThreadSafe<SavePackage>,
virtual void FileSelectionCanceled(void* params);
private:
+ friend class base::RefCountedThreadSafe<SavePackage>;
+
// For testing only.
SavePackage(const FilePath& file_full_path,
const FilePath& directory_full_path);
+ ~SavePackage();
+
// Notes from Init() above applies here as well.
void InternalInit();
diff --git a/chrome/browser/extensions/extension_browser_actions_api.h b/chrome/browser/extensions/extension_browser_actions_api.h
index f892551..fceab48 100644
--- a/chrome/browser/extensions/extension_browser_actions_api.h
+++ b/chrome/browser/extensions/extension_browser_actions_api.h
@@ -14,6 +14,7 @@ class ExtensionActionState;
class BrowserActionFunction : public SyncExtensionFunction {
protected:
BrowserActionFunction() : tab_id_(ExtensionAction::kDefaultTabId) {}
+ virtual ~BrowserActionFunction() {}
virtual bool RunImpl();
virtual bool RunBrowserAction() = 0;
@@ -30,22 +31,26 @@ class BrowserActionFunction : public SyncExtensionFunction {
};
class BrowserActionSetIconFunction : public BrowserActionFunction {
+ ~BrowserActionSetIconFunction() {}
virtual bool RunBrowserAction();
DECLARE_EXTENSION_FUNCTION_NAME("browserAction.setIcon")
};
class BrowserActionSetTitleFunction : public BrowserActionFunction {
+ ~BrowserActionSetTitleFunction() {}
virtual bool RunBrowserAction();
DECLARE_EXTENSION_FUNCTION_NAME("browserAction.setTitle")
};
class BrowserActionSetBadgeTextFunction : public BrowserActionFunction {
+ ~BrowserActionSetBadgeTextFunction() {}
virtual bool RunBrowserAction();
DECLARE_EXTENSION_FUNCTION_NAME("browserAction.setBadgeText")
};
class BrowserActionSetBadgeBackgroundColorFunction
: public BrowserActionFunction {
+ ~BrowserActionSetBadgeBackgroundColorFunction() {}
virtual bool RunBrowserAction();
DECLARE_EXTENSION_FUNCTION_NAME("browserAction.setBadgeBackgroundColor")
};
diff --git a/chrome/browser/extensions/extension_devtools_manager.h b/chrome/browser/extensions/extension_devtools_manager.h
index 35e7cec..f1337ef 100644
--- a/chrome/browser/extensions/extension_devtools_manager.h
+++ b/chrome/browser/extensions/extension_devtools_manager.h
@@ -34,7 +34,6 @@ class ExtensionDevToolsManager
public:
// UI thread only:
explicit ExtensionDevToolsManager(Profile* profile);
- ~ExtensionDevToolsManager();
void AddEventListener(const std::string& event_name,
int render_process_id);
@@ -45,6 +44,9 @@ class ExtensionDevToolsManager
void BridgeClosingForTab(int tab_id);
private:
+ friend class base::RefCountedThreadSafe<ExtensionDevToolsManager>;
+
+ ~ExtensionDevToolsManager();
// Map of tab IDs to the ExtensionDevToolsBridge connected to the tab
std::map<int, linked_ptr<ExtensionDevToolsBridge> > tab_id_to_bridge_;
diff --git a/chrome/browser/extensions/extension_disabled_infobar_delegate.cc b/chrome/browser/extensions/extension_disabled_infobar_delegate.cc
index 0d0d7b4..44f819f 100644
--- a/chrome/browser/extensions/extension_disabled_infobar_delegate.cc
+++ b/chrome/browser/extensions/extension_disabled_infobar_delegate.cc
@@ -37,9 +37,6 @@ class ExtensionDisabledDialogDelegate
NewRunnableMethod(this, &ExtensionDisabledDialogDelegate::Start));
}
- virtual ~ExtensionDisabledDialogDelegate() {
- }
-
// ExtensionInstallUI::Delegate
virtual void ContinueInstall() {
service_->EnableExtension(extension_->id());
@@ -51,6 +48,10 @@ class ExtensionDisabledDialogDelegate
}
private:
+ friend class base::RefCountedThreadSafe<ExtensionDisabledDialogDelegate>;
+
+ virtual ~ExtensionDisabledDialogDelegate() {}
+
void Start() {
// We start on the file thread so we can decode the install icon.
FilePath install_icon_path = install_icon_resource_.GetFilePath();
diff --git a/chrome/browser/extensions/extension_function.h b/chrome/browser/extensions/extension_function.h
index e8a77dd..2766eb7 100644
--- a/chrome/browser/extensions/extension_function.h
+++ b/chrome/browser/extensions/extension_function.h
@@ -33,7 +33,6 @@ class Profile;
class ExtensionFunction : public base::RefCounted<ExtensionFunction> {
public:
ExtensionFunction() : request_id_(-1), name_(""), has_callback_(false) {}
- virtual ~ExtensionFunction() {}
// Specifies the name of the function.
void set_name(const std::string& name) { name_ = name; }
@@ -69,6 +68,10 @@ class ExtensionFunction : public base::RefCounted<ExtensionFunction> {
virtual void Run() = 0;
protected:
+ friend class base::RefCounted<ExtensionFunction>;
+
+ virtual ~ExtensionFunction() {}
+
// Gets the extension that called this function. This can return NULL for
// async functions.
Extension* GetExtension() {
@@ -91,7 +94,6 @@ class ExtensionFunction : public base::RefCounted<ExtensionFunction> {
// of this call.
bool has_callback_;
- private:
DISALLOW_COPY_AND_ASSIGN(ExtensionFunction);
};
@@ -104,7 +106,6 @@ class ExtensionFunction : public base::RefCounted<ExtensionFunction> {
class AsyncExtensionFunction : public ExtensionFunction {
public:
AsyncExtensionFunction() : args_(NULL), bad_message_(false) {}
- virtual ~AsyncExtensionFunction() {}
virtual void SetArgs(const Value* args);
virtual const std::string GetResult();
@@ -119,6 +120,8 @@ class AsyncExtensionFunction : public ExtensionFunction {
virtual bool RunImpl() = 0;
protected:
+ virtual ~AsyncExtensionFunction() {}
+
void SendResponse(bool success);
// Note: After Run() returns, dispatcher() can be NULL. Since these getters
@@ -141,7 +144,6 @@ class AsyncExtensionFunction : public ExtensionFunction {
// returning. The calling renderer process will be killed.
bool bad_message_;
- private:
DISALLOW_COPY_AND_ASSIGN(AsyncExtensionFunction);
};
@@ -164,6 +166,9 @@ class SyncExtensionFunction : public AsyncExtensionFunction {
SendResponse(RunImpl());
}
+ protected:
+ virtual ~SyncExtensionFunction() {}
+
private:
DISALLOW_COPY_AND_ASSIGN(SyncExtensionFunction);
};
diff --git a/chrome/browser/extensions/extension_function_dispatcher.h b/chrome/browser/extensions/extension_function_dispatcher.h
index b987e0e..16a9fb3 100644
--- a/chrome/browser/extensions/extension_function_dispatcher.h
+++ b/chrome/browser/extensions/extension_function_dispatcher.h
@@ -37,9 +37,15 @@ class ExtensionFunctionDispatcher {
// The peer object allows us to notify ExtensionFunctions when we are
// destroyed.
+ // TODO: this should use WeakPtr
struct Peer : public base::RefCounted<Peer> {
Peer(ExtensionFunctionDispatcher* dispatcher) : dispatcher_(dispatcher) {}
ExtensionFunctionDispatcher* dispatcher_;
+
+ private:
+ friend class base::RefCounted<Peer>;
+
+ ~Peer() {}
};
// Gets a list of all known extension function names.
diff --git a/chrome/browser/extensions/extension_i18n_api.h b/chrome/browser/extensions/extension_i18n_api.h
index b7e0cd9..275c882 100644
--- a/chrome/browser/extensions/extension_i18n_api.h
+++ b/chrome/browser/extensions/extension_i18n_api.h
@@ -8,6 +8,7 @@
#include "chrome/browser/extensions/extension_function.h"
class GetAcceptLanguagesFunction : public SyncExtensionFunction {
+ ~GetAcceptLanguagesFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("i18n.getAcceptLanguages")
};
diff --git a/chrome/browser/extensions/extension_message_service.h b/chrome/browser/extensions/extension_message_service.h
index cf52b65..9451381 100644
--- a/chrome/browser/extensions/extension_message_service.h
+++ b/chrome/browser/extensions/extension_message_service.h
@@ -62,7 +62,6 @@ class ExtensionMessageService
// --- UI thread only:
explicit ExtensionMessageService(Profile* profile);
- ~ExtensionMessageService();
// Notification that our owning profile is going away.
void ProfileDestroyed();
@@ -128,9 +127,13 @@ class ExtensionMessageService
ResourceMessageFilter* source);
private:
+ friend class base::RefCountedThreadSafe<ExtensionMessageService>;
+
// A map of channel ID to its channel object.
typedef std::map<int, MessageChannel*> MessageChannelMap;
+ ~ExtensionMessageService();
+
// Allocates a pair of port ids.
// NOTE: this can be called from any thread.
void AllocatePortIdPair(int* port1, int* port2);
diff --git a/chrome/browser/extensions/extension_page_actions_module.h b/chrome/browser/extensions/extension_page_actions_module.h
index 42225fc..8c0e291 100644
--- a/chrome/browser/extensions/extension_page_actions_module.h
+++ b/chrome/browser/extensions/extension_page_actions_module.h
@@ -12,6 +12,7 @@ class ExtensionAction;
class PageActionFunction : public SyncExtensionFunction {
protected:
+ virtual ~PageActionFunction() {}
bool SetPageActionEnabled(bool enable);
bool InitCommon(int tab_id);
@@ -22,46 +23,55 @@ class PageActionFunction : public SyncExtensionFunction {
};
class EnablePageActionFunction : public PageActionFunction {
+ ~EnablePageActionFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("pageActions.enableForTab")
};
class DisablePageActionFunction : public PageActionFunction {
+ ~DisablePageActionFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("pageActions.disableForTab")
};
class PageActionShowFunction : public PageActionFunction {
+ ~PageActionShowFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("pageAction.show")
};
class PageActionHideFunction : public PageActionFunction {
+ ~PageActionHideFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("pageAction.hide")
};
class PageActionSetIconFunction : public PageActionFunction {
+ ~PageActionSetIconFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("pageAction.setIcon")
};
class PageActionSetTitleFunction : public PageActionFunction {
+ ~PageActionSetTitleFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("pageAction.setTitle")
};
class PageActionSetBadgeBackgroundColorFunction : public PageActionFunction {
+ ~PageActionSetBadgeBackgroundColorFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("pageAction.setBadgeBackgroundColor")
};
class PageActionSetBadgeTextColorFunction : public PageActionFunction {
+ ~PageActionSetBadgeTextColorFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("pageAction.setBadgeTextColor")
};
class PageActionSetBadgeTextFunction : public PageActionFunction {
+ ~PageActionSetBadgeTextFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("pageAction.setBadgeText")
};
diff --git a/chrome/browser/extensions/extension_tabs_module.h b/chrome/browser/extensions/extension_tabs_module.h
index 05fdcf3..1fa7f21 100644
--- a/chrome/browser/extensions/extension_tabs_module.h
+++ b/chrome/browser/extensions/extension_tabs_module.h
@@ -51,66 +51,81 @@ class ExtensionTabUtil {
// Windows
class GetWindowFunction : public SyncExtensionFunction {
+ ~GetWindowFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("windows.get")
};
class GetCurrentWindowFunction : public SyncExtensionFunction {
+ ~GetCurrentWindowFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("windows.getCurrent")
};
class GetLastFocusedWindowFunction : public SyncExtensionFunction {
+ ~GetLastFocusedWindowFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("windows.getLastFocused")
};
class GetAllWindowsFunction : public SyncExtensionFunction {
+ ~GetAllWindowsFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("windows.getAll")
};
class CreateWindowFunction : public SyncExtensionFunction {
+ ~CreateWindowFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("windows.create")
};
class UpdateWindowFunction : public SyncExtensionFunction {
+ ~UpdateWindowFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("windows.update")
};
class RemoveWindowFunction : public SyncExtensionFunction {
+ ~RemoveWindowFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("windows.remove")
};
// Tabs
class GetTabFunction : public SyncExtensionFunction {
+ ~GetTabFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("tabs.get")
};
class GetSelectedTabFunction : public SyncExtensionFunction {
+ ~GetSelectedTabFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("tabs.getSelected")
};
class GetAllTabsInWindowFunction : public SyncExtensionFunction {
+ ~GetAllTabsInWindowFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("tabs.getAllInWindow")
};
class CreateTabFunction : public SyncExtensionFunction {
+ ~CreateTabFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("tabs.create")
};
class UpdateTabFunction : public SyncExtensionFunction {
+ ~UpdateTabFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("tabs.update")
};
class MoveTabFunction : public SyncExtensionFunction {
+ ~MoveTabFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("tabs.move")
};
class RemoveTabFunction : public SyncExtensionFunction {
+ ~RemoveTabFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("tabs.remove")
};
class DetectTabLanguageFunction : public AsyncExtensionFunction,
public NotificationObserver {
private:
+ ~DetectTabLanguageFunction() {}
virtual bool RunImpl();
virtual void Observe(NotificationType type,
@@ -120,6 +135,7 @@ class DetectTabLanguageFunction : public AsyncExtensionFunction,
DECLARE_EXTENSION_FUNCTION_NAME("tabs.detectLanguage")
};
class CaptureVisibleTabFunction : public SyncExtensionFunction {
+ ~CaptureVisibleTabFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("tabs.captureVisibleTab")
};
diff --git a/chrome/browser/extensions/extension_test_api.h b/chrome/browser/extensions/extension_test_api.h
index 6ab6857..79adf13 100644
--- a/chrome/browser/extensions/extension_test_api.h
+++ b/chrome/browser/extensions/extension_test_api.h
@@ -8,19 +8,21 @@
#include "chrome/browser/extensions/extension_function.h"
class ExtensionTestPassFunction : public SyncExtensionFunction {
+ ~ExtensionTestPassFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("test.notifyPass")
};
class ExtensionTestFailFunction : public SyncExtensionFunction {
+ ~ExtensionTestFailFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("test.notifyFail")
};
class ExtensionTestLogFunction : public SyncExtensionFunction {
+ ~ExtensionTestLogFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("test.log")
};
#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TEST_API_H_
-
diff --git a/chrome/browser/extensions/extension_toolstrip_api.h b/chrome/browser/extensions/extension_toolstrip_api.h
index 6f648bb..cd4c5e0 100644
--- a/chrome/browser/extensions/extension_toolstrip_api.h
+++ b/chrome/browser/extensions/extension_toolstrip_api.h
@@ -17,6 +17,7 @@ namespace extension_toolstrip_api_events {
class ToolstripFunction : public SyncExtensionFunction {
protected:
+ virtual ~ToolstripFunction() {}
virtual bool RunImpl();
ExtensionShelfModel* model_;
@@ -24,11 +25,13 @@ class ToolstripFunction : public SyncExtensionFunction {
};
class ToolstripExpandFunction : public ToolstripFunction {
+ ~ToolstripExpandFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("toolstrip.expand")
};
class ToolstripCollapseFunction : public ToolstripFunction {
+ ~ToolstripCollapseFunction() {}
virtual bool RunImpl();
DECLARE_EXTENSION_FUNCTION_NAME("toolstrip.collapse")
};
diff --git a/chrome/browser/extensions/extension_updater.cc b/chrome/browser/extensions/extension_updater.cc
index a546b23..7cf0e4d 100644
--- a/chrome/browser/extensions/extension_updater.cc
+++ b/chrome/browser/extensions/extension_updater.cc
@@ -95,6 +95,11 @@ class ExtensionUpdaterFileHandler
LOG(WARNING) << "Failed to delete temp file " << path.value();
}
}
+
+ private:
+ friend class base::RefCountedThreadSafe<ExtensionUpdaterFileHandler>;
+
+ ~ExtensionUpdaterFileHandler() {}
};
diff --git a/chrome/browser/extensions/extension_updater.h b/chrome/browser/extensions/extension_updater.h
index ed6ab2c..84a5a0e 100644
--- a/chrome/browser/extensions/extension_updater.h
+++ b/chrome/browser/extensions/extension_updater.h
@@ -44,8 +44,6 @@ class ExtensionUpdater
PrefService* prefs,
int frequency_seconds);
- virtual ~ExtensionUpdater();
-
// Starts the updater running.
void Start();
@@ -63,10 +61,12 @@ class ExtensionUpdater
}
private:
+ friend class base::RefCountedThreadSafe<ExtensionUpdater>;
friend class ExtensionUpdaterTest;
friend class ExtensionUpdaterFileHandler;
friend class SafeManifestParser;
+ virtual ~ExtensionUpdater();
// We need to keep track of some information associated with a url
// when doing a fetch.
diff --git a/chrome/browser/extensions/extensions_service.h b/chrome/browser/extensions/extensions_service.h
index 55e336d..a73263d 100644
--- a/chrome/browser/extensions/extensions_service.h
+++ b/chrome/browser/extensions/extensions_service.h
@@ -83,7 +83,6 @@ class ExtensionsService
PrefService* prefs,
const FilePath& install_directory,
bool autoupdate_enabled);
- virtual ~ExtensionsService();
// Gets the list of currently installed extensions.
virtual const ExtensionList* extensions() const { return &extensions_; }
@@ -228,6 +227,10 @@ class ExtensionsService
virtual std::vector<FilePath> GetTransientBlacklistPaths();
private:
+ friend class base::RefCountedThreadSafe<ExtensionsService>;
+
+ virtual ~ExtensionsService();
+
// Look up an extension by ID, optionally including either or both of enabled
// and disabled extensions.
Extension* GetExtensionByIdInternal(const std::string& id,
@@ -290,8 +293,6 @@ class ExtensionsServiceBackend
// preferences.
ExtensionsServiceBackend(const FilePath& install_directory);
- virtual ~ExtensionsServiceBackend();
-
// Loads a single extension from |path| where |path| is the top directory of
// a specific extension where its manifest file lives.
// Errors are reported through ExtensionErrorReporter. On success,
@@ -327,6 +328,10 @@ class ExtensionsServiceBackend
const FilePath& path,
Extension::Location location);
private:
+ friend class base::RefCountedThreadSafe<ExtensionsServiceBackend>;
+
+ virtual ~ExtensionsServiceBackend();
+
// Finish installing the extension in |crx_path| after it has been unpacked to
// |unpacked_path|. If |expected_id| is not empty, it's verified against the
// extension's manifest before installation. If |silent| is true, there will
diff --git a/chrome/browser/extensions/extensions_ui.h b/chrome/browser/extensions/extensions_ui.h
index 6023255..352e42c 100644
--- a/chrome/browser/extensions/extensions_ui.h
+++ b/chrome/browser/extensions/extensions_ui.h
@@ -48,6 +48,8 @@ class ExtensionsUIHTMLSource : public ChromeURLDataManager::DataSource {
}
private:
+ ~ExtensionsUIHTMLSource() {}
+
DISALLOW_COPY_AND_ASSIGN(ExtensionsUIHTMLSource);
};
diff --git a/chrome/browser/extensions/file_reader.h b/chrome/browser/extensions/file_reader.h
index 008450e..7ca6309 100644
--- a/chrome/browser/extensions/file_reader.h
+++ b/chrome/browser/extensions/file_reader.h
@@ -29,6 +29,10 @@ class FileReader : public base::RefCountedThreadSafe<FileReader> {
void Start();
private:
+ friend class base::RefCountedThreadSafe<FileReader>;
+
+ ~FileReader() {}
+
void ReadFileOnBackgroundThread();
void RunCallback(bool success, const std::string& data);
diff --git a/chrome/browser/extensions/image_loading_tracker.h b/chrome/browser/extensions/image_loading_tracker.h
index a56aaeb..23f7b71 100644
--- a/chrome/browser/extensions/image_loading_tracker.h
+++ b/chrome/browser/extensions/image_loading_tracker.h
@@ -37,7 +37,6 @@ class ImageLoadingTracker
// get deleted until we get a response from image loading (see
// ImageLoadingDone).
}
- ~ImageLoadingTracker() {}
// If there are remaining images to be loaded, the observing object should
// call this method on its destruction, so that the tracker will not attempt
@@ -56,6 +55,10 @@ class ImageLoadingTracker
private:
class LoadImageTask;
+ friend class base::RefCountedThreadSafe<ImageLoadingTracker>;
+
+ ~ImageLoadingTracker() {}
+
// When an image has finished loaded and scaled on the file thread, it is
// posted back to this method on the original thread. This method then calls
// the observer's OnImageLoaded and deletes the ImageLoadingTracker if it was
diff --git a/chrome/browser/extensions/pack_extension_job.h b/chrome/browser/extensions/pack_extension_job.h
index 8a40692..526d16d 100644
--- a/chrome/browser/extensions/pack_extension_job.h
+++ b/chrome/browser/extensions/pack_extension_job.h
@@ -34,6 +34,10 @@ class PackExtensionJob : public base::RefCountedThreadSafe<PackExtensionJob> {
void ClearClient();
private:
+ friend class base::RefCountedThreadSafe<PackExtensionJob>;
+
+ ~PackExtensionJob() {}
+
void RunOnFileThread();
void ReportSuccessOnUIThread();
void ReportFailureOnUIThread(const std::string& error);
diff --git a/chrome/browser/extensions/sandboxed_extension_unpacker.h b/chrome/browser/extensions/sandboxed_extension_unpacker.h
index 91cd67f..b5f1741 100644
--- a/chrome/browser/extensions/sandboxed_extension_unpacker.h
+++ b/chrome/browser/extensions/sandboxed_extension_unpacker.h
@@ -20,9 +20,6 @@ class ResourceDispatcherHost;
class SandboxedExtensionUnpackerClient
: public base::RefCountedThreadSafe<SandboxedExtensionUnpackerClient> {
public:
- virtual ~SandboxedExtensionUnpackerClient(){
- }
-
// temp_dir - A temporary directoy containing the results of the extension
// unpacking. The client is responsible for deleting this directory.
//
@@ -34,6 +31,11 @@ class SandboxedExtensionUnpackerClient
const FilePath& extension_root,
Extension* extension) = 0;
virtual void OnUnpackFailure(const std::string& error) = 0;
+
+ protected:
+ friend class base::RefCountedThreadSafe<SandboxedExtensionUnpackerClient>;
+
+ virtual ~SandboxedExtensionUnpackerClient() {}
};
// SandboxedExtensionUnpacker unpacks extensions from the CRX format into a
diff --git a/chrome/browser/extensions/user_script_listener.h b/chrome/browser/extensions/user_script_listener.h
index 303e354..7c22b53 100644
--- a/chrome/browser/extensions/user_script_listener.h
+++ b/chrome/browser/extensions/user_script_listener.h
@@ -36,8 +36,12 @@ class UserScriptListener
bool ShouldStartRequest(URLRequest* request);
private:
+ friend class base::RefCountedThreadSafe<UserScriptListener>;
+
typedef std::list<URLPattern> URLPatterns;
+ ~UserScriptListener() {}
+
// Resume any requests that we delayed in order to wait for user scripts.
void StartDelayedRequests();
diff --git a/chrome/browser/extensions/user_script_listener_unittest.cc b/chrome/browser/extensions/user_script_listener_unittest.cc
index 980c3c9..e36a05f 100644
--- a/chrome/browser/extensions/user_script_listener_unittest.cc
+++ b/chrome/browser/extensions/user_script_listener_unittest.cc
@@ -42,6 +42,9 @@ class MockUserScriptMaster : public UserScriptMaster {
void TestStartScan() {
UserScriptMaster::StartScan();
}
+
+ private:
+ ~MockUserScriptMaster() {}
};
class MockIOThread : public ChromeThread {
diff --git a/chrome/browser/extensions/user_script_master.h b/chrome/browser/extensions/user_script_master.h
index 270a690..a8c3fa6 100644
--- a/chrome/browser/extensions/user_script_master.h
+++ b/chrome/browser/extensions/user_script_master.h
@@ -29,7 +29,6 @@ class UserScriptMaster : public base::RefCountedThreadSafe<UserScriptMaster>,
// For testability, the constructor takes the path the scripts live in.
// This is normally a directory inside the profile.
UserScriptMaster(const FilePath& script_dir);
- virtual ~UserScriptMaster();
// Add a watched directory. All scripts will be reloaded when any file in
// this directory changes.
@@ -53,6 +52,11 @@ class UserScriptMaster : public base::RefCountedThreadSafe<UserScriptMaster>,
// Returns the path to the directory user scripts are stored in.
FilePath user_script_dir() const { return user_script_dir_; }
+ protected:
+ friend class base::RefCountedThreadSafe<UserScriptMaster>;
+
+ virtual ~UserScriptMaster();
+
private:
FRIEND_TEST(UserScriptMasterTest, Parse1);
FRIEND_TEST(UserScriptMasterTest, Parse2);
@@ -91,6 +95,10 @@ class UserScriptMaster : public base::RefCountedThreadSafe<UserScriptMaster>,
}
private:
+ friend class base::RefCountedThreadSafe<UserScriptMaster::ScriptReloader>;
+
+ ~ScriptReloader() {}
+
// Where functions are run:
// master file
// StartScan -> RunScan
diff --git a/chrome/browser/process_singleton_linux.cc b/chrome/browser/process_singleton_linux.cc
index af2a519..046d7f9 100644
--- a/chrome/browser/process_singleton_linux.cc
+++ b/chrome/browser/process_singleton_linux.cc
@@ -402,10 +402,6 @@ class ProcessSingleton::LinuxWatcher
parent_(parent) {
}
- virtual ~LinuxWatcher() {
- STLDeleteElements(&readers_);
- }
-
// Start listening for connections on the socket. This method should be
// called from the IO thread.
void StartListening(int socket);
@@ -430,6 +426,12 @@ class ProcessSingleton::LinuxWatcher
}
private:
+ friend class base::RefCountedThreadSafe<ProcessSingleton::LinuxWatcher>;
+
+ virtual ~LinuxWatcher() {
+ STLDeleteElements(&readers_);
+ }
+
// Removes and deletes the SocketReader.
void RemoveSocketReader(SocketReader* reader);
diff --git a/chrome/browser/sync/sync_setup_wizard.cc b/chrome/browser/sync/sync_setup_wizard.cc
index 645c931..b05fe30 100644
--- a/chrome/browser/sync/sync_setup_wizard.cc
+++ b/chrome/browser/sync/sync_setup_wizard.cc
@@ -23,7 +23,6 @@ class SyncResourcesSource : public ChromeURLDataManager::DataSource {
SyncResourcesSource()
: DataSource(chrome::kSyncResourcesHost, MessageLoop::current()) {
}
- virtual ~SyncResourcesSource() { }
virtual void StartDataRequest(const std::string& path, int request_id);
@@ -33,7 +32,10 @@ class SyncResourcesSource : public ChromeURLDataManager::DataSource {
else
return "text/html";
}
+
private:
+ virtual ~SyncResourcesSource() {}
+
DISALLOW_COPY_AND_ASSIGN(SyncResourcesSource);
};