Skip to content

Commit

Permalink
Add the "virtual" keyword on method overrides that are missing it.
Browse files Browse the repository at this point in the history
BUG=none
TEST=compiles

Review URL: http://codereview.chromium.org/5648004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68606 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
erg@google.com committed Dec 8, 2010
1 parent a7a265e commit 78994ab
Show file tree
Hide file tree
Showing 134 changed files with 638 additions and 535 deletions.
2 changes: 1 addition & 1 deletion app/hi_res_timer_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class HighResolutionTimerManager : public SystemMonitor::PowerObserver {
virtual ~HighResolutionTimerManager();

// SystemMonitor::PowerObserver:
void OnPowerStateChange(bool on_battery_power);
virtual void OnPowerStateChange(bool on_battery_power);

private:
// Enable or disable the faster multimedia timer.
Expand Down
4 changes: 2 additions & 2 deletions app/slide_animation.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ class SlideAnimation : public LinearAnimation {
int GetSlideDuration() const { return slide_duration_; }
void SetTweenType(Tween::Type tween_type) { tween_type_ = tween_type; }

double GetCurrentValue() const { return value_current_; }
virtual double GetCurrentValue() const { return value_current_; }
bool IsShowing() const { return showing_; }
bool IsClosing() const { return !showing_ && value_end_ < value_current_; }

private:
// Overridden from Animation.
void AnimateToState(double state);
virtual void AnimateToState(double state);

AnimationDelegate* target_;

Expand Down
6 changes: 3 additions & 3 deletions base/file_descriptor_shuffle.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ class InjectionDelegate {
// An implementation of the InjectionDelegate interface using the file
// descriptor table of the current process as the domain.
class FileDescriptorTableInjection : public InjectionDelegate {
bool Duplicate(int* result, int fd);
bool Move(int src, int dest);
void Close(int fd);
virtual bool Duplicate(int* result, int fd);
virtual bool Move(int src, int dest);
virtual void Close(int fd);
};

// A single arc of the directed graph which describes an injective multimapping.
Expand Down
4 changes: 2 additions & 2 deletions base/message_loop_proxy_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class MessageLoopProxyImpl : public MessageLoopProxy,
int64 delay_ms);
virtual bool BelongsToCurrentThread();

// MessageLoop::DestructionObserver implementation
void WillDestroyCurrentMessageLoop();
// MessageLoop::DestructionObserver implementation
virtual void WillDestroyCurrentMessageLoop();

protected:
// Override OnDestruct so that we can delete the object on the target message
Expand Down
20 changes: 10 additions & 10 deletions base/values.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class FundamentalValue : public Value {
explicit FundamentalValue(bool in_value);
explicit FundamentalValue(int in_value);
explicit FundamentalValue(double in_value);
~FundamentalValue();
virtual ~FundamentalValue();

// Subclassed methods
virtual bool GetAsBoolean(bool* out_value) const;
Expand All @@ -151,12 +151,12 @@ class StringValue : public Value {
// Initializes a StringValue with a string16.
explicit StringValue(const string16& in_value);

~StringValue();
virtual ~StringValue();

// Subclassed methods
bool GetAsString(std::string* out_value) const;
bool GetAsString(string16* out_value) const;
Value* DeepCopy() const;
virtual bool GetAsString(std::string* out_value) const;
virtual bool GetAsString(string16* out_value) const;
virtual Value* DeepCopy() const;
virtual bool Equals(const Value* other) const;

private:
Expand All @@ -178,10 +178,10 @@ class BinaryValue: public Value {
// Returns NULL if buffer is NULL.
static BinaryValue* CreateWithCopiedBuffer(const char* buffer, size_t size);

~BinaryValue();
virtual ~BinaryValue();

// Subclassed methods
Value* DeepCopy() const;
virtual Value* DeepCopy() const;
virtual bool Equals(const Value* other) const;

size_t GetSize() const { return size_; }
Expand All @@ -205,10 +205,10 @@ class BinaryValue: public Value {
class DictionaryValue : public Value {
public:
DictionaryValue();
~DictionaryValue();
virtual ~DictionaryValue();

// Subclassed methods
Value* DeepCopy() const;
virtual Value* DeepCopy() const;
virtual bool Equals(const Value* other) const;

// Returns true if the current dictionary has a value for the given key.
Expand Down Expand Up @@ -368,7 +368,7 @@ class ListValue : public Value {

// Subclassed methods
virtual bool GetAsList(ListValue** out_value);
Value* DeepCopy() const;
virtual Value* DeepCopy() const;
virtual bool Equals(const Value* other) const;

// Clears the contents of this ListValue
Expand Down
2 changes: 1 addition & 1 deletion base/waitable_event_watcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class WaitableEventWatcher
// ---------------------------------------------------------------------------
// Implementation of MessageLoop::DestructionObserver
// ---------------------------------------------------------------------------
void WillDestroyCurrentMessageLoop();
virtual void WillDestroyCurrentMessageLoop();

MessageLoop* message_loop_;
scoped_refptr<Flag> cancel_flag_;
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/autocomplete/history_quick_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class HistoryQuickProvider : public HistoryProvider {

// AutocompleteProvider. |minimal_changes| is ignored since there
// is no asynch completion performed.
void Start(const AutocompleteInput& input, bool minimal_changes);
virtual void Start(const AutocompleteInput& input, bool minimal_changes);

// Performs the autocomplete matching and scoring.
void DoAutocomplete();
Expand Down
6 changes: 3 additions & 3 deletions chrome/browser/autocomplete/keyword_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ class KeywordProvider : public AutocompleteProvider,
void MaybeEndExtensionKeywordMode();

// NotificationObserver interface.
void Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details);
virtual void Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details);

// Model for the keywords. This is only non-null when testing, otherwise the
// TemplateURLModel from the Profile is used.
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/autofill/credit_card.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class CreditCard : public FormGroup {
virtual ~CreditCard();

// FormGroup implementation:
FormGroup* Clone() const;
virtual FormGroup* Clone() const;
virtual void GetPossibleFieldTypes(const string16& text,
FieldTypeSet* possible_types) const;
virtual void GetAvailableFieldTypes(FieldTypeSet* available_types) const;
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/autofill/home_address.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class FormGroup;
class HomeAddress : public Address {
public:
HomeAddress() {}
FormGroup* Clone() const { return new HomeAddress(*this); }
virtual FormGroup* Clone() const { return new HomeAddress(*this); }

protected:
virtual AutoFillFieldType GetLine1Type() const {
Expand Down
14 changes: 7 additions & 7 deletions chrome/browser/automation/automation_provider_observers.h
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ class AutomationProviderSearchEngineObserver
: provider_(provider),
reply_message_(reply_message) {}

void OnTemplateURLModelChanged();
virtual void OnTemplateURLModelChanged();

private:
AutomationProvider* provider_;
Expand Down Expand Up @@ -806,10 +806,10 @@ class AutomationProviderImportSettingsObserver
IPC::Message* reply_message)
: provider_(provider),
reply_message_(reply_message) {}
void ImportStarted() {}
void ImportItemStarted(importer::ImportItem item) {}
void ImportItemEnded(importer::ImportItem item) {}
void ImportEnded();
virtual void ImportStarted() {}
virtual void ImportItemStarted(importer::ImportItem item) {}
virtual void ImportItemEnded(importer::ImportItem item) {}
virtual void ImportEnded();
private:
AutomationProvider* provider_;
IPC::Message* reply_message_;
Expand All @@ -825,7 +825,7 @@ class AutomationProviderGetPasswordsObserver
: provider_(provider),
reply_message_(reply_message) {}

void OnPasswordStoreRequestDone(
virtual void OnPasswordStoreRequestDone(
int handle, const std::vector<webkit_glue::PasswordForm*>& result);

private:
Expand All @@ -842,7 +842,7 @@ class AutomationProviderBrowsingDataObserver
IPC::Message* reply_message)
: provider_(provider),
reply_message_(reply_message) {}
void OnBrowsingDataRemoverDone();
virtual void OnBrowsingDataRemoverDone();

private:
AutomationProvider* provider_;
Expand Down
5 changes: 3 additions & 2 deletions chrome/browser/bookmarks/bookmark_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,9 @@ class BookmarkStorage : public NotificationObserver,
void FinishHistoryMigration();

// NotificationObserver
void Observe(NotificationType type, const NotificationSource& source,
const NotificationDetails& details);
virtual void Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details);

// Serializes the data and schedules save using ImportantFileWriter.
// Returns true on successful serialization.
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/browser_process_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class BrowserProcessImpl : public BrowserProcess, public NonThreadSafe {
virtual void CheckForInspectorFiles();

#if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
void StartAutoupdateTimer();
virtual void StartAutoupdateTimer();
#endif

virtual bool have_inspector_files() const;
Expand Down
6 changes: 3 additions & 3 deletions chrome/browser/browsing_data_remover.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ class BrowsingDataRemover : public NotificationObserver {
// NotificationObserver method. Callback when TemplateURLModel has finished
// loading. Deletes the entries from the model, and if we're not waiting on
// anything else notifies observers and deletes this BrowsingDataRemover.
void Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details);
virtual void Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details);

// If we're not waiting on anything, notifies observers and deletes this
// object.
Expand Down
5 changes: 3 additions & 2 deletions chrome/browser/dom_ui/foreign_session_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ class ForeignSessionHandler : public DOMMessageHandler,
void Init();

// Determines how ForeignSessionHandler will interact with the new tab page.
void Observe(NotificationType type, const NotificationSource& source,
const NotificationDetails& details);
virtual void Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details);

// Returns a pointer to the current session model associator or NULL.
SessionModelAssociator* GetModelAssociator();
Expand Down
6 changes: 3 additions & 3 deletions chrome/browser/dom_ui/new_tab_ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ class NewTabUI : public DOMUI,
private:
FRIEND_TEST_ALL_PREFIXES(NewTabUITest, UpdateUserPrefsVersion);

void Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details);
virtual void Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details);

// Reset the CSS caches.
void InitializeCSSCaches();
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/dom_ui/options/options_ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ class OptionsUI : public DOMUI {
virtual ~OptionsUI();

static RefCountedMemory* GetFaviconResourceBytes();
void RenderViewCreated(RenderViewHost* render_view_host);
void DidBecomeActiveForReusedRenderView();
virtual void RenderViewCreated(RenderViewHost* render_view_host);
virtual void DidBecomeActiveForReusedRenderView();

void InitializeHandlers();

Expand Down
6 changes: 3 additions & 3 deletions chrome/browser/download/download_request_limiter.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ class DownloadRequestLimiter

private:
// NotificationObserver method.
void Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details);
virtual void Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details);

// Notifies the callbacks as to whether the download is allowed or not.
// Updates status_ appropriately.
Expand Down
13 changes: 7 additions & 6 deletions chrome/browser/extensions/extension_bookmarks_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,9 @@ class BookmarksIOFunction : public BookmarksFunction,

// Overridden from SelectFileDialog::Listener:
virtual void FileSelected(const FilePath& path, int index, void* params) = 0;
void MultiFilesSelected(const std::vector<FilePath>& files, void* params);
void FileSelectionCanceled(void* params);
virtual void MultiFilesSelected(const std::vector<FilePath>& files,
void* params);
virtual void FileSelectionCanceled(void* params);
void SelectFile(SelectFileDialog::Type type);

protected:
Expand All @@ -190,8 +191,8 @@ class BookmarksIOFunction : public BookmarksFunction,
class ImportBookmarksFunction : public BookmarksIOFunction {
public:
// Override BookmarkManagerIOFunction.
bool RunImpl();
void FileSelected(const FilePath& path, int index, void* params);
virtual bool RunImpl();
virtual void FileSelected(const FilePath& path, int index, void* params);

private:
DECLARE_EXTENSION_FUNCTION_NAME("bookmarks.import");
Expand All @@ -200,8 +201,8 @@ class ImportBookmarksFunction : public BookmarksIOFunction {
class ExportBookmarksFunction : public BookmarksIOFunction {
public:
// Override BookmarkManagerIOFunction.
bool RunImpl();
void FileSelected(const FilePath& path, int index, void* params);
virtual bool RunImpl();
virtual void FileSelected(const FilePath& path, int index, void* params);

private:
DECLARE_EXTENSION_FUNCTION_NAME("bookmarks.export");
Expand Down
6 changes: 3 additions & 3 deletions chrome/browser/extensions/extension_browser_event_router.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ class ExtensionBrowserEventRouter : public TabStripModelObserver,
Browser* browser);

// NotificationObserver.
void Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details);
virtual void Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details);
private:
// "Synthetic" event. Called from TabInsertedAt if new tab is detected.
void TabCreatedAt(TabContents* contents, int index, bool foreground);
Expand Down
6 changes: 3 additions & 3 deletions chrome/browser/extensions/extension_message_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ class ExtensionMessageService
bool notify_other_port);

// NotificationObserver interface.
void Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details);
virtual void Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details);

// An IPC sender that might be in our list of channels has closed.
void OnSenderClosed(IPC::Message::Sender* sender);
Expand Down
5 changes: 5 additions & 0 deletions chrome/browser/extensions/extensions_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,11 @@ void ExtensionsService::InitEventRouters() {
event_routers_initialized_ = true;
}

const Extension* ExtensionsService::GetExtensionById(const std::string& id,
bool include_disabled) {
return GetExtensionByIdInternal(id, true, include_disabled);
}

void ExtensionsService::Init() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));

Expand Down
8 changes: 3 additions & 5 deletions chrome/browser/extensions/extensions_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,8 @@ class ExtensionsService
void InitEventRouters();

// Look up an extension by ID.
const Extension* GetExtensionById(const std::string& id,
bool include_disabled) {
return GetExtensionByIdInternal(id, true, include_disabled);
}
virtual const Extension* GetExtensionById(const std::string& id,
bool include_disabled);

// Install the extension file at |extension_path|. Will install as an
// update if an older version is already installed.
Expand Down Expand Up @@ -406,7 +404,7 @@ class ExtensionsService
// it.
void DestroyingProfile();

ExtensionPrefs* extension_prefs() { return extension_prefs_; }
virtual ExtensionPrefs* extension_prefs() { return extension_prefs_; }

// Whether the extension service is ready.
// TODO(skerner): Get rid of this method. crbug.com/63756
Expand Down
6 changes: 3 additions & 3 deletions chrome/browser/extensions/sandboxed_extension_unpacker.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ class SandboxedExtensionUnpacker : public UtilityProcessHost::Client {
void StartProcessOnIOThread(const FilePath& temp_crx_path);

// SandboxedExtensionUnpacker
void OnUnpackExtensionSucceeded(const DictionaryValue& manifest);
void OnUnpackExtensionFailed(const std::string& error_message);
void OnProcessCrashed();
virtual void OnUnpackExtensionSucceeded(const DictionaryValue& manifest);
virtual void OnUnpackExtensionFailed(const std::string& error_message);
virtual void OnProcessCrashed();

void ReportFailure(const std::string& message);
void ReportSuccess();
Expand Down
Loading

0 comments on commit 78994ab

Please sign in to comment.