diff options
Diffstat (limited to 'chrome/browser')
27 files changed, 133 insertions, 26 deletions
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/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/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 |