summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos
diff options
context:
space:
mode:
authorrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-25 19:59:41 +0000
committerrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-25 19:59:41 +0000
commit886d3721640dd202ac15c4944e4686bd1cf7f16d (patch)
treef7837588365e131342619d68b3934924c70d0f7a /chrome/browser/chromeos
parente59f00ea94e2642034881cd3d94d9ac1afa02df8 (diff)
downloadchromium_src-886d3721640dd202ac15c4944e4686bd1cf7f16d.zip
chromium_src-886d3721640dd202ac15c4944e4686bd1cf7f16d.tar.gz
chromium_src-886d3721640dd202ac15c4944e4686bd1cf7f16d.tar.bz2
RefCounted types should not have public destructors, chromeos edition
BUG=123295 TEST=none Review URL: https://chromiumcodereview.appspot.com/10386206 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143987 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos')
-rw-r--r--chrome/browser/chromeos/extensions/file_browser_event_router.h3
-rw-r--r--chrome/browser/chromeos/extensions/file_browser_handler_api.cc58
-rw-r--r--chrome/browser/chromeos/extensions/file_browser_handler_api.h6
-rw-r--r--chrome/browser/chromeos/extensions/file_browser_notifications.cc3
-rw-r--r--chrome/browser/chromeos/extensions/file_browser_private_api.cc8
-rw-r--r--chrome/browser/chromeos/extensions/file_browser_private_api.h230
-rw-r--r--chrome/browser/chromeos/extensions/file_handler_util.h3
-rw-r--r--chrome/browser/chromeos/gdata/gdata_file_system_proxy.cc10
-rw-r--r--chrome/browser/chromeos/gdata/gdata_file_system_proxy.h4
-rw-r--r--chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc7
-rw-r--r--chrome/browser/chromeos/gdata/gdata_protocol_handler.cc14
-rw-r--r--chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.cc3
-rw-r--r--chrome/browser/chromeos/locale_change_guard.cc3
-rw-r--r--chrome/browser/chromeos/login/authenticator.cc3
-rw-r--r--chrome/browser/chromeos/login/authenticator.h5
-rw-r--r--chrome/browser/chromeos/login/help_app_launcher.cc7
-rw-r--r--chrome/browser/chromeos/login/help_app_launcher.h5
-rw-r--r--chrome/browser/chromeos/login/login_utils.cc4
-rw-r--r--chrome/browser/chromeos/login/mock_authenticator.h3
-rw-r--r--chrome/browser/chromeos/login/owner_manager.cc6
-rw-r--r--chrome/browser/chromeos/login/owner_manager.h8
-rw-r--r--chrome/browser/chromeos/login/parallel_authenticator.cc4
-rw-r--r--chrome/browser/chromeos/login/parallel_authenticator.h4
-rw-r--r--chrome/browser/chromeos/login/signed_settings.cc94
-rw-r--r--chrome/browser/chromeos/login/signed_settings.h4
-rw-r--r--chrome/browser/chromeos/low_memory_observer.cc9
-rw-r--r--chrome/browser/chromeos/media/media_player_extension_api.h24
-rw-r--r--chrome/browser/chromeos/mobile/mobile_activator.cc22
-rw-r--r--chrome/browser/chromeos/mobile/mobile_activator.h4
-rw-r--r--chrome/browser/chromeos/notifications/system_notification.cc2
-rw-r--r--chrome/browser/chromeos/notifications/system_notification.h3
-rw-r--r--chrome/browser/chromeos/web_socket_proxy.cc2
32 files changed, 335 insertions, 230 deletions
diff --git a/chrome/browser/chromeos/extensions/file_browser_event_router.h b/chrome/browser/chromeos/extensions/file_browser_event_router.h
index d6a2c37..6fd9cd2 100644
--- a/chrome/browser/chromeos/extensions/file_browser_event_router.h
+++ b/chrome/browser/chromeos/extensions/file_browser_event_router.h
@@ -92,6 +92,9 @@ class FileBrowserEventRouter
public:
explicit FileWatcherDelegate(FileBrowserEventRouter* router);
+ protected:
+ virtual ~FileWatcherDelegate() {}
+
private:
// base::files::FilePathWatcher::Delegate overrides.
virtual void OnFilePathChanged(const FilePath& path) OVERRIDE;
diff --git a/chrome/browser/chromeos/extensions/file_browser_handler_api.cc b/chrome/browser/chromeos/extensions/file_browser_handler_api.cc
index 0bd0ee5..bafb685 100644
--- a/chrome/browser/chromeos/extensions/file_browser_handler_api.cc
+++ b/chrome/browser/chromeos/extensions/file_browser_handler_api.cc
@@ -179,6 +179,35 @@ void RelayOpenFileSystemCallbackToFileThread(
FileHandlerSelectFileFunction::FileHandlerSelectFileFunction() {}
+void FileHandlerSelectFileFunction::OnFilePathSelected(
+ bool success,
+ const FilePath& full_path) {
+ if (!success) {
+ Respond(false, std::string(), GURL(), FilePath());
+ return;
+ }
+
+ full_path_ = full_path;
+
+ BrowserContext::GetFileSystemContext(profile_)->OpenFileSystem(
+ source_url_.GetOrigin(), fileapi::kFileSystemTypeExternal, false,
+ base::Bind(&RelayOpenFileSystemCallbackToFileThread,
+ base::Bind(&FileHandlerSelectFileFunction::CreateFileOnFileThread,
+ this)));
+};
+
+// static
+void FileHandlerSelectFileFunction::set_file_selector_for_test(
+ FileSelector* file_selector) {
+ FileHandlerSelectFileFunction::file_selector_for_test_ = file_selector;
+}
+
+// static
+void FileHandlerSelectFileFunction::set_gesture_check_disabled_for_test(
+ bool disabled) {
+ FileHandlerSelectFileFunction::gesture_check_disabled_for_test_ = disabled;
+}
+
FileHandlerSelectFileFunction::~FileHandlerSelectFileFunction() {}
bool FileHandlerSelectFileFunction::RunImpl() {
@@ -198,35 +227,6 @@ bool FileHandlerSelectFileFunction::RunImpl() {
return true;
}
-// static
-void FileHandlerSelectFileFunction::set_file_selector_for_test(
- FileSelector* file_selector) {
- FileHandlerSelectFileFunction::file_selector_for_test_ = file_selector;
-}
-
-// static
-void FileHandlerSelectFileFunction::set_gesture_check_disabled_for_test(
- bool disabled) {
- FileHandlerSelectFileFunction::gesture_check_disabled_for_test_ = disabled;
-}
-
-void FileHandlerSelectFileFunction::OnFilePathSelected(
- bool success,
- const FilePath& full_path) {
- if (!success) {
- Respond(false, std::string(), GURL(), FilePath());
- return;
- }
-
- full_path_ = full_path;
-
- BrowserContext::GetFileSystemContext(profile_)->OpenFileSystem(
- source_url_.GetOrigin(), fileapi::kFileSystemTypeExternal, false,
- base::Bind(&RelayOpenFileSystemCallbackToFileThread,
- base::Bind(&FileHandlerSelectFileFunction::CreateFileOnFileThread,
- this)));
-};
-
void FileHandlerSelectFileFunction::CreateFileOnFileThread(
bool success,
const std::string& file_system_name,
diff --git a/chrome/browser/chromeos/extensions/file_browser_handler_api.h b/chrome/browser/chromeos/extensions/file_browser_handler_api.h
index 407811c..f9a1562 100644
--- a/chrome/browser/chromeos/extensions/file_browser_handler_api.h
+++ b/chrome/browser/chromeos/extensions/file_browser_handler_api.h
@@ -32,8 +32,9 @@ class FileSelector {
class FileHandlerSelectFileFunction : public AsyncExtensionFunction {
public:
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserHandlerInternal.selectFile");
+
FileHandlerSelectFileFunction();
- virtual ~FileHandlerSelectFileFunction() OVERRIDE;
// Called by FileSelector implementation when the user selects new file's
// file path.
@@ -47,6 +48,7 @@ class FileHandlerSelectFileFunction : public AsyncExtensionFunction {
static void set_gesture_check_disabled_for_test(bool disabled);
protected:
+ virtual ~FileHandlerSelectFileFunction() OVERRIDE;
virtual bool RunImpl() OVERRIDE;
private:
@@ -87,8 +89,6 @@ class FileHandlerSelectFileFunction : public AsyncExtensionFunction {
// Once set they will be used for every extension function call.
static file_handler::FileSelector* file_selector_for_test_;
static bool gesture_check_disabled_for_test_;
-
- DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserHandlerInternal.selectFile");
};
#endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_HANDLER_API_H_
diff --git a/chrome/browser/chromeos/extensions/file_browser_notifications.cc b/chrome/browser/chromeos/extensions/file_browser_notifications.cc
index 97800c0..9f75b64 100644
--- a/chrome/browser/chromeos/extensions/file_browser_notifications.cc
+++ b/chrome/browser/chromeos/extensions/file_browser_notifications.cc
@@ -104,7 +104,6 @@ class FileBrowserNotifications::NotificationMessage {
const std::string& id)
: host_(host),
id_(id) {}
- virtual ~Delegate() {}
virtual void Display() OVERRIDE {}
virtual void Error() OVERRIDE {}
virtual void Close(bool by_user) OVERRIDE {
@@ -120,6 +119,8 @@ class FileBrowserNotifications::NotificationMessage {
}
private:
+ virtual ~Delegate() {}
+
base::WeakPtr<FileBrowserNotifications> host_;
std::string id_;
diff --git a/chrome/browser/chromeos/extensions/file_browser_private_api.cc b/chrome/browser/chromeos/extensions/file_browser_private_api.cc
index 2759457..92cd024 100644
--- a/chrome/browser/chromeos/extensions/file_browser_private_api.cc
+++ b/chrome/browser/chromeos/extensions/file_browser_private_api.cc
@@ -690,6 +690,10 @@ bool GetFileTasksFileBrowserFunction::RunImpl() {
ExecuteTasksFileBrowserFunction::ExecuteTasksFileBrowserFunction() {}
+void ExecuteTasksFileBrowserFunction::OnTaskExecuted(bool success) {
+ SendResponse(success);
+}
+
ExecuteTasksFileBrowserFunction::~ExecuteTasksFileBrowserFunction() {}
bool ExecuteTasksFileBrowserFunction::RunImpl() {
@@ -742,10 +746,6 @@ bool ExecuteTasksFileBrowserFunction::RunImpl() {
return true;
}
-void ExecuteTasksFileBrowserFunction::OnTaskExecuted(bool success) {
- SendResponse(success);
-}
-
SetDefaultTaskFileBrowserFunction::SetDefaultTaskFileBrowserFunction() {}
SetDefaultTaskFileBrowserFunction::~SetDefaultTaskFileBrowserFunction() {}
diff --git a/chrome/browser/chromeos/extensions/file_browser_private_api.h b/chrome/browser/chromeos/extensions/file_browser_private_api.h
index a223341..2a43e54 100644
--- a/chrome/browser/chromeos/extensions/file_browser_private_api.h
+++ b/chrome/browser/chromeos/extensions/file_browser_private_api.h
@@ -30,7 +30,12 @@ struct SearchResultInfo;
// Implements the chrome.fileBrowserPrivate.requestLocalFileSystem method.
class RequestLocalFileSystemFunction : public AsyncExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.requestLocalFileSystem");
+
protected:
+ virtual ~RequestLocalFileSystemFunction() {}
+
// AsyncExtensionFunction overrides.
virtual bool RunImpl() OVERRIDE;
@@ -41,12 +46,13 @@ class RequestLocalFileSystemFunction : public AsyncExtensionFunction {
const GURL& root_path);
void RespondFailedOnUIThread(base::PlatformFileError error_code);
void RequestOnFileThread(const GURL& source_url, int child_id);
- DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.requestLocalFileSystem");
};
// Implements the chrome.fileBrowserPrivate.addFileWatch method.
class FileWatchBrowserFunctionBase : public AsyncExtensionFunction {
protected:
+ virtual ~FileWatchBrowserFunctionBase() {}
+
virtual bool PerformFileWatchOperation(
scoped_refptr<FileBrowserEventRouter> event_router,
const FilePath& local_path, const FilePath& virtual_path,
@@ -67,69 +73,77 @@ class FileWatchBrowserFunctionBase : public AsyncExtensionFunction {
// Implements the chrome.fileBrowserPrivate.addFileWatch method.
class AddFileWatchBrowserFunction : public FileWatchBrowserFunctionBase {
+ public:
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.addFileWatch");
+
protected:
+ virtual ~AddFileWatchBrowserFunction() {}
+
virtual bool PerformFileWatchOperation(
scoped_refptr<FileBrowserEventRouter> event_router,
const FilePath& local_path, const FilePath& virtual_path,
const std::string& extension_id) OVERRIDE;
-
- private:
- DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.addFileWatch");
};
// Implements the chrome.fileBrowserPrivate.removeFileWatch method.
class RemoveFileWatchBrowserFunction : public FileWatchBrowserFunctionBase {
+ public:
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.removeFileWatch");
+
protected:
+ virtual ~RemoveFileWatchBrowserFunction() {}
+
virtual bool PerformFileWatchOperation(
scoped_refptr<FileBrowserEventRouter> event_router,
const FilePath& local_path, const FilePath& virtual_path,
const std::string& extension_id) OVERRIDE;
-
- private:
- DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.removeFileWatch");
};
// Implements the chrome.fileBrowserPrivate.getFileTasks method.
class GetFileTasksFileBrowserFunction : public AsyncExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.getFileTasks");
+
protected:
+ virtual ~GetFileTasksFileBrowserFunction() {}
+
// AsyncExtensionFunction overrides.
virtual bool RunImpl() OVERRIDE;
private:
bool FindDriveAppTasks(const std::vector<GURL>& file_urls,
ListValue* result_list);
- DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.getFileTasks");
};
// Implements the chrome.fileBrowserPrivate.executeTask method.
class ExecuteTasksFileBrowserFunction : public AsyncExtensionFunction {
public:
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.executeTask");
+
ExecuteTasksFileBrowserFunction();
- virtual ~ExecuteTasksFileBrowserFunction();
void OnTaskExecuted(bool success);
protected:
+ virtual ~ExecuteTasksFileBrowserFunction();
+
// AsyncExtensionFunction overrides.
virtual bool RunImpl() OVERRIDE;
-
- private:
-
- DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.executeTask");
};
// Implements the chrome.fileBrowserPrivate.setDefaultTask method.
class SetDefaultTaskFileBrowserFunction : public SyncExtensionFunction {
public:
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.setDefaultTask");
+
SetDefaultTaskFileBrowserFunction();
- virtual ~SetDefaultTaskFileBrowserFunction();
protected:
+ virtual ~SetDefaultTaskFileBrowserFunction();
+
// AsyncExtensionFunction overrides.
virtual bool RunImpl() OVERRIDE;
-
- DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.setDefaultTask");
};
// Parent class for the chromium extension APIs for the file dialog.
@@ -164,9 +178,10 @@ class FileBrowserFunction
};
// Select a single file. Closes the dialog window.
-class SelectFileFunction
- : public FileBrowserFunction {
+class SelectFileFunction : public FileBrowserFunction {
public:
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.selectFile");
+
SelectFileFunction() {}
protected:
@@ -179,14 +194,13 @@ class SelectFileFunction
// A callback method to handle the result of
// GetLocalPathsOnFileThreadAndRunCallbackOnUIThread.
void GetLocalPathsResponseOnUIThread(const SelectedFileInfoList& files);
-
- DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.selectFile");
};
// View multiple selected files. Window stays open.
-class ViewFilesFunction
- : public FileBrowserFunction {
+class ViewFilesFunction : public FileBrowserFunction {
public:
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.viewFiles");
+
ViewFilesFunction();
protected:
@@ -200,14 +214,13 @@ class ViewFilesFunction
// GetLocalPathsOnFileThreadAndRunCallbackOnUIThread.
void GetLocalPathsResponseOnUIThread(const std::string& internal_task_id,
const SelectedFileInfoList& files);
-
- DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.viewFiles");
};
// Select multiple files. Closes the dialog window.
-class SelectFilesFunction
- : public FileBrowserFunction {
+class SelectFilesFunction : public FileBrowserFunction {
public:
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.selectFiles");
+
SelectFilesFunction();
protected:
@@ -220,14 +233,13 @@ class SelectFilesFunction
// A callback method to handle the result of
// GetLocalPathsOnFileThreadAndRunCallbackOnUIThread.
void GetLocalPathsResponseOnUIThread(const SelectedFileInfoList& files);
-
- DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.selectFiles");
};
// Cancel file selection Dialog. Closes the dialog window.
-class CancelFileDialogFunction
- : public FileBrowserFunction {
+class CancelFileDialogFunction : public FileBrowserFunction {
public:
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.cancelDialog");
+
CancelFileDialogFunction() {}
protected:
@@ -235,15 +247,13 @@ class CancelFileDialogFunction
// AsyncExtensionFunction overrides.
virtual bool RunImpl() OVERRIDE;
-
- private:
- DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.cancelDialog");
};
// Mount a device or a file.
-class AddMountFunction
- : public FileBrowserFunction {
+class AddMountFunction : public FileBrowserFunction {
public:
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.addMount");
+
AddMountFunction();
protected:
@@ -267,14 +277,13 @@ class AddMountFunction
const FilePath::StringType& file_name,
base::PlatformFileError error,
const FilePath& file_path);
-
- DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.addMount");
};
// Unmounts selected device. Expects mount point path as an argument.
-class RemoveMountFunction
- : public FileBrowserFunction {
+class RemoveMountFunction : public FileBrowserFunction {
public:
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.removeMount");
+
RemoveMountFunction();
protected:
@@ -287,13 +296,12 @@ class RemoveMountFunction
// A callback method to handle the result of
// GetLocalPathsOnFileThreadAndRunCallbackOnUIThread.
void GetLocalPathsResponseOnUIThread(const SelectedFileInfoList& files);
-
- DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.removeMount");
};
-class GetMountPointsFunction
- : public AsyncExtensionFunction {
+class GetMountPointsFunction : public AsyncExtensionFunction {
public:
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.getMountPoints");
+
GetMountPointsFunction();
protected:
@@ -301,15 +309,13 @@ class GetMountPointsFunction
// AsyncExtensionFunction overrides.
virtual bool RunImpl() OVERRIDE;
-
- private:
- DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.getMountPoints");
};
// Formats Device given its mount path.
-class FormatDeviceFunction
- : public FileBrowserFunction {
+class FormatDeviceFunction : public FileBrowserFunction {
public:
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.formatDevice");
+
FormatDeviceFunction();
protected:
@@ -322,13 +328,12 @@ class FormatDeviceFunction
// A callback method to handle the result of
// GetLocalPathsOnFileThreadAndRunCallbackOnUIThread.
void GetLocalPathsResponseOnUIThread(const SelectedFileInfoList& files);
-
- DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.formatDevice");
};
-class GetSizeStatsFunction
- : public FileBrowserFunction {
+class GetSizeStatsFunction : public FileBrowserFunction {
public:
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.getSizeStats");
+
GetSizeStatsFunction();
protected:
@@ -346,48 +351,56 @@ class GetSizeStatsFunction
size_t total_size_kb,
size_t remaining_size_kb);
void CallGetSizeStatsOnFileThread(const std::string& mount_path);
-
- DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.getSizeStats");
};
// Retrieves devices meta-data. Expects volume's device path as an argument.
-class GetVolumeMetadataFunction
- : public FileBrowserFunction {
+class GetVolumeMetadataFunction : public FileBrowserFunction {
public:
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.getVolumeMetadata");
+
GetVolumeMetadataFunction();
protected:
virtual ~GetVolumeMetadataFunction();
+ // AsyncExtensionFunction overrides.
virtual bool RunImpl() OVERRIDE;
private:
// A callback method to handle the result of
// GetLocalPathsOnFileThreadAndRunCallbackOnUIThread.
void GetLocalPathsResponseOnUIThread(const SelectedFileInfoList& files);
-
- DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.getVolumeMetadata");
};
// Toggles fullscreen mode for the browser.
class ToggleFullscreenFunction : public SyncExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.toggleFullscreen");
+
protected:
+ virtual ~ToggleFullscreenFunction() {}
+
+ // SyncExtensionFunction overrides.
virtual bool RunImpl() OVERRIDE;
- private:
- DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.toggleFullscreen");
};
// Checks if the browser is in fullscreen mode.
class IsFullscreenFunction : public SyncExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.isFullscreen");
+
protected:
+ virtual ~IsFullscreenFunction() {}
+
+ // SyncExtensionFunction overrides.
virtual bool RunImpl() OVERRIDE;
- private:
- DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.isFullscreen");
};
// File Dialog Strings.
class FileDialogStringsFunction : public SyncExtensionFunction {
public:
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.getStrings");
+
FileDialogStringsFunction() {}
protected:
@@ -395,9 +408,6 @@ class FileDialogStringsFunction : public SyncExtensionFunction {
// SyncExtensionFunction overrides.
virtual bool RunImpl() OVERRIDE;
-
- private:
- DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.getStrings");
};
// Retrieve property information for multiple files, returning a list of the
@@ -406,14 +416,16 @@ class FileDialogStringsFunction : public SyncExtensionFunction {
// (base::PlatformFileError) for that entry in the returned list.
class GetGDataFilePropertiesFunction : public FileBrowserFunction {
public:
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.getGDataFileProperties");
+
GetGDataFilePropertiesFunction();
protected:
+ virtual ~GetGDataFilePropertiesFunction();
+
void GetNextFileProperties();
void CompleteGetFileProperties();
- virtual ~GetGDataFilePropertiesFunction();
-
// Virtual function that can be overridden to do operations on each virtual
// file path and update its the properties.
virtual void DoOperation(const FilePath& file_path,
@@ -444,8 +456,6 @@ class GetGDataFilePropertiesFunction : public FileBrowserFunction {
size_t current_index_;
base::ListValue* path_list_;
scoped_ptr<base::ListValue> file_properties_;
-
- DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.getGDataFileProperties");
};
// Pin/unpin multiple files in the cache, returning a list of file
@@ -456,6 +466,8 @@ class GetGDataFilePropertiesFunction : public FileBrowserFunction {
// returned list.
class PinGDataFileFunction : public GetGDataFilePropertiesFunction {
public:
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.pinGDataFile");
+
PinGDataFileFunction();
protected:
@@ -481,8 +493,6 @@ class PinGDataFileFunction : public GetGDataFilePropertiesFunction {
// True for pin, false for unpin.
bool set_pin_;
-
- DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.pinGDataFile");
};
// Get file locations for the given list of file URLs. Returns a list of
@@ -490,6 +500,8 @@ class PinGDataFileFunction : public GetGDataFilePropertiesFunction {
// file is on gdata, and 'local' means the file is on the local drive.
class GetFileLocationsFunction : public FileBrowserFunction {
public:
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.getFileLocations");
+
GetFileLocationsFunction();
protected:
@@ -502,8 +514,6 @@ class GetFileLocationsFunction : public FileBrowserFunction {
// A callback method to handle the result of
// GetLocalPathsOnFileThreadAndRunCallbackOnUIThread.
void GetLocalPathsResponseOnUIThread(const SelectedFileInfoList& files);
-
- DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.getFileLocations");
};
// Get gdata files for the given list of file URLs. Initiate downloading of
@@ -516,6 +526,8 @@ class GetFileLocationsFunction : public FileBrowserFunction {
// TODO(satorux): Should we propagate error types to the JavasScript layer?
class GetGDataFilesFunction : public FileBrowserFunction {
public:
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.getGDataFiles");
+
GetGDataFilesFunction();
protected:
@@ -542,48 +554,51 @@ class GetGDataFilesFunction : public FileBrowserFunction {
std::queue<FilePath> remaining_gdata_paths_;
ListValue* local_paths_;
-
- DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.getGDataFiles");
};
// Implements the chrome.fileBrowserPrivate.executeTask method.
class GetFileTransfersFunction : public AsyncExtensionFunction {
public:
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.getFileTransfers");
+
GetFileTransfersFunction();
- virtual ~GetFileTransfersFunction();
protected:
+ virtual ~GetFileTransfersFunction();
+
// AsyncExtensionFunction overrides.
virtual bool RunImpl() OVERRIDE;
private:
ListValue* GetFileTransfersList();
-
- DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.getFileTransfers");
};
// Implements the chrome.fileBrowserPrivate.cancelFileTransfers method.
class CancelFileTransfersFunction : public FileBrowserFunction {
public:
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.cancelFileTransfers");
+
CancelFileTransfersFunction();
- virtual ~CancelFileTransfersFunction();
protected:
+ virtual ~CancelFileTransfersFunction();
+
// AsyncExtensionFunction overrides.
virtual bool RunImpl() OVERRIDE;
void GetLocalPathsResponseOnUIThread(const SelectedFileInfoList& files);
- private:
- DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.cancelFileTransfers");
};
// Implements the chrome.fileBrowserPrivate.transferFile method.
class TransferFileFunction : public FileBrowserFunction {
public:
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.transferFile");
+
TransferFileFunction();
- virtual ~TransferFileFunction();
protected:
+ virtual ~TransferFileFunction();
+
// AsyncExtensionFunction overrides.
virtual bool RunImpl() OVERRIDE;
@@ -594,41 +609,52 @@ class TransferFileFunction : public FileBrowserFunction {
// Helper callback for handling response from GDataFileSystem::TransferFile().
void OnTransferCompleted(base::PlatformFileError error);
-
- DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.transferFile");
};
// Read setting value.
class GetGDataPreferencesFunction : public SyncExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.getGDataPreferences");
+
protected:
+ virtual ~GetGDataPreferencesFunction() {}
+
virtual bool RunImpl() OVERRIDE;
- private:
- DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.getGDataPreferences");
};
// Write setting value.
class SetGDataPreferencesFunction : public SyncExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.setGDataPreferences");
+
protected:
+ virtual ~SetGDataPreferencesFunction() {}
+
virtual bool RunImpl() OVERRIDE;
- private:
- DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.setGDataPreferences");
};
class GetPathForDriveSearchResultFunction : public AsyncExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION_NAME(
+ "fileBrowserPrivate.getPathForDriveSearchResult");
+
protected:
+ virtual ~GetPathForDriveSearchResultFunction() {}
+
virtual bool RunImpl() OVERRIDE;
void OnEntryFound(base::PlatformFileError error,
const FilePath& entry_path,
scoped_ptr<gdata::GDataEntryProto> entry_proto);
-
- private:
- DECLARE_EXTENSION_FUNCTION_NAME(
- "fileBrowserPrivate.getPathForDriveSearchResult");
};
class SearchDriveFunction : public AsyncExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.searchGData");
+
protected:
+ virtual ~SearchDriveFunction() {}
+
virtual bool RunImpl() OVERRIDE;
private:
@@ -646,26 +672,30 @@ class SearchDriveFunction : public AsyncExtensionFunction {
// to represent search results.
std::string file_system_name_;
GURL file_system_url_;
-
- DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.searchGData");
};
// Implements the chrome.fileBrowserPrivate.getNetworkConnectionState method.
class GetNetworkConnectionStateFunction : public SyncExtensionFunction {
- protected:
- virtual bool RunImpl() OVERRIDE;
- private:
+ public:
DECLARE_EXTENSION_FUNCTION_NAME(
"fileBrowserPrivate.getNetworkConnectionState");
+
+ protected:
+ virtual ~GetNetworkConnectionStateFunction() {}
+
+ virtual bool RunImpl() OVERRIDE;
};
// Implements the chrome.fileBrowserPrivate.requestDirectoryRefresh method.
class RequestDirectoryRefreshFunction : public SyncExtensionFunction {
- protected:
- virtual bool RunImpl() OVERRIDE;
- private:
+ public:
DECLARE_EXTENSION_FUNCTION_NAME(
"fileBrowserPrivate.requestDirectoryRefresh");
+
+ protected:
+ virtual ~RequestDirectoryRefreshFunction() {}
+
+ virtual bool RunImpl() OVERRIDE;
};
#endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_PRIVATE_API_H_
diff --git a/chrome/browser/chromeos/extensions/file_handler_util.h b/chrome/browser/chromeos/extensions/file_handler_util.h
index 28614d0..e4f3c05 100644
--- a/chrome/browser/chromeos/extensions/file_handler_util.h
+++ b/chrome/browser/chromeos/extensions/file_handler_util.h
@@ -82,7 +82,6 @@ class FileTaskExecutor : public base::RefCountedThreadSafe<FileTaskExecutor> {
const GURL source_url,
const std::string& extension_id,
const std::string& action_id);
- virtual ~FileTaskExecutor();
// Same as ExecuteAndNotify, but no notification is performed.
virtual bool Execute(const std::vector<GURL>& file_urls);
@@ -98,6 +97,7 @@ class FileTaskExecutor : public base::RefCountedThreadSafe<FileTaskExecutor> {
protected:
explicit FileTaskExecutor(Profile* profile);
+ virtual ~FileTaskExecutor();
// Returns the profile that this task was created with.
Profile* profile() { return profile_; }
@@ -105,6 +105,7 @@ class FileTaskExecutor : public base::RefCountedThreadSafe<FileTaskExecutor> {
// Returns a browser to use for the current browser.
Browser* GetBrowser() const;
private:
+ friend class base::RefCountedThreadSafe<FileTaskExecutor>;
Profile* profile_;
};
diff --git a/chrome/browser/chromeos/gdata/gdata_file_system_proxy.cc b/chrome/browser/chromeos/gdata/gdata_file_system_proxy.cc
index 5d72c16..7efcb59 100644
--- a/chrome/browser/chromeos/gdata/gdata_file_system_proxy.cc
+++ b/chrome/browser/chromeos/gdata/gdata_file_system_proxy.cc
@@ -177,11 +177,6 @@ GDataFileSystemProxy::GDataFileSystemProxy(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
}
-GDataFileSystemProxy::~GDataFileSystemProxy() {
- // Should be deleted from the CrosMountPointProvider on IO thread.
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
-}
-
void GDataFileSystemProxy::GetFileInfo(const GURL& file_url,
const FileSystemOperationInterface::GetMetadataCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
@@ -463,6 +458,11 @@ void GDataFileSystemProxy::CreateWritableSnapshotFile(
callback));
}
+GDataFileSystemProxy::~GDataFileSystemProxy() {
+ // Should be deleted from the CrosMountPointProvider on IO thread.
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+}
+
// static.
bool GDataFileSystemProxy::ValidateUrl(const GURL& url, FilePath* file_path) {
// what platform you're on.
diff --git a/chrome/browser/chromeos/gdata/gdata_file_system_proxy.h b/chrome/browser/chromeos/gdata/gdata_file_system_proxy.h
index 39b1008..34036df 100644
--- a/chrome/browser/chromeos/gdata/gdata_file_system_proxy.h
+++ b/chrome/browser/chromeos/gdata/gdata_file_system_proxy.h
@@ -23,7 +23,6 @@ class GDataFileSystemProxy : public fileapi::RemoteFileSystemProxyInterface {
// |profile| is used to create GDataFileSystem, which is a per-profile
// instance.
explicit GDataFileSystemProxy(GDataFileSystemInterface* file_system);
- virtual ~GDataFileSystemProxy();
// fileapi::RemoteFileSystemProxyInterface overrides.
virtual void GetFileInfo(const GURL& path,
@@ -65,6 +64,9 @@ class GDataFileSystemProxy : public fileapi::RemoteFileSystemProxyInterface {
callback) OVERRIDE;
// TODO(zelidrag): More methods to follow as we implement other parts of FSO.
+ protected:
+ virtual ~GDataFileSystemProxy();
+
private:
// Checks if a given |url| belongs to this file system. If it does,
// the call will return true and fill in |file_path| with a file path of
diff --git a/chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc b/chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc
index dcfc874..5e78bbf 100644
--- a/chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc
+++ b/chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc
@@ -1229,7 +1229,6 @@ class GDataFileSystemTest : public testing::Test {
quota_bytes_total_(0),
quota_bytes_used_(0),
file_proto_(NULL) {}
- virtual ~CallbackHelper() {}
virtual void GetFileCallback(base::PlatformFileError error,
const FilePath& file_path,
@@ -1300,6 +1299,12 @@ class GDataFileSystemTest : public testing::Test {
scoped_ptr<GDataEntryProto> entry_proto_;
scoped_ptr<GDataFileProto> file_proto_;
scoped_ptr<GDataDirectoryProto> directory_proto_;
+
+ protected:
+ virtual ~CallbackHelper() {}
+
+ private:
+ friend class base::RefCountedThreadSafe<CallbackHelper>;
};
MessageLoopForUI message_loop_;
diff --git a/chrome/browser/chromeos/gdata/gdata_protocol_handler.cc b/chrome/browser/chromeos/gdata/gdata_protocol_handler.cc
index a53496f..365a5ac 100644
--- a/chrome/browser/chromeos/gdata/gdata_protocol_handler.cc
+++ b/chrome/browser/chromeos/gdata/gdata_protocol_handler.cc
@@ -127,7 +127,6 @@ void CancelGDataDownloadOnUIThread(const FilePath& gdata_file_path) {
class GDataURLRequestJob : public net::URLRequestJob {
public:
explicit GDataURLRequestJob(net::URLRequest* request);
- virtual ~GDataURLRequestJob();
// net::URLRequestJob overrides:
virtual void Start() OVERRIDE;
@@ -139,6 +138,9 @@ class GDataURLRequestJob : public net::URLRequestJob {
int buf_size,
int* bytes_read) OVERRIDE;
+ protected:
+ virtual ~GDataURLRequestJob();
+
private:
// Helper for Start() to let us start asynchronously.
void StartAsync(GDataFileSystem** file_system);
@@ -233,10 +235,6 @@ GDataURLRequestJob::GDataURLRequestJob(net::URLRequest* request)
download_growable_buf_, download_growable_buf_->capacity());
}
-GDataURLRequestJob::~GDataURLRequestJob() {
- CloseFileStream();
-}
-
void GDataURLRequestJob::Start() {
DVLOG(1) << "Starting request";
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
@@ -461,6 +459,12 @@ bool GDataURLRequestJob::ReadRawData(net::IOBuffer* dest,
return rc;
}
+//======================= GDataURLRequestJob protected methods ================
+
+GDataURLRequestJob::~GDataURLRequestJob() {
+ CloseFileStream();
+}
+
//======================= GDataURLRequestJob private methods ===================
void GDataURLRequestJob::StartAsync(GDataFileSystem** file_system) {
diff --git a/chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.cc b/chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.cc
index 4063852..36273d4 100644
--- a/chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.cc
+++ b/chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.cc
@@ -41,6 +41,9 @@ class ScreensaverUnpackerClient : public SandboxedExtensionUnpackerClient {
const Extension* extension) OVERRIDE;
void OnUnpackFailure(const string16& error) OVERRIDE;
+ protected:
+ virtual ~ScreensaverUnpackerClient() {}
+
private:
void LoadScreensaverExtension(
const FilePath& extension_base_path,
diff --git a/chrome/browser/chromeos/locale_change_guard.cc b/chrome/browser/chromeos/locale_change_guard.cc
index aa861e2..92815d3 100644
--- a/chrome/browser/chromeos/locale_change_guard.cc
+++ b/chrome/browser/chromeos/locale_change_guard.cc
@@ -45,6 +45,9 @@ class LocaleChangeGuard::Delegate : public NotificationDelegate {
return NULL;
}
+ protected:
+ virtual ~Delegate() {}
+
private:
chromeos::LocaleChangeGuard* master_;
diff --git a/chrome/browser/chromeos/login/authenticator.cc b/chrome/browser/chromeos/login/authenticator.cc
index 0a641d5..20de695 100644
--- a/chrome/browser/chromeos/login/authenticator.cc
+++ b/chrome/browser/chromeos/login/authenticator.cc
@@ -9,7 +9,8 @@ namespace chromeos {
class LoginStatusConsumer;
Authenticator::Authenticator(LoginStatusConsumer* consumer)
- : consumer_(consumer), authentication_profile_(NULL) {
+ : consumer_(consumer),
+ authentication_profile_(NULL) {
}
Authenticator::~Authenticator() {}
diff --git a/chrome/browser/chromeos/login/authenticator.h b/chrome/browser/chromeos/login/authenticator.h
index 88fd043..e05f162 100644
--- a/chrome/browser/chromeos/login/authenticator.h
+++ b/chrome/browser/chromeos/login/authenticator.h
@@ -26,7 +26,6 @@ namespace chromeos {
class Authenticator : public base::RefCountedThreadSafe<Authenticator> {
public:
explicit Authenticator(LoginStatusConsumer* consumer);
- virtual ~Authenticator();
// Given externally authenticated |username| and |password|, this method
// attempts to complete authentication process.
@@ -93,10 +92,14 @@ class Authenticator : public base::RefCountedThreadSafe<Authenticator> {
Profile* authentication_profile() { return authentication_profile_; }
protected:
+ virtual ~Authenticator();
+
LoginStatusConsumer* consumer_;
Profile* authentication_profile_;
private:
+ friend class base::RefCountedThreadSafe<Authenticator>;
+
DISALLOW_COPY_AND_ASSIGN(Authenticator);
};
diff --git a/chrome/browser/chromeos/login/help_app_launcher.cc b/chrome/browser/chromeos/login/help_app_launcher.cc
index 004891f..4fa56f0 100644
--- a/chrome/browser/chromeos/login/help_app_launcher.cc
+++ b/chrome/browser/chromeos/login/help_app_launcher.cc
@@ -32,8 +32,6 @@ HelpAppLauncher::HelpAppLauncher(gfx::NativeWindow parent_window)
: parent_window_(parent_window) {
}
-HelpAppLauncher::~HelpAppLauncher() {}
-
void HelpAppLauncher::ShowHelpTopic(HelpTopic help_topic_id) {
Profile* profile = ProfileManager::GetDefaultProfile();
ExtensionService* service = profile->GetExtensionService();
@@ -51,6 +49,11 @@ void HelpAppLauncher::ShowHelpTopic(HelpTopic help_topic_id) {
}
///////////////////////////////////////////////////////////////////////////////
+// HelpApp, protected:
+
+HelpAppLauncher::~HelpAppLauncher() {}
+
+///////////////////////////////////////////////////////////////////////////////
// HelpApp, private:
void HelpAppLauncher::ShowHelpTopicDialog(const GURL& topic_url) {
diff --git a/chrome/browser/chromeos/login/help_app_launcher.h b/chrome/browser/chromeos/login/help_app_launcher.h
index fddcb76..608cddf 100644
--- a/chrome/browser/chromeos/login/help_app_launcher.h
+++ b/chrome/browser/chromeos/login/help_app_launcher.h
@@ -38,7 +38,6 @@ class HelpAppLauncher : public LoginWebDialog::Delegate,
// Parent window is used to show dialog.
explicit HelpAppLauncher(gfx::NativeWindow parent_window);
- virtual ~HelpAppLauncher();
// Shows specified help topic.
void ShowHelpTopic(HelpTopic help_topic_id);
@@ -47,10 +46,14 @@ class HelpAppLauncher : public LoginWebDialog::Delegate,
bool is_open() const { return dialog_.get() && dialog_->is_open(); }
protected:
+ virtual ~HelpAppLauncher();
+
// LoginWebDialog::Delegate implementation:
virtual void OnDialogClosed() OVERRIDE {}
private:
+ friend class base::RefCountedThreadSafe<HelpAppLauncher>;
+
// Shows help topic dialog for specified GURL.
void ShowHelpTopicDialog(const GURL& topic_url);
diff --git a/chrome/browser/chromeos/login/login_utils.cc b/chrome/browser/chromeos/login/login_utils.cc
index cab8a9d..00ec9f1 100644
--- a/chrome/browser/chromeos/login/login_utils.cc
+++ b/chrome/browser/chromeos/login/login_utils.cc
@@ -197,6 +197,10 @@ class JobRestartRequest
}
private:
+ friend class base::RefCountedThreadSafe<JobRestartRequest>;
+
+ ~JobRestartRequest() {}
+
void RestartJob() {
if (BrowserThread::CurrentlyOn(BrowserThread::UI)) {
DBusThreadManager::Get()->GetSessionManagerClient()->RestartJob(
diff --git a/chrome/browser/chromeos/login/mock_authenticator.h b/chrome/browser/chromeos/login/mock_authenticator.h
index d11fcf6..2a8f5c2 100644
--- a/chrome/browser/chromeos/login/mock_authenticator.h
+++ b/chrome/browser/chromeos/login/mock_authenticator.h
@@ -65,6 +65,9 @@ class MockAuthenticator : public Authenticator {
const std::string& login_token,
const std::string& login_captcha) OVERRIDE {}
+ protected:
+ virtual ~MockAuthenticator() {}
+
private:
std::string expected_username_;
std::string expected_password_;
diff --git a/chrome/browser/chromeos/login/owner_manager.cc b/chrome/browser/chromeos/login/owner_manager.cc
index 00a8009..7f9a20a 100644
--- a/chrome/browser/chromeos/login/owner_manager.cc
+++ b/chrome/browser/chromeos/login/owner_manager.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -27,8 +27,6 @@ OwnerManager::OwnerManager()
utils_(OwnerKeyUtils::Create()) {
}
-OwnerManager::~OwnerManager() {}
-
void OwnerManager::UpdateOwnerKey(const BrowserThread::ID thread_id,
const std::vector<uint8>& key,
KeyUpdateDelegate* d) {
@@ -135,6 +133,8 @@ void OwnerManager::Verify(const BrowserThread::ID thread_id,
BootTimesLoader::Get()->AddLoginTimeMarker("VerifyEnd", false);
}
+OwnerManager::~OwnerManager() {}
+
void OwnerManager::SendNotification(
int type,
const content::NotificationDetails& details) {
diff --git a/chrome/browser/chromeos/login/owner_manager.h b/chrome/browser/chromeos/login/owner_manager.h
index 74dc6d5..c0cfbc5 100644
--- a/chrome/browser/chromeos/login/owner_manager.h
+++ b/chrome/browser/chromeos/login/owner_manager.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -51,7 +51,6 @@ class OwnerManager : public base::RefCountedThreadSafe<OwnerManager> {
};
OwnerManager();
- virtual ~OwnerManager();
// Sets a new owner key from a provided memory buffer.
void UpdateOwnerKey(const content::BrowserThread::ID thread_id,
@@ -90,7 +89,12 @@ class OwnerManager : public base::RefCountedThreadSafe<OwnerManager> {
const std::vector<uint8>& signature,
Delegate* d);
+ protected:
+ virtual ~OwnerManager();
+
private:
+ friend class base::RefCountedThreadSafe<OwnerManager>;
+
// A helper method to send a notification on another thread.
void SendNotification(int type,
const content::NotificationDetails& details);
diff --git a/chrome/browser/chromeos/login/parallel_authenticator.cc b/chrome/browser/chromeos/login/parallel_authenticator.cc
index d6ccdde..cb4758d 100644
--- a/chrome/browser/chromeos/login/parallel_authenticator.cc
+++ b/chrome/browser/chromeos/login/parallel_authenticator.cc
@@ -181,8 +181,6 @@ ParallelAuthenticator::ParallelAuthenticator(LoginStatusConsumer* consumer)
OwnershipService::GetSharedInstance()->StartLoadOwnerKeyAttempt();
}
-ParallelAuthenticator::~ParallelAuthenticator() {}
-
void ParallelAuthenticator::AuthenticateToLogin(
Profile* profile,
const std::string& username,
@@ -616,6 +614,8 @@ void ParallelAuthenticator::Resolve() {
}
}
+ParallelAuthenticator::~ParallelAuthenticator() {}
+
ParallelAuthenticator::AuthState ParallelAuthenticator::ResolveState() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// If we haven't mounted the user's home dir yet, we can't be done.
diff --git a/chrome/browser/chromeos/login/parallel_authenticator.h b/chrome/browser/chromeos/login/parallel_authenticator.h
index 465fa23..8410ef3 100644
--- a/chrome/browser/chromeos/login/parallel_authenticator.h
+++ b/chrome/browser/chromeos/login/parallel_authenticator.h
@@ -67,7 +67,6 @@ class ParallelAuthenticator : public Authenticator,
};
explicit ParallelAuthenticator(LoginStatusConsumer* consumer);
- virtual ~ParallelAuthenticator();
// Authenticator overrides.
virtual void CompleteLogin(Profile* profile,
@@ -145,6 +144,9 @@ class ParallelAuthenticator : public Authenticator,
void OnOffTheRecordLoginSuccess();
void OnPasswordChangeDetected();
+ protected:
+ virtual ~ParallelAuthenticator();
+
private:
friend class ParallelAuthenticatorTest;
FRIEND_TEST_ALL_PREFIXES(ParallelAuthenticatorTest,
diff --git a/chrome/browser/chromeos/login/signed_settings.cc b/chrome/browser/chromeos/login/signed_settings.cc
index 44975d7..11fd6d3 100644
--- a/chrome/browser/chromeos/login/signed_settings.cc
+++ b/chrome/browser/chromeos/login/signed_settings.cc
@@ -58,15 +58,19 @@ class StorePolicyOp : public SignedSettings {
public:
StorePolicyOp(em::PolicyFetchResponse* policy,
SignedSettings::Delegate<bool>* d);
- virtual ~StorePolicyOp();
- void Execute();
- void Fail(SignedSettings::ReturnCode code);
void Succeed(bool value);
// Implementation of OwnerManager::Delegate
- void OnKeyOpComplete(const OwnerManager::KeyOpCode return_code,
- const std::vector<uint8>& payload);
+ virtual void Execute() OVERRIDE;
+ virtual void Fail(SignedSettings::ReturnCode code) OVERRIDE;
+ virtual void OnKeyOpComplete(const OwnerManager::KeyOpCode return_code,
+ const std::vector<uint8>& payload) OVERRIDE;
+
+ protected:
+ virtual ~StorePolicyOp();
private:
+ void RequestStorePolicy();
+
void OnBoolComplete(bool success);
// Always call d_->OnSettingOpCompleted() via this call.
// It guarantees that the callback will not be triggered until _after_
@@ -76,21 +80,21 @@ class StorePolicyOp : public SignedSettings {
em::PolicyFetchResponse* policy_;
SignedSettings::Delegate<bool>* d_;
-
- void RequestStorePolicy();
};
class RetrievePolicyOp : public SignedSettings {
public:
explicit RetrievePolicyOp(
SignedSettings::Delegate<const em::PolicyFetchResponse&>* d);
- virtual ~RetrievePolicyOp();
- void Execute();
- void Fail(SignedSettings::ReturnCode code);
void Succeed(const em::PolicyFetchResponse& value);
// Implementation of OwnerManager::Delegate
- void OnKeyOpComplete(const OwnerManager::KeyOpCode return_code,
- const std::vector<uint8>& payload);
+ virtual void Execute() OVERRIDE;
+ virtual void Fail(SignedSettings::ReturnCode code) OVERRIDE;
+ virtual void OnKeyOpComplete(const OwnerManager::KeyOpCode return_code,
+ const std::vector<uint8>& payload) OVERRIDE;
+
+ protected:
+ virtual ~RetrievePolicyOp();
private:
void OnStringComplete(const std::string& serialized_proto);
@@ -130,13 +134,18 @@ StorePolicyOp::StorePolicyOp(em::PolicyFetchResponse* policy,
d_(d) {
}
-StorePolicyOp::~StorePolicyOp() {}
-
-void StorePolicyOp::OnBoolComplete(bool success) {
- if (success)
- Succeed(true);
- else
- Fail(NOT_FOUND);
+void StorePolicyOp::Succeed(bool ignored) {
+ SignedSettings::ReturnCode code = SUCCESS;
+ bool to_ret = true;
+ em::PolicyData poldata;
+ if (SignedSettings::PolicyIsSane(*policy_, &poldata)) {
+ } else {
+ code = NOT_FOUND;
+ to_ret = false;
+ }
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ base::Bind(&StorePolicyOp::PerformCallback, this, code, to_ret));
}
void StorePolicyOp::Execute() {
@@ -155,20 +164,6 @@ void StorePolicyOp::Fail(SignedSettings::ReturnCode code) {
base::Bind(&StorePolicyOp::PerformCallback, this, code, false));
}
-void StorePolicyOp::Succeed(bool ignored) {
- SignedSettings::ReturnCode code = SUCCESS;
- bool to_ret = true;
- em::PolicyData poldata;
- if (SignedSettings::PolicyIsSane(*policy_, &poldata)) {
- } else {
- code = NOT_FOUND;
- to_ret = false;
- }
- BrowserThread::PostTask(
- BrowserThread::UI, FROM_HERE,
- base::Bind(&StorePolicyOp::PerformCallback, this, code, to_ret));
-}
-
void StorePolicyOp::OnKeyOpComplete(const OwnerManager::KeyOpCode return_code,
const std::vector<uint8>& payload) {
// Ensure we're on the UI thread, due to the need to send DBus traffic.
@@ -190,6 +185,8 @@ void StorePolicyOp::OnKeyOpComplete(const OwnerManager::KeyOpCode return_code,
Fail(SignedSettings::MapKeyOpCode(return_code));
}
+StorePolicyOp::~StorePolicyOp() {}
+
void StorePolicyOp::RequestStorePolicy() {
std::string serialized;
if (policy_->SerializeToString(&serialized)) {
@@ -201,6 +198,13 @@ void StorePolicyOp::RequestStorePolicy() {
}
}
+void StorePolicyOp::OnBoolComplete(bool success) {
+ if (success)
+ Succeed(true);
+ else
+ Fail(NOT_FOUND);
+}
+
void StorePolicyOp::PerformCallback(SignedSettings::ReturnCode code,
bool value) {
d_->OnSettingsOpCompleted(code, value);
@@ -211,7 +215,16 @@ RetrievePolicyOp::RetrievePolicyOp(
: d_(d) {
}
-RetrievePolicyOp::~RetrievePolicyOp() {}
+void RetrievePolicyOp::Succeed(const em::PolicyFetchResponse& value) {
+ em::PolicyData poldata;
+ if (SignedSettings::PolicyIsSane(value, &poldata)) {
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ base::Bind(&RetrievePolicyOp::PerformCallback, this, SUCCESS, value));
+ } else {
+ Fail(NOT_FOUND);
+ }
+}
void RetrievePolicyOp::Execute() {
DBusThreadManager::Get()->GetSessionManagerClient()->RetrieveDevicePolicy(
@@ -226,17 +239,6 @@ void RetrievePolicyOp::Fail(SignedSettings::ReturnCode code) {
em::PolicyFetchResponse()));
}
-void RetrievePolicyOp::Succeed(const em::PolicyFetchResponse& value) {
- em::PolicyData poldata;
- if (SignedSettings::PolicyIsSane(value, &poldata)) {
- BrowserThread::PostTask(
- BrowserThread::UI, FROM_HERE,
- base::Bind(&RetrievePolicyOp::PerformCallback, this, SUCCESS, value));
- } else {
- Fail(NOT_FOUND);
- }
-}
-
void RetrievePolicyOp::OnKeyOpComplete(
const OwnerManager::KeyOpCode return_code,
const std::vector<uint8>& payload) {
@@ -254,6 +256,8 @@ void RetrievePolicyOp::OnKeyOpComplete(
Fail(SignedSettings::MapKeyOpCode(return_code));
}
+RetrievePolicyOp::~RetrievePolicyOp() {}
+
void RetrievePolicyOp::OnStringComplete(const std::string& serialized_proto) {
ProcessPolicy(serialized_proto);
}
diff --git a/chrome/browser/chromeos/login/signed_settings.h b/chrome/browser/chromeos/login/signed_settings.h
index d9f7dd9..a160463 100644
--- a/chrome/browser/chromeos/login/signed_settings.h
+++ b/chrome/browser/chromeos/login/signed_settings.h
@@ -51,7 +51,6 @@ class SignedSettings : public base::RefCountedThreadSafe<SignedSettings>,
};
SignedSettings();
- virtual ~SignedSettings();
// These are both "policy" operations, and only one instance of
// one type can be in flight at a time.
@@ -74,6 +73,8 @@ class SignedSettings : public base::RefCountedThreadSafe<SignedSettings>,
const std::vector<uint8>& payload) = 0;
protected:
+ virtual ~SignedSettings();
+
static bool PolicyIsSane(
const enterprise_management::PolicyFetchResponse& value,
enterprise_management::PolicyData* poldata);
@@ -83,6 +84,7 @@ class SignedSettings : public base::RefCountedThreadSafe<SignedSettings>,
OwnershipService* service_;
private:
+ friend class base::RefCountedThreadSafe<SignedSettings>;
friend class SignedSettingsTest;
friend class SignedSettingsHelperTest;
diff --git a/chrome/browser/chromeos/low_memory_observer.cc b/chrome/browser/chromeos/low_memory_observer.cc
index a27602c..efcb55a 100644
--- a/chrome/browser/chromeos/low_memory_observer.cc
+++ b/chrome/browser/chromeos/low_memory_observer.cc
@@ -48,9 +48,6 @@ class LowMemoryObserverImpl
: public base::RefCountedThreadSafe<LowMemoryObserverImpl> {
public:
LowMemoryObserverImpl() : watcher_delegate_(this), file_descriptor_(-1) {}
- ~LowMemoryObserverImpl() {
- StopObservingOnFileThread();
- }
// Start watching the low memory file for readability.
// Calls to StartObserving should always be matched with calls to
@@ -63,6 +60,12 @@ class LowMemoryObserverImpl
void StopObservingOnFileThread();
private:
+ friend class base::RefCountedThreadSafe<LowMemoryObserverImpl>;
+
+ ~LowMemoryObserverImpl() {
+ StopObservingOnFileThread();
+ }
+
// Start a timer to resume watching the low memory file descriptor.
void ScheduleNextObservation();
diff --git a/chrome/browser/chromeos/media/media_player_extension_api.h b/chrome/browser/chromeos/media/media_player_extension_api.h
index 640d517..2ec9f69 100644
--- a/chrome/browser/chromeos/media/media_player_extension_api.h
+++ b/chrome/browser/chromeos/media/media_player_extension_api.h
@@ -14,34 +14,50 @@
// Implements the chrome.mediaPlayerPrivate.play method.
class PlayMediaplayerFunction : public SyncExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION_NAME("mediaPlayerPrivate.play");
+
protected:
+ virtual ~PlayMediaplayerFunction() {}
+
// SyncExtensionFunction overrides.
virtual bool RunImpl() OVERRIDE;
- DECLARE_EXTENSION_FUNCTION_NAME("mediaPlayerPrivate.play");
};
// Implements the chrome.mediaPlayerPrivate.getPlaylist method.
class GetPlaylistMediaplayerFunction : public SyncExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION_NAME("mediaPlayerPrivate.getPlaylist");
+
protected:
+ virtual ~GetPlaylistMediaplayerFunction() {}
+
// SyncExtensionFunction overrides.
virtual bool RunImpl() OVERRIDE;
- DECLARE_EXTENSION_FUNCTION_NAME("mediaPlayerPrivate.getPlaylist");
};
// Implements the chrome.mediaPlayerPrivate.setWindowHeight method.
class SetWindowHeightMediaplayerFunction : public SyncExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION_NAME("mediaPlayerPrivate.setWindowHeight");
+
protected:
+ virtual ~SetWindowHeightMediaplayerFunction() {}
+
// SyncExtensionFunction overrides.
virtual bool RunImpl() OVERRIDE;
- DECLARE_EXTENSION_FUNCTION_NAME("mediaPlayerPrivate.setWindowHeight");
};
// Implements the chrome.mediaPlayerPrivate.closeWindow method.
class CloseWindowMediaplayerFunction : public SyncExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION_NAME("mediaPlayerPrivate.closeWindow");
+
protected:
+ virtual ~CloseWindowMediaplayerFunction() {}
+
// SyncExtensionFunction overrides.
virtual bool RunImpl() OVERRIDE;
- DECLARE_EXTENSION_FUNCTION_NAME("mediaPlayerPrivate.closeWindow");
};
#endif // CHROME_BROWSER_CHROMEOS_MEDIA_MEDIA_PLAYER_EXTENSION_API_H_
diff --git a/chrome/browser/chromeos/mobile/mobile_activator.cc b/chrome/browser/chromeos/mobile/mobile_activator.cc
index aed47ab..476bd37 100644
--- a/chrome/browser/chromeos/mobile/mobile_activator.cc
+++ b/chrome/browser/chromeos/mobile/mobile_activator.cc
@@ -88,11 +88,7 @@ namespace chromeos {
// CellularConfigDocument
//
////////////////////////////////////////////////////////////////////////////////
-CellularConfigDocument::CellularConfigDocument() {
-}
-
-CellularConfigDocument::~CellularConfigDocument() {
-}
+CellularConfigDocument::CellularConfigDocument() {}
std::string CellularConfigDocument::GetErrorMessage(const std::string& code) {
base::AutoLock create(config_lock_);
@@ -117,6 +113,15 @@ void CellularConfigDocument::LoadCellularConfigFile() {
}
}
+CellularConfigDocument::~CellularConfigDocument() {}
+
+void CellularConfigDocument::SetErrorMap(
+ const ErrorMap& map) {
+ base::AutoLock create(config_lock_);
+ error_map_.clear();
+ error_map_.insert(map.begin(), map.end());
+}
+
bool CellularConfigDocument::LoadFromFile(const FilePath& config_path) {
std::string config;
if (!file_util::ReadFileToString(config_path, &config))
@@ -153,13 +158,6 @@ bool CellularConfigDocument::LoadFromFile(const FilePath& config_path) {
return true;
}
-void CellularConfigDocument::SetErrorMap(
- const ErrorMap& map) {
- base::AutoLock create(config_lock_);
- error_map_.clear();
- error_map_.insert(map.begin(), map.end());
-}
-
////////////////////////////////////////////////////////////////////////////////
//
// MobileActivator
diff --git a/chrome/browser/chromeos/mobile/mobile_activator.h b/chrome/browser/chromeos/mobile/mobile_activator.h
index cd5bc50..3b7e881 100644
--- a/chrome/browser/chromeos/mobile/mobile_activator.h
+++ b/chrome/browser/chromeos/mobile/mobile_activator.h
@@ -22,7 +22,6 @@ class CellularConfigDocument
: public base::RefCountedThreadSafe<CellularConfigDocument> {
public:
CellularConfigDocument();
- virtual ~CellularConfigDocument();
// Return error message for a given code.
std::string GetErrorMessage(const std::string& code);
@@ -30,8 +29,11 @@ class CellularConfigDocument
const std::string& version() { return version_; }
private:
+ friend class base::RefCountedThreadSafe<CellularConfigDocument>;
typedef std::map<std::string, std::string> ErrorMap;
+ virtual ~CellularConfigDocument();
+
void SetErrorMap(const ErrorMap& map);
bool LoadFromFile(const FilePath& config_path);
diff --git a/chrome/browser/chromeos/notifications/system_notification.cc b/chrome/browser/chromeos/notifications/system_notification.cc
index efaaa1d..587ce48 100644
--- a/chrome/browser/chromeos/notifications/system_notification.cc
+++ b/chrome/browser/chromeos/notifications/system_notification.cc
@@ -141,4 +141,6 @@ SystemNotification::Delegate::GetRenderViewHost() const {
return NULL;
}
+SystemNotification::Delegate::~Delegate() {}
+
} // namespace chromeos
diff --git a/chrome/browser/chromeos/notifications/system_notification.h b/chrome/browser/chromeos/notifications/system_notification.h
index 40d97de..f9d78b9 100644
--- a/chrome/browser/chromeos/notifications/system_notification.h
+++ b/chrome/browser/chromeos/notifications/system_notification.h
@@ -79,6 +79,9 @@ class SystemNotification : public PowerManagerClient::Observer {
virtual std::string id() const OVERRIDE;
virtual content::RenderViewHost* GetRenderViewHost() const OVERRIDE;
+ protected:
+ virtual ~Delegate();
+
private:
std::string id_;
diff --git a/chrome/browser/chromeos/web_socket_proxy.cc b/chrome/browser/chromeos/web_socket_proxy.cc
index eb7ef07..28d14f1 100644
--- a/chrome/browser/chromeos/web_socket_proxy.cc
+++ b/chrome/browser/chromeos/web_socket_proxy.cc
@@ -464,11 +464,11 @@ class SSLChan : public MessageLoopForIO::Watcher {
DCHECK(host_->data());
}
+ protected:
virtual ~DerivedIOBufferWithSize() {
data_ = NULL; // We do not own memory, bypass base class destructor.
}
- protected:
scoped_refptr<net::IOBuffer> host_;
};