diff options
author | dcheng <dcheng@chromium.org> | 2014-10-21 05:07:58 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-21 12:08:25 +0000 |
commit | c2282aa89148883769f87c74cc3c4608c0933489 (patch) | |
tree | ffa48a41ac574fc701cac64f5457dfc08d2c0c27 /content | |
parent | c793742b02142aed967568c48def709d6d16bd38 (diff) | |
download | chromium_src-c2282aa89148883769f87c74cc3c4608c0933489.zip chromium_src-c2282aa89148883769f87c74cc3c4608c0933489.tar.gz chromium_src-c2282aa89148883769f87c74cc3c4608c0933489.tar.bz2 |
Standardize usage of virtual/override/final in content/browser/
This patch was automatically generated by applying clang fixit hints
generated by the plugin to the source tree.
BUG=417463
TBR=sky@chromium.org
Review URL: https://codereview.chromium.org/667943003
Cr-Commit-Position: refs/heads/master@{#300469}
Diffstat (limited to 'content')
542 files changed, 5351 insertions, 5915 deletions
diff --git a/content/browser/accessibility/accessibility_ui.h b/content/browser/accessibility/accessibility_ui.h index 4922728..014514a 100644 --- a/content/browser/accessibility/accessibility_ui.h +++ b/content/browser/accessibility/accessibility_ui.h @@ -17,7 +17,7 @@ namespace content { class AccessibilityUI : public WebUIController { public: explicit AccessibilityUI(WebUI* web_ui); - virtual ~AccessibilityUI(); + ~AccessibilityUI() override; private: void ToggleAccessibility(const base::ListValue* args); diff --git a/content/browser/accessibility/browser_accessibility_mac.h b/content/browser/accessibility/browser_accessibility_mac.h index 82920e2..9802c60 100644 --- a/content/browser/accessibility/browser_accessibility_mac.h +++ b/content/browser/accessibility/browser_accessibility_mac.h @@ -18,9 +18,9 @@ namespace content { class BrowserAccessibilityMac : public BrowserAccessibility { public: // BrowserAccessibility overrides. - virtual void NativeReleaseReference() override; - virtual bool IsNative() const override; - virtual void OnDataChanged() override; + void NativeReleaseReference() override; + bool IsNative() const override; + void OnDataChanged() override; // The BrowserAccessibilityCocoa associated with us. BrowserAccessibilityCocoa* native_view() const { diff --git a/content/browser/accessibility/browser_accessibility_manager.h b/content/browser/accessibility/browser_accessibility_manager.h index 754294b..3760141 100644 --- a/content/browser/accessibility/browser_accessibility_manager.h +++ b/content/browser/accessibility/browser_accessibility_manager.h @@ -94,7 +94,7 @@ class CONTENT_EXPORT BrowserAccessibilityManager : public ui::AXTreeDelegate { BrowserAccessibilityDelegate* delegate, BrowserAccessibilityFactory* factory = new BrowserAccessibilityFactory()); - virtual ~BrowserAccessibilityManager(); + ~BrowserAccessibilityManager() override; void Initialize(const ui::AXTreeUpdate& initial_tree); @@ -187,12 +187,12 @@ class CONTENT_EXPORT BrowserAccessibilityManager : public ui::AXTreeDelegate { BrowserAccessibility* PreviousInTreeOrder(BrowserAccessibility* node); // AXTreeDelegate implementation. - virtual void OnNodeWillBeDeleted(ui::AXNode* node) override; - virtual void OnNodeCreated(ui::AXNode* node) override; - virtual void OnNodeChanged(ui::AXNode* node) override; - virtual void OnNodeCreationFinished(ui::AXNode* node) override; - virtual void OnNodeChangeFinished(ui::AXNode* node) override; - virtual void OnRootChanged(ui::AXNode* new_root) override {} + void OnNodeWillBeDeleted(ui::AXNode* node) override; + void OnNodeCreated(ui::AXNode* node) override; + void OnNodeChanged(ui::AXNode* node) override; + void OnNodeCreationFinished(ui::AXNode* node) override; + void OnNodeChangeFinished(ui::AXNode* node) override; + void OnRootChanged(ui::AXNode* new_root) override {} BrowserAccessibilityDelegate* delegate() const { return delegate_; } void set_delegate(BrowserAccessibilityDelegate* delegate) { diff --git a/content/browser/accessibility/browser_accessibility_manager_mac.h b/content/browser/accessibility/browser_accessibility_manager_mac.h index 908bdb4..b754a4b 100644 --- a/content/browser/accessibility/browser_accessibility_manager_mac.h +++ b/content/browser/accessibility/browser_accessibility_manager_mac.h @@ -22,17 +22,17 @@ class CONTENT_EXPORT BrowserAccessibilityManagerMac static ui::AXTreeUpdate GetEmptyDocument(); - virtual BrowserAccessibility* GetFocus(BrowserAccessibility* root) override; + BrowserAccessibility* GetFocus(BrowserAccessibility* root) override; // Implementation of BrowserAccessibilityManager. - virtual void NotifyAccessibilityEvent( - ui::AXEvent event_type, BrowserAccessibility* node) override; + void NotifyAccessibilityEvent(ui::AXEvent event_type, + BrowserAccessibility* node) override; NSView* parent_view() { return parent_view_; } private: - virtual void OnNodeCreationFinished(ui::AXNode* node) override; - virtual void OnTreeUpdateFinished() override; + void OnNodeCreationFinished(ui::AXNode* node) override; + void OnTreeUpdateFinished() override; // This gives BrowserAccessibilityManager::Create access to the class // constructor. diff --git a/content/browser/accessibility/browser_accessibility_manager_unittest.cc b/content/browser/accessibility/browser_accessibility_manager_unittest.cc index 9980de6..a104defa 100644 --- a/content/browser/accessibility/browser_accessibility_manager_unittest.cc +++ b/content/browser/accessibility/browser_accessibility_manager_unittest.cc @@ -22,15 +22,11 @@ class CountedBrowserAccessibility : public BrowserAccessibility { global_obj_count_++; native_ref_count_ = 1; } - virtual ~CountedBrowserAccessibility() { - global_obj_count_--; - } + ~CountedBrowserAccessibility() override { global_obj_count_--; } - virtual void NativeAddReference() override { - native_ref_count_++; - } + void NativeAddReference() override { native_ref_count_++; } - virtual void NativeReleaseReference() override { + void NativeReleaseReference() override { native_ref_count_--; if (native_ref_count_ == 0) delete this; @@ -55,8 +51,8 @@ int CountedBrowserAccessibility::global_obj_count_ = 0; class CountedBrowserAccessibilityFactory : public BrowserAccessibilityFactory { public: - virtual ~CountedBrowserAccessibilityFactory() {} - virtual BrowserAccessibility* Create() override { + ~CountedBrowserAccessibilityFactory() override {} + BrowserAccessibility* Create() override { return new CountedBrowserAccessibility(); } }; @@ -67,43 +63,35 @@ class TestBrowserAccessibilityDelegate TestBrowserAccessibilityDelegate() : got_fatal_error_(false) {} - virtual void AccessibilitySetFocus(int acc_obj_id) override {} - virtual void AccessibilityDoDefaultAction(int acc_obj_id) override {} - virtual void AccessibilityShowMenu(const gfx::Point& point) override {} - virtual void AccessibilityScrollToMakeVisible( - int acc_obj_id, const gfx::Rect& subfocus) override {} - virtual void AccessibilityScrollToPoint( - int acc_obj_id, const gfx::Point& point) override {} - virtual void AccessibilitySetTextSelection( - int acc_obj_id, int start_offset, int end_offset) override {} - virtual bool AccessibilityViewHasFocus() const override { - return false; - } - virtual gfx::Rect AccessibilityGetViewBounds() const override { - return gfx::Rect(); - } - virtual gfx::Point AccessibilityOriginInScreen( + void AccessibilitySetFocus(int acc_obj_id) override {} + void AccessibilityDoDefaultAction(int acc_obj_id) override {} + void AccessibilityShowMenu(const gfx::Point& point) override {} + void AccessibilityScrollToMakeVisible(int acc_obj_id, + const gfx::Rect& subfocus) override {} + void AccessibilityScrollToPoint(int acc_obj_id, + const gfx::Point& point) override {} + void AccessibilitySetTextSelection(int acc_obj_id, + int start_offset, + int end_offset) override {} + bool AccessibilityViewHasFocus() const override { return false; } + gfx::Rect AccessibilityGetViewBounds() const override { return gfx::Rect(); } + gfx::Point AccessibilityOriginInScreen( const gfx::Rect& bounds) const override { return gfx::Point(); } - virtual void AccessibilityHitTest(const gfx::Point& point) override {} - virtual void AccessibilityFatalError() override { - got_fatal_error_ = true; - } - virtual gfx::AcceleratedWidget AccessibilityGetAcceleratedWidget() override { + void AccessibilityHitTest(const gfx::Point& point) override {} + void AccessibilityFatalError() override { got_fatal_error_ = true; } + gfx::AcceleratedWidget AccessibilityGetAcceleratedWidget() override { return gfx::kNullAcceleratedWidget; } - virtual gfx::NativeViewAccessible AccessibilityGetNativeViewAccessible() - override { + gfx::NativeViewAccessible AccessibilityGetNativeViewAccessible() override { return NULL; } - virtual BrowserAccessibilityManager* AccessibilityGetChildFrame( + BrowserAccessibilityManager* AccessibilityGetChildFrame( int accessibility_node_id) override { return NULL; } - virtual BrowserAccessibility* AccessibilityGetParentFrame() override { - return NULL; - } + BrowserAccessibility* AccessibilityGetParentFrame() override { return NULL; } bool got_fatal_error() const { return got_fatal_error_; } void reset_got_fatal_error() { got_fatal_error_ = false; } diff --git a/content/browser/accessibility/browser_accessibility_state_impl.h b/content/browser/accessibility/browser_accessibility_state_impl.h index 37dcfad..4c88843 100644 --- a/content/browser/accessibility/browser_accessibility_state_impl.h +++ b/content/browser/accessibility/browser_accessibility_state_impl.h @@ -40,14 +40,14 @@ class CONTENT_EXPORT BrowserAccessibilityStateImpl static BrowserAccessibilityStateImpl* GetInstance(); - virtual void EnableAccessibility() override; - virtual void DisableAccessibility() override; - virtual void ResetAccessibilityMode() override; - virtual void OnScreenReaderDetected() override; - virtual bool IsAccessibleBrowser() override; - virtual void AddHistogramCallback(base::Closure callback) override; + void EnableAccessibility() override; + void DisableAccessibility() override; + void ResetAccessibilityMode() override; + void OnScreenReaderDetected() override; + bool IsAccessibleBrowser() override; + void AddHistogramCallback(base::Closure callback) override; - virtual void UpdateHistogramsForTesting() override; + void UpdateHistogramsForTesting() override; AccessibilityMode accessibility_mode() const { return accessibility_mode_; }; @@ -72,7 +72,7 @@ class CONTENT_EXPORT BrowserAccessibilityStateImpl void UpdateHistograms(); // Leaky singleton, destructor generally won't be called. - virtual ~BrowserAccessibilityStateImpl(); + ~BrowserAccessibilityStateImpl() override; void UpdatePlatformSpecificHistograms(); diff --git a/content/browser/accessibility/cross_platform_accessibility_browsertest.cc b/content/browser/accessibility/cross_platform_accessibility_browsertest.cc index 6116f20..8f83ed9 100644 --- a/content/browser/accessibility/cross_platform_accessibility_browsertest.cc +++ b/content/browser/accessibility/cross_platform_accessibility_browsertest.cc @@ -57,8 +57,8 @@ class CrossPlatformAccessibilityBrowserTest : public ContentBrowserTest { } // ContentBrowserTest - virtual void SetUpInProcessBrowserTestFixture() override; - virtual void TearDownInProcessBrowserTestFixture() override; + void SetUpInProcessBrowserTestFixture() override; + void TearDownInProcessBrowserTestFixture() override; protected: std::string GetAttr(const ui::AXNode* node, diff --git a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc index 704d0df..d475159 100644 --- a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc +++ b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc @@ -146,7 +146,7 @@ class DumpAccessibilityTreeTest : public ContentBrowserTest { } } - virtual void SetUpCommandLine(base::CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { ContentBrowserTest::SetUpCommandLine(command_line); // Enable <dialog>, which is used in some tests. base::CommandLine::ForCurrentProcess()->AppendSwitch( diff --git a/content/browser/appcache/appcache_disk_cache.cc b/content/browser/appcache/appcache_disk_cache.cc index f8486b4..382ed45 100644 --- a/content/browser/appcache/appcache_disk_cache.cc +++ b/content/browser/appcache/appcache_disk_cache.cc @@ -59,8 +59,11 @@ class AppCacheDiskCache::EntryImpl : public Entry { } // Entry implementation. - virtual int Read(int index, int64 offset, net::IOBuffer* buf, int buf_len, - const net::CompletionCallback& callback) override { + int Read(int index, + int64 offset, + net::IOBuffer* buf, + int buf_len, + const net::CompletionCallback& callback) override { if (offset < 0 || offset > kint32max) return net::ERR_INVALID_ARGUMENT; if (!disk_cache_entry_) @@ -69,8 +72,11 @@ class AppCacheDiskCache::EntryImpl : public Entry { index, static_cast<int>(offset), buf, buf_len, callback); } - virtual int Write(int index, int64 offset, net::IOBuffer* buf, int buf_len, - const net::CompletionCallback& callback) override { + int Write(int index, + int64 offset, + net::IOBuffer* buf, + int buf_len, + const net::CompletionCallback& callback) override { if (offset < 0 || offset > kint32max) return net::ERR_INVALID_ARGUMENT; if (!disk_cache_entry_) @@ -80,11 +86,11 @@ class AppCacheDiskCache::EntryImpl : public Entry { index, static_cast<int>(offset), buf, buf_len, callback, kTruncate); } - virtual int64 GetSize(int index) override { + int64 GetSize(int index) override { return disk_cache_entry_ ? disk_cache_entry_->GetDataSize(index) : 0L; } - virtual void Close() override { + void Close() override { if (disk_cache_entry_) disk_cache_entry_->Close(); delete this; @@ -97,7 +103,7 @@ class AppCacheDiskCache::EntryImpl : public Entry { } private: - virtual ~EntryImpl() { + ~EntryImpl() override { if (owner_) owner_->RemoveOpenEntry(this); } diff --git a/content/browser/appcache/appcache_disk_cache.h b/content/browser/appcache/appcache_disk_cache.h index 9f56970..8995e83c 100644 --- a/content/browser/appcache/appcache_disk_cache.h +++ b/content/browser/appcache/appcache_disk_cache.h @@ -26,7 +26,7 @@ class CONTENT_EXPORT AppCacheDiskCache : public AppCacheDiskCacheInterface { public: AppCacheDiskCache(); - virtual ~AppCacheDiskCache(); + ~AppCacheDiskCache() override; // Initializes the object to use disk backed storage. int InitWithDiskBackend( @@ -44,12 +44,13 @@ class CONTENT_EXPORT AppCacheDiskCache void Disable(); bool is_disabled() const { return is_disabled_; } - virtual int CreateEntry(int64 key, Entry** entry, - const net::CompletionCallback& callback) override; - virtual int OpenEntry(int64 key, Entry** entry, - const net::CompletionCallback& callback) override; - virtual int DoomEntry(int64 key, - const net::CompletionCallback& callback) override; + int CreateEntry(int64 key, + Entry** entry, + const net::CompletionCallback& callback) override; + int OpenEntry(int64 key, + Entry** entry, + const net::CompletionCallback& callback) override; + int DoomEntry(int64 key, const net::CompletionCallback& callback) override; private: class CreateBackendCallbackShim; diff --git a/content/browser/appcache/appcache_dispatcher_host.h b/content/browser/appcache/appcache_dispatcher_host.h index 2631605..c0a615e 100644 --- a/content/browser/appcache/appcache_dispatcher_host.h +++ b/content/browser/appcache/appcache_dispatcher_host.h @@ -27,14 +27,14 @@ class AppCacheDispatcherHost : public BrowserMessageFilter { int process_id); // BrowserIOMessageFilter implementation - virtual void OnChannelConnected(int32 peer_pid) override; - virtual bool OnMessageReceived(const IPC::Message& message) override; + void OnChannelConnected(int32 peer_pid) override; + bool OnMessageReceived(const IPC::Message& message) override; protected: - virtual ~AppCacheDispatcherHost(); + ~AppCacheDispatcherHost() override; // BrowserMessageFilter override. - virtual void BadMessageReceived() override; + void BadMessageReceived() override; private: // IPC message handlers diff --git a/content/browser/appcache/appcache_frontend_proxy.h b/content/browser/appcache/appcache_frontend_proxy.h index 221572a..65d03ee 100644 --- a/content/browser/appcache/appcache_frontend_proxy.h +++ b/content/browser/appcache/appcache_frontend_proxy.h @@ -19,22 +19,21 @@ class AppCacheFrontendProxy : public AppCacheFrontend { explicit AppCacheFrontendProxy(IPC::Sender* sender); // AppCacheFrontend methods - virtual void OnCacheSelected(int host_id, - const AppCacheInfo& info) override; - virtual void OnStatusChanged(const std::vector<int>& host_ids, - AppCacheStatus status) override; - virtual void OnEventRaised(const std::vector<int>& host_ids, - AppCacheEventID event_id) override; - virtual void OnProgressEventRaised(const std::vector<int>& host_ids, - const GURL& url, - int num_total, int num_complete) override; - virtual void OnErrorEventRaised(const std::vector<int>& host_ids, - const AppCacheErrorDetails& details) - override; - virtual void OnLogMessage(int host_id, AppCacheLogLevel log_level, - const std::string& message) override; - virtual void OnContentBlocked(int host_id, - const GURL& manifest_url) override; + void OnCacheSelected(int host_id, const AppCacheInfo& info) override; + void OnStatusChanged(const std::vector<int>& host_ids, + AppCacheStatus status) override; + void OnEventRaised(const std::vector<int>& host_ids, + AppCacheEventID event_id) override; + void OnProgressEventRaised(const std::vector<int>& host_ids, + const GURL& url, + int num_total, + int num_complete) override; + void OnErrorEventRaised(const std::vector<int>& host_ids, + const AppCacheErrorDetails& details) override; + void OnLogMessage(int host_id, + AppCacheLogLevel log_level, + const std::string& message) override; + void OnContentBlocked(int host_id, const GURL& manifest_url) override; private: IPC::Sender* sender_; diff --git a/content/browser/appcache/appcache_group.cc b/content/browser/appcache/appcache_group.cc index 5085670..7ebd289 100644 --- a/content/browser/appcache/appcache_group.cc +++ b/content/browser/appcache/appcache_group.cc @@ -27,8 +27,8 @@ class AppCacheGroup::HostObserver : public AppCacheHost::Observer { explicit HostObserver(AppCacheGroup* group) : group_(group) {} // Methods for AppCacheHost::Observer. - virtual void OnCacheSelectionComplete(AppCacheHost* host) override {} // N/A - virtual void OnDestructionImminent(AppCacheHost* host) override { + void OnCacheSelectionComplete(AppCacheHost* host) override {} // N/A + void OnDestructionImminent(AppCacheHost* host) override { group_->HostDestructionImminent(host); } private: diff --git a/content/browser/appcache/appcache_group_unittest.cc b/content/browser/appcache/appcache_group_unittest.cc index 4d01e02..64e321d 100644 --- a/content/browser/appcache/appcache_group_unittest.cc +++ b/content/browser/appcache/appcache_group_unittest.cc @@ -22,37 +22,33 @@ class TestAppCacheFrontend : public content::AppCacheFrontend { last_status_(content::APPCACHE_STATUS_OBSOLETE) { } - virtual void OnCacheSelected( - int host_id, const content::AppCacheInfo& info) override { + void OnCacheSelected(int host_id, + const content::AppCacheInfo& info) override { last_host_id_ = host_id; last_cache_id_ = info.cache_id; last_status_ = info.status; } - virtual void OnStatusChanged(const std::vector<int>& host_ids, - content::AppCacheStatus status) override { - } + void OnStatusChanged(const std::vector<int>& host_ids, + content::AppCacheStatus status) override {} - virtual void OnEventRaised(const std::vector<int>& host_ids, - content::AppCacheEventID event_id) override { - } + void OnEventRaised(const std::vector<int>& host_ids, + content::AppCacheEventID event_id) override {} - virtual void OnErrorEventRaised(const std::vector<int>& host_ids, - const content::AppCacheErrorDetails& details) - override {} + void OnErrorEventRaised( + const std::vector<int>& host_ids, + const content::AppCacheErrorDetails& details) override {} - virtual void OnProgressEventRaised(const std::vector<int>& host_ids, - const GURL& url, - int num_total, int num_complete) override { - } + void OnProgressEventRaised(const std::vector<int>& host_ids, + const GURL& url, + int num_total, + int num_complete) override {} - virtual void OnLogMessage(int host_id, content::AppCacheLogLevel log_level, - const std::string& message) override { - } + void OnLogMessage(int host_id, + content::AppCacheLogLevel log_level, + const std::string& message) override {} - virtual void OnContentBlocked(int host_id, - const GURL& manifest_url) override { - } + void OnContentBlocked(int host_id, const GURL& manifest_url) override {} int last_host_id_; int64 last_cache_id_; @@ -68,7 +64,7 @@ class TestUpdateObserver : public AppCacheGroup::UpdateObserver { TestUpdateObserver() : update_completed_(false), group_has_cache_(false) { } - virtual void OnUpdateComplete(AppCacheGroup* group) override { + void OnUpdateComplete(AppCacheGroup* group) override { update_completed_ = true; group_has_cache_ = group->HasCache(); } @@ -88,7 +84,7 @@ class TestAppCacheHost : public AppCacheHost { update_completed_(false) { } - virtual void OnUpdateComplete(AppCacheGroup* group) override { + void OnUpdateComplete(AppCacheGroup* group) override { update_completed_ = true; } diff --git a/content/browser/appcache/appcache_host.h b/content/browser/appcache/appcache_host.h index 933ad48..9f014fb 100644 --- a/content/browser/appcache/appcache_host.h +++ b/content/browser/appcache/appcache_host.h @@ -68,7 +68,7 @@ class CONTENT_EXPORT AppCacheHost AppCacheHost(int host_id, AppCacheFrontend* frontend, AppCacheServiceImpl* service); - virtual ~AppCacheHost(); + ~AppCacheHost() override; // Adds/removes an observer, the AppCacheHost does not take // ownership of the observer. @@ -192,11 +192,10 @@ class CONTENT_EXPORT AppCacheHost void AssociateCacheHelper(AppCache* cache, const GURL& manifest_url); // AppCacheStorage::Delegate impl - virtual void OnCacheLoaded(AppCache* cache, int64 cache_id) override; - virtual void OnGroupLoaded(AppCacheGroup* group, - const GURL& manifest_url) override; + void OnCacheLoaded(AppCache* cache, int64 cache_id) override; + void OnGroupLoaded(AppCacheGroup* group, const GURL& manifest_url) override; // AppCacheServiceImpl::Observer impl - virtual void OnServiceReinitialized( + void OnServiceReinitialized( AppCacheStorageReference* old_storage_ref) override; void FinishCacheSelection(AppCache* cache, AppCacheGroup* group); @@ -207,7 +206,7 @@ class CONTENT_EXPORT AppCacheHost void ObserveGroupBeingUpdated(AppCacheGroup* group); // AppCacheGroup::UpdateObserver methods. - virtual void OnUpdateComplete(AppCacheGroup* group) override; + void OnUpdateComplete(AppCacheGroup* group) override; // Returns true if this host is for a dedicated worker context. bool is_for_dedicated_worker() const { diff --git a/content/browser/appcache/appcache_host_unittest.cc b/content/browser/appcache/appcache_host_unittest.cc index aed32f4..817e8c0 100644 --- a/content/browser/appcache/appcache_host_unittest.cc +++ b/content/browser/appcache/appcache_host_unittest.cc @@ -42,43 +42,39 @@ class AppCacheHostTest : public testing::Test { content_blocked_(false) { } - virtual void OnCacheSelected( - int host_id, const AppCacheInfo& info) override { + void OnCacheSelected(int host_id, const AppCacheInfo& info) override { last_host_id_ = host_id; last_cache_id_ = info.cache_id; last_status_ = info.status; } - virtual void OnStatusChanged(const std::vector<int>& host_ids, - AppCacheStatus status) override { + void OnStatusChanged(const std::vector<int>& host_ids, + AppCacheStatus status) override { last_status_changed_ = status; } - virtual void OnEventRaised(const std::vector<int>& host_ids, - AppCacheEventID event_id) override { + void OnEventRaised(const std::vector<int>& host_ids, + AppCacheEventID event_id) override { last_event_id_ = event_id; } - virtual void OnErrorEventRaised( - const std::vector<int>& host_ids, - const AppCacheErrorDetails& details) override { + void OnErrorEventRaised(const std::vector<int>& host_ids, + const AppCacheErrorDetails& details) override { last_event_id_ = APPCACHE_ERROR_EVENT; } - virtual void OnProgressEventRaised(const std::vector<int>& host_ids, - const GURL& url, - int num_total, - int num_complete) override { + void OnProgressEventRaised(const std::vector<int>& host_ids, + const GURL& url, + int num_total, + int num_complete) override { last_event_id_ = APPCACHE_PROGRESS_EVENT; } - virtual void OnLogMessage(int host_id, - AppCacheLogLevel log_level, - const std::string& message) override { - } + void OnLogMessage(int host_id, + AppCacheLogLevel log_level, + const std::string& message) override {} - virtual void OnContentBlocked(int host_id, - const GURL& manifest_url) override { + void OnContentBlocked(int host_id, const GURL& manifest_url) override { content_blocked_ = true; } @@ -95,29 +91,26 @@ class AppCacheHostTest : public testing::Test { MockQuotaManagerProxy() : QuotaManagerProxy(NULL, NULL) {} // Not needed for our tests. - virtual void RegisterClient(storage::QuotaClient* client) override {} - virtual void NotifyStorageAccessed(storage::QuotaClient::ID client_id, - const GURL& origin, - storage::StorageType type) override {} - virtual void NotifyStorageModified(storage::QuotaClient::ID client_id, - const GURL& origin, - storage::StorageType type, - int64 delta) override {} - virtual void SetUsageCacheEnabled(storage::QuotaClient::ID client_id, - const GURL& origin, - storage::StorageType type, - bool enabled) override {} - virtual void GetUsageAndQuota( - base::SequencedTaskRunner* original_task_runner, - const GURL& origin, - storage::StorageType type, - const GetUsageAndQuotaCallback& callback) override {} - - virtual void NotifyOriginInUse(const GURL& origin) override { - inuse_[origin] += 1; - } - - virtual void NotifyOriginNoLongerInUse(const GURL& origin) override { + void RegisterClient(storage::QuotaClient* client) override {} + void NotifyStorageAccessed(storage::QuotaClient::ID client_id, + const GURL& origin, + storage::StorageType type) override {} + void NotifyStorageModified(storage::QuotaClient::ID client_id, + const GURL& origin, + storage::StorageType type, + int64 delta) override {} + void SetUsageCacheEnabled(storage::QuotaClient::ID client_id, + const GURL& origin, + storage::StorageType type, + bool enabled) override {} + void GetUsageAndQuota(base::SequencedTaskRunner* original_task_runner, + const GURL& origin, + storage::StorageType type, + const GetUsageAndQuotaCallback& callback) override {} + + void NotifyOriginInUse(const GURL& origin) override { inuse_[origin] += 1; } + + void NotifyOriginNoLongerInUse(const GURL& origin) override { inuse_[origin] -= 1; } @@ -133,7 +126,7 @@ class AppCacheHostTest : public testing::Test { std::map<GURL, int> inuse_; protected: - virtual ~MockQuotaManagerProxy() {} + ~MockQuotaManagerProxy() override {} }; void GetStatusCallback(AppCacheStatus status, void* param) { diff --git a/content/browser/appcache/appcache_interceptor.cc b/content/browser/appcache/appcache_interceptor.cc index 1510c64..adc6d2c 100644 --- a/content/browser/appcache/appcache_interceptor.cc +++ b/content/browser/appcache/appcache_interceptor.cc @@ -17,8 +17,8 @@ class AppCacheInterceptor::StartInterceptor : public net::URLRequestInterceptor { public: StartInterceptor() {} - virtual ~StartInterceptor() {} - virtual net::URLRequestJob* MaybeInterceptRequest( + ~StartInterceptor() override {} + net::URLRequestJob* MaybeInterceptRequest( net::URLRequest* request, net::NetworkDelegate* network_delegate) const override { AppCacheRequestHandler* handler = GetHandler(request); diff --git a/content/browser/appcache/appcache_interceptor.h b/content/browser/appcache/appcache_interceptor.h index b18fc09..049fd7a 100644 --- a/content/browser/appcache/appcache_interceptor.h +++ b/content/browser/appcache/appcache_interceptor.h @@ -59,13 +59,13 @@ class CONTENT_EXPORT AppCacheInterceptor protected: // Override from net::URLRequest::Interceptor: - virtual net::URLRequestJob* MaybeIntercept( + net::URLRequestJob* MaybeIntercept( net::URLRequest* request, net::NetworkDelegate* network_delegate) override; - virtual net::URLRequestJob* MaybeInterceptResponse( + net::URLRequestJob* MaybeInterceptResponse( net::URLRequest* request, net::NetworkDelegate* network_delegate) override; - virtual net::URLRequestJob* MaybeInterceptRedirect( + net::URLRequestJob* MaybeInterceptRedirect( net::URLRequest* request, net::NetworkDelegate* network_delegate, const GURL& location) override; @@ -75,7 +75,7 @@ class CONTENT_EXPORT AppCacheInterceptor class StartInterceptor; AppCacheInterceptor(); - virtual ~AppCacheInterceptor(); + ~AppCacheInterceptor() override; static void SetHandler(net::URLRequest* request, AppCacheRequestHandler* handler); diff --git a/content/browser/appcache/appcache_quota_client.h b/content/browser/appcache/appcache_quota_client.h index f07ad5e..2af0fbe 100644 --- a/content/browser/appcache/appcache_quota_client.h +++ b/content/browser/appcache/appcache_quota_client.h @@ -33,23 +33,23 @@ class AppCacheQuotaClient : public storage::QuotaClient { public: typedef std::deque<base::Closure> RequestQueue; - virtual ~AppCacheQuotaClient(); + ~AppCacheQuotaClient() override; // QuotaClient method overrides - virtual ID id() const override; - virtual void OnQuotaManagerDestroyed() override; - virtual void GetOriginUsage(const GURL& origin, - storage::StorageType type, - const GetUsageCallback& callback) override; - virtual void GetOriginsForType(storage::StorageType type, - const GetOriginsCallback& callback) override; - virtual void GetOriginsForHost(storage::StorageType type, - const std::string& host, - const GetOriginsCallback& callback) override; - virtual void DeleteOriginData(const GURL& origin, - storage::StorageType type, - const DeletionCallback& callback) override; - virtual bool DoesSupport(storage::StorageType type) const override; + ID id() const override; + void OnQuotaManagerDestroyed() override; + void GetOriginUsage(const GURL& origin, + storage::StorageType type, + const GetUsageCallback& callback) override; + void GetOriginsForType(storage::StorageType type, + const GetOriginsCallback& callback) override; + void GetOriginsForHost(storage::StorageType type, + const std::string& host, + const GetOriginsCallback& callback) override; + void DeleteOriginData(const GURL& origin, + storage::StorageType type, + const DeletionCallback& callback) override; + bool DoesSupport(storage::StorageType type) const override; private: friend class content::AppCacheQuotaClientTest; diff --git a/content/browser/appcache/appcache_request_handler.h b/content/browser/appcache/appcache_request_handler.h index e913758..cf0297b 100644 --- a/content/browser/appcache/appcache_request_handler.h +++ b/content/browser/appcache/appcache_request_handler.h @@ -32,7 +32,7 @@ class CONTENT_EXPORT AppCacheRequestHandler public AppCacheHost::Observer, public AppCacheStorage::Delegate { public: - virtual ~AppCacheRequestHandler(); + ~AppCacheRequestHandler() override; // These are called on each request intercept opportunity. AppCacheURLRequestJob* MaybeLoadResource( @@ -62,7 +62,7 @@ class CONTENT_EXPORT AppCacheRequestHandler AppCacheRequestHandler(AppCacheHost* host, ResourceType resource_type); // AppCacheHost::Observer override - virtual void OnDestructionImminent(AppCacheHost* host) override; + void OnDestructionImminent(AppCacheHost* host) override; // Helpers to instruct a waiting job with what response to // deliver for the request we're handling. @@ -87,10 +87,13 @@ class CONTENT_EXPORT AppCacheRequestHandler net::NetworkDelegate* network_delegate); // AppCacheStorage::Delegate methods - virtual void OnMainResponseFound( - const GURL& url, const AppCacheEntry& entry, - const GURL& fallback_url, const AppCacheEntry& fallback_entry, - int64 cache_id, int64 group_id, const GURL& mainfest_url) override; + void OnMainResponseFound(const GURL& url, + const AppCacheEntry& entry, + const GURL& fallback_url, + const AppCacheEntry& fallback_entry, + int64 cache_id, + int64 group_id, + const GURL& mainfest_url) override; // Sub-resource loading ------------------------------------- // Dedicated worker and all manner of sub-resources are handled here. @@ -100,7 +103,7 @@ class CONTENT_EXPORT AppCacheRequestHandler void ContinueMaybeLoadSubResource(); // AppCacheHost::Observer override - virtual void OnCacheSelectionComplete(AppCacheHost* host) override; + void OnCacheSelectionComplete(AppCacheHost* host) override; // Data members ----------------------------------------------- diff --git a/content/browser/appcache/appcache_request_handler_unittest.cc b/content/browser/appcache/appcache_request_handler_unittest.cc index 2d8e66f..5d53a8b 100644 --- a/content/browser/appcache/appcache_request_handler_unittest.cc +++ b/content/browser/appcache/appcache_request_handler_unittest.cc @@ -35,32 +35,27 @@ class AppCacheRequestHandlerTest : public testing::Test { public: class MockFrontend : public AppCacheFrontend { public: - virtual void OnCacheSelected( - int host_id, const AppCacheInfo& info) override {} + void OnCacheSelected(int host_id, const AppCacheInfo& info) override {} - virtual void OnStatusChanged(const std::vector<int>& host_ids, - AppCacheStatus status) override {} + void OnStatusChanged(const std::vector<int>& host_ids, + AppCacheStatus status) override {} - virtual void OnEventRaised(const std::vector<int>& host_ids, - AppCacheEventID event_id) override {} + void OnEventRaised(const std::vector<int>& host_ids, + AppCacheEventID event_id) override {} - virtual void OnErrorEventRaised( - const std::vector<int>& host_ids, - const AppCacheErrorDetails& details) override {} + void OnErrorEventRaised(const std::vector<int>& host_ids, + const AppCacheErrorDetails& details) override {} - virtual void OnProgressEventRaised(const std::vector<int>& host_ids, - const GURL& url, - int num_total, - int num_complete) override { - } + void OnProgressEventRaised(const std::vector<int>& host_ids, + const GURL& url, + int num_total, + int num_complete) override {} - virtual void OnLogMessage(int host_id, - AppCacheLogLevel log_level, - const std::string& message) override { - } + void OnLogMessage(int host_id, + AppCacheLogLevel log_level, + const std::string& message) override {} - virtual void OnContentBlocked(int host_id, - const GURL& manifest_url) override {} + void OnContentBlocked(int host_id, const GURL& manifest_url) override {} }; // Helper callback to run a test on our io_thread. The io_thread is spun up @@ -75,10 +70,8 @@ class AppCacheRequestHandlerTest : public testing::Test { // exercise fallback code paths. class MockURLRequestDelegate : public net::URLRequest::Delegate { - virtual void OnResponseStarted(net::URLRequest* request) override {} - virtual void OnReadCompleted(net::URLRequest* request, - int bytes_read) override { - } + void OnResponseStarted(net::URLRequest* request) override {} + void OnReadCompleted(net::URLRequest* request, int bytes_read) override {} }; class MockURLRequestJob : public net::URLRequestJob { @@ -98,15 +91,10 @@ class AppCacheRequestHandlerTest : public testing::Test { response_info_(info) {} protected: - virtual ~MockURLRequestJob() {} - virtual void Start() override { - NotifyHeadersComplete(); - } - virtual int GetResponseCode() const override { - return response_code_; - } - virtual void GetResponseInfo( - net::HttpResponseInfo* info) override { + ~MockURLRequestJob() override {} + void Start() override { NotifyHeadersComplete(); } + int GetResponseCode() const override { return response_code_; } + void GetResponseInfo(net::HttpResponseInfo* info) override { if (!has_response_info_) return; *info = response_info_; @@ -123,15 +111,13 @@ class AppCacheRequestHandlerTest : public testing::Test { MockURLRequestJobFactory() : job_(NULL) { } - virtual ~MockURLRequestJobFactory() { - DCHECK(!job_); - } + ~MockURLRequestJobFactory() override { DCHECK(!job_); } void SetJob(net::URLRequestJob* job) { job_ = job; } - virtual net::URLRequestJob* MaybeCreateJobWithProtocolHandler( + net::URLRequestJob* MaybeCreateJobWithProtocolHandler( const std::string& scheme, net::URLRequest* request, net::NetworkDelegate* network_delegate) const override { @@ -148,15 +134,15 @@ class AppCacheRequestHandlerTest : public testing::Test { } } - virtual bool IsHandledProtocol(const std::string& scheme) const override { + bool IsHandledProtocol(const std::string& scheme) const override { return scheme == "http"; }; - virtual bool IsHandledURL(const GURL& url) const override { + bool IsHandledURL(const GURL& url) const override { return url.SchemeIs("http"); } - virtual bool IsSafeRedirectTarget(const GURL& location) const override { + bool IsSafeRedirectTarget(const GURL& location) const override { return false; } diff --git a/content/browser/appcache/appcache_response.cc b/content/browser/appcache/appcache_response.cc index b1d2366..0d8b5b4 100644 --- a/content/browser/appcache/appcache_response.cc +++ b/content/browser/appcache/appcache_response.cc @@ -37,7 +37,7 @@ class WrappedPickleIOBuffer : public net::WrappedIOBuffer { } private: - virtual ~WrappedPickleIOBuffer() {} + ~WrappedPickleIOBuffer() override {} scoped_ptr<const Pickle> pickle_; }; diff --git a/content/browser/appcache/appcache_response.h b/content/browser/appcache/appcache_response.h index 9558478..4b7a32c 100644 --- a/content/browser/appcache/appcache_response.h +++ b/content/browser/appcache/appcache_response.h @@ -134,7 +134,7 @@ class CONTENT_EXPORT AppCacheResponseIO { class CONTENT_EXPORT AppCacheResponseReader : public AppCacheResponseIO { public: - virtual ~AppCacheResponseReader(); + ~AppCacheResponseReader() override; // Reads http info from storage. Always returns the result of the read // asynchronously through the 'callback'. Returns the number of bytes read @@ -177,7 +177,7 @@ class CONTENT_EXPORT AppCacheResponseReader int64 group_id, AppCacheDiskCacheInterface* disk_cache); - virtual void OnIOComplete(int result) override; + void OnIOComplete(int result) override; void ContinueReadInfo(); void ContinueReadData(); void OpenEntryIfNeededAndContinue(); @@ -197,7 +197,7 @@ class CONTENT_EXPORT AppCacheResponseReader class CONTENT_EXPORT AppCacheResponseWriter : public AppCacheResponseIO { public: - virtual ~AppCacheResponseWriter(); + ~AppCacheResponseWriter() override; // Writes the http info to storage. Always returns the result of the write // asynchronously through the 'callback'. Returns the number of bytes written @@ -243,7 +243,7 @@ class CONTENT_EXPORT AppCacheResponseWriter SECOND_ATTEMPT }; - virtual void OnIOComplete(int result) override; + void OnIOComplete(int result) override; void ContinueWriteInfo(); void ContinueWriteData(); void CreateEntryIfNeededAndContinue(); diff --git a/content/browser/appcache/appcache_response_unittest.cc b/content/browser/appcache/appcache_response_unittest.cc index b2655b1..815e697 100644 --- a/content/browser/appcache/appcache_response_unittest.cc +++ b/content/browser/appcache/appcache_response_unittest.cc @@ -40,8 +40,8 @@ class AppCacheResponseTest : public testing::Test { : loaded_info_id_(0), test_(test) { } - virtual void OnResponseInfoLoaded(AppCacheResponseInfo* info, - int64 response_id) override { + void OnResponseInfoLoaded(AppCacheResponseInfo* info, + int64 response_id) override { loaded_info_ = info; loaded_info_id_ = response_id; test_->ScheduleNextTask(); diff --git a/content/browser/appcache/appcache_service_impl.cc b/content/browser/appcache/appcache_service_impl.cc index 97a0558..0c784df 100644 --- a/content/browser/appcache/appcache_service_impl.cc +++ b/content/browser/appcache/appcache_service_impl.cc @@ -51,7 +51,7 @@ class AppCacheServiceImpl::AsyncHelper service_->pending_helpers_.insert(this); } - virtual ~AsyncHelper() { + ~AsyncHelper() override { if (service_) service_->pending_helpers_.erase(this); } @@ -94,7 +94,7 @@ class AppCacheServiceImpl::CanHandleOfflineHelper : AsyncHelper { first_party_(first_party) { } - virtual void Start() override { + void Start() override { AppCachePolicy* policy = service_->appcache_policy(); if (policy && !policy->CanLoadAppCache(url_, first_party_)) { CallCallback(net::ERR_FAILED); @@ -107,10 +107,13 @@ class AppCacheServiceImpl::CanHandleOfflineHelper : AsyncHelper { private: // AppCacheStorage::Delegate implementation. - virtual void OnMainResponseFound( - const GURL& url, const AppCacheEntry& entry, - const GURL& fallback_url, const AppCacheEntry& fallback_entry, - int64 cache_id, int64 group_id, const GURL& mainfest_url) override; + void OnMainResponseFound(const GURL& url, + const AppCacheEntry& entry, + const GURL& fallback_url, + const AppCacheEntry& fallback_entry, + int64 cache_id, + int64 group_id, + const GURL& mainfest_url) override; GURL url_; GURL first_party_; @@ -137,17 +140,16 @@ class AppCacheServiceImpl::DeleteHelper : public AsyncHelper { : AsyncHelper(service, callback), manifest_url_(manifest_url) { } - virtual void Start() override { + void Start() override { service_->storage()->LoadOrCreateGroup(manifest_url_, this); } private: // AppCacheStorage::Delegate implementation. - virtual void OnGroupLoaded( - AppCacheGroup* group, const GURL& manifest_url) override; - virtual void OnGroupMadeObsolete(AppCacheGroup* group, - bool success, - int response_code) override; + void OnGroupLoaded(AppCacheGroup* group, const GURL& manifest_url) override; + void OnGroupMadeObsolete(AppCacheGroup* group, + bool success, + int response_code) override; GURL manifest_url_; DISALLOW_COPY_AND_ASSIGN(DeleteHelper); @@ -184,19 +186,18 @@ class AppCacheServiceImpl::DeleteOriginHelper : public AsyncHelper { num_caches_to_delete_(0), successes_(0), failures_(0) { } - virtual void Start() override { + void Start() override { // We start by listing all caches, continues in OnAllInfo(). service_->storage()->GetAllInfo(this); } private: // AppCacheStorage::Delegate implementation. - virtual void OnAllInfo(AppCacheInfoCollection* collection) override; - virtual void OnGroupLoaded( - AppCacheGroup* group, const GURL& manifest_url) override; - virtual void OnGroupMadeObsolete(AppCacheGroup* group, - bool success, - int response_code) override; + void OnAllInfo(AppCacheInfoCollection* collection) override; + void OnGroupLoaded(AppCacheGroup* group, const GURL& manifest_url) override; + void OnGroupMadeObsolete(AppCacheGroup* group, + bool success, + int response_code) override; void CacheCompleted(bool success); @@ -278,13 +279,11 @@ class AppCacheServiceImpl::GetInfoHelper : AsyncHelper { : AsyncHelper(service, callback), collection_(collection) { } - virtual void Start() override { - service_->storage()->GetAllInfo(this); - } + void Start() override { service_->storage()->GetAllInfo(this); } private: // AppCacheStorage::Delegate implementation. - virtual void OnAllInfo(AppCacheInfoCollection* collection) override; + void OnAllInfo(AppCacheInfoCollection* collection) override; scoped_refptr<AppCacheInfoCollection> collection_; @@ -316,11 +315,11 @@ class AppCacheServiceImpl::CheckResponseHelper : AsyncHelper { amount_data_read_(0) { } - virtual void Start() override { + void Start() override { service_->storage()->LoadOrCreateGroup(manifest_url_, this); } - virtual void Cancel() override { + void Cancel() override { AppCacheHistograms::CountCheckResponseResult( AppCacheHistograms::CHECK_CANCELED); response_reader_.reset(); @@ -328,8 +327,7 @@ class AppCacheServiceImpl::CheckResponseHelper : AsyncHelper { } private: - virtual void OnGroupLoaded(AppCacheGroup* group, - const GURL& manifest_url) override; + void OnGroupLoaded(AppCacheGroup* group, const GURL& manifest_url) override; void OnReadInfoComplete(int result); void OnReadDataComplete(int result); diff --git a/content/browser/appcache/appcache_service_impl.h b/content/browser/appcache/appcache_service_impl.h index adbf03d..cb61f3a 100644 --- a/content/browser/appcache/appcache_service_impl.h +++ b/content/browser/appcache/appcache_service_impl.h @@ -79,7 +79,7 @@ class CONTENT_EXPORT AppCacheServiceImpl // If not using quota management, the proxy may be NULL. explicit AppCacheServiceImpl(storage::QuotaManagerProxy* quota_manager_proxy); - virtual ~AppCacheServiceImpl(); + ~AppCacheServiceImpl() override; void Initialize( const base::FilePath& cache_directory, @@ -99,16 +99,14 @@ class CONTENT_EXPORT AppCacheServiceImpl void ScheduleReinitialize(); // AppCacheService implementation: - virtual void CanHandleMainResourceOffline( + void CanHandleMainResourceOffline( const GURL& url, const GURL& first_party, const net::CompletionCallback& callback) override; - virtual void GetAllAppCacheInfo( - AppCacheInfoCollection* collection, - const net::CompletionCallback& callback) override; - virtual void DeleteAppCacheGroup( - const GURL& manifest_url, - const net::CompletionCallback& callback) override; + void GetAllAppCacheInfo(AppCacheInfoCollection* collection, + const net::CompletionCallback& callback) override; + void DeleteAppCacheGroup(const GURL& manifest_url, + const net::CompletionCallback& callback) override; // Deletes all appcaches for the origin, 'callback' is invoked upon // completion. This method always completes asynchronously. diff --git a/content/browser/appcache/appcache_service_unittest.cc b/content/browser/appcache/appcache_service_unittest.cc index 28e68a6..b3532f5 100644 --- a/content/browser/appcache/appcache_service_unittest.cc +++ b/content/browser/appcache/appcache_service_unittest.cc @@ -38,8 +38,8 @@ class MockResponseReader : public AppCacheResponseReader { info_(info), info_size_(info_size), data_(data), data_size_(data_size) { } - virtual void ReadInfo(HttpResponseInfoIOBuffer* info_buf, - const net::CompletionCallback& callback) override { + void ReadInfo(HttpResponseInfoIOBuffer* info_buf, + const net::CompletionCallback& callback) override { info_buffer_ = info_buf; callback_ = callback; // Cleared on completion. @@ -48,8 +48,9 @@ class MockResponseReader : public AppCacheResponseReader { info_buffer_->response_data_size = data_size_; ScheduleUserCallback(rv); } - virtual void ReadData(net::IOBuffer* buf, int buf_len, - const net::CompletionCallback& callback) override { + void ReadData(net::IOBuffer* buf, + int buf_len, + const net::CompletionCallback& callback) override { buffer_ = buf; buffer_len_ = buf_len; callback_ = callback; // Cleared on completion. diff --git a/content/browser/appcache/appcache_storage_impl.cc b/content/browser/appcache/appcache_storage_impl.cc index def8eeb..5df1d3e 100644 --- a/content/browser/appcache/appcache_storage_impl.cc +++ b/content/browser/appcache/appcache_storage_impl.cc @@ -268,11 +268,11 @@ class AppCacheStorageImpl::InitTask : public DatabaseTask { } // DatabaseTask: - virtual void Run() override; - virtual void RunCompleted() override; + void Run() override; + void RunCompleted() override; protected: - virtual ~InitTask() {} + ~InitTask() override {} private: base::FilePath db_file_path_; @@ -330,10 +330,10 @@ class AppCacheStorageImpl::DisableDatabaseTask : public DatabaseTask { : DatabaseTask(storage) {} // DatabaseTask: - virtual void Run() override { database_->Disable(); } + void Run() override { database_->Disable(); } protected: - virtual ~DisableDatabaseTask() {} + ~DisableDatabaseTask() override {} }; // GetAllInfoTask ------- @@ -346,11 +346,11 @@ class AppCacheStorageImpl::GetAllInfoTask : public DatabaseTask { } // DatabaseTask: - virtual void Run() override; - virtual void RunCompleted() override; + void Run() override; + void RunCompleted() override; protected: - virtual ~GetAllInfoTask() {} + ~GetAllInfoTask() override {} private: scoped_refptr<AppCacheInfoCollection> info_collection_; @@ -395,7 +395,7 @@ class AppCacheStorageImpl::StoreOrLoadTask : public DatabaseTask { protected: explicit StoreOrLoadTask(AppCacheStorageImpl* storage) : DatabaseTask(storage) {} - virtual ~StoreOrLoadTask() {} + ~StoreOrLoadTask() override {} bool FindRelatedCacheRecords(int64 cache_id); void CreateCacheAndGroupFromRecords( @@ -500,11 +500,11 @@ class AppCacheStorageImpl::CacheLoadTask : public StoreOrLoadTask { success_(false) {} // DatabaseTask: - virtual void Run() override; - virtual void RunCompleted() override; + void Run() override; + void RunCompleted() override; protected: - virtual ~CacheLoadTask() {} + ~CacheLoadTask() override {} private: int64 cache_id_; @@ -542,11 +542,11 @@ class AppCacheStorageImpl::GroupLoadTask : public StoreOrLoadTask { success_(false) {} // DatabaseTask: - virtual void Run() override; - virtual void RunCompleted() override; + void Run() override; + void RunCompleted() override; protected: - virtual ~GroupLoadTask() {} + ~GroupLoadTask() override {} private: GURL manifest_url_; @@ -596,12 +596,12 @@ class AppCacheStorageImpl::StoreGroupAndCacheTask : public StoreOrLoadTask { int64 quota); // DatabaseTask: - virtual void Run() override; - virtual void RunCompleted() override; - virtual void CancelCompletion() override; + void Run() override; + void RunCompleted() override; + void CancelCompletion() override; protected: - virtual ~StoreGroupAndCacheTask() {} + ~StoreGroupAndCacheTask() override {} private: scoped_refptr<AppCacheGroup> group_; @@ -901,11 +901,11 @@ class AppCacheStorageImpl::FindMainResponseTask : public DatabaseTask { } // DatabaseTask: - virtual void Run() override; - virtual void RunCompleted() override; + void Run() override; + void RunCompleted() override; protected: - virtual ~FindMainResponseTask() {} + ~FindMainResponseTask() override {} private: typedef std::vector<AppCacheDatabase::NamespaceRecord*> @@ -1102,11 +1102,11 @@ class AppCacheStorageImpl::MarkEntryAsForeignTask : public DatabaseTask { : DatabaseTask(storage), cache_id_(cache_id), entry_url_(url) {} // DatabaseTask: - virtual void Run() override; - virtual void RunCompleted() override; + void Run() override; + void RunCompleted() override; protected: - virtual ~MarkEntryAsForeignTask() {} + ~MarkEntryAsForeignTask() override {} private: int64 cache_id_; @@ -1132,12 +1132,12 @@ class AppCacheStorageImpl::MakeGroupObsoleteTask : public DatabaseTask { int response_code); // DatabaseTask: - virtual void Run() override; - virtual void RunCompleted() override; - virtual void CancelCompletion() override; + void Run() override; + void RunCompleted() override; + void CancelCompletion() override; protected: - virtual ~MakeGroupObsoleteTask() {} + ~MakeGroupObsoleteTask() override {} private: scoped_refptr<AppCacheGroup> group_; @@ -1221,11 +1221,11 @@ class AppCacheStorageImpl::GetDeletableResponseIdsTask : public DatabaseTask { : DatabaseTask(storage), max_rowid_(max_rowid) {} // DatabaseTask: - virtual void Run() override; - virtual void RunCompleted() override; + void Run() override; + void RunCompleted() override; protected: - virtual ~GetDeletableResponseIdsTask() {} + ~GetDeletableResponseIdsTask() override {} private: int64 max_rowid_; @@ -1252,12 +1252,12 @@ class AppCacheStorageImpl::InsertDeletableResponseIdsTask : DatabaseTask(storage) {} // DatabaseTask: - virtual void Run() override; + void Run() override; std::vector<int64> response_ids_; protected: - virtual ~InsertDeletableResponseIdsTask() {} + ~InsertDeletableResponseIdsTask() override {} }; void AppCacheStorageImpl::InsertDeletableResponseIdsTask::Run() { @@ -1274,12 +1274,12 @@ class AppCacheStorageImpl::DeleteDeletableResponseIdsTask : DatabaseTask(storage) {} // DatabaseTask: - virtual void Run() override; + void Run() override; std::vector<int64> response_ids_; protected: - virtual ~DeleteDeletableResponseIdsTask() {} + ~DeleteDeletableResponseIdsTask() override {} }; void AppCacheStorageImpl::DeleteDeletableResponseIdsTask::Run() { @@ -1299,10 +1299,10 @@ class AppCacheStorageImpl::UpdateGroupLastAccessTimeTask } // DatabaseTask: - virtual void Run() override; + void Run() override; protected: - virtual ~UpdateGroupLastAccessTimeTask() {} + ~UpdateGroupLastAccessTimeTask() override {} private: int64 group_id_; diff --git a/content/browser/appcache/appcache_storage_impl.h b/content/browser/appcache/appcache_storage_impl.h index 3c6032d..ca6d76b 100644 --- a/content/browser/appcache/appcache_storage_impl.h +++ b/content/browser/appcache/appcache_storage_impl.h @@ -31,7 +31,7 @@ class ChromeAppCacheServiceTest; class AppCacheStorageImpl : public AppCacheStorage { public: explicit AppCacheStorageImpl(AppCacheServiceImpl* service); - virtual ~AppCacheStorageImpl(); + ~AppCacheStorageImpl() override; void Initialize( const base::FilePath& cache_directory, @@ -41,33 +41,33 @@ class AppCacheStorageImpl : public AppCacheStorage { bool is_disabled() const { return is_disabled_; } // AppCacheStorage methods, see the base class for doc comments. - virtual void GetAllInfo(Delegate* delegate) override; - virtual void LoadCache(int64 id, Delegate* delegate) override; - virtual void LoadOrCreateGroup(const GURL& manifest_url, - Delegate* delegate) override; - virtual void StoreGroupAndNewestCache(AppCacheGroup* group, - AppCache* newest_cache, - Delegate* delegate) override; - virtual void FindResponseForMainRequest(const GURL& url, - const GURL& preferred_manifest_url, - Delegate* delegate) override; - virtual void FindResponseForSubRequest( - AppCache* cache, const GURL& url, - AppCacheEntry* found_entry, AppCacheEntry* found_fallback_entry, - bool* found_network_namespace) override; - virtual void MarkEntryAsForeign(const GURL& entry_url, - int64 cache_id) override; - virtual void MakeGroupObsolete(AppCacheGroup* group, - Delegate* delegate, - int response_code) override; - virtual AppCacheResponseReader* CreateResponseReader( - const GURL& manifest_url, int64 group_id, int64 response_id) override; - virtual AppCacheResponseWriter* CreateResponseWriter( - const GURL& manifest_url, int64 group_id) override; - virtual void DoomResponses(const GURL& manifest_url, - const std::vector<int64>& response_ids) override; - virtual void DeleteResponses(const GURL& manifest_url, - const std::vector<int64>& response_ids) override; + void GetAllInfo(Delegate* delegate) override; + void LoadCache(int64 id, Delegate* delegate) override; + void LoadOrCreateGroup(const GURL& manifest_url, Delegate* delegate) override; + void StoreGroupAndNewestCache(AppCacheGroup* group, + AppCache* newest_cache, + Delegate* delegate) override; + void FindResponseForMainRequest(const GURL& url, + const GURL& preferred_manifest_url, + Delegate* delegate) override; + void FindResponseForSubRequest(AppCache* cache, + const GURL& url, + AppCacheEntry* found_entry, + AppCacheEntry* found_fallback_entry, + bool* found_network_namespace) override; + void MarkEntryAsForeign(const GURL& entry_url, int64 cache_id) override; + void MakeGroupObsolete(AppCacheGroup* group, + Delegate* delegate, + int response_code) override; + AppCacheResponseReader* CreateResponseReader(const GURL& manifest_url, + int64 group_id, + int64 response_id) override; + AppCacheResponseWriter* CreateResponseWriter(const GURL& manifest_url, + int64 group_id) override; + void DoomResponses(const GURL& manifest_url, + const std::vector<int64>& response_ids) override; + void DeleteResponses(const GURL& manifest_url, + const std::vector<int64>& response_ids) override; private: // The AppCacheStorageImpl class methods and datamembers may only be diff --git a/content/browser/appcache/appcache_storage_impl_unittest.cc b/content/browser/appcache/appcache_storage_impl_unittest.cc index adfbea7..330d9ab 100644 --- a/content/browser/appcache/appcache_storage_impl_unittest.cc +++ b/content/browser/appcache/appcache_storage_impl_unittest.cc @@ -131,7 +131,7 @@ class MockHttpServerJobFactory : appcache_start_interceptor_(appcache_start_interceptor.Pass()) { } - virtual net::URLRequestJob* MaybeCreateJob( + net::URLRequestJob* MaybeCreateJob( net::URLRequest* request, net::NetworkDelegate* network_delegate) const override { net::URLRequestJob* appcache_job = @@ -151,15 +151,13 @@ class IOThread : public base::Thread { : base::Thread(name) { } - virtual ~IOThread() { - Stop(); - } + ~IOThread() override { Stop(); } net::URLRequestContext* request_context() { return request_context_.get(); } - virtual void Init() override { + void Init() override { scoped_ptr<net::URLRequestJobFactoryImpl> factory( new net::URLRequestJobFactoryImpl()); factory->SetProtocolHandler( @@ -172,7 +170,7 @@ class IOThread : public base::Thread { AppCacheInterceptor::EnsureRegistered(); } - virtual void CleanUp() override { + void CleanUp() override { request_context_.reset(); job_factory_.reset(); } @@ -197,14 +195,14 @@ class AppCacheStorageImplTest : public testing::Test { found_cache_id_(kAppCacheNoCacheId), test_(test) { } - virtual void OnCacheLoaded(AppCache* cache, int64 cache_id) override { + void OnCacheLoaded(AppCache* cache, int64 cache_id) override { loaded_cache_ = cache; loaded_cache_id_ = cache_id; test_->ScheduleNextTask(); } - virtual void OnGroupLoaded(AppCacheGroup* group, - const GURL& manifest_url) override { + void OnGroupLoaded(AppCacheGroup* group, + const GURL& manifest_url) override { loaded_group_ = group; loaded_manifest_url_ = manifest_url; loaded_groups_newest_cache_ = group ? group->newest_complete_cache() @@ -212,30 +210,31 @@ class AppCacheStorageImplTest : public testing::Test { test_->ScheduleNextTask(); } - virtual void OnGroupAndNewestCacheStored( - AppCacheGroup* group, AppCache* newest_cache, bool success, - bool would_exceed_quota) override { + void OnGroupAndNewestCacheStored(AppCacheGroup* group, + AppCache* newest_cache, + bool success, + bool would_exceed_quota) override { stored_group_ = group; stored_group_success_ = success; would_exceed_quota_ = would_exceed_quota; test_->ScheduleNextTask(); } - virtual void OnGroupMadeObsolete(AppCacheGroup* group, - bool success, - int response_code) override { + void OnGroupMadeObsolete(AppCacheGroup* group, + bool success, + int response_code) override { obsoleted_group_ = group; obsoleted_success_ = success; test_->ScheduleNextTask(); } - virtual void OnMainResponseFound(const GURL& url, - const AppCacheEntry& entry, - const GURL& namespace_entry_url, - const AppCacheEntry& fallback_entry, - int64 cache_id, - int64 group_id, - const GURL& manifest_url) override { + void OnMainResponseFound(const GURL& url, + const AppCacheEntry& entry, + const GURL& namespace_entry_url, + const AppCacheEntry& fallback_entry, + int64 cache_id, + int64 group_id, + const GURL& manifest_url) override { found_url_ = url; found_entry_ = entry; found_namespace_entry_url_ = namespace_entry_url; @@ -276,10 +275,9 @@ class AppCacheStorageImplTest : public testing::Test { NULL), async_(false) {} - virtual void GetUsageAndQuota( - const GURL& origin, - storage::StorageType type, - const GetUsageAndQuotaCallback& callback) override { + void GetUsageAndQuota(const GURL& origin, + storage::StorageType type, + const GetUsageAndQuotaCallback& callback) override { EXPECT_EQ(storage::kStorageTypeTemporary, type); if (async_) { base::MessageLoop::current()->PostTask( @@ -299,7 +297,7 @@ class AppCacheStorageImplTest : public testing::Test { bool async_; protected: - virtual ~MockQuotaManager() {} + ~MockQuotaManager() override {} }; class MockQuotaManagerProxy : public storage::QuotaManagerProxy { @@ -313,19 +311,19 @@ class AppCacheStorageImplTest : public testing::Test { manager_ = mock_manager_.get(); } - virtual void NotifyStorageAccessed(storage::QuotaClient::ID client_id, - const GURL& origin, - storage::StorageType type) override { + void NotifyStorageAccessed(storage::QuotaClient::ID client_id, + const GURL& origin, + storage::StorageType type) override { EXPECT_EQ(storage::QuotaClient::kAppcache, client_id); EXPECT_EQ(storage::kStorageTypeTemporary, type); ++notify_storage_accessed_count_; last_origin_ = origin; } - virtual void NotifyStorageModified(storage::QuotaClient::ID client_id, - const GURL& origin, - storage::StorageType type, - int64 delta) override { + void NotifyStorageModified(storage::QuotaClient::ID client_id, + const GURL& origin, + storage::StorageType type, + int64 delta) override { EXPECT_EQ(storage::QuotaClient::kAppcache, client_id); EXPECT_EQ(storage::kStorageTypeTemporary, type); ++notify_storage_modified_count_; @@ -334,18 +332,17 @@ class AppCacheStorageImplTest : public testing::Test { } // Not needed for our tests. - virtual void RegisterClient(storage::QuotaClient* client) override {} - virtual void NotifyOriginInUse(const GURL& origin) override {} - virtual void NotifyOriginNoLongerInUse(const GURL& origin) override {} - virtual void SetUsageCacheEnabled(storage::QuotaClient::ID client_id, - const GURL& origin, - storage::StorageType type, - bool enabled) override {} - virtual void GetUsageAndQuota( - base::SequencedTaskRunner* original_task_runner, - const GURL& origin, - storage::StorageType type, - const GetUsageAndQuotaCallback& callback) override {} + void RegisterClient(storage::QuotaClient* client) override {} + void NotifyOriginInUse(const GURL& origin) override {} + void NotifyOriginNoLongerInUse(const GURL& origin) override {} + void SetUsageCacheEnabled(storage::QuotaClient::ID client_id, + const GURL& origin, + storage::StorageType type, + bool enabled) override {} + void GetUsageAndQuota(base::SequencedTaskRunner* original_task_runner, + const GURL& origin, + storage::StorageType type, + const GetUsageAndQuotaCallback& callback) override {} int notify_storage_accessed_count_; int notify_storage_modified_count_; @@ -354,7 +351,7 @@ class AppCacheStorageImplTest : public testing::Test { scoped_refptr<MockQuotaManager> mock_manager_; protected: - virtual ~MockQuotaManagerProxy() {} + ~MockQuotaManagerProxy() override {} }; template <class Method> @@ -1613,7 +1610,7 @@ class AppCacheStorageImplTest : public testing::Test { explicit MockServiceObserver(AppCacheStorageImplTest* test) : test_(test) {} - virtual void OnServiceReinitialized( + void OnServiceReinitialized( AppCacheStorageReference* old_storage_ref) override { observed_old_storage_ = old_storage_ref; test_->ScheduleNextTask(); @@ -1627,25 +1624,23 @@ class AppCacheStorageImplTest : public testing::Test { public: MockAppCacheFrontend() : error_event_was_raised_(false) {} - virtual void OnCacheSelected( - int host_id, const AppCacheInfo& info) override {} - virtual void OnStatusChanged(const std::vector<int>& host_ids, - AppCacheStatus status) override {} - virtual void OnEventRaised(const std::vector<int>& host_ids, - AppCacheEventID event_id) override {} - virtual void OnProgressEventRaised( - const std::vector<int>& host_ids, - const GURL& url, - int num_total, int num_complete) override {} - virtual void OnErrorEventRaised(const std::vector<int>& host_ids, - const AppCacheErrorDetails& details) - override { + void OnCacheSelected(int host_id, const AppCacheInfo& info) override {} + void OnStatusChanged(const std::vector<int>& host_ids, + AppCacheStatus status) override {} + void OnEventRaised(const std::vector<int>& host_ids, + AppCacheEventID event_id) override {} + void OnProgressEventRaised(const std::vector<int>& host_ids, + const GURL& url, + int num_total, + int num_complete) override {} + void OnErrorEventRaised(const std::vector<int>& host_ids, + const AppCacheErrorDetails& details) override { error_event_was_raised_ = true; } - virtual void OnLogMessage(int host_id, AppCacheLogLevel log_level, - const std::string& message) override {} - virtual void OnContentBlocked( - int host_id, const GURL& manifest_url) override {} + void OnLogMessage(int host_id, + AppCacheLogLevel log_level, + const std::string& message) override {} + void OnContentBlocked(int host_id, const GURL& manifest_url) override {} bool error_event_was_raised_; }; diff --git a/content/browser/appcache/appcache_unittest.cc b/content/browser/appcache/appcache_unittest.cc index 85839d8..4062498 100644 --- a/content/browser/appcache/appcache_unittest.cc +++ b/content/browser/appcache/appcache_unittest.cc @@ -13,23 +13,21 @@ namespace { class MockAppCacheFrontend : public AppCacheFrontend { public: - virtual void OnCacheSelected(int host_id, const AppCacheInfo& info) override { - } - virtual void OnStatusChanged(const std::vector<int>& host_ids, - AppCacheStatus status) override {} - virtual void OnEventRaised(const std::vector<int>& host_ids, - AppCacheEventID event_id) override {} - virtual void OnProgressEventRaised( - const std::vector<int>& host_ids, - const GURL& url, - int num_total, int num_complete) override {} - virtual void OnErrorEventRaised( - const std::vector<int>& host_ids, - const AppCacheErrorDetails& details) override {} - virtual void OnLogMessage(int host_id, AppCacheLogLevel log_level, - const std::string& message) override {} - virtual void OnContentBlocked( - int host_id, const GURL& manifest_url) override {} + void OnCacheSelected(int host_id, const AppCacheInfo& info) override {} + void OnStatusChanged(const std::vector<int>& host_ids, + AppCacheStatus status) override {} + void OnEventRaised(const std::vector<int>& host_ids, + AppCacheEventID event_id) override {} + void OnProgressEventRaised(const std::vector<int>& host_ids, + const GURL& url, + int num_total, + int num_complete) override {} + void OnErrorEventRaised(const std::vector<int>& host_ids, + const AppCacheErrorDetails& details) override {} + void OnLogMessage(int host_id, + AppCacheLogLevel log_level, + const std::string& message) override {} + void OnContentBlocked(int host_id, const GURL& manifest_url) override {} }; } // namespace diff --git a/content/browser/appcache/appcache_update_job.h b/content/browser/appcache/appcache_update_job.h index 0ccb270e..4d2d896 100644 --- a/content/browser/appcache/appcache_update_job.h +++ b/content/browser/appcache/appcache_update_job.h @@ -46,7 +46,7 @@ class CONTENT_EXPORT AppCacheUpdateJob }; AppCacheUpdateJob(AppCacheServiceImpl* service, AppCacheGroup* group); - virtual ~AppCacheUpdateJob(); + ~AppCacheUpdateJob() override; // Triggers the update process or adds more info if this update is already // in progress. @@ -114,7 +114,7 @@ class CONTENT_EXPORT AppCacheUpdateJob URLFetcher(const GURL& url, FetchType fetch_type, AppCacheUpdateJob* job); - virtual ~URLFetcher(); + ~URLFetcher() override; void Start(); FetchType fetch_type() const { return fetch_type_; } net::URLRequest* request() const { return request_.get(); } @@ -134,12 +134,11 @@ class CONTENT_EXPORT AppCacheUpdateJob private: // URLRequest::Delegate overrides - virtual void OnReceivedRedirect(net::URLRequest* request, - const net::RedirectInfo& redirect_info, - bool* defer_redirect) override; - virtual void OnResponseStarted(net::URLRequest* request) override; - virtual void OnReadCompleted(net::URLRequest* request, - int bytes_read) override; + void OnReceivedRedirect(net::URLRequest* request, + const net::RedirectInfo& redirect_info, + bool* defer_redirect) override; + void OnResponseStarted(net::URLRequest* request) override; + void OnReadCompleted(net::URLRequest* request, int bytes_read) override; void AddConditionalHeaders(const net::HttpResponseHeaders* headers); void OnWriteComplete(int result); @@ -165,23 +164,22 @@ class CONTENT_EXPORT AppCacheUpdateJob AppCacheResponseWriter* CreateResponseWriter(); // Methods for AppCacheStorage::Delegate. - virtual void OnResponseInfoLoaded(AppCacheResponseInfo* response_info, - int64 response_id) override; - virtual void OnGroupAndNewestCacheStored(AppCacheGroup* group, - AppCache* newest_cache, - bool success, - bool would_exceed_quota) override; - virtual void OnGroupMadeObsolete(AppCacheGroup* group, + void OnResponseInfoLoaded(AppCacheResponseInfo* response_info, + int64 response_id) override; + void OnGroupAndNewestCacheStored(AppCacheGroup* group, + AppCache* newest_cache, bool success, - int response_code) override; + bool would_exceed_quota) override; + void OnGroupMadeObsolete(AppCacheGroup* group, + bool success, + int response_code) override; // Methods for AppCacheHost::Observer. - virtual void OnCacheSelectionComplete(AppCacheHost* host) override {} // N/A - virtual void OnDestructionImminent(AppCacheHost* host) override; + void OnCacheSelectionComplete(AppCacheHost* host) override {} // N/A + void OnDestructionImminent(AppCacheHost* host) override; // Methods for AppCacheServiceImpl::Observer. - virtual void OnServiceReinitialized( - AppCacheStorageReference* old_storage) override; + void OnServiceReinitialized(AppCacheStorageReference* old_storage) override; void HandleCacheFailure(const AppCacheErrorDetails& details, ResultType result, diff --git a/content/browser/appcache/appcache_update_job_unittest.cc b/content/browser/appcache/appcache_update_job_unittest.cc index 5d10bfd..4955a71 100644 --- a/content/browser/appcache/appcache_update_job_unittest.cc +++ b/content/browser/appcache/appcache_update_job_unittest.cc @@ -195,7 +195,7 @@ class MockHttpServer { class MockHttpServerJobFactory : public net::URLRequestJobFactory::ProtocolHandler { public: - virtual net::URLRequestJob* MaybeCreateJob( + net::URLRequestJob* MaybeCreateJob( net::URLRequest* request, net::NetworkDelegate* network_delegate) const override { return MockHttpServer::JobFactory(request, network_delegate); @@ -219,16 +219,13 @@ class MockFrontend : public AppCacheFrontend { start_update_trigger_(APPCACHE_CHECKING_EVENT), update_(NULL) { } - virtual void OnCacheSelected( - int host_id, const AppCacheInfo& info) override { - } + void OnCacheSelected(int host_id, const AppCacheInfo& info) override {} - virtual void OnStatusChanged(const std::vector<int>& host_ids, - AppCacheStatus status) override { - } + void OnStatusChanged(const std::vector<int>& host_ids, + AppCacheStatus status) override {} - virtual void OnEventRaised(const std::vector<int>& host_ids, - AppCacheEventID event_id) override { + void OnEventRaised(const std::vector<int>& host_ids, + AppCacheEventID event_id) override { raised_events_.push_back(RaisedEvent(host_ids, event_id)); // Trigger additional updates if requested. @@ -243,17 +240,16 @@ class MockFrontend : public AppCacheFrontend { } } - virtual void OnErrorEventRaised(const std::vector<int>& host_ids, - const AppCacheErrorDetails& details) - override { + void OnErrorEventRaised(const std::vector<int>& host_ids, + const AppCacheErrorDetails& details) override { error_message_ = details.message; OnEventRaised(host_ids, APPCACHE_ERROR_EVENT); } - virtual void OnProgressEventRaised(const std::vector<int>& host_ids, - const GURL& url, - int num_total, - int num_complete) override { + void OnProgressEventRaised(const std::vector<int>& host_ids, + const GURL& url, + int num_total, + int num_complete) override { if (!ignore_progress_events_) OnEventRaised(host_ids, APPCACHE_PROGRESS_EVENT); @@ -281,14 +277,11 @@ class MockFrontend : public AppCacheFrontend { } } - virtual void OnLogMessage(int host_id, - AppCacheLogLevel log_level, - const std::string& message) override { - } + void OnLogMessage(int host_id, + AppCacheLogLevel log_level, + const std::string& message) override {} - virtual void OnContentBlocked(int host_id, - const GURL& manifest_url) override { - } + void OnContentBlocked(int host_id, const GURL& manifest_url) override {} void AddExpectedEvent(const std::vector<int>& host_ids, AppCacheEventID event_id) { @@ -345,7 +338,7 @@ class MockFrontend : public AppCacheFrontend { // Helper factories to simulate redirected URL responses for tests. class RedirectFactory : public net::URLRequestJobFactory::ProtocolHandler { public: - virtual net::URLRequestJob* MaybeCreateJob( + net::URLRequestJob* MaybeCreateJob( net::URLRequest* request, net::NetworkDelegate* network_delegate) const override { return new net::URLRequestTestJob( @@ -399,10 +392,10 @@ class RetryRequestTestJob : public net::URLRequestTestJob { } } - virtual int GetResponseCode() const override { return response_code_; } + int GetResponseCode() const override { return response_code_; } private: - virtual ~RetryRequestTestJob() {} + ~RetryRequestTestJob() override {} static std::string retry_headers() { const char no_retry_after[] = @@ -461,7 +454,7 @@ class RetryRequestTestJob : public net::URLRequestTestJob { class RetryRequestTestJobFactory : public net::URLRequestJobFactory::ProtocolHandler { public: - virtual net::URLRequestJob* MaybeCreateJob( + net::URLRequestJob* MaybeCreateJob( net::URLRequest* request, net::NetworkDelegate* network_delegate) const override { return RetryRequestTestJob::RetryFactory(request, network_delegate); @@ -521,7 +514,7 @@ class HttpHeadersRequestTestJob : public net::URLRequestTestJob { } protected: - virtual ~HttpHeadersRequestTestJob() {} + ~HttpHeadersRequestTestJob() override {} private: static std::string expect_if_modified_since_; @@ -541,7 +534,7 @@ bool HttpHeadersRequestTestJob::already_checked_ = false; class IfModifiedSinceJobFactory : public net::URLRequestJobFactory::ProtocolHandler { public: - virtual net::URLRequestJob* MaybeCreateJob( + net::URLRequestJob* MaybeCreateJob( net::URLRequest* request, net::NetworkDelegate* network_delegate) const override { return HttpHeadersRequestTestJob::IfModifiedSinceFactory( @@ -555,9 +548,7 @@ class IOThread : public base::Thread { : base::Thread(name) { } - virtual ~IOThread() { - Stop(); - } + ~IOThread() override { Stop(); } net::URLRequestContext* request_context() { return request_context_.get(); @@ -569,7 +560,7 @@ class IOThread : public base::Thread { request_context_->set_job_factory(job_factory_.get()); } - virtual void Init() override { + void Init() override { scoped_ptr<net::URLRequestJobFactoryImpl> factory( new net::URLRequestJobFactoryImpl()); factory->SetProtocolHandler("http", new MockHttpServerJobFactory); @@ -579,7 +570,7 @@ class IOThread : public base::Thread { request_context_->set_job_factory(job_factory_.get()); } - virtual void CleanUp() override { + void CleanUp() override { request_context_.reset(); job_factory_.reset(); } @@ -3017,7 +3008,7 @@ class AppCacheUpdateJobTest : public testing::Test, group_->AddUpdateObserver(this); } - virtual void OnUpdateComplete(AppCacheGroup* group) override { + void OnUpdateComplete(AppCacheGroup* group) override { ASSERT_EQ(group_.get(), group); protect_newest_cache_ = group->newest_complete_cache(); UpdateFinished(); diff --git a/content/browser/appcache/appcache_url_request_job.h b/content/browser/appcache/appcache_url_request_job.h index e3c0871..580b86a 100644 --- a/content/browser/appcache/appcache_url_request_job.h +++ b/content/browser/appcache/appcache_url_request_job.h @@ -72,7 +72,7 @@ class CONTENT_EXPORT AppCacheURLRequestJob // net::URLRequestJob's Kill method is made public so the users of this // class in the appcache namespace can call it. - virtual void Kill() override; + void Kill() override; // Returns true if the job has been started by the net library. bool has_been_started() const { @@ -90,7 +90,7 @@ class CONTENT_EXPORT AppCacheURLRequestJob } protected: - virtual ~AppCacheURLRequestJob(); + ~AppCacheURLRequestJob() override; private: friend class content::AppCacheRequestHandlerTest; @@ -120,9 +120,9 @@ class CONTENT_EXPORT AppCacheURLRequestJob void BeginErrorDelivery(const char* message); // AppCacheStorage::Delegate methods - virtual void OnResponseInfoLoaded( - AppCacheResponseInfo* response_info, int64 response_id) override; - virtual void OnCacheLoaded(AppCache* cache, int64 cache_id) override; + void OnResponseInfoLoaded(AppCacheResponseInfo* response_info, + int64 response_id) override; + void OnCacheLoaded(AppCache* cache, int64 cache_id) override; const net::HttpResponseInfo* http_info() const; bool is_range_request() const { return range_requested_.IsValid(); } @@ -132,22 +132,19 @@ class CONTENT_EXPORT AppCacheURLRequestJob void OnReadComplete(int result); // net::URLRequestJob methods, see url_request_job.h for doc comments - virtual void Start() override; - virtual net::LoadState GetLoadState() const override; - virtual bool GetCharset(std::string* charset) override; - virtual void GetResponseInfo(net::HttpResponseInfo* info) override; - virtual bool ReadRawData(net::IOBuffer* buf, - int buf_size, - int *bytes_read) override; + void Start() override; + net::LoadState GetLoadState() const override; + bool GetCharset(std::string* charset) override; + void GetResponseInfo(net::HttpResponseInfo* info) override; + bool ReadRawData(net::IOBuffer* buf, int buf_size, int* bytes_read) override; // Sets extra request headers for Job types that support request headers. // This is how we get informed of range-requests. - virtual void SetExtraRequestHeaders( - const net::HttpRequestHeaders& headers) override; + void SetExtraRequestHeaders(const net::HttpRequestHeaders& headers) override; // FilterContext methods - virtual bool GetMimeType(std::string* mime_type) const override; - virtual int GetResponseCode() const override; + bool GetMimeType(std::string* mime_type) const override; + int GetResponseCode() const override; AppCacheHost* host_; AppCacheStorage* storage_; diff --git a/content/browser/appcache/appcache_url_request_job_unittest.cc b/content/browser/appcache/appcache_url_request_job_unittest.cc index 82b698a..08b0fc1 100644 --- a/content/browser/appcache/appcache_url_request_job_unittest.cc +++ b/content/browser/appcache/appcache_url_request_job_unittest.cc @@ -46,9 +46,7 @@ class MockURLRequestJobFactory : public net::URLRequestJobFactory { MockURLRequestJobFactory() : job_(NULL) { } - virtual ~MockURLRequestJobFactory() { - DCHECK(!job_); - } + ~MockURLRequestJobFactory() override { DCHECK(!job_); } void SetJob(net::URLRequestJob* job) { job_ = job; @@ -59,7 +57,7 @@ class MockURLRequestJobFactory : public net::URLRequestJobFactory { } // net::URLRequestJobFactory implementation. - virtual net::URLRequestJob* MaybeCreateJobWithProtocolHandler( + net::URLRequestJob* MaybeCreateJobWithProtocolHandler( const std::string& scheme, net::URLRequest* request, net::NetworkDelegate* network_delegate) const override { @@ -74,15 +72,15 @@ class MockURLRequestJobFactory : public net::URLRequestJobFactory { } } - virtual bool IsHandledProtocol(const std::string& scheme) const override { + bool IsHandledProtocol(const std::string& scheme) const override { return scheme == "http"; }; - virtual bool IsHandledURL(const GURL& url) const override { + bool IsHandledURL(const GURL& url) const override { return url.SchemeIs("http"); } - virtual bool IsSafeRedirectTarget(const GURL& location) const override { + bool IsSafeRedirectTarget(const GURL& location) const override { return false; } @@ -102,8 +100,8 @@ class AppCacheURLRequestJobTest : public testing::Test { : loaded_info_id_(0), test_(test) { } - virtual void OnResponseInfoLoaded(AppCacheResponseInfo* info, - int64 response_id) override { + void OnResponseInfoLoaded(AppCacheResponseInfo* info, + int64 response_id) override { loaded_info_ = info; loaded_info_id_ = response_id; test_->ScheduleNextTask(); @@ -123,7 +121,7 @@ class AppCacheURLRequestJobTest : public testing::Test { kill_after_amount_received_(0), kill_with_io_pending_(false) { } - virtual void OnResponseStarted(net::URLRequest* request) override { + void OnResponseStarted(net::URLRequest* request) override { amount_received_ = 0; did_receive_headers_ = false; if (request->status().is_success()) { @@ -136,8 +134,7 @@ class AppCacheURLRequestJobTest : public testing::Test { } } - virtual void OnReadCompleted(net::URLRequest* request, - int bytes_read) override { + void OnReadCompleted(net::URLRequest* request, int bytes_read) override { if (bytes_read > 0) { amount_received_ += bytes_read; diff --git a/content/browser/appcache/chrome_appcache_service.h b/content/browser/appcache/chrome_appcache_service.h index 6ad8931..6976d87 100644 --- a/content/browser/appcache/chrome_appcache_service.h +++ b/content/browser/appcache/chrome_appcache_service.h @@ -53,13 +53,13 @@ class CONTENT_EXPORT ChromeAppCacheService scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy); // AppCachePolicy overrides - virtual bool CanLoadAppCache(const GURL& manifest_url, - const GURL& first_party) override; - virtual bool CanCreateAppCache(const GURL& manifest_url, - const GURL& first_party) override; + bool CanLoadAppCache(const GURL& manifest_url, + const GURL& first_party) override; + bool CanCreateAppCache(const GURL& manifest_url, + const GURL& first_party) override; protected: - virtual ~ChromeAppCacheService(); + ~ChromeAppCacheService() override; private: friend class base::DeleteHelper<ChromeAppCacheService>; diff --git a/content/browser/appcache/chrome_appcache_service_unittest.cc b/content/browser/appcache/chrome_appcache_service_unittest.cc index e9723bd..450bfe2 100644 --- a/content/browser/appcache/chrome_appcache_service_unittest.cc +++ b/content/browser/appcache/chrome_appcache_service_unittest.cc @@ -39,17 +39,15 @@ class MockURLRequestContextGetter : public net::URLRequestContextGetter { : context_(context), message_loop_proxy_(message_loop_proxy) { } - virtual net::URLRequestContext* GetURLRequestContext() override { - return context_; - } + net::URLRequestContext* GetURLRequestContext() override { return context_; } - virtual scoped_refptr<base::SingleThreadTaskRunner> - GetNetworkTaskRunner() const override { + scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner() + const override { return message_loop_proxy_; } protected: - virtual ~MockURLRequestContextGetter() {} + ~MockURLRequestContextGetter() override {} private: net::URLRequestContext* context_; diff --git a/content/browser/appcache/mock_appcache_policy.h b/content/browser/appcache/mock_appcache_policy.h index b1c5aa8..a571e25 100644 --- a/content/browser/appcache/mock_appcache_policy.h +++ b/content/browser/appcache/mock_appcache_policy.h @@ -16,10 +16,10 @@ class MockAppCachePolicy : public AppCachePolicy { MockAppCachePolicy(); virtual ~MockAppCachePolicy(); - virtual bool CanLoadAppCache(const GURL& manifest_url, - const GURL& first_party) override; - virtual bool CanCreateAppCache(const GURL& manifest_url, - const GURL& first_party) override; + bool CanLoadAppCache(const GURL& manifest_url, + const GURL& first_party) override; + bool CanCreateAppCache(const GURL& manifest_url, + const GURL& first_party) override; bool can_load_return_value_; bool can_create_return_value_; diff --git a/content/browser/appcache/mock_appcache_service.h b/content/browser/appcache/mock_appcache_service.h index 583b032..5e38420 100644 --- a/content/browser/appcache/mock_appcache_service.h +++ b/content/browser/appcache/mock_appcache_service.h @@ -24,7 +24,7 @@ class MockAppCacheService : public AppCacheServiceImpl { // Just returns a canned completion code without actually // removing groups and caches in our mock storage instance. - virtual void DeleteAppCachesForOrigin( + void DeleteAppCachesForOrigin( const GURL& origin, const net::CompletionCallback& callback) override; diff --git a/content/browser/appcache/mock_appcache_storage.h b/content/browser/appcache/mock_appcache_storage.h index a2c3e4e..a6ece43 100644 --- a/content/browser/appcache/mock_appcache_storage.h +++ b/content/browser/appcache/mock_appcache_storage.h @@ -47,37 +47,35 @@ class MockAppCacheStorageTest; class MockAppCacheStorage : public AppCacheStorage { public: explicit MockAppCacheStorage(AppCacheServiceImpl* service); - virtual ~MockAppCacheStorage(); - - virtual void GetAllInfo(Delegate* delegate) override; - virtual void LoadCache(int64 id, Delegate* delegate) override; - virtual void LoadOrCreateGroup(const GURL& manifest_url, - Delegate* delegate) override; - virtual void StoreGroupAndNewestCache(AppCacheGroup* group, - AppCache* newest_cache, - Delegate* delegate) override; - virtual void FindResponseForMainRequest(const GURL& url, - const GURL& preferred_manifest_url, - Delegate* delegate) override; - virtual void FindResponseForSubRequest( - AppCache* cache, const GURL& url, - AppCacheEntry* found_entry, AppCacheEntry* found_fallback_entry, - bool * found_network_namespace) override; - virtual void MarkEntryAsForeign(const GURL& entry_url, - int64 cache_id) override; - virtual void MakeGroupObsolete(AppCacheGroup* group, - Delegate* delegate, - int response_code) override; - virtual AppCacheResponseReader* CreateResponseReader( - const GURL& manifest_url, int64 group_id, int64 response_id) override; - virtual AppCacheResponseWriter* CreateResponseWriter( - const GURL& manifest_url, int64 group_id) override; - virtual void DoomResponses( - const GURL& manifest_url, - const std::vector<int64>& response_ids) override; - virtual void DeleteResponses( - const GURL& manifest_url, - const std::vector<int64>& response_ids) override; + ~MockAppCacheStorage() override; + + void GetAllInfo(Delegate* delegate) override; + void LoadCache(int64 id, Delegate* delegate) override; + void LoadOrCreateGroup(const GURL& manifest_url, Delegate* delegate) override; + void StoreGroupAndNewestCache(AppCacheGroup* group, + AppCache* newest_cache, + Delegate* delegate) override; + void FindResponseForMainRequest(const GURL& url, + const GURL& preferred_manifest_url, + Delegate* delegate) override; + void FindResponseForSubRequest(AppCache* cache, + const GURL& url, + AppCacheEntry* found_entry, + AppCacheEntry* found_fallback_entry, + bool* found_network_namespace) override; + void MarkEntryAsForeign(const GURL& entry_url, int64 cache_id) override; + void MakeGroupObsolete(AppCacheGroup* group, + Delegate* delegate, + int response_code) override; + AppCacheResponseReader* CreateResponseReader(const GURL& manifest_url, + int64 group_id, + int64 response_id) override; + AppCacheResponseWriter* CreateResponseWriter(const GURL& manifest_url, + int64 group_id) override; + void DoomResponses(const GURL& manifest_url, + const std::vector<int64>& response_ids) override; + void DeleteResponses(const GURL& manifest_url, + const std::vector<int64>& response_ids) override; private: friend class AppCacheRequestHandlerTest; diff --git a/content/browser/appcache/mock_appcache_storage_unittest.cc b/content/browser/appcache/mock_appcache_storage_unittest.cc index 66e44d8..8f52912 100644 --- a/content/browser/appcache/mock_appcache_storage_unittest.cc +++ b/content/browser/appcache/mock_appcache_storage_unittest.cc @@ -21,38 +21,39 @@ class MockAppCacheStorageTest : public testing::Test { obsoleted_success_(false), found_cache_id_(kAppCacheNoCacheId) { } - virtual void OnCacheLoaded(AppCache* cache, int64 cache_id) override { + void OnCacheLoaded(AppCache* cache, int64 cache_id) override { loaded_cache_ = cache; loaded_cache_id_ = cache_id; } - virtual void OnGroupLoaded(AppCacheGroup* group, - const GURL& manifest_url) override { + void OnGroupLoaded(AppCacheGroup* group, + const GURL& manifest_url) override { loaded_group_ = group; loaded_manifest_url_ = manifest_url; } - virtual void OnGroupAndNewestCacheStored( - AppCacheGroup* group, AppCache* newest_cache, bool success, - bool would_exceed_quota) override { + void OnGroupAndNewestCacheStored(AppCacheGroup* group, + AppCache* newest_cache, + bool success, + bool would_exceed_quota) override { stored_group_ = group; stored_group_success_ = success; } - virtual void OnGroupMadeObsolete(AppCacheGroup* group, - bool success, - int response_code) override { + void OnGroupMadeObsolete(AppCacheGroup* group, + bool success, + int response_code) override { obsoleted_group_ = group; obsoleted_success_ = success; } - virtual void OnMainResponseFound(const GURL& url, - const AppCacheEntry& entry, - const GURL& fallback_url, - const AppCacheEntry& fallback_entry, - int64 cache_id, - int64 group_id, - const GURL& manifest_url) override { + void OnMainResponseFound(const GURL& url, + const AppCacheEntry& entry, + const GURL& fallback_url, + const AppCacheEntry& fallback_entry, + int64 cache_id, + int64 group_id, + const GURL& manifest_url) override { found_url_ = url; found_entry_ = entry; found_fallback_url_ = fallback_url; diff --git a/content/browser/appcache/view_appcache_internals_job.cc b/content/browser/appcache/view_appcache_internals_job.cc index 6b37562..c904cb4 100644 --- a/content/browser/appcache/view_appcache_internals_job.cc +++ b/content/browser/appcache/view_appcache_internals_job.cc @@ -321,11 +321,9 @@ class BaseInternalsJob : public net::URLRequestSimpleJob, appcache_service_->AddObserver(this); } - virtual ~BaseInternalsJob() { - appcache_service_->RemoveObserver(this); - } + ~BaseInternalsJob() override { appcache_service_->RemoveObserver(this); } - virtual void OnServiceReinitialized( + void OnServiceReinitialized( AppCacheStorageReference* old_storage_ref) override { if (old_storage_ref->storage() == appcache_storage_) disabled_storage_reference_ = old_storage_ref; @@ -346,7 +344,7 @@ class MainPageJob : public BaseInternalsJob { weak_factory_(this) { } - virtual void Start() override { + void Start() override { DCHECK(request_); info_collection_ = new AppCacheInfoCollection; appcache_service_->GetAllAppCacheInfo( @@ -356,10 +354,10 @@ class MainPageJob : public BaseInternalsJob { } // Produces a page containing the listing - virtual int GetData(std::string* mime_type, - std::string* charset, - std::string* out, - const net::CompletionCallback& callback) const override { + int GetData(std::string* mime_type, + std::string* charset, + std::string* out, + const net::CompletionCallback& callback) const override { // TODO(vadimt): Remove ScopedProfile below once crbug.com/422489 is fixed. tracked_objects::ScopedProfile tracking_profile( FROM_HERE_WITH_EXPLICIT_FUNCTION("422489 MainPageJob::GetData")); @@ -392,7 +390,7 @@ class MainPageJob : public BaseInternalsJob { } private: - virtual ~MainPageJob() {} + ~MainPageJob() override {} void OnGotInfoComplete(int rv) { if (rv != net::OK) @@ -413,22 +411,21 @@ class RedirectToMainPageJob : public BaseInternalsJob { AppCacheServiceImpl* service) : BaseInternalsJob(request, network_delegate, service) {} - virtual int GetData(std::string* mime_type, - std::string* charset, - std::string* data, - const net::CompletionCallback& callback) const override { + int GetData(std::string* mime_type, + std::string* charset, + std::string* data, + const net::CompletionCallback& callback) const override { return net::OK; // IsRedirectResponse induces a redirect. } - virtual bool IsRedirectResponse(GURL* location, - int* http_status_code) override { + bool IsRedirectResponse(GURL* location, int* http_status_code) override { *location = ClearQuery(request_->url()); *http_status_code = 307; return true; } protected: - virtual ~RedirectToMainPageJob() {} + ~RedirectToMainPageJob() override {} }; // Job that removes an appcache and then redirects back to the main page. @@ -444,7 +441,7 @@ class RemoveAppCacheJob : public RedirectToMainPageJob { weak_factory_(this) { } - virtual void Start() override { + void Start() override { DCHECK(request_); appcache_service_->DeleteAppCacheGroup( @@ -453,7 +450,7 @@ class RemoveAppCacheJob : public RedirectToMainPageJob { } private: - virtual ~RemoveAppCacheJob() {} + ~RemoveAppCacheJob() override {} void OnDeleteAppCacheComplete(int rv) { StartAsync(); // Causes the base class to redirect. @@ -476,16 +473,16 @@ class ViewAppCacheJob : public BaseInternalsJob, : BaseInternalsJob(request, network_delegate, service), manifest_url_(manifest_url) {} - virtual void Start() override { + void Start() override { DCHECK(request_); appcache_storage_->LoadOrCreateGroup(manifest_url_, this); } // Produces a page containing the entries listing. - virtual int GetData(std::string* mime_type, - std::string* charset, - std::string* out, - const net::CompletionCallback& callback) const override { + int GetData(std::string* mime_type, + std::string* charset, + std::string* out, + const net::CompletionCallback& callback) const override { // TODO(vadimt): Remove ScopedProfile below once crbug.com/422489 is fixed. tracked_objects::ScopedProfile tracking_profile( FROM_HERE_WITH_EXPLICIT_FUNCTION("422489 ViewAppCacheJob::GetData")); @@ -510,13 +507,12 @@ class ViewAppCacheJob : public BaseInternalsJob, } private: - virtual ~ViewAppCacheJob() { + ~ViewAppCacheJob() override { appcache_storage_->CancelDelegateCallbacks(this); } // AppCacheStorage::Delegate override - virtual void OnGroupLoaded( - AppCacheGroup* group, const GURL& manifest_url) override { + void OnGroupLoaded(AppCacheGroup* group, const GURL& manifest_url) override { DCHECK_EQ(manifest_url_, manifest_url); if (group && group->newest_complete_cache()) { appcache_info_.manifest_url = manifest_url; @@ -555,17 +551,17 @@ class ViewEntryJob : public BaseInternalsJob, response_id_(response_id), group_id_(group_id), amount_read_(0) { } - virtual void Start() override { + void Start() override { DCHECK(request_); appcache_storage_->LoadResponseInfo( manifest_url_, group_id_, response_id_, this); } // Produces a page containing the response headers and data. - virtual int GetData(std::string* mime_type, - std::string* charset, - std::string* out, - const net::CompletionCallback& callback) const override { + int GetData(std::string* mime_type, + std::string* charset, + std::string* out, + const net::CompletionCallback& callback) const override { // TODO(vadimt): Remove ScopedProfile below once crbug.com/422489 is fixed. tracked_objects::ScopedProfile tracking_profile( FROM_HERE_WITH_EXPLICIT_FUNCTION("422489 ViewEntryJob::GetData")); @@ -599,12 +595,10 @@ class ViewEntryJob : public BaseInternalsJob, } private: - virtual ~ViewEntryJob() { - appcache_storage_->CancelDelegateCallbacks(this); - } + ~ViewEntryJob() override { appcache_storage_->CancelDelegateCallbacks(this); } - virtual void OnResponseInfoLoaded( - AppCacheResponseInfo* response_info, int64 response_id) override { + void OnResponseInfoLoaded(AppCacheResponseInfo* response_info, + int64 response_id) override { if (!response_info) { StartAsync(); return; diff --git a/content/browser/battery_status/battery_status_browsertest.cc b/content/browser/battery_status/battery_status_browsertest.cc index b2e90e7..880e62a 100644 --- a/content/browser/battery_status/battery_status_browsertest.cc +++ b/content/browser/battery_status/battery_status_browsertest.cc @@ -23,17 +23,17 @@ class FakeBatteryManager : public BatteryStatusManager { explicit FakeBatteryManager( const BatteryStatusService::BatteryUpdateCallback& callback) : callback_(callback), battery_status_available_(true), started_(false) {} - virtual ~FakeBatteryManager() { } + ~FakeBatteryManager() override {} // Methods from BatteryStatusManager. - virtual bool StartListeningBatteryChange() override { + bool StartListeningBatteryChange() override { started_ = true; if (battery_status_available_) InvokeUpdateCallback(); return battery_status_available_; } - virtual void StopListeningBatteryChange() override { } + void StopListeningBatteryChange() override {} void InvokeUpdateCallback() { callback_.Run(status_); @@ -68,12 +68,12 @@ class BatteryStatusBrowserTest : public ContentBrowserTest { io_loop_finished_event_(false, false) { } - virtual void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(CommandLine* command_line) override { command_line->AppendSwitch( switches::kEnableExperimentalWebPlatformFeatures); } - virtual void SetUpOnMainThread() override { + void SetUpOnMainThread() override { BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind(&BatteryStatusBrowserTest::SetUpOnIOThread, this)); diff --git a/content/browser/battery_status/battery_status_manager_mac.cc b/content/browser/battery_status/battery_status_manager_mac.cc index 00b5372..761b271 100644 --- a/content/browser/battery_status/battery_status_manager_mac.cc +++ b/content/browser/battery_status/battery_status_manager_mac.cc @@ -254,18 +254,16 @@ class BatteryStatusManagerMac : public BatteryStatusManager { explicit BatteryStatusManagerMac(const BatteryCallback& callback) : notifier_(new BatteryStatusObserver(callback)) {} - virtual ~BatteryStatusManagerMac() { - notifier_->Stop(); - } + ~BatteryStatusManagerMac() override { notifier_->Stop(); } // BatteryStatusManager: - virtual bool StartListeningBatteryChange() override { + bool StartListeningBatteryChange() override { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); notifier_->Start(); return true; } - virtual void StopListeningBatteryChange() override { + void StopListeningBatteryChange() override { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); notifier_->Stop(); } diff --git a/content/browser/battery_status/battery_status_message_filter.h b/content/browser/battery_status/battery_status_message_filter.h index 3dddc61..efe9430 100644 --- a/content/browser/battery_status/battery_status_message_filter.h +++ b/content/browser/battery_status/battery_status_message_filter.h @@ -15,10 +15,10 @@ class BatteryStatusMessageFilter : public BrowserMessageFilter { BatteryStatusMessageFilter(); // BrowserMessageFilter implementation. - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; private: - virtual ~BatteryStatusMessageFilter(); + ~BatteryStatusMessageFilter() override; void OnBatteryStatusStart(); void OnBatteryStatusStop(); diff --git a/content/browser/battery_status/battery_status_service_unittest.cc b/content/browser/battery_status/battery_status_service_unittest.cc index 54d4833..25a54cb 100644 --- a/content/browser/battery_status/battery_status_service_unittest.cc +++ b/content/browser/battery_status/battery_status_service_unittest.cc @@ -18,17 +18,15 @@ class FakeBatteryManager : public BatteryStatusManager { explicit FakeBatteryManager( const BatteryStatusService::BatteryUpdateCallback& callback) : callback_(callback), start_invoked_count_(0), stop_invoked_count_(0) {} - virtual ~FakeBatteryManager() { } + ~FakeBatteryManager() override {} // Methods from Battery Status Manager - virtual bool StartListeningBatteryChange() override { + bool StartListeningBatteryChange() override { start_invoked_count_++; return true; } - virtual void StopListeningBatteryChange() override { - stop_invoked_count_++; - } + void StopListeningBatteryChange() override { stop_invoked_count_++; } void InvokeUpdateCallback(const blink::WebBatteryStatus& status) { callback_.Run(status); diff --git a/content/browser/bootstrap_sandbox_mac.cc b/content/browser/bootstrap_sandbox_mac.cc index 9c88cf6..2361563 100644 --- a/content/browser/bootstrap_sandbox_mac.cc +++ b/content/browser/bootstrap_sandbox_mac.cc @@ -29,15 +29,14 @@ class BootstrapSandboxPolicy : public BrowserChildProcessObserver { } // BrowserChildProcessObserver: - virtual void BrowserChildProcessHostDisconnected( - const ChildProcessData& data) override; - virtual void BrowserChildProcessCrashed( + void BrowserChildProcessHostDisconnected( const ChildProcessData& data) override; + void BrowserChildProcessCrashed(const ChildProcessData& data) override; private: friend struct DefaultSingletonTraits<BootstrapSandboxPolicy>; BootstrapSandboxPolicy(); - virtual ~BootstrapSandboxPolicy(); + ~BootstrapSandboxPolicy() override; void RegisterSandboxPolicies(); diff --git a/content/browser/browser_child_process_host_impl.h b/content/browser/browser_child_process_host_impl.h index dcd975c..4490b99 100644 --- a/content/browser/browser_child_process_host_impl.h +++ b/content/browser/browser_child_process_host_impl.h @@ -45,32 +45,31 @@ class CONTENT_EXPORT BrowserChildProcessHostImpl BrowserChildProcessHostImpl( int process_type, BrowserChildProcessHostDelegate* delegate); - virtual ~BrowserChildProcessHostImpl(); + ~BrowserChildProcessHostImpl() override; // Terminates all child processes and deletes each BrowserChildProcessHost // instance. static void TerminateAll(); // BrowserChildProcessHost implementation: - virtual bool Send(IPC::Message* message) override; - virtual void Launch( - SandboxedProcessLauncherDelegate* delegate, - base::CommandLine* cmd_line) override; - virtual const ChildProcessData& GetData() const override; - virtual ChildProcessHost* GetHost() const override; - virtual base::TerminationStatus GetTerminationStatus( - bool known_dead, int* exit_code) override; - virtual void SetName(const base::string16& name) override; - virtual void SetHandle(base::ProcessHandle handle) override; + bool Send(IPC::Message* message) override; + void Launch(SandboxedProcessLauncherDelegate* delegate, + base::CommandLine* cmd_line) override; + const ChildProcessData& GetData() const override; + ChildProcessHost* GetHost() const override; + base::TerminationStatus GetTerminationStatus(bool known_dead, + int* exit_code) override; + void SetName(const base::string16& name) override; + void SetHandle(base::ProcessHandle handle) override; // ChildProcessHostDelegate implementation: - virtual bool CanShutdown() override; - virtual void OnChildDisconnected() override; - virtual base::ProcessHandle GetHandle() const override; - virtual bool OnMessageReceived(const IPC::Message& message) override; - virtual void OnChannelConnected(int32 peer_pid) override; - virtual void OnChannelError() override; - virtual void OnBadMessageReceived(const IPC::Message& message) override; + bool CanShutdown() override; + void OnChildDisconnected() override; + base::ProcessHandle GetHandle() const override; + bool OnMessageReceived(const IPC::Message& message) override; + void OnChannelConnected(int32 peer_pid) override; + void OnChannelError() override; + void OnBadMessageReceived(const IPC::Message& message) override; // Removes this host from the host list. Calls ChildProcessHost::ForceShutdown void ForceShutdown(); @@ -103,8 +102,8 @@ class CONTENT_EXPORT BrowserChildProcessHostImpl static void RemoveObserver(BrowserChildProcessObserver* observer); // ChildProcessLauncher::Client implementation. - virtual void OnProcessLaunched() override; - virtual void OnProcessLaunchFailed() override; + void OnProcessLaunched() override; + void OnProcessLaunchFailed() override; #if defined(OS_WIN) // ObjectWatcher::Delegate implementation. diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc index 1eb8598..433dbca 100644 --- a/content/browser/browser_main_loop.cc +++ b/content/browser/browser_main_loop.cc @@ -316,12 +316,11 @@ void ImmediateShutdownAndExitProcess() { class BrowserMainLoop::MemoryObserver : public base::MessageLoop::TaskObserver { public: MemoryObserver() {} - virtual ~MemoryObserver() {} + ~MemoryObserver() override {} - virtual void WillProcessTask(const base::PendingTask& pending_task) override { - } + void WillProcessTask(const base::PendingTask& pending_task) override {} - virtual void DidProcessTask(const base::PendingTask& pending_task) override { + void DidProcessTask(const base::PendingTask& pending_task) override { #if !defined(OS_IOS) // No ProcessMetrics on IOS. scoped_ptr<base::ProcessMetrics> process_metrics( base::ProcessMetrics::CreateProcessMetrics( diff --git a/content/browser/browser_main_runner.cc b/content/browser/browser_main_runner.cc index 5df5d99..981ed02 100644 --- a/content/browser/browser_main_runner.cc +++ b/content/browser/browser_main_runner.cc @@ -134,12 +134,12 @@ class BrowserMainRunnerImpl : public BrowserMainRunner { BrowserMainRunnerImpl() : initialization_started_(false), is_shutdown_(false) {} - virtual ~BrowserMainRunnerImpl() { + ~BrowserMainRunnerImpl() override { if (initialization_started_ && !is_shutdown_) Shutdown(); } - virtual int Initialize(const MainFunctionParams& parameters) override { + int Initialize(const MainFunctionParams& parameters) override { TRACE_EVENT0("startup", "BrowserMainRunnerImpl::Initialize"); // On Android we normally initialize the browser in a series of UI thread // tasks. While this is happening a second request can come from the OS or @@ -216,14 +216,14 @@ class BrowserMainRunnerImpl : public BrowserMainRunner { return -1; } - virtual int Run() override { + int Run() override { DCHECK(initialization_started_); DCHECK(!is_shutdown_); main_loop_->RunMainMessageLoopParts(); return main_loop_->GetResultCode(); } - virtual void Shutdown() override { + void Shutdown() override { DCHECK(initialization_started_); DCHECK(!is_shutdown_); #ifdef LEAK_SANITIZER diff --git a/content/browser/browser_plugin/browser_plugin_embedder.h b/content/browser/browser_plugin/browser_plugin_embedder.h index e8b249c..7ea98f7 100644 --- a/content/browser/browser_plugin/browser_plugin_embedder.h +++ b/content/browser/browser_plugin/browser_plugin_embedder.h @@ -39,7 +39,7 @@ struct NativeWebKeyboardEvent; class CONTENT_EXPORT BrowserPluginEmbedder : public WebContentsObserver { public: - virtual ~BrowserPluginEmbedder(); + ~BrowserPluginEmbedder() override; static BrowserPluginEmbedder* Create(WebContentsImpl* web_contents); @@ -50,7 +50,7 @@ class CONTENT_EXPORT BrowserPluginEmbedder : public WebContentsObserver { void DidSendScreenRects(); // WebContentsObserver implementation. - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; void DragSourceEndedAt(int client_x, int client_y, int screen_x, int screen_y, blink::WebDragOperation operation); diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc index efb76e0..68876ea 100644 --- a/content/browser/browser_plugin/browser_plugin_guest.cc +++ b/content/browser/browser_plugin/browser_plugin_guest.cc @@ -51,15 +51,14 @@ class BrowserPluginGuest::EmbedderWebContentsObserver browser_plugin_guest_(guest) { } - virtual ~EmbedderWebContentsObserver() { - } + ~EmbedderWebContentsObserver() override {} // WebContentsObserver implementation. - virtual void WasShown() override { + void WasShown() override { browser_plugin_guest_->EmbedderVisibilityChanged(true); } - virtual void WasHidden() override { + void WasHidden() override { browser_plugin_guest_->EmbedderVisibilityChanged(false); } diff --git a/content/browser/browser_plugin/browser_plugin_guest.h b/content/browser/browser_plugin/browser_plugin_guest.h index 68871c8..be25d09 100644 --- a/content/browser/browser_plugin/browser_plugin_guest.h +++ b/content/browser/browser_plugin/browser_plugin_guest.h @@ -79,7 +79,7 @@ struct DropData; // which means it can share storage and can script this guest. class CONTENT_EXPORT BrowserPluginGuest : public WebContentsObserver { public: - virtual ~BrowserPluginGuest(); + ~BrowserPluginGuest() override; // The WebContents passed into the factory method here has not been // initialized yet and so it does not yet hold a SiteInstance. @@ -149,16 +149,16 @@ class CONTENT_EXPORT BrowserPluginGuest : public WebContentsObserver { BrowserPluginGuestManager* GetBrowserPluginGuestManager() const; // WebContentsObserver implementation. - virtual void DidCommitProvisionalLoadForFrame( + void DidCommitProvisionalLoadForFrame( RenderFrameHost* render_frame_host, const GURL& url, ui::PageTransition transition_type) override; - virtual void RenderViewReady() override; - virtual void RenderProcessGone(base::TerminationStatus status) override; - virtual bool OnMessageReceived(const IPC::Message& message) override; - virtual bool OnMessageReceived(const IPC::Message& message, - RenderFrameHost* render_frame_host) override; + void RenderViewReady() override; + void RenderProcessGone(base::TerminationStatus status) override; + bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message, + RenderFrameHost* render_frame_host) override; // Exposes the protected web_contents() from WebContentsObserver. WebContentsImpl* GetWebContents() const; diff --git a/content/browser/browser_plugin/browser_plugin_message_filter.h b/content/browser/browser_plugin/browser_plugin_message_filter.h index 10a3b8b..672f6de 100644 --- a/content/browser/browser_plugin/browser_plugin_message_filter.h +++ b/content/browser/browser_plugin/browser_plugin_message_filter.h @@ -20,17 +20,16 @@ class BrowserPluginMessageFilter : public BrowserMessageFilter { BrowserPluginMessageFilter(int render_process_id); // BrowserMessageFilter implementation. - virtual void OverrideThreadForMessage( - const IPC::Message& message, - BrowserThread::ID* thread) override; - virtual bool OnMessageReceived(const IPC::Message& message) override; - virtual void OnDestruct() const override; + void OverrideThreadForMessage(const IPC::Message& message, + BrowserThread::ID* thread) override; + bool OnMessageReceived(const IPC::Message& message) override; + void OnDestruct() const override; private: friend class BrowserThread; friend class base::DeleteHelper<BrowserPluginMessageFilter>; - virtual ~BrowserPluginMessageFilter(); + ~BrowserPluginMessageFilter() override; void ForwardMessageToGuest(const IPC::Message& message); diff --git a/content/browser/browser_plugin/browser_plugin_popup_menu_helper_mac.h b/content/browser/browser_plugin/browser_plugin_popup_menu_helper_mac.h index 322a820..31c1980 100644 --- a/content/browser/browser_plugin/browser_plugin_popup_menu_helper_mac.h +++ b/content/browser/browser_plugin/browser_plugin_popup_menu_helper_mac.h @@ -25,7 +25,7 @@ class BrowserPluginPopupMenuHelper : public PopupMenuHelper { RenderFrameHost* guest_rfh); private: - virtual RenderWidgetHostViewMac* GetRenderWidgetHostView() const override; + RenderWidgetHostViewMac* GetRenderWidgetHostView() const override; RenderViewHostImpl* embedder_rvh_; diff --git a/content/browser/browser_process_sub_thread.h b/content/browser/browser_process_sub_thread.h index 888db2d..5899fa3 100644 --- a/content/browser/browser_process_sub_thread.h +++ b/content/browser/browser_process_sub_thread.h @@ -35,11 +35,11 @@ namespace content { class CONTENT_EXPORT BrowserProcessSubThread : public BrowserThreadImpl { public: explicit BrowserProcessSubThread(BrowserThread::ID identifier); - virtual ~BrowserProcessSubThread(); + ~BrowserProcessSubThread() override; protected: - virtual void Init() override; - virtual void CleanUp() override; + void Init() override; + void CleanUp() override; private: // These methods encapsulate cleanup that needs to happen on the IO thread diff --git a/content/browser/browser_thread_impl.cc b/content/browser/browser_thread_impl.cc index cec1477..33bfeb95 100644 --- a/content/browser/browser_thread_impl.cc +++ b/content/browser/browser_thread_impl.cc @@ -45,26 +45,25 @@ class BrowserThreadMessageLoopProxy : public base::MessageLoopProxy { } // MessageLoopProxy implementation. - virtual bool PostDelayedTask( - const tracked_objects::Location& from_here, - const base::Closure& task, base::TimeDelta delay) override { + bool PostDelayedTask(const tracked_objects::Location& from_here, + const base::Closure& task, + base::TimeDelta delay) override { return BrowserThread::PostDelayedTask(id_, from_here, task, delay); } - virtual bool PostNonNestableDelayedTask( - const tracked_objects::Location& from_here, - const base::Closure& task, - base::TimeDelta delay) override { + bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, + const base::Closure& task, + base::TimeDelta delay) override { return BrowserThread::PostNonNestableDelayedTask(id_, from_here, task, delay); } - virtual bool RunsTasksOnCurrentThread() const override { + bool RunsTasksOnCurrentThread() const override { return BrowserThread::CurrentlyOn(id_); } protected: - virtual ~BrowserThreadMessageLoopProxy() {} + ~BrowserThreadMessageLoopProxy() override {} private: BrowserThread::ID id_; diff --git a/content/browser/browser_thread_impl.h b/content/browser/browser_thread_impl.h index fca4379f..72915ea 100644 --- a/content/browser/browser_thread_impl.h +++ b/content/browser/browser_thread_impl.h @@ -23,14 +23,14 @@ class CONTENT_EXPORT BrowserThreadImpl : public BrowserThread, // thread already exists. BrowserThreadImpl(BrowserThread::ID identifier, base::MessageLoop* message_loop); - virtual ~BrowserThreadImpl(); + ~BrowserThreadImpl() override; static void ShutdownThreadPool(); protected: - virtual void Init() override; - virtual void Run(base::MessageLoop* message_loop) override; - virtual void CleanUp() override; + void Init() override; + void Run(base::MessageLoop* message_loop) override; + void CleanUp() override; private: // We implement all the functionality of the public BrowserThread diff --git a/content/browser/browser_url_handler_impl.h b/content/browser/browser_url_handler_impl.h index 749b3a1..240554b 100644 --- a/content/browser/browser_url_handler_impl.h +++ b/content/browser/browser_url_handler_impl.h @@ -23,12 +23,11 @@ class CONTENT_EXPORT BrowserURLHandlerImpl : public BrowserURLHandler { static BrowserURLHandlerImpl* GetInstance(); // BrowserURLHandler implementation: - virtual void RewriteURLIfNecessary(GURL* url, - BrowserContext* browser_context, - bool* reverse_on_redirect) override; + void RewriteURLIfNecessary(GURL* url, + BrowserContext* browser_context, + bool* reverse_on_redirect) override; // Add the specified handler pair to the list of URL handlers. - virtual void AddHandlerPair(URLHandler handler, - URLHandler reverse_handler) override; + void AddHandlerPair(URLHandler handler, URLHandler reverse_handler) override; // Reverses the rewriting that was done for |original| using the new |url|. bool ReverseURLRewrite(GURL* url, const GURL& original, @@ -37,7 +36,7 @@ class CONTENT_EXPORT BrowserURLHandlerImpl : public BrowserURLHandler { private: // This object is a singleton: BrowserURLHandlerImpl(); - virtual ~BrowserURLHandlerImpl(); + ~BrowserURLHandlerImpl() override; friend struct DefaultSingletonTraits<BrowserURLHandlerImpl>; // The list of known URLHandlers, optionally with reverse-rewriters. diff --git a/content/browser/byte_stream.cc b/content/browser/byte_stream.cc index 669f378..5c836bd 100644 --- a/content/browser/byte_stream.cc +++ b/content/browser/byte_stream.cc @@ -48,7 +48,7 @@ class ByteStreamWriterImpl : public ByteStreamWriter { ByteStreamWriterImpl(scoped_refptr<base::SequencedTaskRunner> task_runner, scoped_refptr<LifetimeFlag> lifetime_flag, size_t buffer_size); - virtual ~ByteStreamWriterImpl(); + ~ByteStreamWriterImpl() override; // Must be called before any operations are performed. void SetPeer(ByteStreamReaderImpl* peer, @@ -56,12 +56,11 @@ class ByteStreamWriterImpl : public ByteStreamWriter { scoped_refptr<LifetimeFlag> peer_lifetime_flag); // Overridden from ByteStreamWriter. - virtual bool Write(scoped_refptr<net::IOBuffer> buffer, - size_t byte_count) override; - virtual void Flush() override; - virtual void Close(int status) override; - virtual void RegisterCallback(const base::Closure& source_callback) override; - virtual size_t GetTotalBufferedBytes() const override; + bool Write(scoped_refptr<net::IOBuffer> buffer, size_t byte_count) override; + void Flush() override; + void Close(int status) override; + void RegisterCallback(const base::Closure& source_callback) override; + size_t GetTotalBufferedBytes() const override; // PostTask target from |ByteStreamReaderImpl::MaybeUpdateInput|. static void UpdateWindow(scoped_refptr<LifetimeFlag> lifetime_flag, @@ -108,7 +107,7 @@ class ByteStreamReaderImpl : public ByteStreamReader { ByteStreamReaderImpl(scoped_refptr<base::SequencedTaskRunner> task_runner, scoped_refptr<LifetimeFlag> lifetime_flag, size_t buffer_size); - virtual ~ByteStreamReaderImpl(); + ~ByteStreamReaderImpl() override; // Must be called before any operations are performed. void SetPeer(ByteStreamWriterImpl* peer, @@ -116,10 +115,9 @@ class ByteStreamReaderImpl : public ByteStreamReader { scoped_refptr<LifetimeFlag> peer_lifetime_flag); // Overridden from ByteStreamReader. - virtual StreamState Read(scoped_refptr<net::IOBuffer>* data, - size_t* length) override; - virtual int GetStatus() const override; - virtual void RegisterCallback(const base::Closure& sink_callback) override; + StreamState Read(scoped_refptr<net::IOBuffer>* data, size_t* length) override; + int GetStatus() const override; + void RegisterCallback(const base::Closure& sink_callback) override; // PostTask target from |ByteStreamWriterImpl::Write| and // |ByteStreamWriterImpl::Close|. diff --git a/content/browser/cert_store_impl.h b/content/browser/cert_store_impl.h index aa8786d..d8b689c 100644 --- a/content/browser/cert_store_impl.h +++ b/content/browser/cert_store_impl.h @@ -18,14 +18,14 @@ class CertStoreImpl : public CertStore { static CertStoreImpl* GetInstance(); // CertStore implementation: - virtual int StoreCert(net::X509Certificate* cert, - int render_process_host_id) override; - virtual bool RetrieveCert(int cert_id, - scoped_refptr<net::X509Certificate>* cert) override; + int StoreCert(net::X509Certificate* cert, + int render_process_host_id) override; + bool RetrieveCert(int cert_id, + scoped_refptr<net::X509Certificate>* cert) override; protected: CertStoreImpl(); - virtual ~CertStoreImpl(); + ~CertStoreImpl() override; private: friend struct DefaultSingletonTraits<CertStoreImpl>; diff --git a/content/browser/child_process_launcher_browsertest.cc b/content/browser/child_process_launcher_browsertest.cc index 1261583..fe3fa1d 100644 --- a/content/browser/child_process_launcher_browsertest.cc +++ b/content/browser/child_process_launcher_browsertest.cc @@ -13,7 +13,7 @@ typedef ContentBrowserTest ChildProcessLauncherBrowserTest; class StatsTableBrowserTest : public ChildProcessLauncherBrowserTest { public: - virtual void SetUpCommandLine(base::CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(switches::kEnableStatsTable); } }; diff --git a/content/browser/child_process_security_policy_impl.h b/content/browser/child_process_security_policy_impl.h index d0a172d..dcc1b88 100644 --- a/content/browser/child_process_security_policy_impl.h +++ b/content/browser/child_process_security_policy_impl.h @@ -35,52 +35,44 @@ class CONTENT_EXPORT ChildProcessSecurityPolicyImpl public: // Object can only be created through GetInstance() so the constructor is // private. - virtual ~ChildProcessSecurityPolicyImpl(); + ~ChildProcessSecurityPolicyImpl() override; static ChildProcessSecurityPolicyImpl* GetInstance(); // ChildProcessSecurityPolicy implementation. - virtual void RegisterWebSafeScheme(const std::string& scheme) override; - virtual bool IsWebSafeScheme(const std::string& scheme) override; - virtual void GrantReadFile(int child_id, const base::FilePath& file) override; - virtual void GrantCreateReadWriteFile(int child_id, - const base::FilePath& file) override; - virtual void GrantCopyInto(int child_id, const base::FilePath& dir) override; - virtual void GrantDeleteFrom(int child_id, - const base::FilePath& dir) override; - virtual void GrantReadFileSystem( + void RegisterWebSafeScheme(const std::string& scheme) override; + bool IsWebSafeScheme(const std::string& scheme) override; + void GrantReadFile(int child_id, const base::FilePath& file) override; + void GrantCreateReadWriteFile(int child_id, + const base::FilePath& file) override; + void GrantCopyInto(int child_id, const base::FilePath& dir) override; + void GrantDeleteFrom(int child_id, const base::FilePath& dir) override; + void GrantReadFileSystem(int child_id, + const std::string& filesystem_id) override; + void GrantWriteFileSystem(int child_id, + const std::string& filesystem_id) override; + void GrantCreateFileForFileSystem(int child_id, + const std::string& filesystem_id) override; + void GrantCreateReadWriteFileSystem( int child_id, const std::string& filesystem_id) override; - virtual void GrantWriteFileSystem( - int child_id, - const std::string& filesystem_id) override; - virtual void GrantCreateFileForFileSystem( - int child_id, - const std::string& filesystem_id) override; - virtual void GrantCreateReadWriteFileSystem( - int child_id, - const std::string& filesystem_id) override; - virtual void GrantCopyIntoFileSystem( - int child_id, - const std::string& filesystem_id) override; - virtual void GrantDeleteFromFileSystem( - int child_id, - const std::string& filesystem_id) override; - virtual void GrantScheme(int child_id, const std::string& scheme) override; - virtual bool CanReadFile(int child_id, const base::FilePath& file) override; - virtual bool CanCreateReadWriteFile(int child_id, - const base::FilePath& file) override; - virtual bool CanReadFileSystem(int child_id, + void GrantCopyIntoFileSystem(int child_id, + const std::string& filesystem_id) override; + void GrantDeleteFromFileSystem(int child_id, const std::string& filesystem_id) override; - virtual bool CanReadWriteFileSystem( - int child_id, - const std::string& filesystem_id) override; - virtual bool CanCopyIntoFileSystem(int child_id, - const std::string& filesystem_id) override; - virtual bool CanDeleteFromFileSystem( - int child_id, - const std::string& filesystem_id) override; - virtual bool HasWebUIBindings(int child_id) override; + void GrantScheme(int child_id, const std::string& scheme) override; + bool CanReadFile(int child_id, const base::FilePath& file) override; + bool CanCreateReadWriteFile(int child_id, + const base::FilePath& file) override; + bool CanReadFileSystem(int child_id, + const std::string& filesystem_id) override; + bool CanReadWriteFileSystem(int child_id, + const std::string& filesystem_id) override; + bool CanCopyIntoFileSystem(int child_id, + const std::string& filesystem_id) override; + bool CanDeleteFromFileSystem(int child_id, + const std::string& filesystem_id) override; + bool HasWebUIBindings(int child_id) override; // Pseudo schemes are treated differently than other schemes because they // cannot be requested like normal URLs. There is no mechanism for revoking diff --git a/content/browser/child_process_security_policy_unittest.cc b/content/browser/child_process_security_policy_unittest.cc index daf0b8d..99e52e4 100644 --- a/content/browser/child_process_security_policy_unittest.cc +++ b/content/browser/child_process_security_policy_unittest.cc @@ -34,7 +34,7 @@ class ChildProcessSecurityPolicyTestBrowserClient public: ChildProcessSecurityPolicyTestBrowserClient() {} - virtual bool IsHandledURL(const GURL& url) override { + bool IsHandledURL(const GURL& url) override { return schemes_.find(url.scheme()) != schemes_.end(); } diff --git a/content/browser/compositor/browser_compositor_ca_layer_tree_mac.h b/content/browser/compositor/browser_compositor_ca_layer_tree_mac.h index f59d865..b342035 100644 --- a/content/browser/compositor/browser_compositor_ca_layer_tree_mac.h +++ b/content/browser/compositor/browser_compositor_ca_layer_tree_mac.h @@ -61,9 +61,9 @@ class BrowserCompositorCALayerTreeMac private: // IOSurfaceLayerClient implementation: - virtual bool IOSurfaceLayerShouldAckImmediately() const override; - virtual void IOSurfaceLayerDidDrawFrame() override; - virtual void IOSurfaceLayerHitError() override; + bool IOSurfaceLayerShouldAckImmediately() const override; + void IOSurfaceLayerDidDrawFrame() override; + void IOSurfaceLayerHitError() override; void GotAcceleratedCAContextFrame( CAContextID ca_context_id, gfx::Size pixel_size, float scale_factor); diff --git a/content/browser/compositor/browser_compositor_output_surface.h b/content/browser/compositor/browser_compositor_output_surface.h index a6f557d..dd53876 100644 --- a/content/browser/compositor/browser_compositor_output_surface.h +++ b/content/browser/compositor/browser_compositor_output_surface.h @@ -25,14 +25,14 @@ class CONTENT_EXPORT BrowserCompositorOutputSurface public ui::CompositorVSyncManager::Observer, public base::NonThreadSafe { public: - virtual ~BrowserCompositorOutputSurface(); + ~BrowserCompositorOutputSurface() override; // cc::OutputSurface implementation. - virtual bool BindToClient(cc::OutputSurfaceClient* client) override; + bool BindToClient(cc::OutputSurfaceClient* client) override; // ui::CompositorOutputSurface::Observer implementation. - virtual void OnUpdateVSyncParameters(base::TimeTicks timebase, - base::TimeDelta interval) override; + void OnUpdateVSyncParameters(base::TimeTicks timebase, + base::TimeDelta interval) override; void OnUpdateVSyncParametersFromGpu(base::TimeTicks tiembase, base::TimeDelta interval); diff --git a/content/browser/compositor/delegated_frame_host.h b/content/browser/compositor/delegated_frame_host.h index ef467fa..a789ef6 100644 --- a/content/browser/compositor/delegated_frame_host.h +++ b/content/browser/compositor/delegated_frame_host.h @@ -81,7 +81,7 @@ class CONTENT_EXPORT DelegatedFrameHost public base::SupportsWeakPtr<DelegatedFrameHost> { public: DelegatedFrameHost(DelegatedFrameHostClient* client); - virtual ~DelegatedFrameHost(); + ~DelegatedFrameHost() override; bool CanCopyToBitmap() const; @@ -145,24 +145,22 @@ class CONTENT_EXPORT DelegatedFrameHost void UnlockResources(); // Overridden from ui::CompositorObserver: - virtual void OnCompositingDidCommit(ui::Compositor* compositor) override; - virtual void OnCompositingStarted(ui::Compositor* compositor, - base::TimeTicks start_time) override; - virtual void OnCompositingEnded(ui::Compositor* compositor) override; - virtual void OnCompositingAborted(ui::Compositor* compositor) override; - virtual void OnCompositingLockStateChanged( - ui::Compositor* compositor) override; + void OnCompositingDidCommit(ui::Compositor* compositor) override; + void OnCompositingStarted(ui::Compositor* compositor, + base::TimeTicks start_time) override; + void OnCompositingEnded(ui::Compositor* compositor) override; + void OnCompositingAborted(ui::Compositor* compositor) override; + void OnCompositingLockStateChanged(ui::Compositor* compositor) override; // Overridden from ui::CompositorVSyncManager::Observer: - virtual void OnUpdateVSyncParameters(base::TimeTicks timebase, - base::TimeDelta interval) override; + void OnUpdateVSyncParameters(base::TimeTicks timebase, + base::TimeDelta interval) override; // Overridden from ui::LayerOwnerObserver: - virtual void OnLayerRecreated(ui::Layer* old_layer, - ui::Layer* new_layer) override; + void OnLayerRecreated(ui::Layer* old_layer, ui::Layer* new_layer) override; // Overridden from ImageTransportFactoryObserver: - virtual void OnLostResources() override; + void OnLostResources() override; bool ShouldSkipFrame(gfx::Size size_in_dip) const; @@ -217,14 +215,13 @@ class CONTENT_EXPORT DelegatedFrameHost void SendReturnedDelegatedResources(uint32 output_surface_id); // DelegatedFrameEvictorClient implementation. - virtual void EvictDelegatedFrame() override; + void EvictDelegatedFrame() override; // cc::DelegatedFrameProviderClient implementation. - virtual void UnusedResourcesAreAvailable() override; + void UnusedResourcesAreAvailable() override; // cc::SurfaceFactoryClient implementation. - virtual void ReturnResources( - const cc::ReturnedResourceArray& resources) override; + void ReturnResources(const cc::ReturnedResourceArray& resources) override; void DidReceiveFrameFromRenderer(const gfx::Rect& damage_rect); diff --git a/content/browser/compositor/gpu_browser_compositor_output_surface.h b/content/browser/compositor/gpu_browser_compositor_output_surface.h index 0878d77..c558b56 100644 --- a/content/browser/compositor/gpu_browser_compositor_output_surface.h +++ b/content/browser/compositor/gpu_browser_compositor_output_surface.h @@ -32,15 +32,15 @@ class GpuBrowserCompositorOutputSurface const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, scoped_ptr<cc::OverlayCandidateValidator> overlay_candidate_validator); - virtual ~GpuBrowserCompositorOutputSurface(); + ~GpuBrowserCompositorOutputSurface() override; protected: // cc::OutputSurface implementation. - virtual void SwapBuffers(cc::CompositorFrame* frame) override; - virtual bool BindToClient(cc::OutputSurfaceClient* client) override; + void SwapBuffers(cc::CompositorFrame* frame) override; + bool BindToClient(cc::OutputSurfaceClient* client) override; #if defined(OS_MACOSX) - virtual void OnSurfaceDisplayed() override; + void OnSurfaceDisplayed() override; #endif CommandBufferProxyImpl* GetCommandBufferProxy(); diff --git a/content/browser/compositor/gpu_process_transport_factory.h b/content/browser/compositor/gpu_process_transport_factory.h index e4a6885..cdee6c0 100644 --- a/content/browser/compositor/gpu_process_transport_factory.h +++ b/content/browser/compositor/gpu_process_transport_factory.h @@ -37,39 +37,35 @@ class GpuProcessTransportFactory public: GpuProcessTransportFactory(); - virtual ~GpuProcessTransportFactory(); + ~GpuProcessTransportFactory() override; scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateOffscreenCommandBufferContext(); // ui::ContextFactory implementation. - virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface( - ui::Compositor* compositor, bool software_fallback) override; - virtual scoped_refptr<ui::Reflector> CreateReflector( - ui::Compositor* source, - ui::Layer* target) override; - virtual void RemoveReflector( - scoped_refptr<ui::Reflector> reflector) override; - virtual void RemoveCompositor(ui::Compositor* compositor) override; - virtual scoped_refptr<cc::ContextProvider> - SharedMainThreadContextProvider() override; - virtual bool DoesCreateTestContexts() override; - virtual cc::SharedBitmapManager* GetSharedBitmapManager() override; - virtual cc::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; - virtual base::MessageLoopProxy* GetCompositorMessageLoop() override; - virtual scoped_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator() - override; + scoped_ptr<cc::OutputSurface> CreateOutputSurface( + ui::Compositor* compositor, + bool software_fallback) override; + scoped_refptr<ui::Reflector> CreateReflector(ui::Compositor* source, + ui::Layer* target) override; + void RemoveReflector(scoped_refptr<ui::Reflector> reflector) override; + void RemoveCompositor(ui::Compositor* compositor) override; + scoped_refptr<cc::ContextProvider> SharedMainThreadContextProvider() override; + bool DoesCreateTestContexts() override; + cc::SharedBitmapManager* GetSharedBitmapManager() override; + cc::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; + base::MessageLoopProxy* GetCompositorMessageLoop() override; + scoped_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator() override; // ImageTransportFactory implementation. - virtual ui::ContextFactory* GetContextFactory() override; - virtual gfx::GLSurfaceHandle GetSharedSurfaceHandle() override; - virtual cc::SurfaceManager* GetSurfaceManager() override; - virtual GLHelper* GetGLHelper() override; - virtual void AddObserver(ImageTransportFactoryObserver* observer) override; - virtual void RemoveObserver( - ImageTransportFactoryObserver* observer) override; + ui::ContextFactory* GetContextFactory() override; + gfx::GLSurfaceHandle GetSharedSurfaceHandle() override; + cc::SurfaceManager* GetSurfaceManager() override; + GLHelper* GetGLHelper() override; + void AddObserver(ImageTransportFactoryObserver* observer) override; + void RemoveObserver(ImageTransportFactoryObserver* observer) override; #if defined(OS_MACOSX) - virtual void OnSurfaceDisplayed(int surface_id) override; + void OnSurfaceDisplayed(int surface_id) override; #endif private: diff --git a/content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.h b/content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.h index 6eed543..a22ab634 100644 --- a/content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.h +++ b/content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.h @@ -21,15 +21,15 @@ class GpuSurfacelessBrowserCompositorOutputSurface const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, scoped_ptr<cc::OverlayCandidateValidator> overlay_candidate_validator, unsigned internalformat); - virtual ~GpuSurfacelessBrowserCompositorOutputSurface(); + ~GpuSurfacelessBrowserCompositorOutputSurface() override; private: // cc::OutputSurface implementation. - virtual void SwapBuffers(cc::CompositorFrame* frame) override; - virtual void OnSwapBuffersComplete() override; - virtual void BindFramebuffer() override; - virtual void Reshape(const gfx::Size& size, float scale_factor) override; - virtual bool BindToClient(cc::OutputSurfaceClient* client) override; + void SwapBuffers(cc::CompositorFrame* frame) override; + void OnSwapBuffersComplete() override; + void BindFramebuffer() override; + void Reshape(const gfx::Size& size, float scale_factor) override; + bool BindToClient(cc::OutputSurfaceClient* client) override; unsigned int internalformat_; scoped_ptr<BufferQueue> output_surface_; diff --git a/content/browser/compositor/io_surface_context_mac.h b/content/browser/compositor/io_surface_context_mac.h index 2654711..7fc466d 100644 --- a/content/browser/compositor/io_surface_context_mac.h +++ b/content/browser/compositor/io_surface_context_mac.h @@ -45,7 +45,7 @@ class IOSurfaceContext CGLContextObj cgl_context() const { return cgl_context_; } // content::GpuDataManagerObserver implementation. - virtual void OnGpuSwitching() override; + void OnGpuSwitching() override; private: friend class base::RefCounted<IOSurfaceContext>; @@ -53,7 +53,7 @@ class IOSurfaceContext IOSurfaceContext( Type type, base::ScopedTypeRef<CGLContextObj> clg_context_strong); - virtual ~IOSurfaceContext(); + ~IOSurfaceContext() override; Type type_; base::ScopedTypeRef<CGLContextObj> cgl_context_; diff --git a/content/browser/compositor/onscreen_display_client.h b/content/browser/compositor/onscreen_display_client.h index 8b6445c..2d611bd 100644 --- a/content/browser/compositor/onscreen_display_client.h +++ b/content/browser/compositor/onscreen_display_client.h @@ -28,7 +28,7 @@ class OnscreenDisplayClient : cc::DisplayClient { scoped_ptr<cc::OutputSurface> output_surface, cc::SurfaceManager* manager, scoped_refptr<base::SingleThreadTaskRunner> task_runner); - virtual ~OnscreenDisplayClient(); + ~OnscreenDisplayClient() override; bool Initialize(); cc::Display* display() { return display_.get(); } @@ -37,13 +37,13 @@ class OnscreenDisplayClient : cc::DisplayClient { } // cc::DisplayClient implementation. - virtual void DisplayDamaged() override; - virtual void DidSwapBuffers() override; - virtual void DidSwapBuffersComplete() override; - virtual void CommitVSyncParameters(base::TimeTicks timebase, - base::TimeDelta interval) override; - virtual void OutputSurfaceLost() override; - virtual void SetMemoryPolicy(const cc::ManagedMemoryPolicy& policy) override; + void DisplayDamaged() override; + void DidSwapBuffers() override; + void DidSwapBuffersComplete() override; + void CommitVSyncParameters(base::TimeTicks timebase, + base::TimeDelta interval) override; + void OutputSurfaceLost() override; + void SetMemoryPolicy(const cc::ManagedMemoryPolicy& policy) override; private: void ScheduleDraw(); diff --git a/content/browser/compositor/owned_mailbox.h b/content/browser/compositor/owned_mailbox.h index 5c22bcd..c886814 100644 --- a/content/browser/compositor/owned_mailbox.h +++ b/content/browser/compositor/owned_mailbox.h @@ -31,10 +31,10 @@ class CONTENT_EXPORT OwnedMailbox : public base::RefCounted<OwnedMailbox>, void Destroy(); protected: - virtual ~OwnedMailbox(); + ~OwnedMailbox() override; // ImageTransportFactoryObserver implementation. - virtual void OnLostResources() override; + void OnLostResources() override; private: friend class base::RefCounted<OwnedMailbox>; diff --git a/content/browser/compositor/reflector_impl.h b/content/browser/compositor/reflector_impl.h index 6123cb5..f771fe4 100644 --- a/content/browser/compositor/reflector_impl.h +++ b/content/browser/compositor/reflector_impl.h @@ -53,7 +53,7 @@ class ReflectorImpl : public base::SupportsWeakPtr<ReflectorImpl>, BrowserCompositorOutputSurface* surface); // ui::Reflector implementation. - virtual void OnMirroringCompositorResized() override; + void OnMirroringCompositorResized() override; // Called in |BrowserCompositorOutputSurface::SwapBuffers| to copy // the full screen image to the |texture_id_|. This must be called @@ -99,7 +99,7 @@ class ReflectorImpl : public base::SupportsWeakPtr<ReflectorImpl>, gpu::MailboxHolder mailbox_holder; }; - virtual ~ReflectorImpl(); + ~ReflectorImpl() override; void AttachToOutputSurfaceOnImplThread( const gpu::MailboxHolder& mailbox_holder, diff --git a/content/browser/compositor/software_browser_compositor_output_surface.h b/content/browser/compositor/software_browser_compositor_output_surface.h index 33f362d..1df9b36 100644 --- a/content/browser/compositor/software_browser_compositor_output_surface.h +++ b/content/browser/compositor/software_browser_compositor_output_surface.h @@ -31,13 +31,13 @@ class CONTENT_EXPORT SoftwareBrowserCompositorOutputSurface IDMap<BrowserCompositorOutputSurface>* output_surface_map, const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager); - virtual ~SoftwareBrowserCompositorOutputSurface(); + ~SoftwareBrowserCompositorOutputSurface() override; private: - virtual void SwapBuffers(cc::CompositorFrame* frame) override; + void SwapBuffers(cc::CompositorFrame* frame) override; #if defined(OS_MACOSX) - virtual void OnSurfaceDisplayed() override; + void OnSurfaceDisplayed() override; #endif // On the software path we need to explicitly call the proxy to update the diff --git a/content/browser/compositor/software_browser_compositor_output_surface_unittest.cc b/content/browser/compositor/software_browser_compositor_output_surface_unittest.cc index f324e77..d165081 100644 --- a/content/browser/compositor/software_browser_compositor_output_surface_unittest.cc +++ b/content/browser/compositor/software_browser_compositor_output_surface_unittest.cc @@ -17,10 +17,9 @@ namespace { class FakeVSyncProvider : public gfx::VSyncProvider { public: FakeVSyncProvider() : call_count_(0) {} - virtual ~FakeVSyncProvider() {} + ~FakeVSyncProvider() override {} - virtual void GetVSyncParameters(const UpdateVSyncCallback& callback) - override { + void GetVSyncParameters(const UpdateVSyncCallback& callback) override { callback.Run(timebase_, interval_); call_count_++; } @@ -42,9 +41,9 @@ class FakeVSyncProvider : public gfx::VSyncProvider { class FakeSoftwareOutputDevice : public cc::SoftwareOutputDevice { public: FakeSoftwareOutputDevice() : vsync_provider_(new FakeVSyncProvider()) {} - virtual ~FakeSoftwareOutputDevice() {} + ~FakeSoftwareOutputDevice() override {} - virtual gfx::VSyncProvider* GetVSyncProvider() override { + gfx::VSyncProvider* GetVSyncProvider() override { return vsync_provider_.get(); } diff --git a/content/browser/compositor/software_output_device_mac.h b/content/browser/compositor/software_output_device_mac.h index 393ac9b..4721c61 100644 --- a/content/browser/compositor/software_output_device_mac.h +++ b/content/browser/compositor/software_output_device_mac.h @@ -20,9 +20,9 @@ namespace content { class SoftwareOutputDeviceMac : public cc::SoftwareOutputDevice { public: explicit SoftwareOutputDeviceMac(ui::Compositor* compositor); - virtual ~SoftwareOutputDeviceMac(); + ~SoftwareOutputDeviceMac() override; - virtual void EndPaint(cc::SoftwareFrameData* frame_data) override; + void EndPaint(cc::SoftwareFrameData* frame_data) override; private: ui::Compositor* compositor_; diff --git a/content/browser/compositor/surface_display_output_surface.h b/content/browser/compositor/surface_display_output_surface.h index ac1a3e2..698b9f5 100644 --- a/content/browser/compositor/surface_display_output_surface.h +++ b/content/browser/compositor/surface_display_output_surface.h @@ -29,7 +29,7 @@ class SurfaceDisplayOutputSurface : public cc::OutputSurface, cc::SurfaceManager* surface_manager, cc::SurfaceIdAllocator* allocator, const scoped_refptr<cc::ContextProvider>& context_provider); - virtual ~SurfaceDisplayOutputSurface(); + ~SurfaceDisplayOutputSurface() override; void set_display_client(OnscreenDisplayClient* display_client) { display_client_ = display_client; @@ -39,12 +39,11 @@ class SurfaceDisplayOutputSurface : public cc::OutputSurface, base::TimeDelta interval); // cc::OutputSurface implementation. - virtual void SwapBuffers(cc::CompositorFrame* frame) override; - virtual bool BindToClient(cc::OutputSurfaceClient* client) override; + void SwapBuffers(cc::CompositorFrame* frame) override; + bool BindToClient(cc::OutputSurfaceClient* client) override; // cc::SurfaceFactoryClient implementation. - virtual void ReturnResources( - const cc::ReturnedResourceArray& resources) override; + void ReturnResources(const cc::ReturnedResourceArray& resources) override; private: void SwapBuffersComplete(); diff --git a/content/browser/compositor/test/no_transport_image_transport_factory.h b/content/browser/compositor/test/no_transport_image_transport_factory.h index 67ba4ec..627a323 100644 --- a/content/browser/compositor/test/no_transport_image_transport_factory.h +++ b/content/browser/compositor/test/no_transport_image_transport_factory.h @@ -19,17 +19,17 @@ namespace content { class NoTransportImageTransportFactory : public ImageTransportFactory { public: NoTransportImageTransportFactory(); - virtual ~NoTransportImageTransportFactory(); + ~NoTransportImageTransportFactory() override; // ImageTransportFactory implementation. - virtual ui::ContextFactory* GetContextFactory() override; - virtual gfx::GLSurfaceHandle GetSharedSurfaceHandle() override; - virtual cc::SurfaceManager* GetSurfaceManager() override; - virtual GLHelper* GetGLHelper() override; - virtual void AddObserver(ImageTransportFactoryObserver* observer) override; - virtual void RemoveObserver(ImageTransportFactoryObserver* observer) override; + ui::ContextFactory* GetContextFactory() override; + gfx::GLSurfaceHandle GetSharedSurfaceHandle() override; + cc::SurfaceManager* GetSurfaceManager() override; + GLHelper* GetGLHelper() override; + void AddObserver(ImageTransportFactoryObserver* observer) override; + void RemoveObserver(ImageTransportFactoryObserver* observer) override; #if defined(OS_MACOSX) - virtual void OnSurfaceDisplayed(int surface_id) override {} + void OnSurfaceDisplayed(int surface_id) override {} #endif private: diff --git a/content/browser/cross_site_transfer_browsertest.cc b/content/browser/cross_site_transfer_browsertest.cc index 55e132d..f611030 100644 --- a/content/browser/cross_site_transfer_browsertest.cc +++ b/content/browser/cross_site_transfer_browsertest.cc @@ -33,12 +33,11 @@ class TrackingResourceDispatcherHostDelegate TrackingResourceDispatcherHostDelegate() : throttle_created_(false) { } - virtual void RequestBeginning( - net::URLRequest* request, - ResourceContext* resource_context, - AppCacheService* appcache_service, - ResourceType resource_type, - ScopedVector<ResourceThrottle>* throttles) override { + void RequestBeginning(net::URLRequest* request, + ResourceContext* resource_context, + AppCacheService* appcache_service, + ResourceType resource_type, + ScopedVector<ResourceThrottle>* throttles) override { CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); ShellResourceDispatcherHostDelegate::RequestBeginning( request, resource_context, appcache_service, resource_type, throttles); @@ -88,7 +87,7 @@ class TrackingResourceDispatcherHostDelegate : request_(request), tracker_(tracker) { } - virtual ~TrackingThrottle() { + ~TrackingThrottle() override { // If the request is deleted without being cancelled, its status will // indicate it succeeded, so have to check if the request is still pending // as well. @@ -97,7 +96,7 @@ class TrackingResourceDispatcherHostDelegate } // ResourceThrottle implementation: - virtual const char* GetNameForLogging() const override { + const char* GetNameForLogging() const override { return "TrackingThrottle"; } @@ -144,8 +143,8 @@ class NoTransferRequestDelegate : public WebContentsDelegate { public: NoTransferRequestDelegate() {} - virtual WebContents* OpenURLFromTab(WebContents* source, - const OpenURLParams& params) override { + WebContents* OpenURLFromTab(WebContents* source, + const OpenURLParams& params) override { bool is_transfer = (params.transferred_global_request_id != GlobalRequestID()); if (is_transfer) @@ -172,7 +171,7 @@ class CrossSiteTransferTest : public ContentBrowserTest { } // ContentBrowserTest implementation: - virtual void SetUpOnMainThread() override { + void SetUpOnMainThread() override { BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind( @@ -180,7 +179,7 @@ class CrossSiteTransferTest : public ContentBrowserTest { base::Unretained(this))); } - virtual void TearDownOnMainThread() override { + void TearDownOnMainThread() override { BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind( @@ -205,7 +204,7 @@ class CrossSiteTransferTest : public ContentBrowserTest { load_observer.Wait(); } - virtual void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(CommandLine* command_line) override { // Use --site-per-process to force process swaps for cross-site transfers. command_line->AppendSwitch(switches::kSitePerProcess); } diff --git a/content/browser/database_quota_client_unittest.cc b/content/browser/database_quota_client_unittest.cc index ca31e50..a439b51 100644 --- a/content/browser/database_quota_client_unittest.cc +++ b/content/browser/database_quota_client_unittest.cc @@ -36,9 +36,8 @@ class MockDatabaseTracker : public DatabaseTracker { delete_called_count_(0), async_delete_(false) {} - virtual bool GetOriginInfo( - const std::string& origin_identifier, - OriginInfo* info) override { + bool GetOriginInfo(const std::string& origin_identifier, + OriginInfo* info) override { std::map<GURL, MockOriginInfo>::const_iterator found = mock_origin_infos_.find( storage::GetOriginFromIdentifier(origin_identifier)); @@ -48,7 +47,7 @@ class MockDatabaseTracker : public DatabaseTracker { return true; } - virtual bool GetAllOriginIdentifiers( + bool GetAllOriginIdentifiers( std::vector<std::string>* origins_identifiers) override { std::map<GURL, MockOriginInfo>::const_iterator iter; for (iter = mock_origin_infos_.begin(); @@ -59,8 +58,7 @@ class MockDatabaseTracker : public DatabaseTracker { return true; } - virtual bool GetAllOriginsInfo( - std::vector<OriginInfo>* origins_info) override { + bool GetAllOriginsInfo(std::vector<OriginInfo>* origins_info) override { std::map<GURL, MockOriginInfo>::const_iterator iter; for (iter = mock_origin_infos_.begin(); iter != mock_origin_infos_.end(); @@ -70,9 +68,8 @@ class MockDatabaseTracker : public DatabaseTracker { return true; } - virtual int DeleteDataForOrigin( - const std::string& origin_identifier, - const net::CompletionCallback& callback) override { + int DeleteDataForOrigin(const std::string& origin_identifier, + const net::CompletionCallback& callback) override { ++delete_called_count_; if (async_delete()) { base::MessageLoopProxy::current()->PostTask( @@ -99,7 +96,7 @@ class MockDatabaseTracker : public DatabaseTracker { void set_async_delete(bool async) { async_delete_ = async; } protected: - virtual ~MockDatabaseTracker() {} + ~MockDatabaseTracker() override {} private: class MockOriginInfo : public OriginInfo { diff --git a/content/browser/database_tracker_unittest.cc b/content/browser/database_tracker_unittest.cc index f456811..14557de 100644 --- a/content/browser/database_tracker_unittest.cc +++ b/content/browser/database_tracker_unittest.cc @@ -43,10 +43,10 @@ class TestObserver : public storage::DatabaseTracker::Observer { observe_scheduled_deletions_(observe_scheduled_deletions) { } - virtual ~TestObserver() {} - virtual void OnDatabaseSizeChanged(const std::string& origin_identifier, - const base::string16& database_name, - int64 database_size) override { + ~TestObserver() override {} + void OnDatabaseSizeChanged(const std::string& origin_identifier, + const base::string16& database_name, + int64 database_size) override { if (!observe_size_changes_) return; new_notification_received_ = true; @@ -54,7 +54,7 @@ class TestObserver : public storage::DatabaseTracker::Observer { database_name_ = database_name; database_size_ = database_size; } - virtual void OnDatabaseScheduledForDeletion( + void OnDatabaseScheduledForDeletion( const std::string& origin_identifier, const base::string16& database_name) override { if (!observe_scheduled_deletions_) @@ -103,23 +103,23 @@ class TestQuotaManagerProxy : public storage::QuotaManagerProxy { registered_client_(NULL) { } - virtual void RegisterClient(storage::QuotaClient* client) override { + void RegisterClient(storage::QuotaClient* client) override { EXPECT_FALSE(registered_client_); registered_client_ = client; } - virtual void NotifyStorageAccessed(storage::QuotaClient::ID client_id, - const GURL& origin, - storage::StorageType type) override { + void NotifyStorageAccessed(storage::QuotaClient::ID client_id, + const GURL& origin, + storage::StorageType type) override { EXPECT_EQ(storage::QuotaClient::kDatabase, client_id); EXPECT_EQ(storage::kStorageTypeTemporary, type); accesses_[origin] += 1; } - virtual void NotifyStorageModified(storage::QuotaClient::ID client_id, - const GURL& origin, - storage::StorageType type, - int64 delta) override { + void NotifyStorageModified(storage::QuotaClient::ID client_id, + const GURL& origin, + storage::StorageType type, + int64 delta) override { EXPECT_EQ(storage::QuotaClient::kDatabase, client_id); EXPECT_EQ(storage::kStorageTypeTemporary, type); modifications_[origin].first += 1; @@ -127,17 +127,16 @@ class TestQuotaManagerProxy : public storage::QuotaManagerProxy { } // Not needed for our tests. - virtual void NotifyOriginInUse(const GURL& origin) override {} - virtual void NotifyOriginNoLongerInUse(const GURL& origin) override {} - virtual void SetUsageCacheEnabled(storage::QuotaClient::ID client_id, - const GURL& origin, - storage::StorageType type, - bool enabled) override {} - virtual void GetUsageAndQuota( - base::SequencedTaskRunner* original_task_runner, - const GURL& origin, - storage::StorageType type, - const GetUsageAndQuotaCallback& callback) override {} + void NotifyOriginInUse(const GURL& origin) override {} + void NotifyOriginNoLongerInUse(const GURL& origin) override {} + void SetUsageCacheEnabled(storage::QuotaClient::ID client_id, + const GURL& origin, + storage::StorageType type, + bool enabled) override {} + void GetUsageAndQuota(base::SequencedTaskRunner* original_task_runner, + const GURL& origin, + storage::StorageType type, + const GetUsageAndQuotaCallback& callback) override {} void SimulateQuotaManagerDestroyed() { if (registered_client_) { @@ -169,9 +168,7 @@ class TestQuotaManagerProxy : public storage::QuotaManagerProxy { std::map<GURL, std::pair<int, int64> > modifications_; protected: - virtual ~TestQuotaManagerProxy() { - EXPECT_FALSE(registered_client_); - } + ~TestQuotaManagerProxy() override { EXPECT_FALSE(registered_client_); } }; diff --git a/content/browser/device_monitor_mac.mm b/content/browser/device_monitor_mac.mm index cbe0bed..f33c097 100644 --- a/content/browser/device_monitor_mac.mm +++ b/content/browser/device_monitor_mac.mm @@ -136,9 +136,10 @@ void DeviceMonitorMacImpl::ConsolidateDevicesListAndNotify( class QTKitMonitorImpl : public DeviceMonitorMacImpl { public: explicit QTKitMonitorImpl(content::DeviceMonitorMac* monitor); - virtual ~QTKitMonitorImpl(); + ~QTKitMonitorImpl() override; + + void OnDeviceChanged() override; - virtual void OnDeviceChanged() override; private: void CountDevices(); void OnAttributeChanged(NSNotification* notification); @@ -377,9 +378,9 @@ class AVFoundationMonitorImpl : public DeviceMonitorMacImpl { AVFoundationMonitorImpl( content::DeviceMonitorMac* monitor, const scoped_refptr<base::SingleThreadTaskRunner>& device_task_runner); - virtual ~AVFoundationMonitorImpl(); + ~AVFoundationMonitorImpl() override; - virtual void OnDeviceChanged() override; + void OnDeviceChanged() override; private: // {Video,AudioInput}DeviceManager's "Device" thread task runner used for diff --git a/content/browser/device_sensors/data_fetcher_shared_memory.h b/content/browser/device_sensors/data_fetcher_shared_memory.h index 4715cbb..e42f45f 100644 --- a/content/browser/device_sensors/data_fetcher_shared_memory.h +++ b/content/browser/device_sensors/data_fetcher_shared_memory.h @@ -27,11 +27,11 @@ class CONTENT_EXPORT DataFetcherSharedMemory public: DataFetcherSharedMemory(); - virtual ~DataFetcherSharedMemory(); + ~DataFetcherSharedMemory() override; private: - virtual bool Start(ConsumerType consumer_type, void* buffer) override; - virtual bool Stop(ConsumerType consumer_type) override; + bool Start(ConsumerType consumer_type, void* buffer) override; + bool Stop(ConsumerType consumer_type) override; #if !defined(OS_ANDROID) DeviceMotionHardwareBuffer* motion_buffer_; @@ -39,8 +39,8 @@ class CONTENT_EXPORT DataFetcherSharedMemory DeviceLightHardwareBuffer* light_buffer_; #endif #if defined(OS_MACOSX) - virtual void Fetch(unsigned consumer_bitmask) override; - virtual FetcherType GetType() const override; + void Fetch(unsigned consumer_bitmask) override; + FetcherType GetType() const override; scoped_ptr<SuddenMotionSensor> sudden_motion_sensor_; #elif defined(OS_WIN) diff --git a/content/browser/device_sensors/data_fetcher_shared_memory_base.cc b/content/browser/device_sensors/data_fetcher_shared_memory_base.cc index c868429..d997537 100644 --- a/content/browser/device_sensors/data_fetcher_shared_memory_base.cc +++ b/content/browser/device_sensors/data_fetcher_shared_memory_base.cc @@ -36,7 +36,7 @@ static size_t GetConsumerSharedMemoryBufferSize(ConsumerType consumer_type) { class DataFetcherSharedMemoryBase::PollingThread : public base::Thread { public: PollingThread(const char* name, DataFetcherSharedMemoryBase* fetcher); - virtual ~PollingThread(); + ~PollingThread() override; void AddConsumer(ConsumerType consumer_type, void* buffer); void RemoveConsumer(ConsumerType consumer_type); diff --git a/content/browser/device_sensors/data_fetcher_shared_memory_base_unittest.cc b/content/browser/device_sensors/data_fetcher_shared_memory_base_unittest.cc index 10586ab..aa1a9a9 100644 --- a/content/browser/device_sensors/data_fetcher_shared_memory_base_unittest.cc +++ b/content/browser/device_sensors/data_fetcher_shared_memory_base_unittest.cc @@ -32,7 +32,7 @@ class FakeDataFetcher : public DataFetcherSharedMemoryBase { light_buffer_(NULL), motion_buffer_(NULL), orientation_buffer_(NULL) {} - virtual ~FakeDataFetcher() { } + ~FakeDataFetcher() override {} bool Init(ConsumerType consumer_type, void* buffer) { EXPECT_TRUE(buffer); @@ -155,9 +155,9 @@ class FakeDataFetcher : public DataFetcherSharedMemoryBase { class FakeNonPollingDataFetcher : public FakeDataFetcher { public: FakeNonPollingDataFetcher() { } - virtual ~FakeNonPollingDataFetcher() { } + ~FakeNonPollingDataFetcher() override {} - virtual bool Start(ConsumerType consumer_type, void* buffer) override { + bool Start(ConsumerType consumer_type, void* buffer) override { Init(consumer_type, buffer); switch (consumer_type) { case CONSUMER_TYPE_MOTION: @@ -178,7 +178,7 @@ class FakeNonPollingDataFetcher : public FakeDataFetcher { return true; } - virtual bool Stop(ConsumerType consumer_type) override { + bool Stop(ConsumerType consumer_type) override { switch (consumer_type) { case CONSUMER_TYPE_MOTION: stop_motion_.Signal(); @@ -195,14 +195,12 @@ class FakeNonPollingDataFetcher : public FakeDataFetcher { return true; } - virtual void Fetch(unsigned consumer_bitmask) override { + void Fetch(unsigned consumer_bitmask) override { FAIL() << "fetch should not be called, " << "because this is a non-polling fetcher"; } - virtual FetcherType GetType() const override { - return FakeDataFetcher::GetType(); - } + FetcherType GetType() const override { return FakeDataFetcher::GetType(); } private: DISALLOW_COPY_AND_ASSIGN(FakeNonPollingDataFetcher); @@ -211,9 +209,9 @@ class FakeNonPollingDataFetcher : public FakeDataFetcher { class FakePollingDataFetcher : public FakeDataFetcher { public: FakePollingDataFetcher() { } - virtual ~FakePollingDataFetcher() { } + ~FakePollingDataFetcher() override {} - virtual bool Start(ConsumerType consumer_type, void* buffer) override { + bool Start(ConsumerType consumer_type, void* buffer) override { EXPECT_TRUE(base::MessageLoop::current() == GetPollingMessageLoop()); Init(consumer_type, buffer); @@ -233,7 +231,7 @@ class FakePollingDataFetcher : public FakeDataFetcher { return true; } - virtual bool Stop(ConsumerType consumer_type) override { + bool Stop(ConsumerType consumer_type) override { EXPECT_TRUE(base::MessageLoop::current() == GetPollingMessageLoop()); switch (consumer_type) { @@ -252,7 +250,7 @@ class FakePollingDataFetcher : public FakeDataFetcher { return true; } - virtual void Fetch(unsigned consumer_bitmask) override { + void Fetch(unsigned consumer_bitmask) override { EXPECT_TRUE(base::MessageLoop::current() == GetPollingMessageLoop()); EXPECT_TRUE(consumer_bitmask & CONSUMER_TYPE_ORIENTATION || consumer_bitmask & CONSUMER_TYPE_MOTION || @@ -266,9 +264,7 @@ class FakePollingDataFetcher : public FakeDataFetcher { UpdateLight(); } - virtual FetcherType GetType() const override { - return FETCHER_TYPE_POLLING_CALLBACK; - } + FetcherType GetType() const override { return FETCHER_TYPE_POLLING_CALLBACK; } private: DISALLOW_COPY_AND_ASSIGN(FakePollingDataFetcher); @@ -277,9 +273,9 @@ class FakePollingDataFetcher : public FakeDataFetcher { class FakeZeroDelayPollingDataFetcher : public FakeDataFetcher { public: FakeZeroDelayPollingDataFetcher() { } - virtual ~FakeZeroDelayPollingDataFetcher() { } + ~FakeZeroDelayPollingDataFetcher() override {} - virtual bool Start(ConsumerType consumer_type, void* buffer) override { + bool Start(ConsumerType consumer_type, void* buffer) override { EXPECT_TRUE(base::MessageLoop::current() == GetPollingMessageLoop()); Init(consumer_type, buffer); @@ -299,7 +295,7 @@ class FakeZeroDelayPollingDataFetcher : public FakeDataFetcher { return true; } - virtual bool Stop(ConsumerType consumer_type) override { + bool Stop(ConsumerType consumer_type) override { EXPECT_TRUE(base::MessageLoop::current() == GetPollingMessageLoop()); switch (consumer_type) { @@ -318,13 +314,11 @@ class FakeZeroDelayPollingDataFetcher : public FakeDataFetcher { return true; } - virtual void Fetch(unsigned consumer_bitmask) override { + void Fetch(unsigned consumer_bitmask) override { FAIL() << "fetch should not be called"; } - virtual FetcherType GetType() const override { - return FETCHER_TYPE_SEPARATE_THREAD; - } + FetcherType GetType() const override { return FETCHER_TYPE_SEPARATE_THREAD; } bool IsPollingTimerRunningForTesting() const { return FakeDataFetcher::IsPollingTimerRunningForTesting(); diff --git a/content/browser/device_sensors/device_inertial_sensor_browsertest.cc b/content/browser/device_sensors/device_inertial_sensor_browsertest.cc index 632722e..3380d8a 100644 --- a/content/browser/device_sensors/device_inertial_sensor_browsertest.cc +++ b/content/browser/device_sensors/device_inertial_sensor_browsertest.cc @@ -34,9 +34,9 @@ class FakeDataFetcher : public DataFetcherSharedMemory { started_light_(false, false), stopped_light_(false, false), sensor_data_available_(true) {} - virtual ~FakeDataFetcher() { } + ~FakeDataFetcher() override {} - virtual bool Start(ConsumerType consumer_type, void* buffer) override { + bool Start(ConsumerType consumer_type, void* buffer) override { EXPECT_TRUE(buffer); switch (consumer_type) { @@ -77,7 +77,7 @@ class FakeDataFetcher : public DataFetcherSharedMemory { return true; } - virtual bool Stop(ConsumerType consumer_type) override { + bool Stop(ConsumerType consumer_type) override { switch (consumer_type) { case CONSUMER_TYPE_MOTION: stopped_motion_.Signal(); @@ -94,13 +94,11 @@ class FakeDataFetcher : public DataFetcherSharedMemory { return true; } - virtual void Fetch(unsigned consumer_bitmask) override { + void Fetch(unsigned consumer_bitmask) override { FAIL() << "fetch should not be called"; } - virtual FetcherType GetType() const override { - return FETCHER_TYPE_DEFAULT; - } + FetcherType GetType() const override { return FETCHER_TYPE_DEFAULT; } void SetSensorDataAvailable(bool available) { sensor_data_available_ = available; @@ -184,7 +182,7 @@ class DeviceInertialSensorBrowserTest : public ContentBrowserTest { io_loop_finished_event_(false, false) { } - virtual void SetUpOnMainThread() override { + void SetUpOnMainThread() override { BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind(&DeviceInertialSensorBrowserTest::SetUpOnIOThread, this)); diff --git a/content/browser/device_sensors/device_light_message_filter.h b/content/browser/device_sensors/device_light_message_filter.h index 0635f6e..eb10bbf 100644 --- a/content/browser/device_sensors/device_light_message_filter.h +++ b/content/browser/device_sensors/device_light_message_filter.h @@ -14,10 +14,10 @@ class DeviceLightMessageFilter : public BrowserMessageFilter { DeviceLightMessageFilter(); // BrowserMessageFilter implementation. - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; private: - virtual ~DeviceLightMessageFilter(); + ~DeviceLightMessageFilter() override; void OnDeviceLightStartPolling(); void OnDeviceLightStopPolling(); diff --git a/content/browser/device_sensors/device_motion_message_filter.h b/content/browser/device_sensors/device_motion_message_filter.h index 4e16e5c..ffe9ff7 100644 --- a/content/browser/device_sensors/device_motion_message_filter.h +++ b/content/browser/device_sensors/device_motion_message_filter.h @@ -14,10 +14,10 @@ class DeviceMotionMessageFilter : public BrowserMessageFilter { DeviceMotionMessageFilter(); // BrowserMessageFilter implementation. - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; private: - virtual ~DeviceMotionMessageFilter(); + ~DeviceMotionMessageFilter() override; void OnDeviceMotionStartPolling(); void OnDeviceMotionStopPolling(); diff --git a/content/browser/device_sensors/device_orientation_message_filter.h b/content/browser/device_sensors/device_orientation_message_filter.h index 73d7f42..acc772d 100644 --- a/content/browser/device_sensors/device_orientation_message_filter.h +++ b/content/browser/device_sensors/device_orientation_message_filter.h @@ -14,10 +14,10 @@ class DeviceOrientationMessageFilter : public BrowserMessageFilter { DeviceOrientationMessageFilter(); // BrowserMessageFilter implementation. - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; private: - virtual ~DeviceOrientationMessageFilter(); + ~DeviceOrientationMessageFilter() override; void OnDeviceOrientationStartPolling(); void OnDeviceOrientationStopPolling(); diff --git a/content/browser/devtools/devtools_agent_host_impl.h b/content/browser/devtools/devtools_agent_host_impl.h index f49e8a0..694590a 100644 --- a/content/browser/devtools/devtools_agent_host_impl.h +++ b/content/browser/devtools/devtools_agent_host_impl.h @@ -38,19 +38,19 @@ class CONTENT_EXPORT DevToolsAgentHostImpl : public DevToolsAgentHost { void Inspect(BrowserContext* browser_context); // DevToolsAgentHost implementation. - virtual void AttachClient(DevToolsAgentHostClient* client) override; - virtual void DetachClient() override; - virtual bool IsAttached() override; - virtual void InspectElement(int x, int y) override; - virtual std::string GetId() override; - virtual WebContents* GetWebContents() override; - virtual void DisconnectWebContents() override; - virtual void ConnectWebContents(WebContents* wc) override; - virtual bool IsWorker() const override; + void AttachClient(DevToolsAgentHostClient* client) override; + void DetachClient() override; + bool IsAttached() override; + void InspectElement(int x, int y) override; + std::string GetId() override; + WebContents* GetWebContents() override; + void DisconnectWebContents() override; + void ConnectWebContents(WebContents* wc) override; + bool IsWorker() const override; protected: DevToolsAgentHostImpl(); - virtual ~DevToolsAgentHostImpl(); + ~DevToolsAgentHostImpl() override; void HostClosed(); void SendMessageToClient(const std::string& message); diff --git a/content/browser/devtools/devtools_frontend_host_impl.h b/content/browser/devtools/devtools_frontend_host_impl.h index 66e65b7..98b9074 100644 --- a/content/browser/devtools/devtools_frontend_host_impl.h +++ b/content/browser/devtools/devtools_frontend_host_impl.h @@ -15,11 +15,11 @@ class DevToolsFrontendHostImpl : public DevToolsFrontendHost, public: DevToolsFrontendHostImpl(RenderViewHost* frontend_rvh, DevToolsFrontendHost::Delegate* delegate); - virtual ~DevToolsFrontendHostImpl(); + ~DevToolsFrontendHostImpl() override; private: // WebContentsObserver overrides. - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; void OnDispatchOnInspectorBackend(const std::string& message); void OnDispatchOnEmbedder(const std::string& message); diff --git a/content/browser/devtools/devtools_http_handler_impl.cc b/content/browser/devtools/devtools_http_handler_impl.cc index 90ee8d2..11f1fb1 100644 --- a/content/browser/devtools/devtools_http_handler_impl.cc +++ b/content/browser/devtools/devtools_http_handler_impl.cc @@ -87,14 +87,13 @@ class DevToolsAgentHostClientImpl : public DevToolsAgentHostClient { agent_host_->AttachClient(this); } - virtual ~DevToolsAgentHostClientImpl() { + ~DevToolsAgentHostClientImpl() override { if (agent_host_.get()) agent_host_->DetachClient(); } - virtual void AgentHostClosed( - DevToolsAgentHost* agent_host, - bool replaced_with_another_client) override { + void AgentHostClosed(DevToolsAgentHost* agent_host, + bool replaced_with_another_client) override { DCHECK(agent_host == agent_host_.get()); agent_host_ = NULL; @@ -120,8 +119,8 @@ class DevToolsAgentHostClientImpl : public DevToolsAgentHostClient { connection_id_)); } - virtual void DispatchProtocolMessage( - DevToolsAgentHost* agent_host, const std::string& message) override { + void DispatchProtocolMessage(DevToolsAgentHost* agent_host, + const std::string& message) override { DCHECK(agent_host == agent_host_.get()); message_loop_->PostTask( FROM_HERE, diff --git a/content/browser/devtools/devtools_http_handler_impl.h b/content/browser/devtools/devtools_http_handler_impl.h index e861ea6..9d5ed81 100644 --- a/content/browser/devtools/devtools_http_handler_impl.h +++ b/content/browser/devtools/devtools_http_handler_impl.h @@ -48,23 +48,21 @@ class DevToolsHttpHandlerImpl const std::string& frontend_url, DevToolsHttpHandlerDelegate* delegate, const base::FilePath& active_port_output_directory); - virtual ~DevToolsHttpHandlerImpl(); + ~DevToolsHttpHandlerImpl() override; void Start(); // DevToolsHttpHandler implementation. - virtual void Stop() override; - virtual GURL GetFrontendURL() override; + void Stop() override; + GURL GetFrontendURL() override; // net::HttpServer::Delegate implementation. - virtual void OnConnect(int connection_id) override {} - virtual void OnHttpRequest(int connection_id, - const net::HttpServerRequestInfo& info) override; - virtual void OnWebSocketRequest( - int connection_id, - const net::HttpServerRequestInfo& info) override; - virtual void OnWebSocketMessage(int connection_id, - const std::string& data) override; - virtual void OnClose(int connection_id) override; + void OnConnect(int connection_id) override {} + void OnHttpRequest(int connection_id, + const net::HttpServerRequestInfo& info) override; + void OnWebSocketRequest(int connection_id, + const net::HttpServerRequestInfo& info) override; + void OnWebSocketMessage(int connection_id, const std::string& data) override; + void OnClose(int connection_id) override; void OnJsonRequestUI(int connection_id, const net::HttpServerRequestInfo& info); diff --git a/content/browser/devtools/devtools_http_handler_unittest.cc b/content/browser/devtools/devtools_http_handler_unittest.cc index 53360c4..a6fd3b3 100644 --- a/content/browser/devtools/devtools_http_handler_unittest.cc +++ b/content/browser/devtools/devtools_http_handler_unittest.cc @@ -28,25 +28,25 @@ class DummyServerSocket : public net::ServerSocket { DummyServerSocket() {} // net::ServerSocket "implementation" - virtual int Listen(const net::IPEndPoint& address, int backlog) override { + int Listen(const net::IPEndPoint& address, int backlog) override { return net::OK; } - virtual int ListenWithAddressAndPort(const std::string& ip_address, - int port, - int backlog) override { + int ListenWithAddressAndPort(const std::string& ip_address, + int port, + int backlog) override { return net::OK; } - virtual int GetLocalAddress(net::IPEndPoint* address) const override { + int GetLocalAddress(net::IPEndPoint* address) const override { net::IPAddressNumber number; EXPECT_TRUE(net::ParseIPLiteralToNumber("127.0.0.1", &number)); *address = net::IPEndPoint(number, kDummyPort); return net::OK; } - virtual int Accept(scoped_ptr<net::StreamSocket>* socket, - const net::CompletionCallback& callback) override { + int Accept(scoped_ptr<net::StreamSocket>* socket, + const net::CompletionCallback& callback) override { return net::ERR_IO_PENDING; } }; @@ -60,13 +60,13 @@ class DummyServerSocketFactory quit_closure_1_(quit_closure_1), quit_closure_2_(quit_closure_2) {} - virtual ~DummyServerSocketFactory() { + ~DummyServerSocketFactory() override { BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, quit_closure_2_); } private: - virtual scoped_ptr<net::ServerSocket> Create() const override { + scoped_ptr<net::ServerSocket> Create() const override { BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, quit_closure_1_); return scoped_ptr<net::ServerSocket>(new DummyServerSocket()); @@ -78,15 +78,13 @@ class DummyServerSocketFactory class DummyDelegate : public DevToolsHttpHandlerDelegate { public: - virtual std::string GetDiscoveryPageHTML() override { return std::string(); } + std::string GetDiscoveryPageHTML() override { return std::string(); } - virtual bool BundlesFrontendResources() override { return true; } + bool BundlesFrontendResources() override { return true; } - virtual base::FilePath GetDebugFrontendDir() override { - return base::FilePath(); - } + base::FilePath GetDebugFrontendDir() override { return base::FilePath(); } - virtual scoped_ptr<net::StreamListenSocket> CreateSocketForTethering( + scoped_ptr<net::StreamListenSocket> CreateSocketForTethering( net::StreamListenSocket::Delegate* delegate, std::string* name) override { return scoped_ptr<net::StreamListenSocket>(); diff --git a/content/browser/devtools/devtools_manager_unittest.cc b/content/browser/devtools/devtools_manager_unittest.cc index 0c34f23..4c52321 100644 --- a/content/browser/devtools/devtools_manager_unittest.cc +++ b/content/browser/devtools/devtools_manager_unittest.cc @@ -36,9 +36,7 @@ class TestDevToolsClientHost : public DevToolsAgentHostClient { closed_(false) { } - virtual ~TestDevToolsClientHost() { - EXPECT_TRUE(closed_); - } + ~TestDevToolsClientHost() override { EXPECT_TRUE(closed_); } void Close() { EXPECT_FALSE(closed_); @@ -47,13 +45,12 @@ class TestDevToolsClientHost : public DevToolsAgentHostClient { closed_ = true; } - virtual void AgentHostClosed( - DevToolsAgentHost* agent_host, bool replaced) override { + void AgentHostClosed(DevToolsAgentHost* agent_host, bool replaced) override { FAIL(); } - virtual void DispatchProtocolMessage( - DevToolsAgentHost* agent_host, const std::string& message) override { + void DispatchProtocolMessage(DevToolsAgentHost* agent_host, + const std::string& message) override { last_sent_message = &message; } @@ -87,7 +84,7 @@ class TestWebContentsDelegate : public WebContentsDelegate { TestWebContentsDelegate() : renderer_unresponsive_received_(false) {} // Notification that the contents is hung. - virtual void RendererUnresponsive(WebContents* source) override { + void RendererUnresponsive(WebContents* source) override { renderer_unresponsive_received_ = true; } @@ -103,26 +100,24 @@ class TestTarget : public DevToolsTarget { public: explicit TestTarget(scoped_refptr<DevToolsAgentHost> agent_host) : agent_host_(agent_host) {} - virtual ~TestTarget() {} - - virtual std::string GetId() const override { return agent_host_->GetId(); } - virtual std::string GetParentId() const override { return std::string(); } - virtual std::string GetType() const override { return std::string(); } - virtual std::string GetTitle() const override { - return agent_host_->GetTitle(); - } - virtual std::string GetDescription() const override { return std::string(); } - virtual GURL GetURL() const override { return agent_host_->GetURL(); } - virtual GURL GetFaviconURL() const override { return GURL(); } - virtual base::TimeTicks GetLastActivityTime() const override { + ~TestTarget() override {} + + std::string GetId() const override { return agent_host_->GetId(); } + std::string GetParentId() const override { return std::string(); } + std::string GetType() const override { return std::string(); } + std::string GetTitle() const override { return agent_host_->GetTitle(); } + std::string GetDescription() const override { return std::string(); } + GURL GetURL() const override { return agent_host_->GetURL(); } + GURL GetFaviconURL() const override { return GURL(); } + base::TimeTicks GetLastActivityTime() const override { return base::TimeTicks(); } - virtual bool IsAttached() const override { return agent_host_->IsAttached(); } - virtual scoped_refptr<DevToolsAgentHost> GetAgentHost() const override { + bool IsAttached() const override { return agent_host_->IsAttached(); } + scoped_refptr<DevToolsAgentHost> GetAgentHost() const override { return agent_host_; } - virtual bool Activate() const override { return agent_host_->Activate(); } - virtual bool Close() const override { return agent_host_->Close(); } + bool Activate() const override { return agent_host_->Activate(); } + bool Close() const override { return agent_host_->Close(); } private: scoped_refptr<DevToolsAgentHost> agent_host_; @@ -130,23 +125,25 @@ class TestTarget : public DevToolsTarget { class TestDevToolsManagerDelegate : public DevToolsManagerDelegate { public: - virtual ~TestDevToolsManagerDelegate() {} + ~TestDevToolsManagerDelegate() override {} - virtual void Inspect(BrowserContext* browser_context, - DevToolsAgentHost* agent_host) override {} + void Inspect(BrowserContext* browser_context, + DevToolsAgentHost* agent_host) override {} - virtual void DevToolsAgentStateChanged(DevToolsAgentHost* agent_host, - bool attached) override {} + void DevToolsAgentStateChanged(DevToolsAgentHost* agent_host, + bool attached) override {} - virtual base::DictionaryValue* HandleCommand( + base::DictionaryValue* HandleCommand( DevToolsAgentHost* agent_host, - base::DictionaryValue* command) override { return NULL; } + base::DictionaryValue* command) override { + return NULL; + } - virtual scoped_ptr<DevToolsTarget> CreateNewTarget(const GURL& url) override { + scoped_ptr<DevToolsTarget> CreateNewTarget(const GURL& url) override { return scoped_ptr<DevToolsTarget>(); } - virtual void EnumerateTargets(TargetCallback callback) override { + void EnumerateTargets(TargetCallback callback) override { TargetList result; DevToolsAgentHost::List agents = DevToolsAgentHost::GetOrCreateAll(); for (DevToolsAgentHost::List::iterator it = agents.begin(); @@ -159,16 +156,15 @@ class TestDevToolsManagerDelegate : public DevToolsManagerDelegate { callback.Run(result); } - virtual std::string GetPageThumbnailData(const GURL& url) override { + std::string GetPageThumbnailData(const GURL& url) override { return std::string(); } }; class ContentBrowserClientWithDevTools : public TestContentBrowserClient { public: - virtual ~ContentBrowserClientWithDevTools() {} - virtual content::DevToolsManagerDelegate* - GetDevToolsManagerDelegate() override { + ~ContentBrowserClientWithDevTools() override {} + content::DevToolsManagerDelegate* GetDevToolsManagerDelegate() override { return new TestDevToolsManagerDelegate(); } }; @@ -177,14 +173,14 @@ class TestDevToolsManagerObserver : public DevToolsManager::Observer { public: TestDevToolsManagerObserver() : updates_count_(0) {} - virtual ~TestDevToolsManagerObserver() {} + ~TestDevToolsManagerObserver() override {} int updates_count() { return updates_count_; } const std::vector<scoped_refptr<DevToolsAgentHost>> hosts() { return hosts_; } - virtual void TargetListChanged(const TargetList& targets) override { + void TargetListChanged(const TargetList& targets) override { updates_count_++; hosts_.clear(); for (TargetList::const_iterator it = targets.begin(); @@ -319,20 +315,18 @@ class TestExternalAgentDelegate: public DevToolsExternalAgentProxyDelegate { EXPECT_EQ(count, event_counter_[name]); } - virtual void Attach(DevToolsExternalAgentProxy* proxy) override { + void Attach(DevToolsExternalAgentProxy* proxy) override { recordEvent("Attach"); }; - virtual void Detach() override { - recordEvent("Detach"); - }; + void Detach() override { recordEvent("Detach"); }; - virtual void SendMessageToBackend(const std::string& message) override { + void SendMessageToBackend(const std::string& message) override { recordEvent(std::string("SendMessageToBackend.") + message); }; public : - virtual ~TestExternalAgentDelegate() { + ~TestExternalAgentDelegate() override { expectEvent(1, "Attach"); expectEvent(1, "Detach"); expectEvent(0, "SendMessageToBackend.message0"); diff --git a/content/browser/devtools/devtools_netlog_observer.h b/content/browser/devtools/devtools_netlog_observer.h index 45f6a0f..2155f06 100644 --- a/content/browser/devtools/devtools_netlog_observer.h +++ b/content/browser/devtools/devtools_netlog_observer.h @@ -29,7 +29,7 @@ class DevToolsNetLogObserver : public net::NetLog::ThreadSafeObserver { public: // net::NetLog::ThreadSafeObserver implementation: - virtual void OnAddEntry(const net::NetLog::Entry& entry) override; + void OnAddEntry(const net::NetLog::Entry& entry) override; void OnAddURLRequestEntry(const net::NetLog::Entry& entry); @@ -46,7 +46,7 @@ class DevToolsNetLogObserver : public net::NetLog::ThreadSafeObserver { static DevToolsNetLogObserver* instance_; DevToolsNetLogObserver(); - virtual ~DevToolsNetLogObserver(); + ~DevToolsNetLogObserver() override; ResourceInfo* GetResourceInfo(uint32 id); diff --git a/content/browser/devtools/devtools_protocol.h b/content/browser/devtools/devtools_protocol.h index 67eb979..512bfb7 100644 --- a/content/browser/devtools/devtools_protocol.h +++ b/content/browser/devtools/devtools_protocol.h @@ -50,7 +50,7 @@ class DevToolsProtocol { public: int id() { return id_; } - virtual std::string Serialize() override; + std::string Serialize() override; // Creates success response. Takes ownership of |result|. scoped_refptr<Response> SuccessResponse(base::DictionaryValue* result); @@ -71,7 +71,7 @@ class DevToolsProtocol { scoped_refptr<Response> AsyncResponsePromise(); protected: - virtual ~Command(); + ~Command() override; private: friend class DevToolsProtocol; @@ -109,12 +109,11 @@ class DevToolsProtocol { class Notification : public Message { public: - - virtual std::string Serialize() override; + std::string Serialize() override; private: friend class DevToolsProtocol; - virtual ~Notification(); + ~Notification() override; // Takes ownership of |params|. Notification(const std::string& method, diff --git a/content/browser/devtools/devtools_system_info_handler.cc b/content/browser/devtools/devtools_system_info_handler.cc index b9c5b4f..15261b3 100644 --- a/content/browser/devtools/devtools_system_info_handler.cc +++ b/content/browser/devtools/devtools_system_info_handler.cc @@ -34,49 +34,43 @@ class AuxGPUInfoEnumerator : public gpu::GPUInfo::Enumerator { : dictionary_(dictionary), in_aux_attributes_(false) { } - virtual void AddInt64(const char* name, int64 value) override { + void AddInt64(const char* name, int64 value) override { if (in_aux_attributes_) dictionary_->SetDouble(name, value); } - virtual void AddInt(const char* name, int value) override { + void AddInt(const char* name, int value) override { if (in_aux_attributes_) dictionary_->SetInteger(name, value); } - virtual void AddString(const char* name, const std::string& value) override { + void AddString(const char* name, const std::string& value) override { if (in_aux_attributes_) dictionary_->SetString(name, value); } - virtual void AddBool(const char* name, bool value) override { + void AddBool(const char* name, bool value) override { if (in_aux_attributes_) dictionary_->SetBoolean(name, value); } - virtual void AddTimeDeltaInSecondsF(const char* name, - const base::TimeDelta& value) override { + void AddTimeDeltaInSecondsF(const char* name, + const base::TimeDelta& value) override { if (in_aux_attributes_) dictionary_->SetDouble(name, value.InSecondsF()); } - virtual void BeginGPUDevice() override { - } + void BeginGPUDevice() override {} - virtual void EndGPUDevice() override { - } + void EndGPUDevice() override {} - virtual void BeginVideoEncodeAcceleratorSupportedProfile() override {} + void BeginVideoEncodeAcceleratorSupportedProfile() override {} - virtual void EndVideoEncodeAcceleratorSupportedProfile() override {} + void EndVideoEncodeAcceleratorSupportedProfile() override {} - virtual void BeginAuxAttributes() override { - in_aux_attributes_ = true; - } + void BeginAuxAttributes() override { in_aux_attributes_ = true; } - virtual void EndAuxAttributes() override { - in_aux_attributes_ = false; - } + void EndAuxAttributes() override { in_aux_attributes_ = false; } private: base::DictionaryValue* dictionary_; diff --git a/content/browser/devtools/devtools_system_info_handler.h b/content/browser/devtools/devtools_system_info_handler.h index afaf042..6217f7a 100644 --- a/content/browser/devtools/devtools_system_info_handler.h +++ b/content/browser/devtools/devtools_system_info_handler.h @@ -14,7 +14,7 @@ class DevToolsSystemInfoHandler : public DevToolsProtocol::Handler { public: DevToolsSystemInfoHandler(); - virtual ~DevToolsSystemInfoHandler(); + ~DevToolsSystemInfoHandler() override; private: scoped_refptr<DevToolsProtocol::Response> OnGetInfo( diff --git a/content/browser/devtools/devtools_tracing_handler.cc b/content/browser/devtools/devtools_tracing_handler.cc index 5dce874..f8539da 100644 --- a/content/browser/devtools/devtools_tracing_handler.cc +++ b/content/browser/devtools/devtools_tracing_handler.cc @@ -32,17 +32,17 @@ class DevToolsTraceSinkProxy : public TracingController::TraceDataSink { explicit DevToolsTraceSinkProxy(base::WeakPtr<DevToolsTracingHandler> handler) : tracing_handler_(handler) {} - virtual void AddTraceChunk(const std::string& chunk) override { + void AddTraceChunk(const std::string& chunk) override { if (DevToolsTracingHandler* h = tracing_handler_.get()) h->OnTraceDataCollected(chunk); } - virtual void Close() override { + void Close() override { if (DevToolsTracingHandler* h = tracing_handler_.get()) h->OnTraceComplete(); } private: - virtual ~DevToolsTraceSinkProxy() {} + ~DevToolsTraceSinkProxy() override {} base::WeakPtr<DevToolsTracingHandler> tracing_handler_; }; diff --git a/content/browser/devtools/devtools_tracing_handler.h b/content/browser/devtools/devtools_tracing_handler.h index 9727466..6b1a93f 100644 --- a/content/browser/devtools/devtools_tracing_handler.h +++ b/content/browser/devtools/devtools_tracing_handler.h @@ -26,7 +26,7 @@ class DevToolsTracingHandler : public DevToolsProtocol::Handler { public: enum Target { Browser, Renderer }; explicit DevToolsTracingHandler(Target target); - virtual ~DevToolsTracingHandler(); + ~DevToolsTracingHandler() override; void OnClientDetached(); diff --git a/content/browser/devtools/embedded_worker_devtools_agent_host.h b/content/browser/devtools/embedded_worker_devtools_agent_host.h index 36fc77c..cb0e45f 100644 --- a/content/browser/devtools/embedded_worker_devtools_agent_host.h +++ b/content/browser/devtools/embedded_worker_devtools_agent_host.h @@ -28,21 +28,21 @@ class EmbeddedWorkerDevToolsAgentHost : public IPCDevToolsAgentHost, bool debug_service_worker_on_start); // DevToolsAgentHost override. - virtual bool IsWorker() const override; - virtual Type GetType() override; - virtual std::string GetTitle() override; - virtual GURL GetURL() override; - virtual bool Activate() override; - virtual bool Close() override; + bool IsWorker() const override; + Type GetType() override; + std::string GetTitle() override; + GURL GetURL() override; + bool Activate() override; + bool Close() override; // IPCDevToolsAgentHost implementation. - virtual void SendMessageToAgent(IPC::Message* message) override; - virtual void Attach() override; - virtual void OnClientAttached() override {} - virtual void OnClientDetached() override; + void SendMessageToAgent(IPC::Message* message) override; + void Attach() override; + void OnClientAttached() override {} + void OnClientDetached() override; // IPC::Listener implementation. - virtual bool OnMessageReceived(const IPC::Message& msg) override; + bool OnMessageReceived(const IPC::Message& msg) override; void WorkerReadyForInspection(); void WorkerRestarted(WorkerId worker_id); @@ -54,7 +54,7 @@ class EmbeddedWorkerDevToolsAgentHost : public IPCDevToolsAgentHost, private: friend class EmbeddedWorkerDevToolsManagerTest; - virtual ~EmbeddedWorkerDevToolsAgentHost(); + ~EmbeddedWorkerDevToolsAgentHost() override; enum WorkerState { WORKER_UNINSPECTED, diff --git a/content/browser/devtools/embedded_worker_devtools_manager_unittest.cc b/content/browser/devtools/embedded_worker_devtools_manager_unittest.cc index f96b4dc..b15dc3b 100644 --- a/content/browser/devtools/embedded_worker_devtools_manager_unittest.cc +++ b/content/browser/devtools/embedded_worker_devtools_manager_unittest.cc @@ -21,11 +21,10 @@ namespace { class TestDevToolsClientHost : public DevToolsAgentHostClient { public: TestDevToolsClientHost() {} - virtual ~TestDevToolsClientHost() {} - virtual void DispatchProtocolMessage( - DevToolsAgentHost* agent_host, const std::string& message) override {} - virtual void AgentHostClosed( - DevToolsAgentHost* agent_host, bool replaced) override {} + ~TestDevToolsClientHost() override {} + void DispatchProtocolMessage(DevToolsAgentHost* agent_host, + const std::string& message) override {} + void AgentHostClosed(DevToolsAgentHost* agent_host, bool replaced) override {} void InspectAgentHost(DevToolsAgentHost* agent_host) { if (agent_host_.get()) diff --git a/content/browser/devtools/forwarding_agent_host.h b/content/browser/devtools/forwarding_agent_host.h index 8995be1..7f9bcec 100644 --- a/content/browser/devtools/forwarding_agent_host.h +++ b/content/browser/devtools/forwarding_agent_host.h @@ -20,23 +20,23 @@ class ForwardingAgentHost ForwardingAgentHost(DevToolsExternalAgentProxyDelegate* delegate); private: - virtual ~ForwardingAgentHost(); + ~ForwardingAgentHost() override; // DevToolsExternalAgentProxy implementation. - virtual void DispatchOnClientHost(const std::string& message) override; - virtual void ConnectionClosed() override; + void DispatchOnClientHost(const std::string& message) override; + void ConnectionClosed() override; // DevToolsAgentHostImpl implementation. - virtual void Attach() override; - virtual void Detach() override; - virtual void DispatchProtocolMessage(const std::string& message) override; + void Attach() override; + void Detach() override; + void DispatchProtocolMessage(const std::string& message) override; // DevToolsAgentHost implementation - virtual Type GetType() override; - virtual std::string GetTitle() override; - virtual GURL GetURL() override; - virtual bool Activate() override; - virtual bool Close() override; + Type GetType() override; + std::string GetTitle() override; + GURL GetURL() override; + bool Activate() override; + bool Close() override; scoped_ptr<DevToolsExternalAgentProxyDelegate> delegate_; }; diff --git a/content/browser/devtools/ipc_devtools_agent_host.h b/content/browser/devtools/ipc_devtools_agent_host.h index 3195080..a952588 100644 --- a/content/browser/devtools/ipc_devtools_agent_host.h +++ b/content/browser/devtools/ipc_devtools_agent_host.h @@ -16,14 +16,14 @@ namespace content { class CONTENT_EXPORT IPCDevToolsAgentHost : public DevToolsAgentHostImpl { public: // DevToolsAgentHostImpl implementation. - virtual void Attach() override; - virtual void Detach() override; - virtual void DispatchProtocolMessage(const std::string& message) override; - virtual void InspectElement(int x, int y) override; + void Attach() override; + void Detach() override; + void DispatchProtocolMessage(const std::string& message) override; + void InspectElement(int x, int y) override; protected: IPCDevToolsAgentHost(); - virtual ~IPCDevToolsAgentHost(); + ~IPCDevToolsAgentHost() override; void Reattach(const std::string& saved_agent_state); void ProcessChunkedMessageFromAgent(const std::string& message, diff --git a/content/browser/devtools/protocol/power_handler.h b/content/browser/devtools/protocol/power_handler.h index 4482937..f0892c7 100644 --- a/content/browser/devtools/protocol/power_handler.h +++ b/content/browser/devtools/protocol/power_handler.h @@ -17,12 +17,12 @@ class PowerHandler : public PowerProfilerObserver { typedef DevToolsProtocolClient::Response Response; PowerHandler(); - virtual ~PowerHandler(); + ~PowerHandler() override; void SetClient(scoped_ptr<Client> client); // PowerProfilerObserver override. - virtual void OnPowerEvent(const PowerEventVector& events) override; + void OnPowerEvent(const PowerEventVector& events) override; void Detached(); diff --git a/content/browser/devtools/render_view_devtools_agent_host.h b/content/browser/devtools/render_view_devtools_agent_host.h index dcbe426..0f4208f 100644 --- a/content/browser/devtools/render_view_devtools_agent_host.h +++ b/content/browser/devtools/render_view_devtools_agent_host.h @@ -50,44 +50,44 @@ class CONTENT_EXPORT RenderViewDevToolsAgentHost const cc::CompositorFrameMetadata& frame_metadata); // DevTooolsAgentHost overrides. - virtual void DisconnectWebContents() override; - virtual void ConnectWebContents(WebContents* web_contents) override; - virtual WebContents* GetWebContents() override; - virtual Type GetType() override; - virtual std::string GetTitle() override; - virtual GURL GetURL() override; - virtual bool Activate() override; - virtual bool Close() override; + void DisconnectWebContents() override; + void ConnectWebContents(WebContents* web_contents) override; + WebContents* GetWebContents() override; + Type GetType() override; + std::string GetTitle() override; + GURL GetURL() override; + bool Activate() override; + bool Close() override; private: friend class DevToolsAgentHost; - virtual ~RenderViewDevToolsAgentHost(); + ~RenderViewDevToolsAgentHost() override; // IPCDevToolsAgentHost overrides. - virtual void DispatchProtocolMessage(const std::string& message) override; - virtual void SendMessageToAgent(IPC::Message* msg) override; - virtual void OnClientAttached() override; - virtual void OnClientDetached() override; + void DispatchProtocolMessage(const std::string& message) override; + void SendMessageToAgent(IPC::Message* msg) override; + void OnClientAttached() override; + void OnClientDetached() override; // WebContentsObserver overrides. - virtual void AboutToNavigateRenderView(RenderViewHost* dest_rvh) override; - virtual void RenderViewHostChanged(RenderViewHost* old_host, - RenderViewHost* new_host) override; - virtual void RenderViewDeleted(RenderViewHost* rvh) override; - virtual void RenderProcessGone(base::TerminationStatus status) override; - virtual bool OnMessageReceived(const IPC::Message& message, - RenderFrameHost* render_frame_host) override; - virtual bool OnMessageReceived(const IPC::Message& message) override; - virtual void DidAttachInterstitialPage() override; - virtual void DidDetachInterstitialPage() override; - virtual void TitleWasSet(NavigationEntry* entry, bool explicit_set) override; - virtual void NavigationEntryCommitted( + void AboutToNavigateRenderView(RenderViewHost* dest_rvh) override; + void RenderViewHostChanged(RenderViewHost* old_host, + RenderViewHost* new_host) override; + void RenderViewDeleted(RenderViewHost* rvh) override; + void RenderProcessGone(base::TerminationStatus status) override; + bool OnMessageReceived(const IPC::Message& message, + RenderFrameHost* render_frame_host) override; + bool OnMessageReceived(const IPC::Message& message) override; + void DidAttachInterstitialPage() override; + void DidDetachInterstitialPage() override; + void TitleWasSet(NavigationEntry* entry, bool explicit_set) override; + void NavigationEntryCommitted( const LoadCommittedDetails& load_details) override; // NotificationObserver overrides: - virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) override; + void Observe(int type, + const NotificationSource& source, + const NotificationDetails& details) override; void DisconnectRenderViewHost(); void ConnectRenderViewHost(RenderViewHost* rvh); diff --git a/content/browser/devtools/renderer_overrides_handler_browsertest.cc b/content/browser/devtools/renderer_overrides_handler_browsertest.cc index c50e62d..cbf0e5b 100644 --- a/content/browser/devtools/renderer_overrides_handler_browsertest.cc +++ b/content/browser/devtools/renderer_overrides_handler_browsertest.cc @@ -56,18 +56,18 @@ class RendererOverridesHandlerTest : public ContentBrowserTest, scoped_refptr<DevToolsAgentHost> agent_host_; private: - virtual void SetUpOnMainThread() override { + void SetUpOnMainThread() override { agent_host_ = DevToolsAgentHost::GetOrCreateFor(shell()->web_contents()); agent_host_->AttachClient(this); } - virtual void TearDownOnMainThread() override { + void TearDownOnMainThread() override { agent_host_->DetachClient(); agent_host_ = NULL; } - virtual void DispatchProtocolMessage( - DevToolsAgentHost* agent_host, const std::string& message) override { + void DispatchProtocolMessage(DevToolsAgentHost* agent_host, + const std::string& message) override { scoped_ptr<base::DictionaryValue> root( static_cast<base::DictionaryValue*>(base::JSONReader::Read(message))); base::DictionaryValue* result; @@ -76,8 +76,7 @@ class RendererOverridesHandlerTest : public ContentBrowserTest, base::MessageLoop::current()->QuitNow(); } - virtual void AgentHostClosed( - DevToolsAgentHost* agent_host, bool replaced) override { + void AgentHostClosed(DevToolsAgentHost* agent_host, bool replaced) override { EXPECT_TRUE(false); } }; @@ -99,7 +98,7 @@ IN_PROC_BROWSER_TEST_F(RendererOverridesHandlerTest, QueryUsageAndQuota) { class CaptureScreenshotTest : public RendererOverridesHandlerTest { private: #if !defined(OS_ANDROID) - virtual void SetUpCommandLine(base::CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(switches::kEnablePixelOutputInTests); } #endif diff --git a/content/browser/devtools/tethering_handler.cc b/content/browser/devtools/tethering_handler.cc index 8f41dea..e0c083d 100644 --- a/content/browser/devtools/tethering_handler.cc +++ b/content/browser/devtools/tethering_handler.cc @@ -50,11 +50,11 @@ class SocketPump : public net::StreamListenSocket::Delegate { return channel_name; } - virtual ~SocketPump() { } + ~SocketPump() override {} private: - virtual void DidAccept(net::StreamListenSocket* server, - scoped_ptr<net::StreamListenSocket> socket) override { + void DidAccept(net::StreamListenSocket* server, + scoped_ptr<net::StreamListenSocket> socket) override { if (accepted_socket_.get()) return; @@ -71,9 +71,9 @@ class SocketPump : public net::StreamListenSocket::Delegate { OnClientRead(result); } - virtual void DidRead(net::StreamListenSocket* socket, - const char* data, - int len) override { + void DidRead(net::StreamListenSocket* socket, + const char* data, + int len) override { int old_size = wire_buffer_size_; wire_buffer_size_ += len; while (wire_buffer_->capacity() < wire_buffer_size_) @@ -84,9 +84,7 @@ class SocketPump : public net::StreamListenSocket::Delegate { OnClientWrite(0); } - virtual void DidClose(net::StreamListenSocket* socket) override { - SelfDestruct(); - } + void DidClose(net::StreamListenSocket* socket) override { SelfDestruct(); } void OnClientRead(int result) { if (result <= 0) { diff --git a/content/browser/devtools/tethering_handler.h b/content/browser/devtools/tethering_handler.h index e34613f..d6e56b5 100644 --- a/content/browser/devtools/tethering_handler.h +++ b/content/browser/devtools/tethering_handler.h @@ -20,7 +20,7 @@ class TetheringHandler : public DevToolsProtocol::Handler { public: TetheringHandler(DevToolsHttpHandlerDelegate* delegate, scoped_refptr<base::MessageLoopProxy> message_loop_proxy); - virtual ~TetheringHandler(); + ~TetheringHandler() override; private: class TetheringImpl; diff --git a/content/browser/dom_storage/dom_storage_area_unittest.cc b/content/browser/dom_storage/dom_storage_area_unittest.cc index 6c16b74..c074cc0 100644 --- a/content/browser/dom_storage/dom_storage_area_unittest.cc +++ b/content/browser/dom_storage/dom_storage_area_unittest.cc @@ -58,7 +58,7 @@ class DOMStorageAreaTest : public testing::Test { class VerifyChangesCommittedDatabase : public DOMStorageDatabase { public: VerifyChangesCommittedDatabase() {} - virtual ~VerifyChangesCommittedDatabase() { + ~VerifyChangesCommittedDatabase() override { const base::string16 kKey(ASCIIToUTF16("key")); const base::string16 kValue(ASCIIToUTF16("value")); DOMStorageValuesMap values; diff --git a/content/browser/dom_storage/dom_storage_context_wrapper.h b/content/browser/dom_storage/dom_storage_context_wrapper.h index 0711fc3..efd5091 100644 --- a/content/browser/dom_storage/dom_storage_context_wrapper.h +++ b/content/browser/dom_storage/dom_storage_context_wrapper.h @@ -33,17 +33,16 @@ class CONTENT_EXPORT DOMStorageContextWrapper : storage::SpecialStoragePolicy* special_storage_policy); // DOMStorageContext implementation. - virtual void GetLocalStorageUsage( + void GetLocalStorageUsage( const GetLocalStorageUsageCallback& callback) override; - virtual void GetSessionStorageUsage( + void GetSessionStorageUsage( const GetSessionStorageUsageCallback& callback) override; - virtual void DeleteLocalStorage(const GURL& origin) override; - virtual void DeleteSessionStorage( - const SessionStorageUsageInfo& usage_info) override; - virtual void SetSaveSessionStorageOnDisk() override; - virtual scoped_refptr<SessionStorageNamespace> - RecreateSessionStorage(const std::string& persistent_id) override; - virtual void StartScavengingUnusedSessionStorage() override; + void DeleteLocalStorage(const GURL& origin) override; + void DeleteSessionStorage(const SessionStorageUsageInfo& usage_info) override; + void SetSaveSessionStorageOnDisk() override; + scoped_refptr<SessionStorageNamespace> RecreateSessionStorage( + const std::string& persistent_id) override; + void StartScavengingUnusedSessionStorage() override; // Used by content settings to alter the behavior around // what data to keep and what data to discard at shutdown. @@ -59,7 +58,7 @@ class CONTENT_EXPORT DOMStorageContextWrapper : friend class SessionStorageNamespaceImpl; // ditto friend class base::RefCountedThreadSafe<DOMStorageContextWrapper>; - virtual ~DOMStorageContextWrapper(); + ~DOMStorageContextWrapper() override; DOMStorageContextImpl* context() const { return context_.get(); } scoped_refptr<DOMStorageContextImpl> context_; diff --git a/content/browser/dom_storage/dom_storage_message_filter.h b/content/browser/dom_storage/dom_storage_message_filter.h index d287039..d93acfd 100644 --- a/content/browser/dom_storage/dom_storage_message_filter.h +++ b/content/browser/dom_storage/dom_storage_message_filter.h @@ -34,17 +34,17 @@ class DOMStorageMessageFilter DOMStorageContextWrapper* context); private: - virtual ~DOMStorageMessageFilter(); + ~DOMStorageMessageFilter() override; void InitializeInSequence(); void UninitializeInSequence(); // BrowserMessageFilter implementation - virtual void OnFilterAdded(IPC::Sender* sender) override; - virtual void OnFilterRemoved() override; - virtual base::TaskRunner* OverrideTaskRunnerForMessage( + void OnFilterAdded(IPC::Sender* sender) override; + void OnFilterRemoved() override; + base::TaskRunner* OverrideTaskRunnerForMessage( const IPC::Message& message) override; - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; // Message Handlers. void OnOpenStorageArea(int connection_id, int64 namespace_id, @@ -63,21 +63,18 @@ class DOMStorageMessageFilter // DOMStorageContextImpl::EventObserver implementation which // sends events back to our renderer process. - virtual void OnDOMStorageItemSet( - const DOMStorageArea* area, - const base::string16& key, - const base::string16& new_value, - const base::NullableString16& old_value, - const GURL& page_url) override; - virtual void OnDOMStorageItemRemoved( - const DOMStorageArea* area, - const base::string16& key, - const base::string16& old_value, - const GURL& page_url) override; - virtual void OnDOMStorageAreaCleared( - const DOMStorageArea* area, - const GURL& page_url) override; - virtual void OnDOMSessionStorageReset(int64 namespace_id) override; + void OnDOMStorageItemSet(const DOMStorageArea* area, + const base::string16& key, + const base::string16& new_value, + const base::NullableString16& old_value, + const GURL& page_url) override; + void OnDOMStorageItemRemoved(const DOMStorageArea* area, + const base::string16& key, + const base::string16& old_value, + const GURL& page_url) override; + void OnDOMStorageAreaCleared(const DOMStorageArea* area, + const GURL& page_url) override; + void OnDOMSessionStorageReset(int64 namespace_id) override; void SendDOMStorageEvent( const DOMStorageArea* area, diff --git a/content/browser/dom_storage/dom_storage_task_runner.h b/content/browser/dom_storage/dom_storage_task_runner.h index 6186d0a6..a2000a0 100644 --- a/content/browser/dom_storage/dom_storage_task_runner.h +++ b/content/browser/dom_storage/dom_storage_task_runner.h @@ -49,7 +49,7 @@ class CONTENT_EXPORT DOMStorageTaskRunner // The TaskRunner override returns true if the current thread is running // on the primary sequence. - virtual bool RunsTasksOnCurrentThread() const override; + bool RunsTasksOnCurrentThread() const override; // Returns true if the current thread is running on the given |sequence_id|. virtual bool IsRunningOnSequence(SequenceID sequence_id) const = 0; @@ -61,7 +61,7 @@ class CONTENT_EXPORT DOMStorageTaskRunner } protected: - virtual ~DOMStorageTaskRunner() {} + ~DOMStorageTaskRunner() override {} }; // A derived class used in chromium that utilizes a SequenceWorkerPool @@ -76,20 +76,18 @@ class CONTENT_EXPORT DOMStorageWorkerPoolTaskRunner : base::SequencedWorkerPool::SequenceToken commit_sequence_token, base::MessageLoopProxy* delayed_task_loop); - virtual bool PostDelayedTask( - const tracked_objects::Location& from_here, - const base::Closure& task, - base::TimeDelta delay) override; + bool PostDelayedTask(const tracked_objects::Location& from_here, + const base::Closure& task, + base::TimeDelta delay) override; - virtual bool PostShutdownBlockingTask( - const tracked_objects::Location& from_here, - SequenceID sequence_id, - const base::Closure& task) override; + bool PostShutdownBlockingTask(const tracked_objects::Location& from_here, + SequenceID sequence_id, + const base::Closure& task) override; - virtual bool IsRunningOnSequence(SequenceID sequence_id) const override; + bool IsRunningOnSequence(SequenceID sequence_id) const override; protected: - virtual ~DOMStorageWorkerPoolTaskRunner(); + ~DOMStorageWorkerPoolTaskRunner() override; private: @@ -111,20 +109,18 @@ class CONTENT_EXPORT MockDOMStorageTaskRunner : public: explicit MockDOMStorageTaskRunner(base::MessageLoopProxy* message_loop); - virtual bool PostDelayedTask( - const tracked_objects::Location& from_here, - const base::Closure& task, - base::TimeDelta delay) override; + bool PostDelayedTask(const tracked_objects::Location& from_here, + const base::Closure& task, + base::TimeDelta delay) override; - virtual bool PostShutdownBlockingTask( - const tracked_objects::Location& from_here, - SequenceID sequence_id, - const base::Closure& task) override; + bool PostShutdownBlockingTask(const tracked_objects::Location& from_here, + SequenceID sequence_id, + const base::Closure& task) override; - virtual bool IsRunningOnSequence(SequenceID sequence_id) const override; + bool IsRunningOnSequence(SequenceID sequence_id) const override; protected: - virtual ~MockDOMStorageTaskRunner(); + ~MockDOMStorageTaskRunner() override; private: const scoped_refptr<base::MessageLoopProxy> message_loop_; diff --git a/content/browser/dom_storage/local_storage_database_adapter.h b/content/browser/dom_storage/local_storage_database_adapter.h index c758dd4..fca55d0 100644 --- a/content/browser/dom_storage/local_storage_database_adapter.h +++ b/content/browser/dom_storage/local_storage_database_adapter.h @@ -22,12 +22,12 @@ class CONTENT_EXPORT LocalStorageDatabaseAdapter : public DOMStorageDatabaseAdapter { public: explicit LocalStorageDatabaseAdapter(const base::FilePath& path); - virtual ~LocalStorageDatabaseAdapter(); - virtual void ReadAllValues(DOMStorageValuesMap* result) override; - virtual bool CommitChanges(bool clear_all_first, - const DOMStorageValuesMap& changes) override; - virtual void DeleteFiles() override; - virtual void Reset() override; + ~LocalStorageDatabaseAdapter() override; + void ReadAllValues(DOMStorageValuesMap* result) override; + bool CommitChanges(bool clear_all_first, + const DOMStorageValuesMap& changes) override; + void DeleteFiles() override; + void Reset() override; protected: // Constructor that uses an in-memory sqlite database, for testing. diff --git a/content/browser/dom_storage/session_storage_database_adapter.h b/content/browser/dom_storage/session_storage_database_adapter.h index d20b8db..1b5a91d 100644 --- a/content/browser/dom_storage/session_storage_database_adapter.h +++ b/content/browser/dom_storage/session_storage_database_adapter.h @@ -18,10 +18,11 @@ class SessionStorageDatabaseAdapter : public DOMStorageDatabaseAdapter { SessionStorageDatabaseAdapter(SessionStorageDatabase* db, const std::string& permanent_namespace_id, const GURL& origin); - virtual ~SessionStorageDatabaseAdapter(); - virtual void ReadAllValues(DOMStorageValuesMap* result) override; - virtual bool CommitChanges(bool clear_all_first, - const DOMStorageValuesMap& changes) override; + ~SessionStorageDatabaseAdapter() override; + void ReadAllValues(DOMStorageValuesMap* result) override; + bool CommitChanges(bool clear_all_first, + const DOMStorageValuesMap& changes) override; + private: scoped_refptr<SessionStorageDatabase> db_; std::string permanent_namespace_id_; diff --git a/content/browser/dom_storage/session_storage_namespace_impl.h b/content/browser/dom_storage/session_storage_namespace_impl.h index cadb239..025ee87 100644 --- a/content/browser/dom_storage/session_storage_namespace_impl.h +++ b/content/browser/dom_storage/session_storage_namespace_impl.h @@ -40,26 +40,26 @@ class SessionStorageNamespaceImpl SessionStorageNamespaceImpl* master_session_storage_namespace); // SessionStorageNamespace implementation. - virtual int64 id() const override; - virtual const std::string& persistent_id() const override; - virtual void SetShouldPersist(bool should_persist) override; - virtual bool should_persist() const override; + int64 id() const override; + const std::string& persistent_id() const override; + void SetShouldPersist(bool should_persist) override; + bool should_persist() const override; SessionStorageNamespaceImpl* Clone(); bool IsFromContext(DOMStorageContextWrapper* context); - virtual void AddTransactionLogProcessId(int process_id) override; - virtual void RemoveTransactionLogProcessId(int process_id) override; - virtual void Merge(bool actually_merge, - int process_id, - SessionStorageNamespace* other, - const MergeResultCallback& callback) override; - virtual bool IsAliasOf(SessionStorageNamespace* other) override; - virtual SessionStorageNamespace* CreateAlias() override; + void AddTransactionLogProcessId(int process_id) override; + void RemoveTransactionLogProcessId(int process_id) override; + void Merge(bool actually_merge, + int process_id, + SessionStorageNamespace* other, + const MergeResultCallback& callback) override; + bool IsAliasOf(SessionStorageNamespace* other) override; + SessionStorageNamespace* CreateAlias() override; private: explicit SessionStorageNamespaceImpl(DOMStorageSession* clone); - virtual ~SessionStorageNamespaceImpl(); + ~SessionStorageNamespaceImpl() override; scoped_refptr<DOMStorageSession> session_; diff --git a/content/browser/download/download_browsertest.cc b/content/browser/download/download_browsertest.cc index d516d9a..a011fc9 100644 --- a/content/browser/download/download_browsertest.cc +++ b/content/browser/download/download_browsertest.cc @@ -122,17 +122,15 @@ class DownloadFileWithDelay : public DownloadFileImpl { base::WeakPtr<DownloadDestinationObserver> observer, base::WeakPtr<DownloadFileWithDelayFactory> owner); - virtual ~DownloadFileWithDelay(); + ~DownloadFileWithDelay() override; // Wraps DownloadFileImpl::Rename* and intercepts the return callback, // storing it in the factory that produced this object for later // retrieval. - virtual void RenameAndUniquify( - const base::FilePath& full_path, - const RenameCompletionCallback& callback) override; - virtual void RenameAndAnnotate( - const base::FilePath& full_path, - const RenameCompletionCallback& callback) override; + void RenameAndUniquify(const base::FilePath& full_path, + const RenameCompletionCallback& callback) override; + void RenameAndAnnotate(const base::FilePath& full_path, + const RenameCompletionCallback& callback) override; private: static void RenameCallbackWrapper( @@ -155,10 +153,10 @@ class DownloadFileWithDelay : public DownloadFileImpl { class DownloadFileWithDelayFactory : public DownloadFileFactory { public: DownloadFileWithDelayFactory(); - virtual ~DownloadFileWithDelayFactory(); + ~DownloadFileWithDelayFactory() override; // DownloadFileFactory interface. - virtual DownloadFile* CreateFile( + DownloadFile* CreateFile( scoped_ptr<DownloadSaveInfo> save_info, const base::FilePath& default_download_directory, const GURL& url, @@ -292,12 +290,12 @@ class CountingDownloadFile : public DownloadFileImpl { url, referrer_url, calculate_hash, stream.Pass(), bound_net_log, observer) {} - virtual ~CountingDownloadFile() { + ~CountingDownloadFile() override { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); active_files_--; } - virtual void Initialize(const InitializeCallback& callback) override { + void Initialize(const InitializeCallback& callback) override { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); active_files_++; return DownloadFileImpl::Initialize(callback); @@ -331,18 +329,18 @@ int CountingDownloadFile::active_files_ = 0; class CountingDownloadFileFactory : public DownloadFileFactory { public: CountingDownloadFileFactory() {} - virtual ~CountingDownloadFileFactory() {} + ~CountingDownloadFileFactory() override {} // DownloadFileFactory interface. - virtual DownloadFile* CreateFile( - scoped_ptr<DownloadSaveInfo> save_info, - const base::FilePath& default_downloads_directory, - const GURL& url, - const GURL& referrer_url, - bool calculate_hash, - scoped_ptr<ByteStreamReader> stream, - const net::BoundNetLog& bound_net_log, - base::WeakPtr<DownloadDestinationObserver> observer) override { + DownloadFile* CreateFile( + scoped_ptr<DownloadSaveInfo> save_info, + const base::FilePath& default_downloads_directory, + const GURL& url, + const GURL& referrer_url, + bool calculate_hash, + scoped_ptr<ByteStreamReader> stream, + const net::BoundNetLog& bound_net_log, + base::WeakPtr<DownloadDestinationObserver> observer) override { scoped_ptr<PowerSaveBlocker> psb( PowerSaveBlocker::Create( PowerSaveBlocker::kPowerSaveBlockPreventAppSuspension, @@ -358,9 +356,9 @@ class TestShellDownloadManagerDelegate : public ShellDownloadManagerDelegate { public: TestShellDownloadManagerDelegate() : delay_download_open_(false) {} - virtual ~TestShellDownloadManagerDelegate() {} + ~TestShellDownloadManagerDelegate() override {} - virtual bool ShouldOpenDownload( + bool ShouldOpenDownload( DownloadItem* item, const DownloadOpenDelayedCallback& callback) override { if (delay_download_open_) { @@ -400,9 +398,7 @@ class RecordingDownloadObserver : DownloadItem::Observer { download_->AddObserver(this); } - virtual ~RecordingDownloadObserver() { - RemoveObserver(); - } + ~RecordingDownloadObserver() override { RemoveObserver(); } void CompareToExpectedRecord(const RecordStruct expected[], size_t size) { EXPECT_EQ(size, record_.size()); @@ -415,7 +411,7 @@ class RecordingDownloadObserver : DownloadItem::Observer { } private: - virtual void OnDownloadUpdated(DownloadItem* download) override { + void OnDownloadUpdated(DownloadItem* download) override { DCHECK_EQ(download_, download); DownloadItem::DownloadState state = download->GetState(); int bytes = download->GetReceivedBytes(); @@ -426,7 +422,7 @@ class RecordingDownloadObserver : DownloadItem::Observer { } } - virtual void OnDownloadDestroyed(DownloadItem* download) override { + void OnDownloadDestroyed(DownloadItem* download) override { DCHECK_EQ(download_, download); RemoveObserver(); } @@ -453,20 +449,20 @@ class DownloadCreateObserver : DownloadManager::Observer { manager_->AddObserver(this); } - virtual ~DownloadCreateObserver() { + ~DownloadCreateObserver() override { if (manager_) manager_->RemoveObserver(this); manager_ = NULL; } - virtual void ManagerGoingDown(DownloadManager* manager) override { + void ManagerGoingDown(DownloadManager* manager) override { DCHECK_EQ(manager_, manager); manager_->RemoveObserver(this); manager_ = NULL; } - virtual void OnDownloadCreated(DownloadManager* manager, - DownloadItem* download) override { + void OnDownloadCreated(DownloadManager* manager, + DownloadItem* download) override { if (!item_) item_ = download; @@ -574,7 +570,7 @@ class DownloadContentTest : public ContentBrowserTest { ByteStreamWriter::kFractionBufferBeforeSending) + 1; } - virtual void SetUpOnMainThread() override { + void SetUpOnMainThread() override { ASSERT_TRUE(downloads_directory_.CreateUniqueTempDir()); test_delegate_.reset(new TestShellDownloadManagerDelegate()); diff --git a/content/browser/download/download_file_impl.h b/content/browser/download/download_file_impl.h index 7326665..9ff3f85 100644 --- a/content/browser/download/download_file_impl.h +++ b/content/browser/download/download_file_impl.h @@ -44,24 +44,22 @@ class CONTENT_EXPORT DownloadFileImpl : virtual public DownloadFile { const net::BoundNetLog& bound_net_log, base::WeakPtr<DownloadDestinationObserver> observer); - virtual ~DownloadFileImpl(); + ~DownloadFileImpl() override; // DownloadFile functions. - virtual void Initialize(const InitializeCallback& callback) override; - virtual void RenameAndUniquify( - const base::FilePath& full_path, - const RenameCompletionCallback& callback) override; - virtual void RenameAndAnnotate( - const base::FilePath& full_path, - const RenameCompletionCallback& callback) override; - virtual void Detach() override; - virtual void Cancel() override; - virtual base::FilePath FullPath() const override; - virtual bool InProgress() const override; - virtual int64 CurrentSpeed() const override; - virtual bool GetHash(std::string* hash) override; - virtual std::string GetHashState() override; - virtual void SetClientGuid(const std::string& guid) override; + void Initialize(const InitializeCallback& callback) override; + void RenameAndUniquify(const base::FilePath& full_path, + const RenameCompletionCallback& callback) override; + void RenameAndAnnotate(const base::FilePath& full_path, + const RenameCompletionCallback& callback) override; + void Detach() override; + void Cancel() override; + base::FilePath FullPath() const override; + bool InProgress() const override; + int64 CurrentSpeed() const override; + bool GetHash(std::string* hash) override; + std::string GetHashState() override; + void SetClientGuid(const std::string& guid) override; protected: // For test class overrides. diff --git a/content/browser/download/download_file_unittest.cc b/content/browser/download/download_file_unittest.cc index 40f4fad..dbf0fe3 100644 --- a/content/browser/download/download_file_unittest.cc +++ b/content/browser/download/download_file_unittest.cc @@ -87,8 +87,7 @@ class TestDownloadFileImpl : public DownloadFileImpl { observer) {} protected: - virtual base::TimeDelta GetRetryDelayForFailedRename( - int attempt_count) override { + base::TimeDelta GetRetryDelayForFailedRename(int attempt_count) override { return base::TimeDelta::FromMilliseconds(0); } @@ -96,8 +95,7 @@ class TestDownloadFileImpl : public DownloadFileImpl { // On Posix, we don't encounter transient errors during renames, except // possibly EAGAIN, which is difficult to replicate reliably. So we resort to // simulating a transient error using ACCESS_DENIED instead. - virtual bool ShouldRetryFailedRename( - DownloadInterruptReason reason) override { + bool ShouldRetryFailedRename(DownloadInterruptReason reason) override { return reason == DOWNLOAD_INTERRUPT_REASON_FILE_ACCESS_DENIED; } #endif diff --git a/content/browser/download/download_item_impl.h b/content/browser/download/download_item_impl.h index 755bf60..4a95e76 100644 --- a/content/browser/download/download_item_impl.h +++ b/content/browser/download/download_item_impl.h @@ -87,77 +87,76 @@ class CONTENT_EXPORT DownloadItemImpl scoped_ptr<DownloadRequestHandleInterface> request_handle, const net::BoundNetLog& bound_net_log); - virtual ~DownloadItemImpl(); + ~DownloadItemImpl() override; // DownloadItem - virtual void AddObserver(DownloadItem::Observer* observer) override; - virtual void RemoveObserver(DownloadItem::Observer* observer) override; - virtual void UpdateObservers() override; - virtual void ValidateDangerousDownload() override; - virtual void StealDangerousDownload(const AcquireFileCallback& callback) - override; - virtual void Pause() override; - virtual void Resume() override; - virtual void Cancel(bool user_cancel) override; - virtual void Remove() override; - virtual void OpenDownload() override; - virtual void ShowDownloadInShell() override; - virtual uint32 GetId() const override; - virtual DownloadState GetState() const override; - virtual DownloadInterruptReason GetLastReason() const override; - virtual bool IsPaused() const override; - virtual bool IsTemporary() const override; - virtual bool CanResume() const override; - virtual bool IsDone() const override; - virtual const GURL& GetURL() const override; - virtual const std::vector<GURL>& GetUrlChain() const override; - virtual const GURL& GetOriginalUrl() const override; - virtual const GURL& GetReferrerUrl() const override; - virtual const GURL& GetTabUrl() const override; - virtual const GURL& GetTabReferrerUrl() const override; - virtual std::string GetSuggestedFilename() const override; - virtual std::string GetContentDisposition() const override; - virtual std::string GetMimeType() const override; - virtual std::string GetOriginalMimeType() const override; - virtual std::string GetRemoteAddress() const override; - virtual bool HasUserGesture() const override; - virtual ui::PageTransition GetTransitionType() const override; - virtual const std::string& GetLastModifiedTime() const override; - virtual const std::string& GetETag() const override; - virtual bool IsSavePackageDownload() const override; - virtual const base::FilePath& GetFullPath() const override; - virtual const base::FilePath& GetTargetFilePath() const override; - virtual const base::FilePath& GetForcedFilePath() const override; - virtual base::FilePath GetFileNameToReportUser() const override; - virtual TargetDisposition GetTargetDisposition() const override; - virtual const std::string& GetHash() const override; - virtual const std::string& GetHashState() const override; - virtual bool GetFileExternallyRemoved() const override; - virtual void DeleteFile(const base::Callback<void(bool)>& callback) override; - virtual bool IsDangerous() const override; - virtual DownloadDangerType GetDangerType() const override; - virtual bool TimeRemaining(base::TimeDelta* remaining) const override; - virtual int64 CurrentSpeed() const override; - virtual int PercentComplete() const override; - virtual bool AllDataSaved() const override; - virtual int64 GetTotalBytes() const override; - virtual int64 GetReceivedBytes() const override; - virtual base::Time GetStartTime() const override; - virtual base::Time GetEndTime() const override; - virtual bool CanShowInFolder() override; - virtual bool CanOpenDownload() override; - virtual bool ShouldOpenFileBasedOnExtension() override; - virtual bool GetOpenWhenComplete() const override; - virtual bool GetAutoOpened() override; - virtual bool GetOpened() const override; - virtual BrowserContext* GetBrowserContext() const override; - virtual WebContents* GetWebContents() const override; - virtual void OnContentCheckCompleted(DownloadDangerType danger_type) override; - virtual void SetOpenWhenComplete(bool open) override; - virtual void SetIsTemporary(bool temporary) override; - virtual void SetOpened(bool opened) override; - virtual void SetDisplayName(const base::FilePath& name) override; - virtual std::string DebugString(bool verbose) const override; + void AddObserver(DownloadItem::Observer* observer) override; + void RemoveObserver(DownloadItem::Observer* observer) override; + void UpdateObservers() override; + void ValidateDangerousDownload() override; + void StealDangerousDownload(const AcquireFileCallback& callback) override; + void Pause() override; + void Resume() override; + void Cancel(bool user_cancel) override; + void Remove() override; + void OpenDownload() override; + void ShowDownloadInShell() override; + uint32 GetId() const override; + DownloadState GetState() const override; + DownloadInterruptReason GetLastReason() const override; + bool IsPaused() const override; + bool IsTemporary() const override; + bool CanResume() const override; + bool IsDone() const override; + const GURL& GetURL() const override; + const std::vector<GURL>& GetUrlChain() const override; + const GURL& GetOriginalUrl() const override; + const GURL& GetReferrerUrl() const override; + const GURL& GetTabUrl() const override; + const GURL& GetTabReferrerUrl() const override; + std::string GetSuggestedFilename() const override; + std::string GetContentDisposition() const override; + std::string GetMimeType() const override; + std::string GetOriginalMimeType() const override; + std::string GetRemoteAddress() const override; + bool HasUserGesture() const override; + ui::PageTransition GetTransitionType() const override; + const std::string& GetLastModifiedTime() const override; + const std::string& GetETag() const override; + bool IsSavePackageDownload() const override; + const base::FilePath& GetFullPath() const override; + const base::FilePath& GetTargetFilePath() const override; + const base::FilePath& GetForcedFilePath() const override; + base::FilePath GetFileNameToReportUser() const override; + TargetDisposition GetTargetDisposition() const override; + const std::string& GetHash() const override; + const std::string& GetHashState() const override; + bool GetFileExternallyRemoved() const override; + void DeleteFile(const base::Callback<void(bool)>& callback) override; + bool IsDangerous() const override; + DownloadDangerType GetDangerType() const override; + bool TimeRemaining(base::TimeDelta* remaining) const override; + int64 CurrentSpeed() const override; + int PercentComplete() const override; + bool AllDataSaved() const override; + int64 GetTotalBytes() const override; + int64 GetReceivedBytes() const override; + base::Time GetStartTime() const override; + base::Time GetEndTime() const override; + bool CanShowInFolder() override; + bool CanOpenDownload() override; + bool ShouldOpenFileBasedOnExtension() override; + bool GetOpenWhenComplete() const override; + bool GetAutoOpened() override; + bool GetOpened() const override; + BrowserContext* GetBrowserContext() const override; + WebContents* GetWebContents() const override; + void OnContentCheckCompleted(DownloadDangerType danger_type) override; + void SetOpenWhenComplete(bool open) override; + void SetIsTemporary(bool temporary) override; + void SetOpened(bool opened) override; + void SetDisplayName(const base::FilePath& name) override; + std::string DebugString(bool verbose) const override; // All remaining public interfaces virtual to allow for DownloadItemImpl // mocks. @@ -210,11 +209,11 @@ class CONTENT_EXPORT DownloadItemImpl virtual void MarkAsComplete(); // DownloadDestinationObserver - virtual void DestinationUpdate(int64 bytes_so_far, - int64 bytes_per_sec, - const std::string& hash_state) override; - virtual void DestinationError(DownloadInterruptReason reason) override; - virtual void DestinationCompleted(const std::string& final_hash) override; + void DestinationUpdate(int64 bytes_so_far, + int64 bytes_per_sec, + const std::string& hash_state) override; + void DestinationError(DownloadInterruptReason reason) override; + void DestinationCompleted(const std::string& final_hash) override; private: // Fine grained states of a download. Note that active downloads are created diff --git a/content/browser/download/download_item_impl_unittest.cc b/content/browser/download/download_item_impl_unittest.cc index cd78c9b..acbc55e 100644 --- a/content/browser/download/download_item_impl_unittest.cc +++ b/content/browser/download/download_item_impl_unittest.cc @@ -121,17 +121,17 @@ class DownloadItemTest : public testing::Test { item_->AddObserver(this); } - virtual ~MockObserver() { + ~MockObserver() override { if (item_) item_->RemoveObserver(this); } - virtual void OnDownloadRemoved(DownloadItem* download) override { + void OnDownloadRemoved(DownloadItem* download) override { DVLOG(20) << " " << __FUNCTION__ << " download = " << download->DebugString(false); removed_ = true; } - virtual void OnDownloadUpdated(DownloadItem* download) override { + void OnDownloadUpdated(DownloadItem* download) override { DVLOG(20) << " " << __FUNCTION__ << " download = " << download->DebugString(false); updated_ = true; @@ -147,12 +147,12 @@ class DownloadItemTest : public testing::Test { last_state_ = new_state; } - virtual void OnDownloadOpened(DownloadItem* download) override { + void OnDownloadOpened(DownloadItem* download) override { DVLOG(20) << " " << __FUNCTION__ << " download = " << download->DebugString(false); } - virtual void OnDownloadDestroyed(DownloadItem* download) override { + void OnDownloadDestroyed(DownloadItem* download) override { DVLOG(20) << " " << __FUNCTION__ << " download = " << download->DebugString(false); destroyed_ = true; diff --git a/content/browser/download/download_manager_impl.cc b/content/browser/download/download_manager_impl.cc index 0ef4729..30296cb 100644 --- a/content/browser/download/download_manager_impl.cc +++ b/content/browser/download/download_manager_impl.cc @@ -161,9 +161,9 @@ class MapValueIteratorAdapter { class DownloadItemFactoryImpl : public DownloadItemFactory { public: DownloadItemFactoryImpl() {} - virtual ~DownloadItemFactoryImpl() {} + ~DownloadItemFactoryImpl() override {} - virtual DownloadItemImpl* CreatePersistedItem( + DownloadItemImpl* CreatePersistedItem( DownloadItemImplDelegate* delegate, uint32 download_id, const base::FilePath& current_path, @@ -205,7 +205,7 @@ class DownloadItemFactoryImpl : public DownloadItemFactory { bound_net_log); } - virtual DownloadItemImpl* CreateActiveItem( + DownloadItemImpl* CreateActiveItem( DownloadItemImplDelegate* delegate, uint32 download_id, const DownloadCreateInfo& info, @@ -213,7 +213,7 @@ class DownloadItemFactoryImpl : public DownloadItemFactory { return new DownloadItemImpl(delegate, download_id, info, bound_net_log); } - virtual DownloadItemImpl* CreateSavePageItem( + DownloadItemImpl* CreateSavePageItem( DownloadItemImplDelegate* delegate, uint32 download_id, const base::FilePath& path, diff --git a/content/browser/download/download_manager_impl.h b/content/browser/download/download_manager_impl.h index fa3626c..0c9c33b 100644 --- a/content/browser/download/download_manager_impl.h +++ b/content/browser/download/download_manager_impl.h @@ -40,7 +40,7 @@ class CONTENT_EXPORT DownloadManagerImpl : public DownloadManager, // Caller guarantees that |net_log| will remain valid // for the lifetime of DownloadManagerImpl (until Shutdown() is called). DownloadManagerImpl(net::NetLog* net_log, BrowserContext* browser_context); - virtual ~DownloadManagerImpl(); + ~DownloadManagerImpl() override; // Implementation functions (not part of the DownloadManager interface). @@ -58,22 +58,22 @@ class CONTENT_EXPORT DownloadManagerImpl : public DownloadManager, void OnSavePackageSuccessfullyFinished(DownloadItem* download_item); // DownloadManager functions. - virtual void SetDelegate(DownloadManagerDelegate* delegate) override; - virtual DownloadManagerDelegate* GetDelegate() const override; - virtual void Shutdown() override; - virtual void GetAllDownloads(DownloadVector* result) override; - virtual void StartDownload( + void SetDelegate(DownloadManagerDelegate* delegate) override; + DownloadManagerDelegate* GetDelegate() const override; + void Shutdown() override; + void GetAllDownloads(DownloadVector* result) override; + void StartDownload( scoped_ptr<DownloadCreateInfo> info, scoped_ptr<ByteStreamReader> stream, const DownloadUrlParameters::OnStartedCallback& on_started) override; - virtual int RemoveDownloadsBetween(base::Time remove_begin, - base::Time remove_end) override; - virtual int RemoveDownloads(base::Time remove_begin) override; - virtual int RemoveAllDownloads() override; - virtual void DownloadUrl(scoped_ptr<DownloadUrlParameters> params) override; - virtual void AddObserver(Observer* observer) override; - virtual void RemoveObserver(Observer* observer) override; - virtual content::DownloadItem* CreateDownloadItem( + int RemoveDownloadsBetween(base::Time remove_begin, + base::Time remove_end) override; + int RemoveDownloads(base::Time remove_begin) override; + int RemoveAllDownloads() override; + void DownloadUrl(scoped_ptr<DownloadUrlParameters> params) override; + void AddObserver(Observer* observer) override; + void RemoveObserver(Observer* observer) override; + content::DownloadItem* CreateDownloadItem( uint32 id, const base::FilePath& current_path, const base::FilePath& target_path, @@ -91,11 +91,11 @@ class CONTENT_EXPORT DownloadManagerImpl : public DownloadManager, DownloadDangerType danger_type, DownloadInterruptReason interrupt_reason, bool opened) override; - virtual int InProgressCount() const override; - virtual int NonMaliciousInProgressCount() const override; - virtual BrowserContext* GetBrowserContext() const override; - virtual void CheckForHistoryFilesRemoval() override; - virtual DownloadItem* GetDownload(uint32 id) override; + int InProgressCount() const override; + int NonMaliciousInProgressCount() const override; + BrowserContext* GetBrowserContext() const override; + void CheckForHistoryFilesRemoval() override; + DownloadItem* GetDownload(uint32 id) override; // For testing; specifically, accessed from TestFileErrorInjector. void SetDownloadItemFactoryForTesting( @@ -144,22 +144,20 @@ class CONTENT_EXPORT DownloadManagerImpl : public DownloadManager, // Overridden from DownloadItemImplDelegate // (Note that |GetBrowserContext| are present in both interfaces.) - virtual void DetermineDownloadTarget( - DownloadItemImpl* item, const DownloadTargetCallback& callback) override; - virtual bool ShouldCompleteDownload( - DownloadItemImpl* item, const base::Closure& complete_callback) override; - virtual bool ShouldOpenFileBasedOnExtension( - const base::FilePath& path) override; - virtual bool ShouldOpenDownload( - DownloadItemImpl* item, - const ShouldOpenDownloadCallback& callback) override; - virtual void CheckForFileRemoval(DownloadItemImpl* download_item) override; - virtual void ResumeInterruptedDownload( + void DetermineDownloadTarget(DownloadItemImpl* item, + const DownloadTargetCallback& callback) override; + bool ShouldCompleteDownload(DownloadItemImpl* item, + const base::Closure& complete_callback) override; + bool ShouldOpenFileBasedOnExtension(const base::FilePath& path) override; + bool ShouldOpenDownload(DownloadItemImpl* item, + const ShouldOpenDownloadCallback& callback) override; + void CheckForFileRemoval(DownloadItemImpl* download_item) override; + void ResumeInterruptedDownload( scoped_ptr<content::DownloadUrlParameters> params, uint32 id) override; - virtual void OpenDownload(DownloadItemImpl* download) override; - virtual void ShowDownloadInShell(DownloadItemImpl* download) override; - virtual void DownloadRemoved(DownloadItemImpl* download) override; + void OpenDownload(DownloadItemImpl* download) override; + void ShowDownloadInShell(DownloadItemImpl* download) override; + void DownloadRemoved(DownloadItemImpl* download) override; // Factory for creation of downloads items. scoped_ptr<DownloadItemFactory> item_factory_; diff --git a/content/browser/download/download_manager_impl_unittest.cc b/content/browser/download/download_manager_impl_unittest.cc index 0685148..f3f6979 100644 --- a/content/browser/download/download_manager_impl_unittest.cc +++ b/content/browser/download/download_manager_impl_unittest.cc @@ -211,7 +211,7 @@ class MockDownloadItemFactory public base::SupportsWeakPtr<MockDownloadItemFactory> { public: MockDownloadItemFactory(); - virtual ~MockDownloadItemFactory(); + ~MockDownloadItemFactory() override; // Access to map of created items. // TODO(rdsmith): Could add type (save page, persisted, etc.) @@ -229,7 +229,7 @@ class MockDownloadItemFactory void RemoveItem(int id); // Overridden methods from DownloadItemFactory. - virtual DownloadItemImpl* CreatePersistedItem( + DownloadItemImpl* CreatePersistedItem( DownloadItemImplDelegate* delegate, uint32 download_id, const base::FilePath& current_path, @@ -249,17 +249,17 @@ class MockDownloadItemFactory DownloadInterruptReason interrupt_reason, bool opened, const net::BoundNetLog& bound_net_log) override; - virtual DownloadItemImpl* CreateActiveItem( + DownloadItemImpl* CreateActiveItem( DownloadItemImplDelegate* delegate, uint32 download_id, const DownloadCreateInfo& info, const net::BoundNetLog& bound_net_log) override; - virtual DownloadItemImpl* CreateSavePageItem( + DownloadItemImpl* CreateSavePageItem( DownloadItemImplDelegate* delegate, uint32 download_id, const base::FilePath& path, const GURL& url, - const std::string& mime_type, + const std::string& mime_type, scoped_ptr<DownloadRequestHandleInterface> request_handle, const net::BoundNetLog& bound_net_log) override; diff --git a/content/browser/download/download_request_handle.h b/content/browser/download/download_request_handle.h index a082905..76affae2 100644 --- a/content/browser/download/download_request_handle.h +++ b/content/browser/download/download_request_handle.h @@ -45,7 +45,7 @@ class CONTENT_EXPORT DownloadRequestHandleInterface { class CONTENT_EXPORT DownloadRequestHandle : public DownloadRequestHandleInterface { public: - virtual ~DownloadRequestHandle(); + ~DownloadRequestHandle() override; // Create a null DownloadRequestHandle: getters will return null, and // all actions are no-ops. @@ -63,12 +63,12 @@ class CONTENT_EXPORT DownloadRequestHandle int request_id); // Implement DownloadRequestHandleInterface interface. - virtual WebContents* GetWebContents() const override; - virtual DownloadManager* GetDownloadManager() const override; - virtual void PauseRequest() const override; - virtual void ResumeRequest() const override; - virtual void CancelRequest() const override; - virtual std::string DebugString() const override; + WebContents* GetWebContents() const override; + DownloadManager* GetDownloadManager() const override; + void PauseRequest() const override; + void ResumeRequest() const override; + void CancelRequest() const override; + std::string DebugString() const override; private: base::WeakPtr<DownloadResourceHandler> handler_; diff --git a/content/browser/download/download_resource_handler.h b/content/browser/download/download_resource_handler.h index 893c66c..632e887 100644 --- a/content/browser/download/download_resource_handler.h +++ b/content/browser/download/download_resource_handler.h @@ -46,36 +46,35 @@ class CONTENT_EXPORT DownloadResourceHandler const DownloadUrlParameters::OnStartedCallback& started_cb, scoped_ptr<DownloadSaveInfo> save_info); - virtual bool OnUploadProgress(uint64 position, uint64 size) override; + bool OnUploadProgress(uint64 position, uint64 size) override; - virtual bool OnRequestRedirected(const net::RedirectInfo& redirect_info, - ResourceResponse* response, - bool* defer) override; + bool OnRequestRedirected(const net::RedirectInfo& redirect_info, + ResourceResponse* response, + bool* defer) override; // Send the download creation information to the download thread. - virtual bool OnResponseStarted(ResourceResponse* response, - bool* defer) override; + bool OnResponseStarted(ResourceResponse* response, bool* defer) override; // Pass-through implementation. - virtual bool OnWillStart(const GURL& url, bool* defer) override; + bool OnWillStart(const GURL& url, bool* defer) override; // Pass-through implementation. - virtual bool OnBeforeNetworkStart(const GURL& url, bool* defer) override; + bool OnBeforeNetworkStart(const GURL& url, bool* defer) override; // Create a new buffer, which will be handed to the download thread for file // writing and deletion. - virtual bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) override; + bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, + int* buf_size, + int min_size) override; - virtual bool OnReadCompleted(int bytes_read, bool* defer) override; + bool OnReadCompleted(int bytes_read, bool* defer) override; - virtual void OnResponseCompleted(const net::URLRequestStatus& status, - const std::string& security_info, - bool* defer) override; + void OnResponseCompleted(const net::URLRequestStatus& status, + const std::string& security_info, + bool* defer) override; // N/A to this flavor of DownloadHandler. - virtual void OnDataDownloaded(int bytes_downloaded) override; + void OnDataDownloaded(int bytes_downloaded) override; void PauseRequest(); void ResumeRequest(); @@ -86,7 +85,7 @@ class CONTENT_EXPORT DownloadResourceHandler std::string DebugString() const; private: - virtual ~DownloadResourceHandler(); + ~DownloadResourceHandler() override; // Arrange for started_cb_ to be called on the UI thread with the // below values, nulling out started_cb_. Should only be called diff --git a/content/browser/download/drag_download_file.cc b/content/browser/download/drag_download_file.cc index 725792b..ca68740 100644 --- a/content/browser/download/drag_download_file.cc +++ b/content/browser/download/drag_download_file.cc @@ -83,7 +83,7 @@ class DragDownloadFile::DragDownloadFileUI : public DownloadItem::Observer { } private: - virtual ~DragDownloadFileUI() { + ~DragDownloadFileUI() override { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (download_item_) download_item_->RemoveObserver(this); @@ -103,7 +103,7 @@ class DragDownloadFile::DragDownloadFileUI : public DownloadItem::Observer { } // DownloadItem::Observer: - virtual void OnDownloadUpdated(DownloadItem* item) override { + void OnDownloadUpdated(DownloadItem* item) override { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_EQ(download_item_, item); DownloadItem::DownloadState state = download_item_->GetState(); @@ -121,7 +121,7 @@ class DragDownloadFile::DragDownloadFileUI : public DownloadItem::Observer { // Ignore other states. } - virtual void OnDownloadDestroyed(DownloadItem* item) override { + void OnDownloadDestroyed(DownloadItem* item) override { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_EQ(download_item_, item); if (!on_completed_.is_null()) { diff --git a/content/browser/download/drag_download_file.h b/content/browser/download/drag_download_file.h index 5dfbcb9..825f736 100644 --- a/content/browser/download/drag_download_file.h +++ b/content/browser/download/drag_download_file.h @@ -42,15 +42,15 @@ class CONTENT_EXPORT DragDownloadFile : public ui::DownloadFileProvider { WebContents* web_contents); // DownloadFileProvider methods. - virtual void Start(ui::DownloadFileObserver* observer) override; - virtual bool Wait() override; - virtual void Stop() override; + void Start(ui::DownloadFileObserver* observer) override; + bool Wait() override; + void Stop() override; private: class DragDownloadFileUI; enum State {INITIALIZED, STARTED, SUCCESS, FAILURE}; - virtual ~DragDownloadFile(); + ~DragDownloadFile() override; void DownloadCompleted(bool is_successful); void CheckThread(); diff --git a/content/browser/download/drag_download_file_browsertest.cc b/content/browser/download/drag_download_file_browsertest.cc index 789bb46..9c53300 100644 --- a/content/browser/download/drag_download_file_browsertest.cc +++ b/content/browser/download/drag_download_file_browsertest.cc @@ -62,7 +62,7 @@ class DragDownloadFileTest : public ContentBrowserTest { } protected: - virtual void SetUpOnMainThread() override { + void SetUpOnMainThread() override { ASSERT_TRUE(downloads_directory_.CreateUniqueTempDir()); ShellDownloadManagerDelegate* delegate = static_cast<ShellDownloadManagerDelegate*>( diff --git a/content/browser/download/drag_download_util.h b/content/browser/download/drag_download_util.h index 753076a..38b516c 100644 --- a/content/browser/download/drag_download_util.h +++ b/content/browser/download/drag_download_util.h @@ -45,11 +45,11 @@ class PromiseFileFinalizer : public ui::DownloadFileObserver { explicit PromiseFileFinalizer(DragDownloadFile* drag_file_downloader); // DownloadFileObserver methods. - virtual void OnDownloadCompleted(const base::FilePath& file_path) override; - virtual void OnDownloadAborted() override; + void OnDownloadCompleted(const base::FilePath& file_path) override; + void OnDownloadAborted() override; protected: - virtual ~PromiseFileFinalizer(); + ~PromiseFileFinalizer() override; private: void Cleanup(); diff --git a/content/browser/download/mhtml_generation_manager.cc b/content/browser/download/mhtml_generation_manager.cc index 516f780..d02d509 100644 --- a/content/browser/download/mhtml_generation_manager.cc +++ b/content/browser/download/mhtml_generation_manager.cc @@ -19,7 +19,7 @@ namespace content { class MHTMLGenerationManager::Job : public RenderProcessHostObserver { public: Job(); - virtual ~Job(); + ~Job() override; void SetWebContents(WebContents* web_contents); @@ -33,11 +33,10 @@ class MHTMLGenerationManager::Job : public RenderProcessHostObserver { void set_callback(GenerateMHTMLCallback callback) { callback_ = callback; } // RenderProcessHostObserver: - virtual void RenderProcessExited(RenderProcessHost* host, - base::TerminationStatus status, - int exit_code) override; - virtual void RenderProcessHostDestroyed(RenderProcessHost* host) override; - + void RenderProcessExited(RenderProcessHost* host, + base::TerminationStatus status, + int exit_code) override; + void RenderProcessHostDestroyed(RenderProcessHost* host) override; private: // The handle to the file the MHTML is saved to for the browser process. diff --git a/content/browser/download/save_file_resource_handler.h b/content/browser/download/save_file_resource_handler.h index d115b6f..b7425b49 100644 --- a/content/browser/download/save_file_resource_handler.h +++ b/content/browser/download/save_file_resource_handler.h @@ -26,42 +26,41 @@ class SaveFileResourceHandler : public ResourceHandler { int render_view_id, const GURL& url, SaveFileManager* manager); - virtual ~SaveFileResourceHandler(); + ~SaveFileResourceHandler() override; // ResourceHandler Implementation: - virtual bool OnUploadProgress(uint64 position, uint64 size) override; + bool OnUploadProgress(uint64 position, uint64 size) override; // Saves the redirected URL to final_url_, we need to use the original // URL to match original request. - virtual bool OnRequestRedirected(const net::RedirectInfo& redirect_info, - ResourceResponse* response, - bool* defer) override; + bool OnRequestRedirected(const net::RedirectInfo& redirect_info, + ResourceResponse* response, + bool* defer) override; // Sends the download creation information to the download thread. - virtual bool OnResponseStarted(ResourceResponse* response, - bool* defer) override; + bool OnResponseStarted(ResourceResponse* response, bool* defer) override; // Pass-through implementation. - virtual bool OnWillStart(const GURL& url, bool* defer) override; + bool OnWillStart(const GURL& url, bool* defer) override; // Pass-through implementation. - virtual bool OnBeforeNetworkStart(const GURL& url, bool* defer) override; + bool OnBeforeNetworkStart(const GURL& url, bool* defer) override; // Creates a new buffer, which will be handed to the download thread for file // writing and deletion. - virtual bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) override; + bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, + int* buf_size, + int min_size) override; // Passes the buffer to the download file writer. - virtual bool OnReadCompleted(int bytes_read, bool* defer) override; + bool OnReadCompleted(int bytes_read, bool* defer) override; - virtual void OnResponseCompleted(const net::URLRequestStatus& status, - const std::string& security_info, - bool* defer) override; + void OnResponseCompleted(const net::URLRequestStatus& status, + const std::string& security_info, + bool* defer) override; // N/A to this flavor of SaveFileResourceHandler. - virtual void OnDataDownloaded(int bytes_downloaded) override; + void OnDataDownloaded(int bytes_downloaded) override; // If the content-length header is not present (or contains something other // than numbers), StringToInt64 returns 0, which indicates 'unknown size' and diff --git a/content/browser/download/save_package.cc b/content/browser/download/save_package.cc index e979470..486cb10 100644 --- a/content/browser/download/save_package.cc +++ b/content/browser/download/save_package.cc @@ -113,16 +113,14 @@ class SavePackageRequestHandle : public DownloadRequestHandleInterface { : save_package_(save_package) {} // DownloadRequestHandleInterface - virtual WebContents* GetWebContents() const override { + WebContents* GetWebContents() const override { return save_package_.get() ? save_package_->web_contents() : NULL; } - virtual DownloadManager* GetDownloadManager() const override { - return NULL; - } - virtual void PauseRequest() const override {} - virtual void ResumeRequest() const override {} - virtual void CancelRequest() const override {} - virtual std::string DebugString() const override { + DownloadManager* GetDownloadManager() const override { return NULL; } + void PauseRequest() const override {} + void ResumeRequest() const override {} + void CancelRequest() const override {} + std::string DebugString() const override { return "SavePackage DownloadRequestHandle"; } diff --git a/content/browser/download/save_package.h b/content/browser/download/save_package.h index 940e335..3507b17 100644 --- a/content/browser/download/save_package.h +++ b/content/browser/download/save_package.h @@ -135,7 +135,7 @@ class CONTENT_EXPORT SavePackage const base::FilePath& file_full_path, const base::FilePath& directory_full_path); - virtual ~SavePackage(); + ~SavePackage() override; // Notes from Init() above applies here as well. void InternalInit(); @@ -146,10 +146,10 @@ class CONTENT_EXPORT SavePackage void DoSavingProcess(); // WebContentsObserver implementation. - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; // DownloadItem::Observer implementation. - virtual void OnDownloadDestroyed(DownloadItem* download) override; + void OnDownloadDestroyed(DownloadItem* download) override; // Update the download history of this item upon completion. void FinalizeDownloadEntry(); diff --git a/content/browser/file_descriptor_info_impl.h b/content/browser/file_descriptor_info_impl.h index cf6a4f2..78d746e 100644 --- a/content/browser/file_descriptor_info_impl.h +++ b/content/browser/file_descriptor_info_impl.h @@ -16,15 +16,15 @@ class FileDescriptorInfoImpl : public FileDescriptorInfo { public: CONTENT_EXPORT static scoped_ptr<FileDescriptorInfo> Create(); - virtual ~FileDescriptorInfoImpl(); - virtual void Share(int id, base::PlatformFile fd) override; - virtual void Transfer(int id, base::ScopedFD fd) override; - virtual const base::FileHandleMappingVector& GetMapping() const override; - virtual base::FileHandleMappingVector GetMappingWithIDAdjustment( + ~FileDescriptorInfoImpl() override; + void Share(int id, base::PlatformFile fd) override; + void Transfer(int id, base::ScopedFD fd) override; + const base::FileHandleMappingVector& GetMapping() const override; + base::FileHandleMappingVector GetMappingWithIDAdjustment( int delta) const override; - virtual base::PlatformFile GetFDAt(size_t i) const override; - virtual int GetIDAt(size_t i) const override; - virtual size_t GetMappingSize() const override; + base::PlatformFile GetFDAt(size_t i) const override; + int GetIDAt(size_t i) const override; + size_t GetMappingSize() const override; private: FileDescriptorInfoImpl(); diff --git a/content/browser/fileapi/blob_url_request_job_unittest.cc b/content/browser/fileapi/blob_url_request_job_unittest.cc index 5341292..4c7d607 100644 --- a/content/browser/fileapi/blob_url_request_job_unittest.cc +++ b/content/browser/fileapi/blob_url_request_job_unittest.cc @@ -61,7 +61,7 @@ class BlobURLRequestJobTest : public testing::Test { MockProtocolHandler(BlobURLRequestJobTest* test) : test_(test) {} // net::URLRequestJobFactory::ProtocolHandler override. - virtual net::URLRequestJob* MaybeCreateJob( + net::URLRequestJob* MaybeCreateJob( net::URLRequest* request, net::NetworkDelegate* network_delegate) const override { return new BlobURLRequestJob(request, diff --git a/content/browser/fileapi/chrome_blob_storage_context.cc b/content/browser/fileapi/chrome_blob_storage_context.cc index 7c59ed4..f085242 100644 --- a/content/browser/fileapi/chrome_blob_storage_context.cc +++ b/content/browser/fileapi/chrome_blob_storage_context.cc @@ -27,11 +27,9 @@ class BlobHandleImpl : public BlobHandle { : handle_(handle.Pass()) { } - virtual ~BlobHandleImpl() {} + ~BlobHandleImpl() override {} - virtual std::string GetUUID() override { - return handle_->uuid(); - } + std::string GetUUID() override { return handle_->uuid(); } private: scoped_ptr<storage::BlobDataHandle> handle_; diff --git a/content/browser/fileapi/copy_or_move_file_validator_unittest.cc b/content/browser/fileapi/copy_or_move_file_validator_unittest.cc index f416462..ea2ba89 100644 --- a/content/browser/fileapi/copy_or_move_file_validator_unittest.cc +++ b/content/browser/fileapi/copy_or_move_file_validator_unittest.cc @@ -197,9 +197,9 @@ class TestCopyOrMoveFileValidatorFactory // TODO(gbillock): switch args to enum or something explicit TestCopyOrMoveFileValidatorFactory(Validity validity) : validity_(validity) {} - virtual ~TestCopyOrMoveFileValidatorFactory() {} + ~TestCopyOrMoveFileValidatorFactory() override {} - virtual storage::CopyOrMoveFileValidator* CreateCopyOrMoveFileValidator( + storage::CopyOrMoveFileValidator* CreateCopyOrMoveFileValidator( const FileSystemURL& /*src_url*/, const base::FilePath& /*platform_path*/) override { return new TestCopyOrMoveFileValidator(validity_); @@ -216,16 +216,16 @@ class TestCopyOrMoveFileValidatorFactory base::File::FILE_OK : base::File::FILE_ERROR_SECURITY) { } - virtual ~TestCopyOrMoveFileValidator() {} + ~TestCopyOrMoveFileValidator() override {} - virtual void StartPreWriteValidation( + void StartPreWriteValidation( const ResultCallback& result_callback) override { // Post the result since a real validator must do work asynchronously. base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(result_callback, result_)); } - virtual void StartPostWriteValidation( + void StartPostWriteValidation( const base::FilePath& dest_platform_path, const ResultCallback& result_callback) override { // Post the result since a real validator must do work asynchronously. diff --git a/content/browser/fileapi/copy_or_move_operation_delegate_unittest.cc b/content/browser/fileapi/copy_or_move_operation_delegate_unittest.cc index 2cb9911..a50d4a0 100644 --- a/content/browser/fileapi/copy_or_move_operation_delegate_unittest.cc +++ b/content/browser/fileapi/copy_or_move_operation_delegate_unittest.cc @@ -52,9 +52,9 @@ class TestValidatorFactory : public storage::CopyOrMoveFileValidatorFactory { public: // A factory that creates validators that accept everything or nothing. TestValidatorFactory() {} - virtual ~TestValidatorFactory() {} + ~TestValidatorFactory() override {} - virtual storage::CopyOrMoveFileValidator* CreateCopyOrMoveFileValidator( + storage::CopyOrMoveFileValidator* CreateCopyOrMoveFileValidator( const FileSystemURL& /*src_url*/, const base::FilePath& /*platform_path*/) override { // Move arg management to TestValidator? @@ -73,16 +73,16 @@ class TestValidatorFactory : public storage::CopyOrMoveFileValidatorFactory { base::File::FILE_ERROR_SECURITY), reject_string_(reject_string) { } - virtual ~TestValidator() {} + ~TestValidator() override {} - virtual void StartPreWriteValidation( + void StartPreWriteValidation( const ResultCallback& result_callback) override { // Post the result since a real validator must do work asynchronously. base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(result_callback, result_)); } - virtual void StartPostWriteValidation( + void StartPostWriteValidation( const base::FilePath& dest_platform_path, const ResultCallback& result_callback) override { base::File::Error result = write_result_; diff --git a/content/browser/fileapi/file_system_browsertest.cc b/content/browser/fileapi/file_system_browsertest.cc index dac5eff..804f04e 100644 --- a/content/browser/fileapi/file_system_browsertest.cc +++ b/content/browser/fileapi/file_system_browsertest.cc @@ -51,7 +51,7 @@ class FileSystemBrowserTest : public ContentBrowserTest { class FileSystemBrowserTestWithLowQuota : public FileSystemBrowserTest { public: - virtual void SetUpOnMainThread() override { + void SetUpOnMainThread() override { const int kInitialQuotaKilobytes = 5000; const int kTemporaryStorageQuotaMaxSize = kInitialQuotaKilobytes * 1024 * QuotaManager::kPerHostTemporaryPortion; diff --git a/content/browser/fileapi/file_system_dir_url_request_job_unittest.cc b/content/browser/fileapi/file_system_dir_url_request_job_unittest.cc index 356988a..d2a6abc 100644 --- a/content/browser/fileapi/file_system_dir_url_request_job_unittest.cc +++ b/content/browser/fileapi/file_system_dir_url_request_job_unittest.cc @@ -80,7 +80,7 @@ class FileSystemDirURLRequestJobFactory : public net::URLRequestJobFactory { : storage_domain_(storage_domain), file_system_context_(context) { } - virtual net::URLRequestJob* MaybeCreateJobWithProtocolHandler( + net::URLRequestJob* MaybeCreateJobWithProtocolHandler( const std::string& scheme, net::URLRequest* request, net::NetworkDelegate* network_delegate) const override { @@ -88,15 +88,13 @@ class FileSystemDirURLRequestJobFactory : public net::URLRequestJobFactory { request, network_delegate, storage_domain_, file_system_context_); } - virtual bool IsHandledProtocol(const std::string& scheme) const override { + bool IsHandledProtocol(const std::string& scheme) const override { return true; } - virtual bool IsHandledURL(const GURL& url) const override { - return true; - } + bool IsHandledURL(const GURL& url) const override { return true; } - virtual bool IsSafeRedirectTarget(const GURL& location) const override { + bool IsSafeRedirectTarget(const GURL& location) const override { return false; } diff --git a/content/browser/fileapi/file_system_url_request_job_unittest.cc b/content/browser/fileapi/file_system_url_request_job_unittest.cc index 19f5614..5f8c0cd 100644 --- a/content/browser/fileapi/file_system_url_request_job_unittest.cc +++ b/content/browser/fileapi/file_system_url_request_job_unittest.cc @@ -89,7 +89,7 @@ class FileSystemURLRequestJobFactory : public net::URLRequestJobFactory { : storage_domain_(storage_domain), file_system_context_(context) { } - virtual net::URLRequestJob* MaybeCreateJobWithProtocolHandler( + net::URLRequestJob* MaybeCreateJobWithProtocolHandler( const std::string& scheme, net::URLRequest* request, net::NetworkDelegate* network_delegate) const override { @@ -97,15 +97,13 @@ class FileSystemURLRequestJobFactory : public net::URLRequestJobFactory { request, network_delegate, storage_domain_, file_system_context_); } - virtual bool IsHandledProtocol(const std::string& scheme) const override { + bool IsHandledProtocol(const std::string& scheme) const override { return true; } - virtual bool IsHandledURL(const GURL& url) const override { - return true; - } + bool IsHandledURL(const GURL& url) const override { return true; } - virtual bool IsSafeRedirectTarget(const GURL& location) const override { + bool IsSafeRedirectTarget(const GURL& location) const override { return false; } diff --git a/content/browser/fileapi/file_writer_delegate_unittest.cc b/content/browser/fileapi/file_writer_delegate_unittest.cc index af4dd3b..12e288c 100644 --- a/content/browser/fileapi/file_writer_delegate_unittest.cc +++ b/content/browser/fileapi/file_writer_delegate_unittest.cc @@ -175,15 +175,13 @@ class FileWriterDelegateTestJob : public net::URLRequestJob { cursor_(0) { } - virtual void Start() override { + void Start() override { base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&FileWriterDelegateTestJob::NotifyHeadersComplete, this)); } - virtual bool ReadRawData(net::IOBuffer* buf, - int buf_size, - int *bytes_read) override { + bool ReadRawData(net::IOBuffer* buf, int buf_size, int* bytes_read) override { if (remaining_bytes_ < buf_size) buf_size = static_cast<int>(remaining_bytes_); @@ -196,12 +194,10 @@ class FileWriterDelegateTestJob : public net::URLRequestJob { return true; } - virtual int GetResponseCode() const override { - return 200; - } + int GetResponseCode() const override { return 200; } protected: - virtual ~FileWriterDelegateTestJob() {} + ~FileWriterDelegateTestJob() override {} private: std::string content_; @@ -215,7 +211,7 @@ class BlobURLRequestJobFactory : public net::URLRequestJobFactory { : content_data_(content_data) { } - virtual net::URLRequestJob* MaybeCreateJobWithProtocolHandler( + net::URLRequestJob* MaybeCreateJobWithProtocolHandler( const std::string& scheme, net::URLRequest* request, net::NetworkDelegate* network_delegate) const override { @@ -223,15 +219,15 @@ class BlobURLRequestJobFactory : public net::URLRequestJobFactory { request, network_delegate, *content_data_); } - virtual bool IsHandledProtocol(const std::string& scheme) const override { + bool IsHandledProtocol(const std::string& scheme) const override { return scheme == "blob"; } - virtual bool IsHandledURL(const GURL& url) const override { + bool IsHandledURL(const GURL& url) const override { return url.SchemeIs("blob"); } - virtual bool IsSafeRedirectTarget(const GURL& location) const override { + bool IsSafeRedirectTarget(const GURL& location) const override { return true; } diff --git a/content/browser/fileapi/fileapi_message_filter.h b/content/browser/fileapi/fileapi_message_filter.h index 2506eed..297213d 100644 --- a/content/browser/fileapi/fileapi_message_filter.h +++ b/content/browser/fileapi/fileapi_message_filter.h @@ -73,16 +73,16 @@ class CONTENT_EXPORT FileAPIMessageFilter : public BrowserMessageFilter { StreamContext* stream_context); // BrowserMessageFilter implementation. - virtual void OnChannelConnected(int32 peer_pid) override; - virtual void OnChannelClosing() override; - virtual base::TaskRunner* OverrideTaskRunnerForMessage( + void OnChannelConnected(int32 peer_pid) override; + void OnChannelClosing() override; + base::TaskRunner* OverrideTaskRunnerForMessage( const IPC::Message& message) override; - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; protected: - virtual ~FileAPIMessageFilter(); + ~FileAPIMessageFilter() override; - virtual void BadMessageReceived() override; + void BadMessageReceived() override; private: typedef storage::FileSystemOperationRunner::OperationID OperationID; diff --git a/content/browser/fileapi/mock_file_change_observer.h b/content/browser/fileapi/mock_file_change_observer.h index db110ac..3465a7a 100644 --- a/content/browser/fileapi/mock_file_change_observer.h +++ b/content/browser/fileapi/mock_file_change_observer.h @@ -17,19 +17,19 @@ namespace storage { class MockFileChangeObserver : public FileChangeObserver { public: MockFileChangeObserver(); - virtual ~MockFileChangeObserver(); + ~MockFileChangeObserver() override; // Creates a ChangeObserverList which only contains given |observer|. static ChangeObserverList CreateList(MockFileChangeObserver* observer); // FileChangeObserver overrides. - virtual void OnCreateFile(const FileSystemURL& url) override; - virtual void OnCreateFileFrom(const FileSystemURL& url, - const FileSystemURL& src) override; - virtual void OnRemoveFile(const FileSystemURL& url) override; - virtual void OnModifyFile(const FileSystemURL& url) override; - virtual void OnCreateDirectory(const FileSystemURL& url) override; - virtual void OnRemoveDirectory(const FileSystemURL& url) override; + void OnCreateFile(const FileSystemURL& url) override; + void OnCreateFileFrom(const FileSystemURL& url, + const FileSystemURL& src) override; + void OnRemoveFile(const FileSystemURL& url) override; + void OnModifyFile(const FileSystemURL& url) override; + void OnCreateDirectory(const FileSystemURL& url) override; + void OnRemoveDirectory(const FileSystemURL& url) override; void ResetCount() { create_file_count_ = 0; diff --git a/content/browser/fileapi/mock_file_update_observer.h b/content/browser/fileapi/mock_file_update_observer.h index b01c6c9..78aef9f 100644 --- a/content/browser/fileapi/mock_file_update_observer.h +++ b/content/browser/fileapi/mock_file_update_observer.h @@ -19,15 +19,15 @@ namespace storage { class MockFileUpdateObserver : public FileUpdateObserver { public: MockFileUpdateObserver(); - virtual ~MockFileUpdateObserver(); + ~MockFileUpdateObserver() override; // Creates a ChangeObserverList which only contains given |observer|. static UpdateObserverList CreateList(MockFileUpdateObserver* observer); // FileUpdateObserver overrides. - virtual void OnStartUpdate(const FileSystemURL& url) override; - virtual void OnUpdate(const FileSystemURL& url, int64 delta) override; - virtual void OnEndUpdate(const FileSystemURL& url) override; + void OnStartUpdate(const FileSystemURL& url) override; + void OnUpdate(const FileSystemURL& url, int64 delta) override; + void OnEndUpdate(const FileSystemURL& url) override; void Enable() { is_ready_ = true; } diff --git a/content/browser/fileapi/mock_url_request_delegate.h b/content/browser/fileapi/mock_url_request_delegate.h index ef301ae..a628f6e 100644 --- a/content/browser/fileapi/mock_url_request_delegate.h +++ b/content/browser/fileapi/mock_url_request_delegate.h @@ -17,11 +17,10 @@ namespace content { class MockURLRequestDelegate : public net::URLRequest::Delegate { public: MockURLRequestDelegate(); - virtual ~MockURLRequestDelegate(); + ~MockURLRequestDelegate() override; - virtual void OnResponseStarted(net::URLRequest* request) override; - virtual void OnReadCompleted(net::URLRequest* request, - int bytes_read) override; + void OnResponseStarted(net::URLRequest* request) override; + void OnReadCompleted(net::URLRequest* request, int bytes_read) override; const std::string& response_data() const { return response_data_; } private: diff --git a/content/browser/fileapi/recursive_operation_delegate_unittest.cc b/content/browser/fileapi/recursive_operation_delegate_unittest.cc index 58e935e..f57722f 100644 --- a/content/browser/fileapi/recursive_operation_delegate_unittest.cc +++ b/content/browser/fileapi/recursive_operation_delegate_unittest.cc @@ -45,21 +45,17 @@ class LoggingRecursiveOperation : public storage::RecursiveOperationDelegate { root_(root), callback_(callback), weak_factory_(this) {} - virtual ~LoggingRecursiveOperation() {} + ~LoggingRecursiveOperation() override {} const std::vector<LogEntry>& log_entries() const { return log_entries_; } // RecursiveOperationDelegate overrides. - virtual void Run() override { - NOTREACHED(); - } + void Run() override { NOTREACHED(); } - virtual void RunRecursively() override { - StartRecursiveOperation(root_, callback_); - } + void RunRecursively() override { StartRecursiveOperation(root_, callback_); } - virtual void ProcessFile(const FileSystemURL& url, - const StatusCallback& callback) override { + void ProcessFile(const FileSystemURL& url, + const StatusCallback& callback) override { RecordLogEntry(LogEntry::PROCESS_FILE, url); operation_runner()->GetMetadata( url, @@ -67,14 +63,14 @@ class LoggingRecursiveOperation : public storage::RecursiveOperationDelegate { weak_factory_.GetWeakPtr(), callback)); } - virtual void ProcessDirectory(const FileSystemURL& url, - const StatusCallback& callback) override { + void ProcessDirectory(const FileSystemURL& url, + const StatusCallback& callback) override { RecordLogEntry(LogEntry::PROCESS_DIRECTORY, url); callback.Run(base::File::FILE_OK); } - virtual void PostProcessDirectory(const FileSystemURL& url, - const StatusCallback& callback) override { + void PostProcessDirectory(const FileSystemURL& url, + const StatusCallback& callback) override { RecordLogEntry(LogEntry::POST_PROCESS_DIRECTORY, url); callback.Run(base::File::FILE_OK); } diff --git a/content/browser/fileapi/upload_file_system_file_element_reader.h b/content/browser/fileapi/upload_file_system_file_element_reader.h index 806473e..bc2a6f7 100644 --- a/content/browser/fileapi/upload_file_system_file_element_reader.h +++ b/content/browser/fileapi/upload_file_system_file_element_reader.h @@ -31,15 +31,15 @@ class CONTENT_EXPORT UploadFileSystemFileElementReader : uint64 range_offset, uint64 range_length, const base::Time& expected_modification_time); - virtual ~UploadFileSystemFileElementReader(); + ~UploadFileSystemFileElementReader() override; // UploadElementReader overrides: - virtual int Init(const net::CompletionCallback& callback) override; - virtual uint64 GetContentLength() const override; - virtual uint64 BytesRemaining() const override; - virtual int Read(net::IOBuffer* buf, - int buf_length, - const net::CompletionCallback& callback) override; + int Init(const net::CompletionCallback& callback) override; + uint64 GetContentLength() const override; + uint64 BytesRemaining() const override; + int Read(net::IOBuffer* buf, + int buf_length, + const net::CompletionCallback& callback) override; private: void OnGetLength(const net::CompletionCallback& callback, int64 result); diff --git a/content/browser/frame_host/frame_tree_browsertest.cc b/content/browser/frame_host/frame_tree_browsertest.cc index 6e953e4..9f16066 100644 --- a/content/browser/frame_host/frame_tree_browsertest.cc +++ b/content/browser/frame_host/frame_tree_browsertest.cc @@ -203,7 +203,7 @@ class CrossProcessFrameTreeBrowserTest : public ContentBrowserTest { public: CrossProcessFrameTreeBrowserTest() {} - virtual void SetUpCommandLine(base::CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(switches::kSitePerProcess); } diff --git a/content/browser/frame_host/frame_tree_unittest.cc b/content/browser/frame_host/frame_tree_unittest.cc index b4d41b2..bb705c7 100644 --- a/content/browser/frame_host/frame_tree_unittest.cc +++ b/content/browser/frame_host/frame_tree_unittest.cc @@ -51,7 +51,7 @@ class TreeWalkingWebContentsLogger : public WebContentsObserver { explicit TreeWalkingWebContentsLogger(WebContents* web_contents) : WebContentsObserver(web_contents) {} - virtual ~TreeWalkingWebContentsLogger() { + ~TreeWalkingWebContentsLogger() override { EXPECT_EQ("", log_) << "Activity logged that was not expected"; } @@ -63,22 +63,22 @@ class TreeWalkingWebContentsLogger : public WebContentsObserver { } // content::WebContentsObserver implementation. - virtual void RenderFrameCreated(RenderFrameHost* render_frame_host) override { + void RenderFrameCreated(RenderFrameHost* render_frame_host) override { LogWhatHappened("RenderFrameCreated", render_frame_host); } - virtual void RenderFrameHostChanged(RenderFrameHost* old_host, - RenderFrameHost* new_host) override { + void RenderFrameHostChanged(RenderFrameHost* old_host, + RenderFrameHost* new_host) override { if (old_host) LogWhatHappened("RenderFrameChanged(old)", old_host); LogWhatHappened("RenderFrameChanged(new)", new_host); } - virtual void RenderFrameDeleted(RenderFrameHost* render_frame_host) override { + void RenderFrameDeleted(RenderFrameHost* render_frame_host) override { LogWhatHappened("RenderFrameDeleted", render_frame_host); } - virtual void RenderProcessGone(base::TerminationStatus status) override { + void RenderProcessGone(base::TerminationStatus status) override { LogWhatHappened("RenderProcessGone"); } diff --git a/content/browser/frame_host/interstitial_page_impl.cc b/content/browser/frame_host/interstitial_page_impl.cc index 6899d42..a588132 100644 --- a/content/browser/frame_host/interstitial_page_impl.cc +++ b/content/browser/frame_host/interstitial_page_impl.cc @@ -78,24 +78,24 @@ class InterstitialPageImpl::InterstitialPageRVHDelegateView // RenderViewHostDelegateView implementation: #if defined(OS_MACOSX) || defined(OS_ANDROID) - virtual void ShowPopupMenu(RenderFrameHost* render_frame_host, - const gfx::Rect& bounds, - int item_height, - double item_font_size, - int selected_item, - const std::vector<MenuItem>& items, - bool right_aligned, - bool allow_multiple_selection) override; - virtual void HidePopupMenu() override; + void ShowPopupMenu(RenderFrameHost* render_frame_host, + const gfx::Rect& bounds, + int item_height, + double item_font_size, + int selected_item, + const std::vector<MenuItem>& items, + bool right_aligned, + bool allow_multiple_selection) override; + void HidePopupMenu() override; #endif - virtual void StartDragging(const DropData& drop_data, - WebDragOperationsMask operations_allowed, - const gfx::ImageSkia& image, - const gfx::Vector2d& image_offset, - const DragEventSourceInfo& event_info) override; - virtual void UpdateDragCursor(WebDragOperation operation) override; - virtual void GotFocus() override; - virtual void TakeFocus(bool reverse) override; + void StartDragging(const DropData& drop_data, + WebDragOperationsMask operations_allowed, + const gfx::ImageSkia& image, + const gfx::Vector2d& image_offset, + const DragEventSourceInfo& event_info) override; + void UpdateDragCursor(WebDragOperation operation) override; + void GotFocus() override; + void TakeFocus(bool reverse) override; virtual void OnFindReply(int request_id, int number_of_matches, const gfx::Rect& selection_rect, diff --git a/content/browser/frame_host/interstitial_page_impl.h b/content/browser/frame_host/interstitial_page_impl.h index 35cd2d5..b1dd303 100644 --- a/content/browser/frame_host/interstitial_page_impl.h +++ b/content/browser/frame_host/interstitial_page_impl.h @@ -55,18 +55,18 @@ class CONTENT_EXPORT InterstitialPageImpl bool new_navigation, const GURL& url, InterstitialPageDelegate* delegate); - virtual ~InterstitialPageImpl(); + ~InterstitialPageImpl() override; // InterstitialPage implementation: - virtual void Show() override; - virtual void Hide() override; - virtual void DontProceed() override; - virtual void Proceed() override; - virtual RenderViewHost* GetRenderViewHostForTesting() const override; - virtual InterstitialPageDelegate* GetDelegateForTesting() override; - virtual void DontCreateViewForTesting() override; - virtual void SetSize(const gfx::Size& size) override; - virtual void Focus() override; + void Show() override; + void Hide() override; + void DontProceed() override; + void Proceed() override; + RenderViewHost* GetRenderViewHostForTesting() const override; + InterstitialPageDelegate* GetDelegateForTesting() override; + void DontCreateViewForTesting() override; + void SetSize(const gfx::Size& size) override; + void Focus() override; // Allows the user to navigate away by disabling the interstitial, canceling // the pending request, and unblocking the hidden renderer. The interstitial @@ -99,72 +99,67 @@ class CONTENT_EXPORT InterstitialPageImpl protected: // NotificationObserver method: - virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) override; + void Observe(int type, + const NotificationSource& source, + const NotificationDetails& details) override; // WebContentsObserver implementation: - virtual bool OnMessageReceived(const IPC::Message& message, - RenderFrameHost* render_frame_host) override; - virtual bool OnMessageReceived(const IPC::Message& message) override; - virtual void WebContentsDestroyed() override; - virtual void NavigationEntryCommitted( + bool OnMessageReceived(const IPC::Message& message, + RenderFrameHost* render_frame_host) override; + bool OnMessageReceived(const IPC::Message& message) override; + void WebContentsDestroyed() override; + void NavigationEntryCommitted( const LoadCommittedDetails& load_details) override; // RenderFrameHostDelegate implementation: - virtual bool OnMessageReceived(RenderFrameHost* render_frame_host, - const IPC::Message& message) override; - virtual void RenderFrameCreated(RenderFrameHost* render_frame_host) override; - virtual void UpdateTitle(RenderFrameHost* render_frame_host, - int32 page_id, - const base::string16& title, - base::i18n::TextDirection title_direction) override; - virtual AccessibilityMode GetAccessibilityMode() const override; + bool OnMessageReceived(RenderFrameHost* render_frame_host, + const IPC::Message& message) override; + void RenderFrameCreated(RenderFrameHost* render_frame_host) override; + void UpdateTitle(RenderFrameHost* render_frame_host, + int32 page_id, + const base::string16& title, + base::i18n::TextDirection title_direction) override; + AccessibilityMode GetAccessibilityMode() const override; // RenderViewHostDelegate implementation: - virtual RenderViewHostDelegateView* GetDelegateView() override; - virtual bool OnMessageReceived(RenderViewHost* render_view_host, - const IPC::Message& message) override; - virtual const GURL& GetMainFrameLastCommittedURL() const override; - virtual void RenderViewTerminated(RenderViewHost* render_view_host, - base::TerminationStatus status, - int error_code) override; - virtual RendererPreferences GetRendererPrefs( + RenderViewHostDelegateView* GetDelegateView() override; + bool OnMessageReceived(RenderViewHost* render_view_host, + const IPC::Message& message) override; + const GURL& GetMainFrameLastCommittedURL() const override; + void RenderViewTerminated(RenderViewHost* render_view_host, + base::TerminationStatus status, + int error_code) override; + RendererPreferences GetRendererPrefs( BrowserContext* browser_context) const override; - virtual WebPreferences ComputeWebkitPrefs() override; - virtual gfx::Rect GetRootWindowResizerRect() const override; - virtual void CreateNewWindow( + WebPreferences ComputeWebkitPrefs() override; + gfx::Rect GetRootWindowResizerRect() const override; + void CreateNewWindow( int render_process_id, int route_id, int main_frame_route_id, const ViewHostMsg_CreateWindow_Params& params, SessionStorageNamespace* session_storage_namespace) override; - virtual void CreateNewWidget(int render_process_id, - int route_id, - blink::WebPopupType popup_type) override; - virtual void CreateNewFullscreenWidget(int render_process_id, - int route_id) override; - virtual void ShowCreatedWindow(int route_id, - WindowOpenDisposition disposition, - const gfx::Rect& initial_pos, - bool user_gesture) override; - virtual void ShowCreatedWidget(int route_id, - const gfx::Rect& initial_pos) override; - virtual void ShowCreatedFullscreenWidget(int route_id) override; - - virtual SessionStorageNamespace* GetSessionStorageNamespace( + void CreateNewWidget(int render_process_id, + int route_id, + blink::WebPopupType popup_type) override; + void CreateNewFullscreenWidget(int render_process_id, int route_id) override; + void ShowCreatedWindow(int route_id, + WindowOpenDisposition disposition, + const gfx::Rect& initial_pos, + bool user_gesture) override; + void ShowCreatedWidget(int route_id, const gfx::Rect& initial_pos) override; + void ShowCreatedFullscreenWidget(int route_id) override; + + SessionStorageNamespace* GetSessionStorageNamespace( SiteInstance* instance) override; - virtual FrameTree* GetFrameTree() override; + FrameTree* GetFrameTree() override; // RenderWidgetHostDelegate implementation: - virtual void RenderWidgetDeleted( - RenderWidgetHostImpl* render_widget_host) override; - virtual bool PreHandleKeyboardEvent( - const NativeWebKeyboardEvent& event, - bool* is_keyboard_shortcut) override; - virtual void HandleKeyboardEvent( - const NativeWebKeyboardEvent& event) override; + void RenderWidgetDeleted(RenderWidgetHostImpl* render_widget_host) override; + bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, + bool* is_keyboard_shortcut) override; + void HandleKeyboardEvent(const NativeWebKeyboardEvent& event) override; #if defined(OS_WIN) virtual gfx::NativeViewAccessible GetParentNativeViewAccessible() override; #endif diff --git a/content/browser/frame_host/interstitial_page_navigator_impl.h b/content/browser/frame_host/interstitial_page_navigator_impl.h index bc06494..2f96614 100644 --- a/content/browser/frame_host/interstitial_page_navigator_impl.h +++ b/content/browser/frame_host/interstitial_page_navigator_impl.h @@ -22,14 +22,13 @@ class CONTENT_EXPORT InterstitialPageNavigatorImpl : public Navigator { InterstitialPageImpl* interstitial, NavigationControllerImpl* navigation_controller); - virtual NavigationController* GetController() override; - virtual void DidNavigate( - RenderFrameHostImpl* render_frame_host, - const FrameHostMsg_DidCommitProvisionalLoad_Params& - input_params) override; + NavigationController* GetController() override; + void DidNavigate(RenderFrameHostImpl* render_frame_host, + const FrameHostMsg_DidCommitProvisionalLoad_Params& + input_params) override; private: - virtual ~InterstitialPageNavigatorImpl() {} + ~InterstitialPageNavigatorImpl() override {} // The InterstitialPage with which this navigator object is associated. // Non owned pointer. diff --git a/content/browser/frame_host/navigation_controller_impl.h b/content/browser/frame_host/navigation_controller_impl.h index 8a730da..a646646 100644 --- a/content/browser/frame_host/navigation_controller_impl.h +++ b/content/browser/frame_host/navigation_controller_impl.h @@ -31,68 +31,63 @@ class CONTENT_EXPORT NavigationControllerImpl NavigationControllerImpl( NavigationControllerDelegate* delegate, BrowserContext* browser_context); - virtual ~NavigationControllerImpl(); + ~NavigationControllerImpl() override; // NavigationController implementation: - virtual WebContents* GetWebContents() const override; - virtual BrowserContext* GetBrowserContext() const override; - virtual void SetBrowserContext( - BrowserContext* browser_context) override; - virtual void Restore( - int selected_navigation, - RestoreType type, - std::vector<NavigationEntry*>* entries) override; - virtual NavigationEntry* GetActiveEntry() const override; - virtual NavigationEntry* GetVisibleEntry() const override; - virtual int GetCurrentEntryIndex() const override; - virtual NavigationEntry* GetLastCommittedEntry() const override; - virtual int GetLastCommittedEntryIndex() const override; - virtual bool CanViewSource() const override; - virtual int GetEntryCount() const override; - virtual NavigationEntry* GetEntryAtIndex(int index) const override; - virtual NavigationEntry* GetEntryAtOffset(int offset) const override; - virtual void DiscardNonCommittedEntries() override; - virtual NavigationEntry* GetPendingEntry() const override; - virtual int GetPendingEntryIndex() const override; - virtual NavigationEntry* GetTransientEntry() const override; - virtual void SetTransientEntry(NavigationEntry* entry) override; - virtual void LoadURL(const GURL& url, - const Referrer& referrer, - ui::PageTransition type, - const std::string& extra_headers) override; - virtual void LoadURLWithParams(const LoadURLParams& params) override; - virtual void LoadIfNecessary() override; - virtual bool CanGoBack() const override; - virtual bool CanGoForward() const override; - virtual bool CanGoToOffset(int offset) const override; - virtual void GoBack() override; - virtual void GoForward() override; - virtual void GoToIndex(int index) override; - virtual void GoToOffset(int offset) override; - virtual bool RemoveEntryAtIndex(int index) override; - virtual const SessionStorageNamespaceMap& - GetSessionStorageNamespaceMap() const override; - virtual SessionStorageNamespace* - GetDefaultSessionStorageNamespace() override; - virtual void SetMaxRestoredPageID(int32 max_id) override; - virtual int32 GetMaxRestoredPageID() const override; - virtual bool NeedsReload() const override; - virtual void SetNeedsReload() override; - virtual void CancelPendingReload() override; - virtual void ContinuePendingReload() override; - virtual bool IsInitialNavigation() const override; - virtual void Reload(bool check_for_repost) override; - virtual void ReloadIgnoringCache(bool check_for_repost) override; - virtual void ReloadOriginalRequestURL(bool check_for_repost) override; - virtual void NotifyEntryChanged(const NavigationEntry* entry, - int index) override; - virtual void CopyStateFrom( - const NavigationController& source) override; - virtual void CopyStateFromAndPrune(NavigationController* source, - bool replace_entry) override; - virtual bool CanPruneAllButLastCommitted() override; - virtual void PruneAllButLastCommitted() override; - virtual void ClearAllScreenshots() override; + WebContents* GetWebContents() const override; + BrowserContext* GetBrowserContext() const override; + void SetBrowserContext(BrowserContext* browser_context) override; + void Restore(int selected_navigation, + RestoreType type, + std::vector<NavigationEntry*>* entries) override; + NavigationEntry* GetActiveEntry() const override; + NavigationEntry* GetVisibleEntry() const override; + int GetCurrentEntryIndex() const override; + NavigationEntry* GetLastCommittedEntry() const override; + int GetLastCommittedEntryIndex() const override; + bool CanViewSource() const override; + int GetEntryCount() const override; + NavigationEntry* GetEntryAtIndex(int index) const override; + NavigationEntry* GetEntryAtOffset(int offset) const override; + void DiscardNonCommittedEntries() override; + NavigationEntry* GetPendingEntry() const override; + int GetPendingEntryIndex() const override; + NavigationEntry* GetTransientEntry() const override; + void SetTransientEntry(NavigationEntry* entry) override; + void LoadURL(const GURL& url, + const Referrer& referrer, + ui::PageTransition type, + const std::string& extra_headers) override; + void LoadURLWithParams(const LoadURLParams& params) override; + void LoadIfNecessary() override; + bool CanGoBack() const override; + bool CanGoForward() const override; + bool CanGoToOffset(int offset) const override; + void GoBack() override; + void GoForward() override; + void GoToIndex(int index) override; + void GoToOffset(int offset) override; + bool RemoveEntryAtIndex(int index) override; + const SessionStorageNamespaceMap& GetSessionStorageNamespaceMap() + const override; + SessionStorageNamespace* GetDefaultSessionStorageNamespace() override; + void SetMaxRestoredPageID(int32 max_id) override; + int32 GetMaxRestoredPageID() const override; + bool NeedsReload() const override; + void SetNeedsReload() override; + void CancelPendingReload() override; + void ContinuePendingReload() override; + bool IsInitialNavigation() const override; + void Reload(bool check_for_repost) override; + void ReloadIgnoringCache(bool check_for_repost) override; + void ReloadOriginalRequestURL(bool check_for_repost) override; + void NotifyEntryChanged(const NavigationEntry* entry, int index) override; + void CopyStateFrom(const NavigationController& source) override; + void CopyStateFromAndPrune(NavigationController* source, + bool replace_entry) override; + bool CanPruneAllButLastCommitted() override; + void PruneAllButLastCommitted() override; + void ClearAllScreenshots() override; // Whether this is the initial navigation in an unmodified new tab. In this // case, we know there is no content displayed in the page. diff --git a/content/browser/frame_host/navigation_controller_impl_unittest.cc b/content/browser/frame_host/navigation_controller_impl_unittest.cc index 621ab24..a1d14ca 100644 --- a/content/browser/frame_host/navigation_controller_impl_unittest.cc +++ b/content/browser/frame_host/navigation_controller_impl_unittest.cc @@ -74,8 +74,7 @@ class MockScreenshotManager : public content::NavigationEntryScreenshotManager { encoding_screenshot_in_progress_(false) { } - virtual ~MockScreenshotManager() { - } + ~MockScreenshotManager() override {} void TakeScreenshotFor(content::NavigationEntryImpl* entry) { SkBitmap bitmap; @@ -100,12 +99,10 @@ class MockScreenshotManager : public content::NavigationEntryScreenshotManager { private: // Overridden from content::NavigationEntryScreenshotManager: - virtual void TakeScreenshotImpl( - content::RenderViewHost* host, - content::NavigationEntryImpl* entry) override { - } + void TakeScreenshotImpl(content::RenderViewHost* host, + content::NavigationEntryImpl* entry) override {} - virtual void OnScreenshotSet(content::NavigationEntryImpl* entry) override { + void OnScreenshotSet(content::NavigationEntryImpl* entry) override { encoding_screenshot_in_progress_ = false; NavigationEntryScreenshotManager::OnScreenshotSet(entry); if (message_loop_runner_.get()) @@ -196,13 +193,13 @@ class NavigationControllerTest } // WebContentsObserver: - virtual void DidStartNavigationToPendingEntry( + void DidStartNavigationToPendingEntry( const GURL& url, NavigationController::ReloadType reload_type) override { navigated_url_ = url; } - virtual void NavigationEntryCommitted( + void NavigationEntryCommitted( const LoadCommittedDetails& load_details) override { navigation_entry_committed_counter_++; } @@ -247,12 +244,12 @@ class TestWebContentsDelegate : public WebContentsDelegate { } // Keep track of whether the tab has notified us of a navigation state change. - virtual void NavigationStateChanged(const WebContents* source, - InvalidateTypes changed_flags) override { + void NavigationStateChanged(const WebContents* source, + InvalidateTypes changed_flags) override { navigation_state_change_count_++; } - virtual void ShowRepostFormWarningDialog(WebContents* source) override { + void ShowRepostFormWarningDialog(WebContents* source) override { repost_form_warning_count_++; } @@ -2292,9 +2289,9 @@ class PrunedListener : public NotificationObserver { Source<NavigationController>(controller)); } - virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) override { + void Observe(int type, + const NotificationSource& source, + const NotificationDetails& details) override { if (type == NOTIFICATION_NAV_LIST_PRUNED) { notification_count_++; details_ = *(Details<PrunedDetails>(details).ptr()); diff --git a/content/browser/frame_host/navigation_entry_impl.h b/content/browser/frame_host/navigation_entry_impl.h index 4e38954..37de182 100644 --- a/content/browser/frame_host/navigation_entry_impl.h +++ b/content/browser/frame_host/navigation_entry_impl.h @@ -32,63 +32,61 @@ class CONTENT_EXPORT NavigationEntryImpl const base::string16& title, ui::PageTransition transition_type, bool is_renderer_initiated); - virtual ~NavigationEntryImpl(); + ~NavigationEntryImpl() override; // NavigationEntry implementation: - virtual int GetUniqueID() const override; - virtual PageType GetPageType() const override; - virtual void SetURL(const GURL& url) override; - virtual const GURL& GetURL() const override; - virtual void SetBaseURLForDataURL(const GURL& url) override; - virtual const GURL& GetBaseURLForDataURL() const override; - virtual void SetReferrer(const Referrer& referrer) override; - virtual const Referrer& GetReferrer() const override; - virtual void SetVirtualURL(const GURL& url) override; - virtual const GURL& GetVirtualURL() const override; - virtual void SetTitle(const base::string16& title) override; - virtual const base::string16& GetTitle() const override; - virtual void SetPageState(const PageState& state) override; - virtual const PageState& GetPageState() const override; - virtual void SetPageID(int page_id) override; - virtual int32 GetPageID() const override; - virtual const base::string16& GetTitleForDisplay( + int GetUniqueID() const override; + PageType GetPageType() const override; + void SetURL(const GURL& url) override; + const GURL& GetURL() const override; + void SetBaseURLForDataURL(const GURL& url) override; + const GURL& GetBaseURLForDataURL() const override; + void SetReferrer(const Referrer& referrer) override; + const Referrer& GetReferrer() const override; + void SetVirtualURL(const GURL& url) override; + const GURL& GetVirtualURL() const override; + void SetTitle(const base::string16& title) override; + const base::string16& GetTitle() const override; + void SetPageState(const PageState& state) override; + const PageState& GetPageState() const override; + void SetPageID(int page_id) override; + int32 GetPageID() const override; + const base::string16& GetTitleForDisplay( const std::string& languages) const override; - virtual bool IsViewSourceMode() const override; - virtual void SetTransitionType(ui::PageTransition transition_type) override; - virtual ui::PageTransition GetTransitionType() const override; - virtual const GURL& GetUserTypedURL() const override; - virtual void SetHasPostData(bool has_post_data) override; - virtual bool GetHasPostData() const override; - virtual void SetPostID(int64 post_id) override; - virtual int64 GetPostID() const override; - virtual void SetBrowserInitiatedPostData( - const base::RefCountedMemory* data) override; - virtual const base::RefCountedMemory* - GetBrowserInitiatedPostData() const override; - virtual const FaviconStatus& GetFavicon() const override; - virtual FaviconStatus& GetFavicon() override; - virtual const SSLStatus& GetSSL() const override; - virtual SSLStatus& GetSSL() override; - virtual void SetOriginalRequestURL(const GURL& original_url) override; - virtual const GURL& GetOriginalRequestURL() const override; - virtual void SetIsOverridingUserAgent(bool override) override; - virtual bool GetIsOverridingUserAgent() const override; - virtual void SetTimestamp(base::Time timestamp) override; - virtual base::Time GetTimestamp() const override; - virtual void SetCanLoadLocalResources(bool allow) override; - virtual bool GetCanLoadLocalResources() const override; - virtual void SetFrameToNavigate(const std::string& frame_name) override; - virtual const std::string& GetFrameToNavigate() const override; - virtual void SetExtraData(const std::string& key, - const base::string16& data) override; - virtual bool GetExtraData(const std::string& key, - base::string16* data) const override; - virtual void ClearExtraData(const std::string& key) override; - virtual void SetHttpStatusCode(int http_status_code) override; - virtual int GetHttpStatusCode() const override; - virtual void SetRedirectChain(const std::vector<GURL>& redirects) override; - virtual const std::vector<GURL>& GetRedirectChain() const override; - virtual bool IsRestored() const override; + bool IsViewSourceMode() const override; + void SetTransitionType(ui::PageTransition transition_type) override; + ui::PageTransition GetTransitionType() const override; + const GURL& GetUserTypedURL() const override; + void SetHasPostData(bool has_post_data) override; + bool GetHasPostData() const override; + void SetPostID(int64 post_id) override; + int64 GetPostID() const override; + void SetBrowserInitiatedPostData(const base::RefCountedMemory* data) override; + const base::RefCountedMemory* GetBrowserInitiatedPostData() const override; + const FaviconStatus& GetFavicon() const override; + FaviconStatus& GetFavicon() override; + const SSLStatus& GetSSL() const override; + SSLStatus& GetSSL() override; + void SetOriginalRequestURL(const GURL& original_url) override; + const GURL& GetOriginalRequestURL() const override; + void SetIsOverridingUserAgent(bool override) override; + bool GetIsOverridingUserAgent() const override; + void SetTimestamp(base::Time timestamp) override; + base::Time GetTimestamp() const override; + void SetCanLoadLocalResources(bool allow) override; + bool GetCanLoadLocalResources() const override; + void SetFrameToNavigate(const std::string& frame_name) override; + const std::string& GetFrameToNavigate() const override; + void SetExtraData(const std::string& key, + const base::string16& data) override; + bool GetExtraData(const std::string& key, + base::string16* data) const override; + void ClearExtraData(const std::string& key) override; + void SetHttpStatusCode(int http_status_code) override; + int GetHttpStatusCode() const override; + void SetRedirectChain(const std::vector<GURL>& redirects) override; + const std::vector<GURL>& GetRedirectChain() const override; + bool IsRestored() const override; // Once a navigation entry is committed, we should no longer track several // pieces of non-persisted state, as documented on the members below. diff --git a/content/browser/frame_host/navigator_impl.h b/content/browser/frame_host/navigator_impl.h index e0cac3e..e142b3f 100644 --- a/content/browser/frame_host/navigator_impl.h +++ b/content/browser/frame_host/navigator_impl.h @@ -36,62 +36,58 @@ class CONTENT_EXPORT NavigatorImpl : public Navigator { NavigatorDelegate* delegate); // Navigator implementation. - virtual NavigationController* GetController() override; - virtual void DidStartProvisionalLoad(RenderFrameHostImpl* render_frame_host, - const GURL& url, - bool is_transition_navigation) override; - virtual void DidFailProvisionalLoadWithError( + NavigationController* GetController() override; + void DidStartProvisionalLoad(RenderFrameHostImpl* render_frame_host, + const GURL& url, + bool is_transition_navigation) override; + void DidFailProvisionalLoadWithError( RenderFrameHostImpl* render_frame_host, const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) override; - virtual void DidFailLoadWithError( - RenderFrameHostImpl* render_frame_host, - const GURL& url, - int error_code, - const base::string16& error_description) override; - virtual void DidNavigate( - RenderFrameHostImpl* render_frame_host, - const FrameHostMsg_DidCommitProvisionalLoad_Params& - input_params) override; - virtual bool NavigateToPendingEntry( + void DidFailLoadWithError(RenderFrameHostImpl* render_frame_host, + const GURL& url, + int error_code, + const base::string16& error_description) override; + void DidNavigate(RenderFrameHostImpl* render_frame_host, + const FrameHostMsg_DidCommitProvisionalLoad_Params& + input_params) override; + bool NavigateToPendingEntry( RenderFrameHostImpl* render_frame_host, NavigationController::ReloadType reload_type) override; - virtual void RequestOpenURL(RenderFrameHostImpl* render_frame_host, - const GURL& url, - const Referrer& referrer, - WindowOpenDisposition disposition, - bool should_replace_current_entry, - bool user_gesture) override; - virtual void RequestTransferURL( - RenderFrameHostImpl* render_frame_host, - const GURL& url, - const std::vector<GURL>& redirect_chain, - const Referrer& referrer, - ui::PageTransition page_transition, - WindowOpenDisposition disposition, - const GlobalRequestID& transferred_global_request_id, - bool should_replace_current_entry, - bool user_gesture) override; - virtual void OnBeginNavigation( - FrameTreeNode* frame_tree_node, - const FrameHostMsg_BeginNavigation_Params& params, - const CommonNavigationParams& common_params) override; - virtual void CommitNavigation(FrameTreeNode* frame_tree_node, - ResourceResponse* response, - scoped_ptr<StreamHandle> body) override; - virtual void LogResourceRequestTime( - base::TimeTicks timestamp, const GURL& url) override; - virtual void LogBeforeUnloadTime( + void RequestOpenURL(RenderFrameHostImpl* render_frame_host, + const GURL& url, + const Referrer& referrer, + WindowOpenDisposition disposition, + bool should_replace_current_entry, + bool user_gesture) override; + void RequestTransferURL(RenderFrameHostImpl* render_frame_host, + const GURL& url, + const std::vector<GURL>& redirect_chain, + const Referrer& referrer, + ui::PageTransition page_transition, + WindowOpenDisposition disposition, + const GlobalRequestID& transferred_global_request_id, + bool should_replace_current_entry, + bool user_gesture) override; + void OnBeginNavigation(FrameTreeNode* frame_tree_node, + const FrameHostMsg_BeginNavigation_Params& params, + const CommonNavigationParams& common_params) override; + void CommitNavigation(FrameTreeNode* frame_tree_node, + ResourceResponse* response, + scoped_ptr<StreamHandle> body) override; + void LogResourceRequestTime(base::TimeTicks timestamp, + const GURL& url) override; + void LogBeforeUnloadTime( const base::TimeTicks& renderer_before_unload_start_time, const base::TimeTicks& renderer_before_unload_end_time) override; - virtual void CancelNavigation(FrameTreeNode* frame_tree_node) override; + void CancelNavigation(FrameTreeNode* frame_tree_node) override; private: // Holds data used to track browser side navigation metrics. struct NavigationMetricsData; friend class NavigatorTest; - virtual ~NavigatorImpl(); + ~NavigatorImpl() override; // Navigates to the given entry, which must be the pending entry. Private // because all callers should use NavigateToPendingEntry. diff --git a/content/browser/frame_host/popup_menu_helper_mac.h b/content/browser/frame_host/popup_menu_helper_mac.h index 70000d6..e92aa10 100644 --- a/content/browser/frame_host/popup_menu_helper_mac.h +++ b/content/browser/frame_host/popup_menu_helper_mac.h @@ -50,9 +50,9 @@ class PopupMenuHelper : public NotificationObserver { virtual RenderWidgetHostViewMac* GetRenderWidgetHostView() const; // NotificationObserver implementation: - virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) override; + void Observe(int type, + const NotificationSource& source, + const NotificationDetails& details) override; NotificationRegistrar notification_registrar_; RenderFrameHostImpl* render_frame_host_; diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc index e4f174e..bd837fa 100644 --- a/content/browser/frame_host/render_frame_host_impl.cc +++ b/content/browser/frame_host/render_frame_host_impl.cc @@ -85,9 +85,9 @@ class DesktopNotificationDelegateImpl : public DesktopNotificationDelegate { render_frame_id_(render_frame_host->GetRoutingID()), notification_id_(notification_id) {} - virtual ~DesktopNotificationDelegateImpl() {} + ~DesktopNotificationDelegateImpl() override {} - virtual void NotificationDisplayed() override { + void NotificationDisplayed() override { RenderFrameHost* rfh = RenderFrameHost::FromID(render_process_id_, render_frame_id_); if (!rfh) @@ -97,7 +97,7 @@ class DesktopNotificationDelegateImpl : public DesktopNotificationDelegate { rfh->GetRoutingID(), notification_id_)); } - virtual void NotificationError() override { + void NotificationError() override { RenderFrameHost* rfh = RenderFrameHost::FromID(render_process_id_, render_frame_id_); if (!rfh) @@ -107,7 +107,7 @@ class DesktopNotificationDelegateImpl : public DesktopNotificationDelegate { rfh->GetRoutingID(), notification_id_)); } - virtual void NotificationClosed(bool by_user) override { + void NotificationClosed(bool by_user) override { RenderFrameHost* rfh = RenderFrameHost::FromID(render_process_id_, render_frame_id_); if (!rfh) @@ -119,7 +119,7 @@ class DesktopNotificationDelegateImpl : public DesktopNotificationDelegate { notification_id_); } - virtual void NotificationClick() override { + void NotificationClick() override { RenderFrameHost* rfh = RenderFrameHost::FromID(render_process_id_, render_frame_id_); if (!rfh) diff --git a/content/browser/frame_host/render_frame_host_impl.h b/content/browser/frame_host/render_frame_host_impl.h index 0dd9bff..3fcb8e2 100644 --- a/content/browser/frame_host/render_frame_host_impl.h +++ b/content/browser/frame_host/render_frame_host_impl.h @@ -95,55 +95,52 @@ class CONTENT_EXPORT RenderFrameHostImpl static RenderFrameHostImpl* FromID(int process_id, int routing_id); - virtual ~RenderFrameHostImpl(); + ~RenderFrameHostImpl() override; // RenderFrameHost - virtual int GetRoutingID() override; - virtual SiteInstanceImpl* GetSiteInstance() override; - virtual RenderProcessHost* GetProcess() override; - virtual RenderFrameHost* GetParent() override; - virtual const std::string& GetFrameName() override; - virtual bool IsCrossProcessSubframe() override; - virtual GURL GetLastCommittedURL() override; - virtual gfx::NativeView GetNativeView() override; - virtual void ExecuteJavaScript( - const base::string16& javascript) override; - virtual void ExecuteJavaScript( - const base::string16& javascript, - const JavaScriptResultCallback& callback) override; - virtual void ExecuteJavaScriptForTests( - const base::string16& javascript) override; - virtual RenderViewHost* GetRenderViewHost() override; - virtual ServiceRegistry* GetServiceRegistry() override; + int GetRoutingID() override; + SiteInstanceImpl* GetSiteInstance() override; + RenderProcessHost* GetProcess() override; + RenderFrameHost* GetParent() override; + const std::string& GetFrameName() override; + bool IsCrossProcessSubframe() override; + GURL GetLastCommittedURL() override; + gfx::NativeView GetNativeView() override; + void ExecuteJavaScript(const base::string16& javascript) override; + void ExecuteJavaScript(const base::string16& javascript, + const JavaScriptResultCallback& callback) override; + void ExecuteJavaScriptForTests(const base::string16& javascript) override; + RenderViewHost* GetRenderViewHost() override; + ServiceRegistry* GetServiceRegistry() override; // IPC::Sender - virtual bool Send(IPC::Message* msg) override; + bool Send(IPC::Message* msg) override; // IPC::Listener - virtual bool OnMessageReceived(const IPC::Message& msg) override; + bool OnMessageReceived(const IPC::Message& msg) override; // BrowserAccessibilityDelegate - virtual void AccessibilitySetFocus(int acc_obj_id) override; - virtual void AccessibilityDoDefaultAction(int acc_obj_id) override; - virtual void AccessibilityShowMenu(const gfx::Point& global_point) override; - virtual void AccessibilityScrollToMakeVisible( - int acc_obj_id, const gfx::Rect& subfocus) override; - virtual void AccessibilityScrollToPoint( - int acc_obj_id, const gfx::Point& point) override; - virtual void AccessibilitySetTextSelection( - int acc_obj_id, int start_offset, int end_offset) override; - virtual bool AccessibilityViewHasFocus() const override; - virtual gfx::Rect AccessibilityGetViewBounds() const override; - virtual gfx::Point AccessibilityOriginInScreen(const gfx::Rect& bounds) - const override; - virtual void AccessibilityHitTest(const gfx::Point& point) override; - virtual void AccessibilityFatalError() override; - virtual gfx::AcceleratedWidget AccessibilityGetAcceleratedWidget() override; - virtual gfx::NativeViewAccessible AccessibilityGetNativeViewAccessible() - override; - virtual BrowserAccessibilityManager* AccessibilityGetChildFrame( + void AccessibilitySetFocus(int acc_obj_id) override; + void AccessibilityDoDefaultAction(int acc_obj_id) override; + void AccessibilityShowMenu(const gfx::Point& global_point) override; + void AccessibilityScrollToMakeVisible(int acc_obj_id, + const gfx::Rect& subfocus) override; + void AccessibilityScrollToPoint(int acc_obj_id, + const gfx::Point& point) override; + void AccessibilitySetTextSelection(int acc_obj_id, + int start_offset, + int end_offset) override; + bool AccessibilityViewHasFocus() const override; + gfx::Rect AccessibilityGetViewBounds() const override; + gfx::Point AccessibilityOriginInScreen( + const gfx::Rect& bounds) const override; + void AccessibilityHitTest(const gfx::Point& point) override; + void AccessibilityFatalError() override; + gfx::AcceleratedWidget AccessibilityGetAcceleratedWidget() override; + gfx::NativeViewAccessible AccessibilityGetNativeViewAccessible() override; + BrowserAccessibilityManager* AccessibilityGetChildFrame( int accessibility_node_id) override; - virtual BrowserAccessibility* AccessibilityGetParentFrame() override; + BrowserAccessibility* AccessibilityGetParentFrame() override; // Creates a RenderFrame in the renderer process. Only called for // cross-process subframe navigations in --site-per-process. diff --git a/content/browser/frame_host/render_frame_host_manager.h b/content/browser/frame_host/render_frame_host_manager.h index a9d5f44..ff9d769 100644 --- a/content/browser/frame_host/render_frame_host_manager.h +++ b/content/browser/frame_host/render_frame_host_manager.h @@ -187,7 +187,7 @@ class CONTENT_EXPORT RenderFrameHostManager : public NotificationObserver { RenderViewHostDelegate* render_view_delegate, RenderWidgetHostDelegate* render_widget_delegate, Delegate* delegate); - virtual ~RenderFrameHostManager(); + ~RenderFrameHostManager() override; // For arguments, see WebContentsImpl constructor. void Init(BrowserContext* browser_context, @@ -326,9 +326,9 @@ class CONTENT_EXPORT RenderFrameHostManager : public NotificationObserver { InterstitialPageImpl* interstitial_page() const { return interstitial_page_; } // NotificationObserver implementation. - virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) override; + void Observe(int type, + const NotificationSource& source, + const NotificationDetails& details) override; // Returns whether the given RenderFrameHost (or its associated // RenderViewHost) is on the list of swapped out RenderFrameHosts. diff --git a/content/browser/frame_host/render_frame_host_manager_browsertest.cc b/content/browser/frame_host/render_frame_host_manager_browsertest.cc index 18b5a68..38eef8c 100644 --- a/content/browser/frame_host/render_frame_host_manager_browsertest.cc +++ b/content/browser/frame_host/render_frame_host_manager_browsertest.cc @@ -1151,7 +1151,7 @@ class RenderViewHostDestructionObserver : public WebContentsObserver { public: explicit RenderViewHostDestructionObserver(WebContents* web_contents) : WebContentsObserver(web_contents) {} - virtual ~RenderViewHostDestructionObserver() {} + ~RenderViewHostDestructionObserver() override {} void EnsureRVHGetsDestructed(RenderViewHost* rvh) { watched_render_view_hosts_.insert(rvh); } @@ -1161,7 +1161,7 @@ class RenderViewHostDestructionObserver : public WebContentsObserver { private: // WebContentsObserver implementation: - virtual void RenderViewDeleted(RenderViewHost* rvh) override { + void RenderViewDeleted(RenderViewHost* rvh) override { watched_render_view_hosts_.erase(rvh); } @@ -1390,7 +1390,7 @@ class RFHMProcessPerTabTest : public RenderFrameHostManagerTest { public: RFHMProcessPerTabTest() {} - virtual void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(CommandLine* command_line) override { command_line->AppendSwitch(switches::kProcessPerTab); } }; diff --git a/content/browser/frame_host/render_frame_host_manager_unittest.cc b/content/browser/frame_host/render_frame_host_manager_unittest.cc index c718043..f74e412 100644 --- a/content/browser/frame_host/render_frame_host_manager_unittest.cc +++ b/content/browser/frame_host/render_frame_host_manager_unittest.cc @@ -51,32 +51,32 @@ class RenderFrameHostManagerTestWebUIControllerFactory RenderFrameHostManagerTestWebUIControllerFactory() : should_create_webui_(false) { } - virtual ~RenderFrameHostManagerTestWebUIControllerFactory() {} + ~RenderFrameHostManagerTestWebUIControllerFactory() override {} void set_should_create_webui(bool should_create_webui) { should_create_webui_ = should_create_webui; } // WebUIFactory implementation. - virtual WebUIController* CreateWebUIControllerForURL( - WebUI* web_ui, const GURL& url) const override { + WebUIController* CreateWebUIControllerForURL(WebUI* web_ui, + const GURL& url) const override { if (!(should_create_webui_ && HasWebUIScheme(url))) return NULL; return new WebUIController(web_ui); } - virtual WebUI::TypeID GetWebUIType(BrowserContext* browser_context, - const GURL& url) const override { + WebUI::TypeID GetWebUIType(BrowserContext* browser_context, + const GURL& url) const override { return WebUI::kNoWebUI; } - virtual bool UseWebUIForURL(BrowserContext* browser_context, - const GURL& url) const override { + bool UseWebUIForURL(BrowserContext* browser_context, + const GURL& url) const override { return HasWebUIScheme(url); } - virtual bool UseWebUIBindingsForURL(BrowserContext* browser_context, - const GURL& url) const override { + bool UseWebUIBindingsForURL(BrowserContext* browser_context, + const GURL& url) const override { return HasWebUIScheme(url); } @@ -89,11 +89,11 @@ class RenderFrameHostManagerTestWebUIControllerFactory class BeforeUnloadFiredWebContentsDelegate : public WebContentsDelegate { public: BeforeUnloadFiredWebContentsDelegate() {} - virtual ~BeforeUnloadFiredWebContentsDelegate() {} + ~BeforeUnloadFiredWebContentsDelegate() override {} - virtual void BeforeUnloadFired(WebContents* web_contents, - bool proceed, - bool* proceed_to_fire_unload) override { + void BeforeUnloadFired(WebContents* web_contents, + bool proceed, + bool* proceed_to_fire_unload) override { *proceed_to_fire_unload = proceed; } @@ -104,9 +104,9 @@ class BeforeUnloadFiredWebContentsDelegate : public WebContentsDelegate { class CloseWebContentsDelegate : public WebContentsDelegate { public: CloseWebContentsDelegate() : close_called_(false) {} - virtual ~CloseWebContentsDelegate() {} + ~CloseWebContentsDelegate() override {} - virtual void CloseContents(WebContents* web_contents) override { + void CloseContents(WebContents* web_contents) override { close_called_ = true; } @@ -129,7 +129,7 @@ class RenderViewHostDeletedObserver : public WebContentsObserver { deleted_(false) { } - virtual void RenderViewDeleted(RenderViewHost* render_view_host) override { + void RenderViewDeleted(RenderViewHost* render_view_host) override { if (render_view_host->GetProcess()->GetID() == process_id_ && render_view_host->GetRoutingID() == routing_id_) { deleted_ = true; @@ -157,7 +157,7 @@ class RenderFrameHostCreatedObserver : public WebContentsObserver { created_(false) { } - virtual void RenderFrameCreated(RenderFrameHost* render_frame_host) override { + void RenderFrameCreated(RenderFrameHost* render_frame_host) override { created_ = true; } @@ -182,7 +182,7 @@ class RenderFrameHostDeletedObserver : public WebContentsObserver { deleted_(false) { } - virtual void RenderFrameDeleted(RenderFrameHost* render_frame_host) override { + void RenderFrameDeleted(RenderFrameHost* render_frame_host) override { if (render_frame_host->GetProcess()->GetID() == process_id_ && render_frame_host->GetRoutingID() == routing_id_) { deleted_ = true; @@ -213,13 +213,12 @@ class PluginFaviconMessageObserver : public WebContentsObserver { plugin_crashed_(false), favicon_received_(false) { } - virtual void PluginCrashed(const base::FilePath& plugin_path, - base::ProcessId plugin_pid) override { + void PluginCrashed(const base::FilePath& plugin_path, + base::ProcessId plugin_pid) override { plugin_crashed_ = true; } - virtual void DidUpdateFaviconURL( - const std::vector<FaviconURL>& candidates) override { + void DidUpdateFaviconURL(const std::vector<FaviconURL>& candidates) override { favicon_received_ = true; } @@ -248,7 +247,7 @@ class FrameLifetimeConsistencyChecker : public WebContentsObserver { RenderFrameCreated(web_contents->GetMainFrame()); } - virtual void RenderFrameCreated(RenderFrameHost* render_frame_host) override { + void RenderFrameCreated(RenderFrameHost* render_frame_host) override { std::pair<int, int> routing_pair = std::make_pair(render_frame_host->GetProcess()->GetID(), render_frame_host->GetRoutingID()); @@ -264,7 +263,7 @@ class FrameLifetimeConsistencyChecker : public WebContentsObserver { } } - virtual void RenderFrameDeleted(RenderFrameHost* render_frame_host) override { + void RenderFrameDeleted(RenderFrameHost* render_frame_host) override { std::pair<int, int> routing_pair = std::make_pair(render_frame_host->GetProcess()->GetID(), render_frame_host->GetRoutingID()); @@ -750,8 +749,7 @@ class RenderViewHostDestroyer : public WebContentsObserver { render_view_host_(render_view_host), web_contents_(web_contents) {} - virtual void RenderViewDeleted( - RenderViewHost* render_view_host) override { + void RenderViewDeleted(RenderViewHost* render_view_host) override { if (render_view_host == render_view_host_) delete web_contents_; } diff --git a/content/browser/frame_host/render_frame_message_filter.h b/content/browser/frame_host/render_frame_message_filter.h index b3d76b6..0de54b1 100644 --- a/content/browser/frame_host/render_frame_message_filter.h +++ b/content/browser/frame_host/render_frame_message_filter.h @@ -21,10 +21,10 @@ class RenderFrameMessageFilter : public BrowserMessageFilter { RenderFrameMessageFilter(int render_process_id, RenderWidgetHelper* render_widget_helper); - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; private: - virtual ~RenderFrameMessageFilter(); + ~RenderFrameMessageFilter() override; void OnCreateChildFrame(int parent_routing_id, const std::string& frame_name, diff --git a/content/browser/frame_host/render_frame_proxy_host.h b/content/browser/frame_host/render_frame_proxy_host.h index 29933af..ed3235c 100644 --- a/content/browser/frame_host/render_frame_proxy_host.h +++ b/content/browser/frame_host/render_frame_proxy_host.h @@ -59,7 +59,7 @@ class RenderFrameProxyHost RenderFrameProxyHost(SiteInstance* site_instance, FrameTreeNode* frame_tree_node); - virtual ~RenderFrameProxyHost(); + ~RenderFrameProxyHost() override; RenderProcessHost* GetProcess() { return site_instance_->GetProcess(); @@ -93,10 +93,10 @@ class RenderFrameProxyHost scoped_ptr<RenderFrameHostImpl> PassFrameHostOwnership(); // IPC::Sender - virtual bool Send(IPC::Message* msg) override; + bool Send(IPC::Message* msg) override; // IPC::Listener - virtual bool OnMessageReceived(const IPC::Message& msg) override; + bool OnMessageReceived(const IPC::Message& msg) override; CrossProcessFrameConnector* cross_process_frame_connector() { return cross_process_frame_connector_.get(); diff --git a/content/browser/frame_host/render_widget_host_view_child_frame.h b/content/browser/frame_host/render_widget_host_view_child_frame.h index 4ca0716..4774d55 100644 --- a/content/browser/frame_host/render_widget_host_view_child_frame.h +++ b/content/browser/frame_host/render_widget_host_view_child_frame.h @@ -28,7 +28,7 @@ class CONTENT_EXPORT RenderWidgetHostViewChildFrame : public RenderWidgetHostViewBase { public: explicit RenderWidgetHostViewChildFrame(RenderWidgetHost* widget); - virtual ~RenderWidgetHostViewChildFrame(); + ~RenderWidgetHostViewChildFrame() override; void set_cross_process_frame_connector( CrossProcessFrameConnector* frame_connector) { @@ -36,93 +36,90 @@ class CONTENT_EXPORT RenderWidgetHostViewChildFrame } // RenderWidgetHostView implementation. - virtual void InitAsChild(gfx::NativeView parent_view) override; - virtual RenderWidgetHost* GetRenderWidgetHost() const override; - virtual void SetSize(const gfx::Size& size) override; - virtual void SetBounds(const gfx::Rect& rect) override; - virtual void Focus() override; - virtual bool HasFocus() const override; - virtual bool IsSurfaceAvailableForCopy() const override; - virtual void Show() override; - virtual void Hide() override; - virtual bool IsShowing() override; - virtual gfx::Rect GetViewBounds() const override; - virtual gfx::Vector2dF GetLastScrollOffset() const override; - virtual gfx::NativeView GetNativeView() const override; - virtual gfx::NativeViewId GetNativeViewId() const override; - virtual gfx::NativeViewAccessible GetNativeViewAccessible() override; - virtual void SetBackgroundOpaque(bool opaque) override; - virtual gfx::Size GetPhysicalBackingSize() const override; + void InitAsChild(gfx::NativeView parent_view) override; + RenderWidgetHost* GetRenderWidgetHost() const override; + void SetSize(const gfx::Size& size) override; + void SetBounds(const gfx::Rect& rect) override; + void Focus() override; + bool HasFocus() const override; + bool IsSurfaceAvailableForCopy() const override; + void Show() override; + void Hide() override; + bool IsShowing() override; + gfx::Rect GetViewBounds() const override; + gfx::Vector2dF GetLastScrollOffset() const override; + gfx::NativeView GetNativeView() const override; + gfx::NativeViewId GetNativeViewId() const override; + gfx::NativeViewAccessible GetNativeViewAccessible() override; + void SetBackgroundOpaque(bool opaque) override; + gfx::Size GetPhysicalBackingSize() const override; // RenderWidgetHostViewBase implementation. - virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, - const gfx::Rect& pos) override; - virtual void InitAsFullscreen( - RenderWidgetHostView* reference_host_view) override; - virtual void WasShown() override; - virtual void WasHidden() override; - virtual void MovePluginWindows( - const std::vector<WebPluginGeometry>& moves) override; - virtual void Blur() override; - virtual void UpdateCursor(const WebCursor& cursor) override; - virtual void SetIsLoading(bool is_loading) override; - virtual void TextInputTypeChanged(ui::TextInputType type, - ui::TextInputMode input_mode, - bool can_compose_inline) override; - virtual void ImeCancelComposition() override; + void InitAsPopup(RenderWidgetHostView* parent_host_view, + const gfx::Rect& pos) override; + void InitAsFullscreen(RenderWidgetHostView* reference_host_view) override; + void WasShown() override; + void WasHidden() override; + void MovePluginWindows(const std::vector<WebPluginGeometry>& moves) override; + void Blur() override; + void UpdateCursor(const WebCursor& cursor) override; + void SetIsLoading(bool is_loading) override; + void TextInputTypeChanged(ui::TextInputType type, + ui::TextInputMode input_mode, + bool can_compose_inline) override; + void ImeCancelComposition() override; #if defined(OS_MACOSX) || defined(USE_AURA) - virtual void ImeCompositionRangeChanged( + void ImeCompositionRangeChanged( const gfx::Range& range, const std::vector<gfx::Rect>& character_bounds) override; #endif - virtual void RenderProcessGone(base::TerminationStatus status, - int error_code) override; - virtual void Destroy() override; - virtual void SetTooltipText(const base::string16& tooltip_text) override; - virtual void SelectionChanged(const base::string16& text, - size_t offset, - const gfx::Range& range) override; - virtual void SelectionBoundsChanged( + void RenderProcessGone(base::TerminationStatus status, + int error_code) override; + void Destroy() override; + void SetTooltipText(const base::string16& tooltip_text) override; + void SelectionChanged(const base::string16& text, + size_t offset, + const gfx::Range& range) override; + void SelectionBoundsChanged( const ViewHostMsg_SelectionBounds_Params& params) override; - virtual void CopyFromCompositingSurface( + void CopyFromCompositingSurface( const gfx::Rect& src_subrect, const gfx::Size& dst_size, const base::Callback<void(bool, const SkBitmap&)>& callback, const SkColorType color_type) override; - virtual void CopyFromCompositingSurfaceToVideoFrame( + void CopyFromCompositingSurfaceToVideoFrame( const gfx::Rect& src_subrect, const scoped_refptr<media::VideoFrame>& target, const base::Callback<void(bool)>& callback) override; - virtual bool CanCopyToVideoFrame() const override; - virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) override; - virtual void OnSwapCompositorFrame( - uint32 output_surface_id, - scoped_ptr<cc::CompositorFrame> frame) override; - virtual void GetScreenInfo(blink::WebScreenInfo* results) override; - virtual gfx::Rect GetBoundsInRootWindow() override; - virtual gfx::GLSurfaceHandle GetCompositingSurface() override; + bool CanCopyToVideoFrame() const override; + bool HasAcceleratedSurface(const gfx::Size& desired_size) override; + void OnSwapCompositorFrame(uint32 output_surface_id, + scoped_ptr<cc::CompositorFrame> frame) override; + void GetScreenInfo(blink::WebScreenInfo* results) override; + gfx::Rect GetBoundsInRootWindow() override; + gfx::GLSurfaceHandle GetCompositingSurface() override; #if defined(USE_AURA) virtual void ProcessAckedTouchEvent( const TouchEventWithLatencyInfo& touch, InputEventAckState ack_result) override; #endif // defined(USE_AURA) - virtual bool LockMouse() override; - virtual void UnlockMouse() override; + bool LockMouse() override; + void UnlockMouse() override; #if defined(OS_MACOSX) // RenderWidgetHostView implementation. - virtual void SetActive(bool active) override; - virtual void SetTakesFocusOnlyOnMouseDown(bool flag) override; - virtual void SetWindowVisibility(bool visible) override; - virtual void WindowFrameChanged() override; - virtual void ShowDefinitionForSelection() override; - virtual bool SupportsSpeech() const override; - virtual void SpeakSelection() override; - virtual bool IsSpeaking() const override; - virtual void StopSpeaking() override; + void SetActive(bool active) override; + void SetTakesFocusOnlyOnMouseDown(bool flag) override; + void SetWindowVisibility(bool visible) override; + void WindowFrameChanged() override; + void ShowDefinitionForSelection() override; + bool SupportsSpeech() const override; + void SpeakSelection() override; + bool IsSpeaking() const override; + void StopSpeaking() override; // RenderWidgetHostViewBase implementation. - virtual bool PostProcessEventForPluginIme( + bool PostProcessEventForPluginIme( const NativeWebKeyboardEvent& event) override; #endif // defined(OS_MACOSX) @@ -137,10 +134,10 @@ class CONTENT_EXPORT RenderWidgetHostViewChildFrame gfx::NativeViewAccessible accessible_parent) override; virtual gfx::NativeViewId GetParentForWindowlessPlugin() const override; #endif - virtual BrowserAccessibilityManager* CreateBrowserAccessibilityManager( + BrowserAccessibilityManager* CreateBrowserAccessibilityManager( BrowserAccessibilityDelegate* delegate) override; - virtual SkColorType PreferredReadbackFormat() override; + SkColorType PreferredReadbackFormat() override; protected: friend class RenderWidgetHostView; diff --git a/content/browser/frame_host/render_widget_host_view_child_frame_unittest.cc b/content/browser/frame_host/render_widget_host_view_child_frame_unittest.cc index 95b4eb3..bdf6ff2 100644 --- a/content/browser/frame_host/render_widget_host_view_child_frame_unittest.cc +++ b/content/browser/frame_host/render_widget_host_view_child_frame_unittest.cc @@ -20,7 +20,7 @@ namespace { class MockRenderWidgetHostDelegate : public RenderWidgetHostDelegate { public: MockRenderWidgetHostDelegate() {} - virtual ~MockRenderWidgetHostDelegate() {} + ~MockRenderWidgetHostDelegate() override {} }; class RenderWidgetHostViewChildFrameTest : public testing::Test { diff --git a/content/browser/frame_host/render_widget_host_view_guest.h b/content/browser/frame_host/render_widget_host_view_guest.h index 30edf5f..2d6a880 100644 --- a/content/browser/frame_host/render_widget_host_view_guest.h +++ b/content/browser/frame_host/render_widget_host_view_guest.h @@ -43,86 +43,82 @@ class CONTENT_EXPORT RenderWidgetHostViewGuest RenderWidgetHost* widget, BrowserPluginGuest* guest, base::WeakPtr<RenderWidgetHostViewBase> platform_view); - virtual ~RenderWidgetHostViewGuest(); + ~RenderWidgetHostViewGuest() override; bool OnMessageReceivedFromEmbedder(const IPC::Message& message, RenderWidgetHostImpl* embedder); // RenderWidgetHostView implementation. - virtual bool OnMessageReceived(const IPC::Message& msg) override; - virtual void InitAsChild(gfx::NativeView parent_view) override; - virtual void SetSize(const gfx::Size& size) override; - virtual void SetBounds(const gfx::Rect& rect) override; - virtual void Focus() override; - virtual bool HasFocus() const override; - virtual gfx::NativeView GetNativeView() const override; - virtual gfx::NativeViewId GetNativeViewId() const override; - virtual gfx::NativeViewAccessible GetNativeViewAccessible() override; - virtual gfx::Rect GetViewBounds() const override; - virtual void SetBackgroundOpaque(bool opaque) override; - virtual gfx::Size GetPhysicalBackingSize() const override; - virtual base::string16 GetSelectedText() const override; + bool OnMessageReceived(const IPC::Message& msg) override; + void InitAsChild(gfx::NativeView parent_view) override; + void SetSize(const gfx::Size& size) override; + void SetBounds(const gfx::Rect& rect) override; + void Focus() override; + bool HasFocus() const override; + gfx::NativeView GetNativeView() const override; + gfx::NativeViewId GetNativeViewId() const override; + gfx::NativeViewAccessible GetNativeViewAccessible() override; + gfx::Rect GetViewBounds() const override; + void SetBackgroundOpaque(bool opaque) override; + gfx::Size GetPhysicalBackingSize() const override; + base::string16 GetSelectedText() const override; // RenderWidgetHostViewBase implementation. - virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, - const gfx::Rect& pos) override; - virtual void InitAsFullscreen( - RenderWidgetHostView* reference_host_view) override; - virtual void WasShown() override; - virtual void WasHidden() override; - virtual void MovePluginWindows( - const std::vector<WebPluginGeometry>& moves) override; - virtual void UpdateCursor(const WebCursor& cursor) override; - virtual void SetIsLoading(bool is_loading) override; - virtual void TextInputTypeChanged(ui::TextInputType type, - ui::TextInputMode input_mode, - bool can_compose_inline) override; - virtual void ImeCancelComposition() override; + void InitAsPopup(RenderWidgetHostView* parent_host_view, + const gfx::Rect& pos) override; + void InitAsFullscreen(RenderWidgetHostView* reference_host_view) override; + void WasShown() override; + void WasHidden() override; + void MovePluginWindows(const std::vector<WebPluginGeometry>& moves) override; + void UpdateCursor(const WebCursor& cursor) override; + void SetIsLoading(bool is_loading) override; + void TextInputTypeChanged(ui::TextInputType type, + ui::TextInputMode input_mode, + bool can_compose_inline) override; + void ImeCancelComposition() override; #if defined(OS_MACOSX) || defined(USE_AURA) - virtual void ImeCompositionRangeChanged( + void ImeCompositionRangeChanged( const gfx::Range& range, const std::vector<gfx::Rect>& character_bounds) override; #endif - virtual void RenderProcessGone(base::TerminationStatus status, - int error_code) override; - virtual void Destroy() override; - virtual void SetTooltipText(const base::string16& tooltip_text) override; - virtual void SelectionChanged(const base::string16& text, - size_t offset, - const gfx::Range& range) override; - virtual void SelectionBoundsChanged( + void RenderProcessGone(base::TerminationStatus status, + int error_code) override; + void Destroy() override; + void SetTooltipText(const base::string16& tooltip_text) override; + void SelectionChanged(const base::string16& text, + size_t offset, + const gfx::Range& range) override; + void SelectionBoundsChanged( const ViewHostMsg_SelectionBounds_Params& params) override; - virtual void CopyFromCompositingSurface( - const gfx::Rect& src_subrect, - const gfx::Size& dst_size, - CopyFromCompositingSurfaceCallback& callback, - const SkColorType color_type) override; - virtual void OnSwapCompositorFrame( - uint32 output_surface_id, - scoped_ptr<cc::CompositorFrame> frame) override; + void CopyFromCompositingSurface(const gfx::Rect& src_subrect, + const gfx::Size& dst_size, + CopyFromCompositingSurfaceCallback& callback, + const SkColorType color_type) override; + void OnSwapCompositorFrame(uint32 output_surface_id, + scoped_ptr<cc::CompositorFrame> frame) override; #if defined(USE_AURA) virtual void ProcessAckedTouchEvent( const TouchEventWithLatencyInfo& touch, InputEventAckState ack_result) override; #endif - virtual bool LockMouse() override; - virtual void UnlockMouse() override; - virtual void GetScreenInfo(blink::WebScreenInfo* results) override; + bool LockMouse() override; + void UnlockMouse() override; + void GetScreenInfo(blink::WebScreenInfo* results) override; #if defined(OS_MACOSX) // RenderWidgetHostView implementation. - virtual void SetActive(bool active) override; - virtual void SetTakesFocusOnlyOnMouseDown(bool flag) override; - virtual void SetWindowVisibility(bool visible) override; - virtual void WindowFrameChanged() override; - virtual void ShowDefinitionForSelection() override; - virtual bool SupportsSpeech() const override; - virtual void SpeakSelection() override; - virtual bool IsSpeaking() const override; - virtual void StopSpeaking() override; + void SetActive(bool active) override; + void SetTakesFocusOnlyOnMouseDown(bool flag) override; + void SetWindowVisibility(bool visible) override; + void WindowFrameChanged() override; + void ShowDefinitionForSelection() override; + bool SupportsSpeech() const override; + void SpeakSelection() override; + bool IsSpeaking() const override; + void StopSpeaking() override; // RenderWidgetHostViewBase implementation. - virtual bool PostProcessEventForPluginIme( + bool PostProcessEventForPluginIme( const NativeWebKeyboardEvent& event) override; #endif // defined(OS_MACOSX) @@ -144,11 +140,11 @@ class CONTENT_EXPORT RenderWidgetHostViewGuest #endif // Overridden from ui::GestureEventHelper. - virtual bool CanDispatchToConsumer(ui::GestureConsumer* consumer) override; - virtual void DispatchGestureEvent(ui::GestureEvent* event) override; - virtual void DispatchCancelTouchEvent(ui::TouchEvent* event) override; + bool CanDispatchToConsumer(ui::GestureConsumer* consumer) override; + void DispatchGestureEvent(ui::GestureEvent* event) override; + void DispatchCancelTouchEvent(ui::TouchEvent* event) override; - virtual SkColorType PreferredReadbackFormat() override; + SkColorType PreferredReadbackFormat() override; protected: friend class RenderWidgetHostView; diff --git a/content/browser/frame_host/render_widget_host_view_guest_unittest.cc b/content/browser/frame_host/render_widget_host_view_guest_unittest.cc index b658158..726d7a9 100644 --- a/content/browser/frame_host/render_widget_host_view_guest_unittest.cc +++ b/content/browser/frame_host/render_widget_host_view_guest_unittest.cc @@ -20,7 +20,7 @@ namespace { class MockRenderWidgetHostDelegate : public RenderWidgetHostDelegate { public: MockRenderWidgetHostDelegate() {} - virtual ~MockRenderWidgetHostDelegate() {} + ~MockRenderWidgetHostDelegate() override {} }; class RenderWidgetHostViewGuestTest : public testing::Test { diff --git a/content/browser/gamepad/gamepad_platform_data_fetcher_mac.h b/content/browser/gamepad/gamepad_platform_data_fetcher_mac.h index 20db3c9..77c024e 100644 --- a/content/browser/gamepad/gamepad_platform_data_fetcher_mac.h +++ b/content/browser/gamepad/gamepad_platform_data_fetcher_mac.h @@ -31,10 +31,10 @@ class GamepadPlatformDataFetcherMac : public GamepadDataFetcher, public XboxDataFetcher::Delegate { public: GamepadPlatformDataFetcherMac(); - virtual ~GamepadPlatformDataFetcherMac(); - virtual void GetGamepadData(blink::WebGamepads* pads, - bool devices_changed_hint) override; - virtual void PauseHint(bool paused) override; + ~GamepadPlatformDataFetcherMac() override; + void GetGamepadData(blink::WebGamepads* pads, + bool devices_changed_hint) override; + void PauseHint(bool paused) override; private: bool enabled_; @@ -63,10 +63,10 @@ class GamepadPlatformDataFetcherMac : public GamepadDataFetcher, void DeviceRemove(IOHIDDeviceRef device); void ValueChanged(IOHIDValueRef value); - virtual void XboxDeviceAdd(XboxController* device) override; - virtual void XboxDeviceRemove(XboxController* device) override; - virtual void XboxValueChanged(XboxController* device, - const XboxController::Data& data) override; + void XboxDeviceAdd(XboxController* device) override; + void XboxDeviceRemove(XboxController* device) override; + void XboxValueChanged(XboxController* device, + const XboxController::Data& data) override; void RegisterForNotifications(); void UnregisterFromNotifications(); diff --git a/content/browser/gamepad/gamepad_provider.h b/content/browser/gamepad/gamepad_provider.h index 97657c9..a81061a 100644 --- a/content/browser/gamepad/gamepad_provider.h +++ b/content/browser/gamepad/gamepad_provider.h @@ -37,7 +37,7 @@ class CONTENT_EXPORT GamepadProvider : // Manually specifies the data fetcher. Used for testing. explicit GamepadProvider(scoped_ptr<GamepadDataFetcher> fetcher); - virtual ~GamepadProvider(); + ~GamepadProvider() override; // Returns the shared memory handle of the gamepad data duplicated into the // given process. @@ -56,7 +56,7 @@ class CONTENT_EXPORT GamepadProvider : void RegisterForUserGesture(const base::Closure& closure); // base::SystemMonitor::DevicesChangedObserver implementation. - virtual void OnDevicesChanged(base::SystemMonitor::DeviceType type) override; + void OnDevicesChanged(base::SystemMonitor::DeviceType type) override; private: void Initialize(scoped_ptr<GamepadDataFetcher> fetcher); diff --git a/content/browser/gamepad/gamepad_service_unittest.cc b/content/browser/gamepad/gamepad_service_unittest.cc index 5acf3eb..8033280b8 100644 --- a/content/browser/gamepad/gamepad_service_unittest.cc +++ b/content/browser/gamepad/gamepad_service_unittest.cc @@ -24,14 +24,12 @@ class ConnectionListener : public GamepadConsumer { ClearCounters(); } - virtual void OnGamepadConnected( - unsigned index, - const blink::WebGamepad& gamepad) override { + void OnGamepadConnected(unsigned index, + const blink::WebGamepad& gamepad) override { connected_counter_++; } - virtual void OnGamepadDisconnected( - unsigned index, - const blink::WebGamepad& gamepad) override { + void OnGamepadDisconnected(unsigned index, + const blink::WebGamepad& gamepad) override { disconnected_counter_++; } diff --git a/content/browser/gamepad/gamepad_test_helpers.h b/content/browser/gamepad/gamepad_test_helpers.h index 68a6d37..dbaa966 100644 --- a/content/browser/gamepad/gamepad_test_helpers.h +++ b/content/browser/gamepad/gamepad_test_helpers.h @@ -23,11 +23,11 @@ class MockGamepadDataFetcher : public GamepadDataFetcher { // returned when the provider queries us. explicit MockGamepadDataFetcher(const blink::WebGamepads& test_data); - virtual ~MockGamepadDataFetcher(); + ~MockGamepadDataFetcher() override; // GamepadDataFetcher. - virtual void GetGamepadData(blink::WebGamepads* pads, - bool devices_changed_hint) override; + void GetGamepadData(blink::WebGamepads* pads, + bool devices_changed_hint) override; // Blocks the current thread until the GamepadProvider reads from this // fetcher on the background thread. @@ -69,7 +69,7 @@ class GamepadTestHelper { class GamepadServiceTestConstructor : public GamepadTestHelper { public: explicit GamepadServiceTestConstructor(const blink::WebGamepads& test_data); - virtual ~GamepadServiceTestConstructor(); + ~GamepadServiceTestConstructor() override; GamepadService* gamepad_service() { return gamepad_service_; } MockGamepadDataFetcher* data_fetcher() { return data_fetcher_; } diff --git a/content/browser/gamepad/xbox_data_fetcher_mac.h b/content/browser/gamepad/xbox_data_fetcher_mac.h index b8df654..d88ad96 100644 --- a/content/browser/gamepad/xbox_data_fetcher_mac.h +++ b/content/browser/gamepad/xbox_data_fetcher_mac.h @@ -163,9 +163,9 @@ class XboxDataFetcher : public XboxController::Delegate { void AddController(XboxController* controller); void RemoveController(XboxController* controller); void RemoveControllerByLocationID(uint32 id); - virtual void XboxControllerGotData(XboxController* controller, - const XboxController::Data& data) override; - virtual void XboxControllerError(XboxController* controller) override; + void XboxControllerGotData(XboxController* controller, + const XboxController::Data& data) override; + void XboxControllerError(XboxController* controller) override; Delegate* delegate_; diff --git a/content/browser/geofencing/geofencing_dispatcher_host.h b/content/browser/geofencing/geofencing_dispatcher_host.h index 14e3264..86858b8 100644 --- a/content/browser/geofencing/geofencing_dispatcher_host.h +++ b/content/browser/geofencing/geofencing_dispatcher_host.h @@ -21,10 +21,10 @@ class GeofencingDispatcherHost : public BrowserMessageFilter { explicit GeofencingDispatcherHost(BrowserContext* browser_context); private: - virtual ~GeofencingDispatcherHost(); + ~GeofencingDispatcherHost() override; // BrowserMessageFilter implementation. - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; void OnRegisterRegion(int thread_id, int request_id, diff --git a/content/browser/geolocation/geolocation_dispatcher_host.h b/content/browser/geolocation/geolocation_dispatcher_host.h index c719e7a..d942cff 100644 --- a/content/browser/geolocation/geolocation_dispatcher_host.h +++ b/content/browser/geolocation/geolocation_dispatcher_host.h @@ -22,7 +22,7 @@ namespace content { class GeolocationDispatcherHost : public WebContentsObserver { public: explicit GeolocationDispatcherHost(WebContents* web_contents); - virtual ~GeolocationDispatcherHost(); + ~GeolocationDispatcherHost() override; // Pause or resumes geolocation. Resuming when nothing is paused is a no-op. // If the web contents is paused while not currently using geolocation but @@ -39,14 +39,14 @@ class GeolocationDispatcherHost : public WebContentsObserver { private: // WebContentsObserver - virtual void RenderFrameDeleted(RenderFrameHost* render_frame_host) override; - virtual void RenderViewHostChanged(RenderViewHost* old_host, - RenderViewHost* new_host) override; - virtual void DidNavigateAnyFrame(RenderFrameHost* render_frame_host, - const LoadCommittedDetails& details, - const FrameNavigateParams& params) override; - virtual bool OnMessageReceived( - const IPC::Message& msg, RenderFrameHost* render_frame_host) override; + void RenderFrameDeleted(RenderFrameHost* render_frame_host) override; + void RenderViewHostChanged(RenderViewHost* old_host, + RenderViewHost* new_host) override; + void DidNavigateAnyFrame(RenderFrameHost* render_frame_host, + const LoadCommittedDetails& details, + const FrameNavigateParams& params) override; + bool OnMessageReceived(const IPC::Message& msg, + RenderFrameHost* render_frame_host) override; // Message handlers: // TODO(mlamouri): |requesting_origin| should be a security origin to diff --git a/content/browser/geolocation/geolocation_provider_impl.h b/content/browser/geolocation/geolocation_provider_impl.h index c4a29c5..b3c1286 100644 --- a/content/browser/geolocation/geolocation_provider_impl.h +++ b/content/browser/geolocation/geolocation_provider_impl.h @@ -26,11 +26,11 @@ class CONTENT_EXPORT GeolocationProviderImpl public base::Thread { public: // GeolocationProvider implementation: - virtual scoped_ptr<GeolocationProvider::Subscription> - AddLocationUpdateCallback(const LocationUpdateCallback& callback, - bool use_high_accuracy) override; - virtual void UserDidOptIntoLocationServices() override; - virtual void OverrideLocationForTesting(const Geoposition& position) override; + scoped_ptr<GeolocationProvider::Subscription> AddLocationUpdateCallback( + const LocationUpdateCallback& callback, + bool use_high_accuracy) override; + void UserDidOptIntoLocationServices() override; + void OverrideLocationForTesting(const Geoposition& position) override; // Callback from the LocationArbitrator. Public for testing. void OnLocationUpdate(const Geoposition& position); @@ -48,7 +48,7 @@ class CONTENT_EXPORT GeolocationProviderImpl protected: friend struct DefaultSingletonTraits<GeolocationProviderImpl>; GeolocationProviderImpl(); - virtual ~GeolocationProviderImpl(); + ~GeolocationProviderImpl() override; // Useful for injecting mock geolocation arbitrator in tests. virtual LocationArbitrator* CreateArbitrator(); @@ -75,8 +75,8 @@ class CONTENT_EXPORT GeolocationProviderImpl void NotifyClients(const Geoposition& position); // Thread - virtual void Init() override; - virtual void CleanUp() override; + void Init() override; + void CleanUp() override; base::CallbackList<void(const Geoposition&)> high_accuracy_callbacks_; base::CallbackList<void(const Geoposition&)> low_accuracy_callbacks_; diff --git a/content/browser/geolocation/geolocation_provider_impl_unittest.cc b/content/browser/geolocation/geolocation_provider_impl_unittest.cc index 1558daad..47275e1 100644 --- a/content/browser/geolocation/geolocation_provider_impl_unittest.cc +++ b/content/browser/geolocation/geolocation_provider_impl_unittest.cc @@ -27,7 +27,7 @@ namespace content { class LocationProviderForTestArbitrator : public GeolocationProviderImpl { public: LocationProviderForTestArbitrator() : mock_arbitrator_(NULL) {} - virtual ~LocationProviderForTestArbitrator() {} + ~LocationProviderForTestArbitrator() override {} // Only valid for use on the geolocation thread. MockLocationArbitrator* mock_arbitrator() const { @@ -36,7 +36,7 @@ class LocationProviderForTestArbitrator : public GeolocationProviderImpl { protected: // GeolocationProviderImpl implementation: - virtual LocationArbitrator* CreateArbitrator() override; + LocationArbitrator* CreateArbitrator() override; private: MockLocationArbitrator* mock_arbitrator_; @@ -61,7 +61,7 @@ class MockGeolocationObserver : public GeolocationObserver { class AsyncMockGeolocationObserver : public MockGeolocationObserver { public: - virtual void OnLocationUpdate(const Geoposition& position) override { + void OnLocationUpdate(const Geoposition& position) override { MockGeolocationObserver::OnLocationUpdate(position); base::MessageLoop::current()->Quit(); } diff --git a/content/browser/geolocation/location_arbitrator_impl.h b/content/browser/geolocation/location_arbitrator_impl.h index 45682ab..3ef7d5d 100644 --- a/content/browser/geolocation/location_arbitrator_impl.h +++ b/content/browser/geolocation/location_arbitrator_impl.h @@ -37,15 +37,15 @@ class CONTENT_EXPORT LocationArbitratorImpl : public LocationArbitrator { typedef base::Callback<void(const Geoposition&)> LocationUpdateCallback; explicit LocationArbitratorImpl(const LocationUpdateCallback& callback); - virtual ~LocationArbitratorImpl(); + ~LocationArbitratorImpl() override; static GURL DefaultNetworkProviderURL(); // LocationArbitrator - virtual void StartProviders(bool use_high_accuracy) override; - virtual void StopProviders() override; - virtual void OnPermissionGranted() override; - virtual bool HasPermissionBeenGranted() const override; + void StartProviders(bool use_high_accuracy) override; + void StopProviders() override; + void OnPermissionGranted() override; + bool HasPermissionBeenGranted() const override; protected: AccessTokenStore* GetAccessTokenStore(); diff --git a/content/browser/geolocation/location_arbitrator_impl_unittest.cc b/content/browser/geolocation/location_arbitrator_impl_unittest.cc index ff6ed25..f5142fa 100644 --- a/content/browser/geolocation/location_arbitrator_impl_unittest.cc +++ b/content/browser/geolocation/location_arbitrator_impl_unittest.cc @@ -73,15 +73,13 @@ class TestingLocationArbitrator : public LocationArbitratorImpl { access_token_store_(access_token_store) { } - virtual base::Time GetTimeNow() const override { - return GetTimeNowForTest(); - } + base::Time GetTimeNow() const override { return GetTimeNowForTest(); } - virtual AccessTokenStore* NewAccessTokenStore() override { + AccessTokenStore* NewAccessTokenStore() override { return access_token_store_.get(); } - virtual LocationProvider* NewNetworkLocationProvider( + LocationProvider* NewNetworkLocationProvider( AccessTokenStore* access_token_store, net::URLRequestContextGetter* context, const GURL& url, @@ -89,7 +87,7 @@ class TestingLocationArbitrator : public LocationArbitratorImpl { return new MockLocationProvider(&cell_); } - virtual LocationProvider* NewSystemLocationProvider() override { + LocationProvider* NewSystemLocationProvider() override { return new MockLocationProvider(&gps_); } diff --git a/content/browser/geolocation/location_provider_base.h b/content/browser/geolocation/location_provider_base.h index 196dc5c..1e3f443 100644 --- a/content/browser/geolocation/location_provider_base.h +++ b/content/browser/geolocation/location_provider_base.h @@ -14,15 +14,15 @@ class CONTENT_EXPORT LocationProviderBase : NON_EXPORTED_BASE(public LocationProvider) { public: LocationProviderBase(); - virtual ~LocationProviderBase(); + ~LocationProviderBase() override; protected: void NotifyCallback(const Geoposition& position); // Overridden from LocationProvider: - virtual void SetUpdateCallback( + void SetUpdateCallback( const LocationProviderUpdateCallback& callback) override; - virtual void RequestRefresh() override; + void RequestRefresh() override; private: LocationProviderUpdateCallback callback_; diff --git a/content/browser/geolocation/mock_location_arbitrator.h b/content/browser/geolocation/mock_location_arbitrator.h index b65818b..620bcc8 100644 --- a/content/browser/geolocation/mock_location_arbitrator.h +++ b/content/browser/geolocation/mock_location_arbitrator.h @@ -20,11 +20,10 @@ class MockLocationArbitrator : public LocationArbitrator { bool providers_started() const { return providers_started_; } // LocationArbitrator: - virtual void StartProviders(bool use_high_accuracy) - override; - virtual void StopProviders() override; - virtual void OnPermissionGranted() override; - virtual bool HasPermissionBeenGranted() const override; + void StartProviders(bool use_high_accuracy) override; + void StopProviders() override; + void OnPermissionGranted() override; + bool HasPermissionBeenGranted() const override; private: bool permission_granted_; diff --git a/content/browser/geolocation/mock_location_provider.cc b/content/browser/geolocation/mock_location_provider.cc index 58d9c43..2953ba1 100644 --- a/content/browser/geolocation/mock_location_provider.cc +++ b/content/browser/geolocation/mock_location_provider.cc @@ -86,7 +86,7 @@ class AutoMockLocationProvider : public MockLocationProvider { position_.error_code = Geoposition::ERROR_CODE_POSITION_UNAVAILABLE; } } - virtual bool StartProvider(bool high_accuracy) override { + bool StartProvider(bool high_accuracy) override { MockLocationProvider::StartProvider(high_accuracy); if (!requires_permission_to_start_) { UpdateListenersIfNeeded(); @@ -94,7 +94,7 @@ class AutoMockLocationProvider : public MockLocationProvider { return true; } - virtual void OnPermissionGranted() override { + void OnPermissionGranted() override { MockLocationProvider::OnPermissionGranted(); if (requires_permission_to_start_) { UpdateListenersIfNeeded(); diff --git a/content/browser/geolocation/mock_location_provider.h b/content/browser/geolocation/mock_location_provider.h index e0e2199..882a447 100644 --- a/content/browser/geolocation/mock_location_provider.h +++ b/content/browser/geolocation/mock_location_provider.h @@ -20,16 +20,16 @@ class MockLocationProvider : public LocationProviderBase { // Will update |*self_ref| to point to |this| on construction, and to NULL // on destruction. explicit MockLocationProvider(MockLocationProvider** self_ref); - virtual ~MockLocationProvider(); + ~MockLocationProvider() override; // Updates listeners with the new position. void HandlePositionChanged(const Geoposition& position); // LocationProvider implementation. - virtual bool StartProvider(bool high_accuracy) override; - virtual void StopProvider() override; - virtual void GetPosition(Geoposition* position) override; - virtual void OnPermissionGranted() override; + bool StartProvider(bool high_accuracy) override; + void StopProvider() override; + void GetPosition(Geoposition* position) override; + void OnPermissionGranted() override; Geoposition position_; enum State { STOPPED, LOW_ACCURACY, HIGH_ACCURACY } state_; diff --git a/content/browser/geolocation/network_location_provider.h b/content/browser/geolocation/network_location_provider.h index 06e90da..e3588c6 100644 --- a/content/browser/geolocation/network_location_provider.h +++ b/content/browser/geolocation/network_location_provider.h @@ -69,14 +69,14 @@ class NetworkLocationProvider net::URLRequestContextGetter* context, const GURL& url, const base::string16& access_token); - virtual ~NetworkLocationProvider(); + ~NetworkLocationProvider() override; // LocationProvider implementation - virtual bool StartProvider(bool high_accuracy) override; - virtual void StopProvider() override; - virtual void GetPosition(Geoposition *position) override; - virtual void RequestRefresh() override; - virtual void OnPermissionGranted() override; + bool StartProvider(bool high_accuracy) override; + void StopProvider() override; + void GetPosition(Geoposition* position) override; + void RequestRefresh() override; + void OnPermissionGranted() override; private: // Satisfies a position request from cache or network. diff --git a/content/browser/geolocation/network_location_provider_unittest.cc b/content/browser/geolocation/network_location_provider_unittest.cc index ea52b90..881ec68 100644 --- a/content/browser/geolocation/network_location_provider_unittest.cc +++ b/content/browser/geolocation/network_location_provider_unittest.cc @@ -66,15 +66,11 @@ class MockWifiDataProvider : public WifiDataProvider { MockWifiDataProvider() : start_calls_(0), stop_calls_(0), got_data_(true) {} // WifiDataProvider implementation. - virtual void StartDataProvider() override { - ++start_calls_; - } + void StartDataProvider() override { ++start_calls_; } - virtual void StopDataProvider() override { - ++stop_calls_; - } + void StopDataProvider() override { ++stop_calls_; } - virtual bool GetData(WifiData* data_out) override { + bool GetData(WifiData* data_out) override { CHECK(data_out); *data_out = data_; return got_data_; @@ -93,7 +89,7 @@ class MockWifiDataProvider : public WifiDataProvider { int stop_calls_; private: - virtual ~MockWifiDataProvider() { + ~MockWifiDataProvider() override { CHECK(this == instance_); instance_ = NULL; } diff --git a/content/browser/geolocation/network_location_request.h b/content/browser/geolocation/network_location_request.h index ee1f9b1..f0734e0 100644 --- a/content/browser/geolocation/network_location_request.h +++ b/content/browser/geolocation/network_location_request.h @@ -41,7 +41,7 @@ class NetworkLocationRequest : private net::URLFetcherDelegate { NetworkLocationRequest(net::URLRequestContextGetter* context, const GURL& url, LocationResponseCallback callback); - virtual ~NetworkLocationRequest(); + ~NetworkLocationRequest() override; // Makes a new request. Returns true if the new request was successfully // started. In all cases, any currently pending request will be canceled. @@ -54,7 +54,7 @@ class NetworkLocationRequest : private net::URLFetcherDelegate { private: // net::URLFetcherDelegate - virtual void OnURLFetchComplete(const net::URLFetcher* source) override; + void OnURLFetchComplete(const net::URLFetcher* source) override; scoped_refptr<net::URLRequestContextGetter> url_context_; LocationResponseCallback location_response_callback_; diff --git a/content/browser/geolocation/wifi_data_provider_common.h b/content/browser/geolocation/wifi_data_provider_common.h index 61939c5..771dd41 100644 --- a/content/browser/geolocation/wifi_data_provider_common.h +++ b/content/browser/geolocation/wifi_data_provider_common.h @@ -39,12 +39,12 @@ class CONTENT_EXPORT WifiDataProviderCommon : public WifiDataProvider { WifiDataProviderCommon(); // WifiDataProvider implementation - virtual void StartDataProvider() override; - virtual void StopDataProvider() override; - virtual bool GetData(WifiData* data) override; + void StartDataProvider() override; + void StopDataProvider() override; + bool GetData(WifiData* data) override; protected: - virtual ~WifiDataProviderCommon(); + ~WifiDataProviderCommon() override; // Returns ownership. virtual WlanApiInterface* NewWlanApi() = 0; diff --git a/content/browser/geolocation/wifi_data_provider_common_unittest.cc b/content/browser/geolocation/wifi_data_provider_common_unittest.cc index 54763a6..01a6ffb 100644 --- a/content/browser/geolocation/wifi_data_provider_common_unittest.cc +++ b/content/browser/geolocation/wifi_data_provider_common_unittest.cc @@ -84,11 +84,11 @@ class WifiDataProviderCommonWithMock : public WifiDataProviderCommon { new_polling_policy_(new MockPollingPolicy) {} // WifiDataProviderCommon - virtual WlanApiInterface* NewWlanApi() override { + WlanApiInterface* NewWlanApi() override { CHECK(new_wlan_api_ != NULL); return new_wlan_api_.release(); } - virtual WifiPollingPolicy* NewPollingPolicy() override { + WifiPollingPolicy* NewPollingPolicy() override { CHECK(new_polling_policy_ != NULL); return new_polling_policy_.release(); } @@ -97,7 +97,7 @@ class WifiDataProviderCommonWithMock : public WifiDataProviderCommon { scoped_ptr<MockPollingPolicy> new_polling_policy_; private: - virtual ~WifiDataProviderCommonWithMock() {} + ~WifiDataProviderCommonWithMock() override {} DISALLOW_COPY_AND_ASSIGN(WifiDataProviderCommonWithMock); }; diff --git a/content/browser/geolocation/wifi_data_provider_corewlan_mac.mm b/content/browser/geolocation/wifi_data_provider_corewlan_mac.mm index ee5fbcf..7e783f4 100644 --- a/content/browser/geolocation/wifi_data_provider_corewlan_mac.mm +++ b/content/browser/geolocation/wifi_data_provider_corewlan_mac.mm @@ -55,7 +55,7 @@ class CoreWlanApi : public WifiDataProviderCommon::WlanApiInterface { bool Init(); // WlanApiInterface - virtual bool GetAccessPointData(WifiData::AccessPointDataSet* data) override; + bool GetAccessPointData(WifiData::AccessPointDataSet* data) override; private: base::scoped_nsobject<NSBundle> bundle_; diff --git a/content/browser/geolocation/wifi_data_provider_mac.cc b/content/browser/geolocation/wifi_data_provider_mac.cc index 39d65dd..da54187 100644 --- a/content/browser/geolocation/wifi_data_provider_mac.cc +++ b/content/browser/geolocation/wifi_data_provider_mac.cc @@ -30,7 +30,7 @@ const int kNoWifiPollingIntervalMilliseconds = 20 * 1000; // 20s class Apple80211Api : public WifiDataProviderCommon::WlanApiInterface { public: Apple80211Api(); - virtual ~Apple80211Api(); + ~Apple80211Api() override; // Must be called before any other interface method. Will return false if the // Apple80211 framework cannot be initialized (e.g. running on post-10.5 OSX), @@ -38,7 +38,7 @@ class Apple80211Api : public WifiDataProviderCommon::WlanApiInterface { bool Init(); // WlanApiInterface - virtual bool GetAccessPointData(WifiData::AccessPointDataSet* data) override; + bool GetAccessPointData(WifiData::AccessPointDataSet* data) override; private: // Handle, context and function pointers for Apple80211 library. diff --git a/content/browser/geolocation/wifi_data_provider_mac.h b/content/browser/geolocation/wifi_data_provider_mac.h index 4116a89..c1bd798 100644 --- a/content/browser/geolocation/wifi_data_provider_mac.h +++ b/content/browser/geolocation/wifi_data_provider_mac.h @@ -17,11 +17,11 @@ class WifiDataProviderMac : public WifiDataProviderCommon { WifiDataProviderMac(); private: - virtual ~WifiDataProviderMac(); + ~WifiDataProviderMac() override; // WifiDataProviderCommon - virtual WlanApiInterface* NewWlanApi() override; - virtual WifiPollingPolicy* NewPollingPolicy() override; + WlanApiInterface* NewWlanApi() override; + WifiPollingPolicy* NewPollingPolicy() override; DISALLOW_COPY_AND_ASSIGN(WifiDataProviderMac); }; diff --git a/content/browser/gpu/browser_gpu_channel_host_factory.h b/content/browser/gpu/browser_gpu_channel_host_factory.h index c013558..4bc0b41 100644 --- a/content/browser/gpu/browser_gpu_channel_host_factory.h +++ b/content/browser/gpu/browser_gpu_channel_host_factory.h @@ -24,12 +24,11 @@ class CONTENT_EXPORT BrowserGpuChannelHostFactory static BrowserGpuChannelHostFactory* instance() { return instance_; } // GpuChannelHostFactory implementation. - virtual bool IsMainThread() override; - virtual base::MessageLoop* GetMainLoop() override; - virtual scoped_refptr<base::MessageLoopProxy> GetIOLoopProxy() override; - virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory( - size_t size) override; - virtual CreateCommandBufferResult CreateViewCommandBuffer( + bool IsMainThread() override; + base::MessageLoop* GetMainLoop() override; + scoped_refptr<base::MessageLoopProxy> GetIOLoopProxy() override; + scoped_ptr<base::SharedMemory> AllocateSharedMemory(size_t size) override; + CreateCommandBufferResult CreateViewCommandBuffer( int32 surface_id, const GPUCreateCommandBufferConfig& init_params, int32 route_id) override; @@ -58,7 +57,7 @@ class CONTENT_EXPORT BrowserGpuChannelHostFactory class EstablishRequest; BrowserGpuChannelHostFactory(); - virtual ~BrowserGpuChannelHostFactory(); + ~BrowserGpuChannelHostFactory() override; void GpuChannelEstablished(); void CreateViewCommandBufferOnIO( diff --git a/content/browser/gpu/browser_gpu_memory_buffer_manager.h b/content/browser/gpu/browser_gpu_memory_buffer_manager.h index 2d0bbc1..f37fc5c 100644 --- a/content/browser/gpu/browser_gpu_memory_buffer_manager.h +++ b/content/browser/gpu/browser_gpu_memory_buffer_manager.h @@ -19,16 +19,16 @@ class CONTENT_EXPORT BrowserGpuMemoryBufferManager AllocationCallback; explicit BrowserGpuMemoryBufferManager(int gpu_client_id); - virtual ~BrowserGpuMemoryBufferManager(); + ~BrowserGpuMemoryBufferManager() override; static BrowserGpuMemoryBufferManager* current(); // Overridden from cc::GpuMemoryBufferManager: - virtual scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( + scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( const gfx::Size& size, gfx::GpuMemoryBuffer::Format format, gfx::GpuMemoryBuffer::Usage usage) override; - virtual gfx::GpuMemoryBuffer* GpuMemoryBufferFromClientBuffer( + gfx::GpuMemoryBuffer* GpuMemoryBufferFromClientBuffer( ClientBuffer buffer) override; void AllocateGpuMemoryBufferForChildProcess( diff --git a/content/browser/gpu/gpu_data_manager_impl.h b/content/browser/gpu/gpu_data_manager_impl.h index 2bd8f4a..981ad7a 100644 --- a/content/browser/gpu/gpu_data_manager_impl.h +++ b/content/browser/gpu/gpu_data_manager_impl.h @@ -58,33 +58,32 @@ class CONTENT_EXPORT GpuDataManagerImpl static GpuDataManagerImpl* GetInstance(); // GpuDataManager implementation. - virtual void InitializeForTesting( - const std::string& gpu_blacklist_json, - const gpu::GPUInfo& gpu_info) override; - virtual bool IsFeatureBlacklisted(int feature) const override; - virtual gpu::GPUInfo GetGPUInfo() const override; - virtual void GetGpuProcessHandles( + void InitializeForTesting(const std::string& gpu_blacklist_json, + const gpu::GPUInfo& gpu_info) override; + bool IsFeatureBlacklisted(int feature) const override; + gpu::GPUInfo GetGPUInfo() const override; + void GetGpuProcessHandles( const GetGpuProcessHandlesCallback& callback) const override; - virtual bool GpuAccessAllowed(std::string* reason) const override; - virtual void RequestCompleteGpuInfoIfNeeded() override; - virtual bool IsEssentialGpuInfoAvailable() const override; - virtual bool IsCompleteGpuInfoAvailable() const override; - virtual void RequestVideoMemoryUsageStatsUpdate() const override; - virtual bool ShouldUseSwiftShader() const override; - virtual void RegisterSwiftShaderPath(const base::FilePath& path) override; - virtual bool ShouldUseWarp() const override; - virtual void AddObserver(GpuDataManagerObserver* observer) override; - virtual void RemoveObserver(GpuDataManagerObserver* observer) override; - virtual void UnblockDomainFrom3DAPIs(const GURL& url) override; - virtual void DisableGpuWatchdog() override; - virtual void SetGLStrings(const std::string& gl_vendor, - const std::string& gl_renderer, - const std::string& gl_version) override; - virtual void GetGLStrings(std::string* gl_vendor, - std::string* gl_renderer, - std::string* gl_version) override; - virtual void DisableHardwareAcceleration() override; - virtual bool CanUseGpuBrowserCompositor() const override; + bool GpuAccessAllowed(std::string* reason) const override; + void RequestCompleteGpuInfoIfNeeded() override; + bool IsEssentialGpuInfoAvailable() const override; + bool IsCompleteGpuInfoAvailable() const override; + void RequestVideoMemoryUsageStatsUpdate() const override; + bool ShouldUseSwiftShader() const override; + void RegisterSwiftShaderPath(const base::FilePath& path) override; + bool ShouldUseWarp() const override; + void AddObserver(GpuDataManagerObserver* observer) override; + void RemoveObserver(GpuDataManagerObserver* observer) override; + void UnblockDomainFrom3DAPIs(const GURL& url) override; + void DisableGpuWatchdog() override; + void SetGLStrings(const std::string& gl_vendor, + const std::string& gl_renderer, + const std::string& gl_version) override; + void GetGLStrings(std::string* gl_vendor, + std::string* gl_renderer, + std::string* gl_version) override; + void DisableHardwareAcceleration() override; + bool CanUseGpuBrowserCompositor() const override; // This collects preliminary GPU info, load GpuBlacklist, and compute the // preliminary blacklisted features; it should only be called at browser @@ -207,7 +206,7 @@ class CONTENT_EXPORT GpuDataManagerImpl }; GpuDataManagerImpl(); - virtual ~GpuDataManagerImpl(); + ~GpuDataManagerImpl() override; mutable base::Lock lock_; scoped_ptr<GpuDataManagerImplPrivate> private_; diff --git a/content/browser/gpu/gpu_data_manager_impl_private_unittest.cc b/content/browser/gpu/gpu_data_manager_impl_private_unittest.cc index 312dd9e..00963fe 100644 --- a/content/browser/gpu/gpu_data_manager_impl_private_unittest.cc +++ b/content/browser/gpu/gpu_data_manager_impl_private_unittest.cc @@ -29,18 +29,16 @@ class TestObserver : public GpuDataManagerObserver { : gpu_info_updated_(false), video_memory_usage_stats_updated_(false) { } - virtual ~TestObserver() { } + ~TestObserver() override {} bool gpu_info_updated() const { return gpu_info_updated_; } bool video_memory_usage_stats_updated() const { return video_memory_usage_stats_updated_; } - virtual void OnGpuInfoUpdate() override { - gpu_info_updated_ = true; - } + void OnGpuInfoUpdate() override { gpu_info_updated_ = true; } - virtual void OnVideoMemoryUsageStatsUpdate( + void OnVideoMemoryUsageStatsUpdate( const GPUVideoMemoryUsageStats& stats) override { video_memory_usage_stats_updated_ = true; } diff --git a/content/browser/gpu/gpu_internals_ui.cc b/content/browser/gpu/gpu_internals_ui.cc index 8b59931..c8758c5 100644 --- a/content/browser/gpu/gpu_internals_ui.cc +++ b/content/browser/gpu/gpu_internals_ui.cc @@ -242,14 +242,14 @@ class GpuMessageHandler public GpuDataManagerObserver { public: GpuMessageHandler(); - virtual ~GpuMessageHandler(); + ~GpuMessageHandler() override; // WebUIMessageHandler implementation. - virtual void RegisterMessages() override; + void RegisterMessages() override; // GpuDataManagerObserver implementation. - virtual void OnGpuInfoUpdate() override; - virtual void OnGpuSwitching() override; + void OnGpuInfoUpdate() override; + void OnGpuSwitching() override; // Messages void OnBrowserBridgeInitialized(const base::ListValue* list); diff --git a/content/browser/gpu/gpu_ipc_browsertests.cc b/content/browser/gpu/gpu_ipc_browsertests.cc index 3c03637..dd78ba6 100644 --- a/content/browser/gpu/gpu_ipc_browsertests.cc +++ b/content/browser/gpu/gpu_ipc_browsertests.cc @@ -25,7 +25,7 @@ const content::CauseForGpuLaunch kInitCause = class ContextTestBase : public content::ContentBrowserTest { public: - virtual void SetUpOnMainThread() override { + void SetUpOnMainThread() override { if (!content::BrowserGpuChannelHostFactory::CanUseForTesting()) return; @@ -52,7 +52,7 @@ class ContextTestBase : public content::ContentBrowserTest { ContentBrowserTest::SetUpOnMainThread(); } - virtual void TearDownOnMainThread() override { + void TearDownOnMainThread() override { // Must delete the context first. context_.reset(NULL); ContentBrowserTest::TearDownOnMainThread(); @@ -73,7 +73,7 @@ namespace content { class BrowserGpuChannelHostFactoryTest : public ContentBrowserTest { public: - virtual void SetUpOnMainThread() override { + void SetUpOnMainThread() override { if (!BrowserGpuChannelHostFactory::CanUseForTesting()) return; diff --git a/content/browser/gpu/gpu_memory_buffer_factory_host_impl.h b/content/browser/gpu/gpu_memory_buffer_factory_host_impl.h index f8bf42c..e425b94 100644 --- a/content/browser/gpu/gpu_memory_buffer_factory_host_impl.h +++ b/content/browser/gpu/gpu_memory_buffer_factory_host_impl.h @@ -15,17 +15,17 @@ class CONTENT_EXPORT GpuMemoryBufferFactoryHostImpl : public GpuMemoryBufferFactoryHost { public: GpuMemoryBufferFactoryHostImpl(); - virtual ~GpuMemoryBufferFactoryHostImpl(); + ~GpuMemoryBufferFactoryHostImpl() override; // Overridden from GpuMemoryBufferFactoryHost: - virtual void CreateGpuMemoryBuffer( + void CreateGpuMemoryBuffer( const gfx::GpuMemoryBufferHandle& handle, const gfx::Size& size, gfx::GpuMemoryBuffer::Format format, gfx::GpuMemoryBuffer::Usage usage, const CreateGpuMemoryBufferCallback& callback) override; - virtual void DestroyGpuMemoryBuffer(const gfx::GpuMemoryBufferHandle& handle, - int32 sync_point) override; + void DestroyGpuMemoryBuffer(const gfx::GpuMemoryBufferHandle& handle, + int32 sync_point) override; void set_gpu_host_id(int gpu_host_id) { gpu_host_id_ = gpu_host_id; } diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc index 0b4bfa8..7c181a8 100644 --- a/content/browser/gpu/gpu_process_host.cc +++ b/content/browser/gpu/gpu_process_host.cc @@ -153,7 +153,7 @@ class GpuSandboxedProcessLauncherDelegate : ipc_fd_(host->TakeClientFileDescriptor()) {} #endif - virtual ~GpuSandboxedProcessLauncherDelegate() {} + ~GpuSandboxedProcessLauncherDelegate() override {} #if defined(OS_WIN) virtual bool ShouldSandbox() override { @@ -250,9 +250,7 @@ class GpuSandboxedProcessLauncherDelegate } #elif defined(OS_POSIX) - virtual base::ScopedFD TakeIpcFd() override { - return ipc_fd_.Pass(); - } + base::ScopedFD TakeIpcFd() override { return ipc_fd_.Pass(); } #endif // OS_WIN private: diff --git a/content/browser/gpu/gpu_process_host.h b/content/browser/gpu/gpu_process_host.h index b17580b..636f61a 100644 --- a/content/browser/gpu/gpu_process_host.h +++ b/content/browser/gpu/gpu_process_host.h @@ -95,7 +95,7 @@ class GpuProcessHost : public BrowserChildProcessHostDelegate, int host_id() const { return host_id_; } // IPC::Sender implementation. - virtual bool Send(IPC::Message* msg) override; + bool Send(IPC::Message* msg) override; // Adds a message filter to the GpuProcessHost's channel. void AddFilter(IPC::MessageFilter* filter); @@ -145,7 +145,7 @@ class GpuProcessHost : public BrowserChildProcessHostDelegate, static bool ValidateHost(GpuProcessHost* host); GpuProcessHost(int host_id, GpuProcessKind kind); - virtual ~GpuProcessHost(); + ~GpuProcessHost() override; bool Init(); @@ -153,10 +153,10 @@ class GpuProcessHost : public BrowserChildProcessHostDelegate, void RouteOnUIThread(const IPC::Message& message); // BrowserChildProcessHostDelegate implementation. - virtual bool OnMessageReceived(const IPC::Message& message) override; - virtual void OnChannelConnected(int32 peer_pid) override; - virtual void OnProcessLaunched() override; - virtual void OnProcessCrashed(int exit_code) override; + bool OnMessageReceived(const IPC::Message& message) override; + void OnChannelConnected(int32 peer_pid) override; + void OnProcessLaunched() override; + void OnProcessCrashed(int exit_code) override; // Message handlers. void OnInitialized(bool result, const gpu::GPUInfo& gpu_info); diff --git a/content/browser/gpu/gpu_process_host_ui_shim.h b/content/browser/gpu/gpu_process_host_ui_shim.h index 526e6bc2..e47dc90 100644 --- a/content/browser/gpu/gpu_process_host_ui_shim.h +++ b/content/browser/gpu/gpu_process_host_ui_shim.h @@ -64,13 +64,13 @@ class GpuProcessHostUIShim : public IPC::Listener, CONTENT_EXPORT static GpuProcessHostUIShim* GetOneInstance(); // IPC::Sender implementation. - virtual bool Send(IPC::Message* msg) override; + bool Send(IPC::Message* msg) override; // IPC::Listener implementation. // The GpuProcessHost causes this to be called on the UI thread to // dispatch the incoming messages from the GPU process, which are // actually received on the IO thread. - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; CONTENT_EXPORT void SimulateRemoveAllContext(); CONTENT_EXPORT void SimulateCrash(); @@ -78,7 +78,7 @@ class GpuProcessHostUIShim : public IPC::Listener, private: explicit GpuProcessHostUIShim(int host_id); - virtual ~GpuProcessHostUIShim(); + ~GpuProcessHostUIShim() override; // Message handlers. bool OnControlMessageReceived(const IPC::Message& message); diff --git a/content/browser/gpu/gpu_surface_tracker.h b/content/browser/gpu/gpu_surface_tracker.h index af30fba..03d182f 100644 --- a/content/browser/gpu/gpu_surface_tracker.h +++ b/content/browser/gpu/gpu_surface_tracker.h @@ -51,7 +51,7 @@ class GpuSurfaceTracker : public GpuSurfaceLookup { // GpuSurfaceLookup implementation: // Returns the native widget associated with a given surface_id. - virtual gfx::AcceleratedWidget AcquireNativeWidget(int surface_id) override; + gfx::AcceleratedWidget AcquireNativeWidget(int surface_id) override; // Gets the global instance of the surface tracker. static GpuSurfaceTracker* Get() { return GetInstance(); } @@ -124,7 +124,7 @@ class GpuSurfaceTracker : public GpuSurfaceLookup { friend struct DefaultSingletonTraits<GpuSurfaceTracker>; GpuSurfaceTracker(); - virtual ~GpuSurfaceTracker(); + ~GpuSurfaceTracker() override; base::Lock lock_; SurfaceMap surface_map_; diff --git a/content/browser/histogram_internals_request_job.h b/content/browser/histogram_internals_request_job.h index 6e52221..6304198 100644 --- a/content/browser/histogram_internals_request_job.h +++ b/content/browser/histogram_internals_request_job.h @@ -17,13 +17,13 @@ class HistogramInternalsRequestJob : public net::URLRequestSimpleJob { HistogramInternalsRequestJob(net::URLRequest* request, net::NetworkDelegate* network_delegate); - virtual int GetData(std::string* mime_type, - std::string* charset, - std::string* data, - const net::CompletionCallback& callback) const override; + int GetData(std::string* mime_type, + std::string* charset, + std::string* data, + const net::CompletionCallback& callback) const override; private: - virtual ~HistogramInternalsRequestJob() {} + ~HistogramInternalsRequestJob() override {} // The string to select histograms which have |path_| as a substring. std::string path_; diff --git a/content/browser/histogram_message_filter.h b/content/browser/histogram_message_filter.h index 11ae8e0..25fa676 100644 --- a/content/browser/histogram_message_filter.h +++ b/content/browser/histogram_message_filter.h @@ -19,10 +19,10 @@ class HistogramMessageFilter : public BrowserMessageFilter { HistogramMessageFilter(); // BrowserMessageFilter implementation. - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; private: - virtual ~HistogramMessageFilter(); + ~HistogramMessageFilter() override; // Message handlers. void OnChildHistogramData(int sequence_number, diff --git a/content/browser/histogram_synchronizer.h b/content/browser/histogram_synchronizer.h index 4cfb766..b7d75e0 100644 --- a/content/browser/histogram_synchronizer.h +++ b/content/browser/histogram_synchronizer.h @@ -80,7 +80,7 @@ class HistogramSynchronizer : public HistogramSubscriber { class RequestContext; HistogramSynchronizer(); - virtual ~HistogramSynchronizer(); + ~HistogramSynchronizer() override; // Establish a new sequence number, and use it to notify all processes // (renderers, plugins, GPU, etc) of the need to supply, to the browser, @@ -95,14 +95,14 @@ class HistogramSynchronizer : public HistogramSubscriber { // Update the number of pending processes for the given |sequence_number|. // This is called on UI thread. - virtual void OnPendingProcesses(int sequence_number, - int pending_processes, - bool end) override; + void OnPendingProcesses(int sequence_number, + int pending_processes, + bool end) override; // Send histogram_data back to caller and also record that we are waiting // for one less histogram data from child process for the given sequence // number. This method is accessible on UI thread. - virtual void OnHistogramDataCollected( + void OnHistogramDataCollected( int sequence_number, const std::vector<std::string>& pickled_histograms) override; diff --git a/content/browser/host_zoom_map_impl.h b/content/browser/host_zoom_map_impl.h index 464d424..d2a8a67 100644 --- a/content/browser/host_zoom_map_impl.h +++ b/content/browser/host_zoom_map_impl.h @@ -28,35 +28,31 @@ class CONTENT_EXPORT HostZoomMapImpl : public NON_EXPORTED_BASE(HostZoomMap), public base::SupportsUserData::Data { public: HostZoomMapImpl(); - virtual ~HostZoomMapImpl(); + ~HostZoomMapImpl() override; // HostZoomMap implementation: - virtual void CopyFrom(HostZoomMap* copy) override; - virtual double GetZoomLevelForHostAndScheme( - const std::string& scheme, - const std::string& host) const override; + void CopyFrom(HostZoomMap* copy) override; + double GetZoomLevelForHostAndScheme(const std::string& scheme, + const std::string& host) const override; // TODO(wjmaclean) Should we use a GURL here? crbug.com/384486 - virtual bool HasZoomLevel(const std::string& scheme, - const std::string& host) const override; - virtual ZoomLevelVector GetAllZoomLevels() const override; - virtual void SetZoomLevelForHost( - const std::string& host, - double level) override; - virtual void SetZoomLevelForHostAndScheme( - const std::string& scheme, - const std::string& host, - double level) override; - virtual bool UsesTemporaryZoomLevel(int render_process_id, - int render_view_id) const override; - virtual void SetTemporaryZoomLevel(int render_process_id, - int render_view_id, - double level) override; - - virtual void ClearTemporaryZoomLevel(int render_process_id, - int render_view_id) override; - virtual double GetDefaultZoomLevel() const override; - virtual void SetDefaultZoomLevel(double level) override; - virtual scoped_ptr<Subscription> AddZoomLevelChangedCallback( + bool HasZoomLevel(const std::string& scheme, + const std::string& host) const override; + ZoomLevelVector GetAllZoomLevels() const override; + void SetZoomLevelForHost(const std::string& host, double level) override; + void SetZoomLevelForHostAndScheme(const std::string& scheme, + const std::string& host, + double level) override; + bool UsesTemporaryZoomLevel(int render_process_id, + int render_view_id) const override; + void SetTemporaryZoomLevel(int render_process_id, + int render_view_id, + double level) override; + + void ClearTemporaryZoomLevel(int render_process_id, + int render_view_id) override; + double GetDefaultZoomLevel() const override; + void SetDefaultZoomLevel(double level) override; + scoped_ptr<Subscription> AddZoomLevelChangedCallback( const ZoomLevelChangedCallback& callback) override; // Returns the current zoom level for the specified WebContents. This may @@ -86,9 +82,9 @@ class CONTENT_EXPORT HostZoomMapImpl : public NON_EXPORTED_BASE(HostZoomMap), int render_view_id) const; // NotificationObserver implementation. - virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) override; + void Observe(int type, + const NotificationSource& source, + const NotificationDetails& details) override; private: typedef std::map<std::string, double> HostZoomLevels; diff --git a/content/browser/indexed_db/indexed_db_active_blob_registry_unittest.cc b/content/browser/indexed_db/indexed_db_active_blob_registry_unittest.cc index 7193b90..aa412cf 100644 --- a/content/browser/indexed_db/indexed_db_active_blob_registry_unittest.cc +++ b/content/browser/indexed_db/indexed_db_active_blob_registry_unittest.cc @@ -19,8 +19,8 @@ class RegistryTestMockFactory : public MockIndexedDBFactory { public: RegistryTestMockFactory() : duplicate_calls_(false) {} - virtual void ReportOutstandingBlobs(const GURL& origin_url, - bool blobs_outstanding) override { + void ReportOutstandingBlobs(const GURL& origin_url, + bool blobs_outstanding) override { if (blobs_outstanding) { if (origins_.count(origin_url)) { duplicate_calls_ = true; @@ -45,7 +45,7 @@ class RegistryTestMockFactory : public MockIndexedDBFactory { } private: - virtual ~RegistryTestMockFactory() {} + ~RegistryTestMockFactory() override {} std::set<GURL> origins_; bool duplicate_calls_; @@ -63,7 +63,7 @@ class MockIDBBackingStore : public IndexedDBFakeBackingStore { : IndexedDBFakeBackingStore(factory, task_runner), duplicate_calls_(false) {} - virtual void ReportBlobUnused(int64 database_id, int64 blob_key) override { + void ReportBlobUnused(int64 database_id, int64 blob_key) override { unused_blobs_.insert(std::make_pair(database_id, blob_key)); } @@ -78,7 +78,7 @@ class MockIDBBackingStore : public IndexedDBFakeBackingStore { const KeyPairSet& unused_blobs() const { return unused_blobs_; } protected: - virtual ~MockIDBBackingStore() {} + ~MockIDBBackingStore() override {} private: KeyPairSet unused_blobs_; diff --git a/content/browser/indexed_db/indexed_db_backing_store.cc b/content/browser/indexed_db/indexed_db_backing_store.cc index 4bbf2f0..781eadc 100644 --- a/content/browser/indexed_db/indexed_db_backing_store.cc +++ b/content/browser/indexed_db/indexed_db_backing_store.cc @@ -486,14 +486,13 @@ WARN_UNUSED_RESULT static leveldb::Status GetMaxObjectStoreId( class DefaultLevelDBFactory : public LevelDBFactory { public: DefaultLevelDBFactory() {} - virtual leveldb::Status OpenLevelDB(const base::FilePath& file_name, - const LevelDBComparator* comparator, - scoped_ptr<LevelDBDatabase>* db, - bool* is_disk_full) override { + leveldb::Status OpenLevelDB(const base::FilePath& file_name, + const LevelDBComparator* comparator, + scoped_ptr<LevelDBDatabase>* db, + bool* is_disk_full) override { return LevelDBDatabase::Open(file_name, comparator, db, is_disk_full); } - virtual leveldb::Status DestroyLevelDB(const base::FilePath& file_name) - override { + leveldb::Status DestroyLevelDB(const base::FilePath& file_name) override { return LevelDBDatabase::Destroy(file_name); } @@ -2207,12 +2206,11 @@ class IndexedDBBackingStore::Transaction::ChainedBlobWriterImpl FROM_HERE, base::Bind(&ChainedBlobWriterImpl::WriteNextFile, this)); } - virtual void set_delegate(scoped_ptr<FileWriterDelegate> delegate) override { + void set_delegate(scoped_ptr<FileWriterDelegate> delegate) override { delegate_.reset(delegate.release()); } - virtual void ReportWriteCompletion(bool succeeded, - int64 bytes_written) override { + void ReportWriteCompletion(bool succeeded, int64 bytes_written) override { DCHECK(waiting_for_callback_); DCHECK(!succeeded || bytes_written >= 0); waiting_for_callback_ = false; @@ -2233,7 +2231,7 @@ class IndexedDBBackingStore::Transaction::ChainedBlobWriterImpl } } - virtual void Abort() override { + void Abort() override { if (!waiting_for_callback_) return; self_ref_ = this; @@ -2241,7 +2239,7 @@ class IndexedDBBackingStore::Transaction::ChainedBlobWriterImpl } private: - virtual ~ChainedBlobWriterImpl() {} + ~ChainedBlobWriterImpl() override {} void WriteNextFile() { DCHECK(!waiting_for_callback_); @@ -3252,24 +3250,22 @@ class ObjectStoreKeyCursorImpl : public IndexedDBBackingStore::Cursor { database_id, cursor_options) {} - virtual Cursor* Clone() override { - return new ObjectStoreKeyCursorImpl(this); - } + Cursor* Clone() override { return new ObjectStoreKeyCursorImpl(this); } // IndexedDBBackingStore::Cursor - virtual IndexedDBValue* value() override { + IndexedDBValue* value() override { NOTREACHED(); return NULL; } - virtual bool LoadCurrentRow() override; + bool LoadCurrentRow() override; protected: - virtual std::string EncodeKey(const IndexedDBKey& key) override { + std::string EncodeKey(const IndexedDBKey& key) override { return ObjectStoreDataKey::Encode( cursor_options_.database_id, cursor_options_.object_store_id, key); } - virtual std::string EncodeKey(const IndexedDBKey& key, - const IndexedDBKey& primary_key) override { + std::string EncodeKey(const IndexedDBKey& key, + const IndexedDBKey& primary_key) override { NOTREACHED(); return std::string(); } @@ -3318,19 +3314,19 @@ class ObjectStoreCursorImpl : public IndexedDBBackingStore::Cursor { database_id, cursor_options) {} - virtual Cursor* Clone() override { return new ObjectStoreCursorImpl(this); } + Cursor* Clone() override { return new ObjectStoreCursorImpl(this); } // IndexedDBBackingStore::Cursor - virtual IndexedDBValue* value() override { return ¤t_value_; } - virtual bool LoadCurrentRow() override; + IndexedDBValue* value() override { return ¤t_value_; } + bool LoadCurrentRow() override; protected: - virtual std::string EncodeKey(const IndexedDBKey& key) override { + std::string EncodeKey(const IndexedDBKey& key) override { return ObjectStoreDataKey::Encode( cursor_options_.database_id, cursor_options_.object_store_id, key); } - virtual std::string EncodeKey(const IndexedDBKey& key, - const IndexedDBKey& primary_key) override { + std::string EncodeKey(const IndexedDBKey& key, + const IndexedDBKey& primary_key) override { NOTREACHED(); return std::string(); } @@ -3388,32 +3384,30 @@ class IndexKeyCursorImpl : public IndexedDBBackingStore::Cursor { database_id, cursor_options) {} - virtual Cursor* Clone() override { return new IndexKeyCursorImpl(this); } + Cursor* Clone() override { return new IndexKeyCursorImpl(this); } // IndexedDBBackingStore::Cursor - virtual IndexedDBValue* value() override { + IndexedDBValue* value() override { NOTREACHED(); return NULL; } - virtual const IndexedDBKey& primary_key() const override { - return *primary_key_; - } - virtual const IndexedDBBackingStore::RecordIdentifier& record_identifier() + const IndexedDBKey& primary_key() const override { return *primary_key_; } + const IndexedDBBackingStore::RecordIdentifier& record_identifier() const override { NOTREACHED(); return record_identifier_; } - virtual bool LoadCurrentRow() override; + bool LoadCurrentRow() override; protected: - virtual std::string EncodeKey(const IndexedDBKey& key) override { + std::string EncodeKey(const IndexedDBKey& key) override { return IndexDataKey::Encode(cursor_options_.database_id, cursor_options_.object_store_id, cursor_options_.index_id, key); } - virtual std::string EncodeKey(const IndexedDBKey& key, - const IndexedDBKey& primary_key) override { + std::string EncodeKey(const IndexedDBKey& key, + const IndexedDBKey& primary_key) override { return IndexDataKey::Encode(cursor_options_.database_id, cursor_options_.object_store_id, cursor_options_.index_id, @@ -3503,29 +3497,27 @@ class IndexCursorImpl : public IndexedDBBackingStore::Cursor { database_id, cursor_options) {} - virtual Cursor* Clone() override { return new IndexCursorImpl(this); } + Cursor* Clone() override { return new IndexCursorImpl(this); } // IndexedDBBackingStore::Cursor - virtual IndexedDBValue* value() override { return ¤t_value_; } - virtual const IndexedDBKey& primary_key() const override { - return *primary_key_; - } - virtual const IndexedDBBackingStore::RecordIdentifier& record_identifier() + IndexedDBValue* value() override { return ¤t_value_; } + const IndexedDBKey& primary_key() const override { return *primary_key_; } + const IndexedDBBackingStore::RecordIdentifier& record_identifier() const override { NOTREACHED(); return record_identifier_; } - virtual bool LoadCurrentRow() override; + bool LoadCurrentRow() override; protected: - virtual std::string EncodeKey(const IndexedDBKey& key) override { + std::string EncodeKey(const IndexedDBKey& key) override { return IndexDataKey::Encode(cursor_options_.database_id, cursor_options_.object_store_id, cursor_options_.index_id, key); } - virtual std::string EncodeKey(const IndexedDBKey& key, - const IndexedDBKey& primary_key) override { + std::string EncodeKey(const IndexedDBKey& key, + const IndexedDBKey& primary_key) override { return IndexDataKey::Encode(cursor_options_.database_id, cursor_options_.object_store_id, cursor_options_.index_id, @@ -4107,14 +4099,14 @@ class IndexedDBBackingStore::Transaction::BlobWriteCallbackWrapper BlobWriteCallbackWrapper(IndexedDBBackingStore::Transaction* transaction, scoped_refptr<BlobWriteCallback> callback) : transaction_(transaction), callback_(callback) {} - virtual void Run(bool succeeded) override { + void Run(bool succeeded) override { callback_->Run(succeeded); if (succeeded) // Else it's already been deleted during rollback. transaction_->chained_blob_writer_ = NULL; } private: - virtual ~BlobWriteCallbackWrapper() {} + ~BlobWriteCallbackWrapper() override {} friend class base::RefCounted<IndexedDBBackingStore::BlobWriteCallback>; IndexedDBBackingStore::Transaction* transaction_; diff --git a/content/browser/indexed_db/indexed_db_backing_store.h b/content/browser/indexed_db/indexed_db_backing_store.h index 1e72d80..a15b237 100644 --- a/content/browser/indexed_db/indexed_db_backing_store.h +++ b/content/browser/indexed_db/indexed_db_backing_store.h @@ -58,9 +58,9 @@ class CONTENT_EXPORT IndexedDBBackingStore public: class CONTENT_EXPORT Comparator : public LevelDBComparator { public: - virtual int Compare(const base::StringPiece& a, - const base::StringPiece& b) const override; - virtual const char* Name() const override; + int Compare(const base::StringPiece& a, + const base::StringPiece& b) const override; + const char* Name() const override; }; class CONTENT_EXPORT RecordIdentifier { diff --git a/content/browser/indexed_db/indexed_db_backing_store_unittest.cc b/content/browser/indexed_db/indexed_db_backing_store_unittest.cc index b6f8297..e4a2322 100644 --- a/content/browser/indexed_db/indexed_db_backing_store_unittest.cc +++ b/content/browser/indexed_db/indexed_db_backing_store_unittest.cc @@ -34,24 +34,23 @@ namespace { class Comparator : public LevelDBComparator { public: - virtual int Compare(const base::StringPiece& a, - const base::StringPiece& b) const override { + int Compare(const base::StringPiece& a, + const base::StringPiece& b) const override { return content::Compare(a, b, false /*index_keys*/); } - virtual const char* Name() const override { return "idb_cmp1"; } + const char* Name() const override { return "idb_cmp1"; } }; class DefaultLevelDBFactory : public LevelDBFactory { public: DefaultLevelDBFactory() {} - virtual leveldb::Status OpenLevelDB(const base::FilePath& file_name, - const LevelDBComparator* comparator, - scoped_ptr<LevelDBDatabase>* db, - bool* is_disk_full) override { + leveldb::Status OpenLevelDB(const base::FilePath& file_name, + const LevelDBComparator* comparator, + scoped_ptr<LevelDBDatabase>* db, + bool* is_disk_full) override { return LevelDBDatabase::Open(file_name, comparator, db, is_disk_full); } - virtual leveldb::Status DestroyLevelDB( - const base::FilePath& file_name) override { + leveldb::Status DestroyLevelDB(const base::FilePath& file_name) override { return LevelDBDatabase::Destroy(file_name); } @@ -114,9 +113,9 @@ class TestableIndexedDBBackingStore : public IndexedDBBackingStore { void ClearRemovals() { removals_.clear(); } protected: - virtual ~TestableIndexedDBBackingStore() {} + ~TestableIndexedDBBackingStore() override {} - virtual bool WriteBlobFile( + bool WriteBlobFile( int64 database_id, const Transaction::WriteDescriptor& descriptor, Transaction::ChainedBlobWriter* chained_blob_writer) override { @@ -137,7 +136,7 @@ class TestableIndexedDBBackingStore : public IndexedDBBackingStore { return true; } - virtual bool RemoveBlobFile(int64 database_id, int64 key) override { + bool RemoveBlobFile(int64 database_id, int64 key) override { if (database_id_ != database_id || !KeyPrefix::IsValidDatabaseId(database_id)) { return false; @@ -147,7 +146,7 @@ class TestableIndexedDBBackingStore : public IndexedDBBackingStore { } // Timers don't play nicely with unit tests. - virtual void StartJournalCleaningTimer() override { + void StartJournalCleaningTimer() override { CleanPrimaryJournalIgnoreReturn(); } @@ -201,9 +200,9 @@ class TestIDBFactory : public IndexedDBFactoryImpl { } protected: - virtual ~TestIDBFactory() {} + ~TestIDBFactory() override {} - virtual scoped_refptr<IndexedDBBackingStore> OpenBackingStoreHelper( + scoped_refptr<IndexedDBBackingStore> OpenBackingStoreHelper( const GURL& origin_url, const base::FilePath& data_directory, net::URLRequestContext* request_context, @@ -359,7 +358,7 @@ class IndexedDBBackingStoreTest : public testing::Test { class TestCallback : public IndexedDBBackingStore::BlobWriteCallback { public: TestCallback() : called(false), succeeded(false) {} - virtual void Run(bool succeeded_in) override { + void Run(bool succeeded_in) override { called = true; succeeded = succeeded_in; } @@ -367,7 +366,7 @@ class TestCallback : public IndexedDBBackingStore::BlobWriteCallback { bool succeeded; protected: - virtual ~TestCallback() {} + ~TestCallback() override {} private: DISALLOW_COPY_AND_ASSIGN(TestCallback); diff --git a/content/browser/indexed_db/indexed_db_browsertest.cc b/content/browser/indexed_db/indexed_db_browsertest.cc index 10dbc01..12a28e1 100644 --- a/content/browser/indexed_db/indexed_db_browsertest.cc +++ b/content/browser/indexed_db/indexed_db_browsertest.cc @@ -246,7 +246,7 @@ class IndexedDBBrowserTestWithLowQuota : public IndexedDBBrowserTest { public: IndexedDBBrowserTestWithLowQuota() {} - virtual void SetUpOnMainThread() override { + void SetUpOnMainThread() override { const int kInitialQuotaKilobytes = 5000; SetQuota(kInitialQuotaKilobytes); } @@ -263,7 +263,7 @@ class IndexedDBBrowserTestWithGCExposed : public IndexedDBBrowserTest { public: IndexedDBBrowserTestWithGCExposed() {} - virtual void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(CommandLine* command_line) override { command_line->AppendSwitchASCII(switches::kJavaScriptFlags, "--expose-gc"); } @@ -297,7 +297,7 @@ static void CopyLevelDBToProfile(Shell* shell, class IndexedDBBrowserTestWithPreexistingLevelDB : public IndexedDBBrowserTest { public: IndexedDBBrowserTestWithPreexistingLevelDB() {} - virtual void SetUpOnMainThread() override { + void SetUpOnMainThread() override { scoped_refptr<IndexedDBContextImpl> context = GetContext(); context->TaskRunner()->PostTask( FROM_HERE, @@ -317,9 +317,7 @@ class IndexedDBBrowserTestWithPreexistingLevelDB : public IndexedDBBrowserTest { class IndexedDBBrowserTestWithVersion0Schema : public IndexedDBBrowserTestWithPreexistingLevelDB { - virtual std::string EnclosingLevelDBDir() override { - return "migration_from_0"; - } + std::string EnclosingLevelDBDir() override { return "migration_from_0"; } }; IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestWithVersion0Schema, MigrationTest) { @@ -328,9 +326,7 @@ IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestWithVersion0Schema, MigrationTest) { class IndexedDBBrowserTestWithVersion123456Schema : public IndexedDBBrowserTestWithPreexistingLevelDB { - virtual std::string EnclosingLevelDBDir() override { - return "schema_version_123456"; - } + std::string EnclosingLevelDBDir() override { return "schema_version_123456"; } }; IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestWithVersion123456Schema, @@ -344,9 +340,7 @@ IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestWithVersion123456Schema, class IndexedDBBrowserTestWithVersion987654SSVData : public IndexedDBBrowserTestWithPreexistingLevelDB { - virtual std::string EnclosingLevelDBDir() override { - return "ssv_version_987654"; - } + std::string EnclosingLevelDBDir() override { return "ssv_version_987654"; } }; IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestWithVersion987654SSVData, @@ -360,9 +354,7 @@ IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestWithVersion987654SSVData, class IndexedDBBrowserTestWithCorruptLevelDB : public IndexedDBBrowserTestWithPreexistingLevelDB { - virtual std::string EnclosingLevelDBDir() override { - return "corrupt_leveldb"; - } + std::string EnclosingLevelDBDir() override { return "corrupt_leveldb"; } }; IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestWithCorruptLevelDB, @@ -376,9 +368,7 @@ IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestWithCorruptLevelDB, class IndexedDBBrowserTestWithMissingSSTFile : public IndexedDBBrowserTestWithPreexistingLevelDB { - virtual std::string EnclosingLevelDBDir() override { - return "missing_sst"; - } + std::string EnclosingLevelDBDir() override { return "missing_sst"; } }; IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestWithMissingSSTFile, @@ -723,7 +713,7 @@ IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, ForceCloseEventTest) { class IndexedDBBrowserTestSingleProcess : public IndexedDBBrowserTest { public: - virtual void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(CommandLine* command_line) override { command_line->AppendSwitch(switches::kSingleProcess); } }; diff --git a/content/browser/indexed_db/indexed_db_cleanup_on_io_error_unittest.cc b/content/browser/indexed_db/indexed_db_cleanup_on_io_error_unittest.cc index 04a40c4..27f72f2 100644 --- a/content/browser/indexed_db/indexed_db_cleanup_on_io_error_unittest.cc +++ b/content/browser/indexed_db/indexed_db_cleanup_on_io_error_unittest.cc @@ -48,10 +48,10 @@ class BustedLevelDBDatabase : public LevelDBDatabase { const LevelDBComparator* /*comparator*/) { return scoped_ptr<LevelDBDatabase>(new BustedLevelDBDatabase); } - virtual leveldb::Status Get(const base::StringPiece& key, - std::string* value, - bool* found, - const LevelDBSnapshot* = 0) override { + leveldb::Status Get(const base::StringPiece& key, + std::string* value, + bool* found, + const LevelDBSnapshot* = 0) override { return leveldb::Status::IOError("It's busted!"); } @@ -61,17 +61,15 @@ class BustedLevelDBDatabase : public LevelDBDatabase { class BustedLevelDBFactory : public LevelDBFactory { public: - virtual leveldb::Status OpenLevelDB( - const base::FilePath& file_name, - const LevelDBComparator* comparator, - scoped_ptr<LevelDBDatabase>* db, - bool* is_disk_full = 0) override { + leveldb::Status OpenLevelDB(const base::FilePath& file_name, + const LevelDBComparator* comparator, + scoped_ptr<LevelDBDatabase>* db, + bool* is_disk_full = 0) override { if (open_error_.ok()) *db = BustedLevelDBDatabase::Open(file_name, comparator); return open_error_; } - virtual leveldb::Status DestroyLevelDB( - const base::FilePath& file_name) override { + leveldb::Status DestroyLevelDB(const base::FilePath& file_name) override { return leveldb::Status::IOError("error"); } void SetOpenError(const leveldb::Status& open_error) { diff --git a/content/browser/indexed_db/indexed_db_context_impl.h b/content/browser/indexed_db/indexed_db_context_impl.h index 3ec39e0..8fff76c 100644 --- a/content/browser/indexed_db/indexed_db_context_impl.h +++ b/content/browser/indexed_db/indexed_db_context_impl.h @@ -63,14 +63,13 @@ class CONTENT_EXPORT IndexedDBContextImpl void SetForceKeepSessionState() { force_keep_session_state_ = true; } // IndexedDBContext implementation: - virtual base::SequencedTaskRunner* TaskRunner() const override; - virtual std::vector<IndexedDBInfo> GetAllOriginsInfo() override; - virtual int64 GetOriginDiskUsage(const GURL& origin_url) override; - virtual void DeleteForOrigin(const GURL& origin_url) override; - virtual base::FilePath GetFilePathForTesting( + base::SequencedTaskRunner* TaskRunner() const override; + std::vector<IndexedDBInfo> GetAllOriginsInfo() override; + int64 GetOriginDiskUsage(const GURL& origin_url) override; + void DeleteForOrigin(const GURL& origin_url) override; + base::FilePath GetFilePathForTesting( const std::string& origin_id) const override; - virtual void SetTaskRunnerForTesting(base::SequencedTaskRunner* task_runner) - override; + void SetTaskRunnerForTesting(base::SequencedTaskRunner* task_runner) override; // Methods called by IndexedDBDispatcherHost for quota support. void ConnectionOpened(const GURL& origin_url, IndexedDBConnection* db); @@ -106,7 +105,7 @@ class CONTENT_EXPORT IndexedDBContextImpl bool is_incognito() const { return data_path_.empty(); } protected: - virtual ~IndexedDBContextImpl(); + ~IndexedDBContextImpl() override; private: FRIEND_TEST_ALL_PREFIXES(IndexedDBTest, ClearLocalState); diff --git a/content/browser/indexed_db/indexed_db_database_unittest.cc b/content/browser/indexed_db/indexed_db_database_unittest.cc index fe5ec45..25244ed 100644 --- a/content/browser/indexed_db/indexed_db_database_unittest.cc +++ b/content/browser/indexed_db/indexed_db_database_unittest.cc @@ -158,16 +158,14 @@ class MockDeleteCallbacks : public IndexedDBCallbacks { blocked_called_(false), success_called_(false) {} - virtual void OnBlocked(int64 existing_version) override { - blocked_called_ = true; - } - virtual void OnSuccess(int64 result) override { success_called_ = true; } + void OnBlocked(int64 existing_version) override { blocked_called_ = true; } + void OnSuccess(int64 result) override { success_called_ = true; } bool blocked_called() const { return blocked_called_; } bool success_called() const { return success_called_; } private: - virtual ~MockDeleteCallbacks() {} + ~MockDeleteCallbacks() override {} bool blocked_called_; bool success_called_; diff --git a/content/browser/indexed_db/indexed_db_dispatcher_host.h b/content/browser/indexed_db/indexed_db_dispatcher_host.h index df9b375..667ec7c 100644 --- a/content/browser/indexed_db/indexed_db_dispatcher_host.h +++ b/content/browser/indexed_db/indexed_db_dispatcher_host.h @@ -58,12 +58,12 @@ class IndexedDBDispatcherHost : public BrowserMessageFilter { const content::IndexedDBDatabaseMetadata& metadata); // BrowserMessageFilter implementation. - virtual void OnChannelConnected(int32 peer_pid) override; - virtual void OnChannelClosing() override; - virtual void OnDestruct() const override; - virtual base::TaskRunner* OverrideTaskRunnerForMessage( + void OnChannelConnected(int32 peer_pid) override; + void OnChannelClosing() override; + void OnDestruct() const override; + base::TaskRunner* OverrideTaskRunnerForMessage( const IPC::Message& message) override; - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; void FinishTransaction(int64 host_transaction_id, bool committed); @@ -234,7 +234,7 @@ class IndexedDBDispatcherHost : public BrowserMessageFilter { DISALLOW_COPY_AND_ASSIGN(CursorDispatcherHost); }; - virtual ~IndexedDBDispatcherHost(); + ~IndexedDBDispatcherHost() override; // Helper templates. template <class ReturnType> diff --git a/content/browser/indexed_db/indexed_db_factory_impl.h b/content/browser/indexed_db/indexed_db_factory_impl.h index a169b2e..da9d2a9 100644 --- a/content/browser/indexed_db/indexed_db_factory_impl.h +++ b/content/browser/indexed_db/indexed_db_factory_impl.h @@ -20,53 +20,51 @@ class CONTENT_EXPORT IndexedDBFactoryImpl : public IndexedDBFactory { explicit IndexedDBFactoryImpl(IndexedDBContextImpl* context); // content::IndexedDBFactory overrides: - virtual void ReleaseDatabase(const IndexedDBDatabase::Identifier& identifier, - bool forcedClose) override; - - virtual void GetDatabaseNames( - scoped_refptr<IndexedDBCallbacks> callbacks, - const GURL& origin_url, - const base::FilePath& data_directory, - net::URLRequestContext* request_context) override; - virtual void Open(const base::string16& name, - const IndexedDBPendingConnection& connection, - net::URLRequestContext* request_context, - const GURL& origin_url, - const base::FilePath& data_directory) override; - - virtual void DeleteDatabase(const base::string16& name, - net::URLRequestContext* request_context, - scoped_refptr<IndexedDBCallbacks> callbacks, - const GURL& origin_url, - const base::FilePath& data_directory) override; - - virtual void HandleBackingStoreFailure(const GURL& origin_url) override; - virtual void HandleBackingStoreCorruption( + void ReleaseDatabase(const IndexedDBDatabase::Identifier& identifier, + bool forcedClose) override; + + void GetDatabaseNames(scoped_refptr<IndexedDBCallbacks> callbacks, + const GURL& origin_url, + const base::FilePath& data_directory, + net::URLRequestContext* request_context) override; + void Open(const base::string16& name, + const IndexedDBPendingConnection& connection, + net::URLRequestContext* request_context, + const GURL& origin_url, + const base::FilePath& data_directory) override; + + void DeleteDatabase(const base::string16& name, + net::URLRequestContext* request_context, + scoped_refptr<IndexedDBCallbacks> callbacks, + const GURL& origin_url, + const base::FilePath& data_directory) override; + + void HandleBackingStoreFailure(const GURL& origin_url) override; + void HandleBackingStoreCorruption( const GURL& origin_url, const IndexedDBDatabaseError& error) override; - virtual OriginDBs GetOpenDatabasesForOrigin( - const GURL& origin_url) const override; + OriginDBs GetOpenDatabasesForOrigin(const GURL& origin_url) const override; - virtual void ForceClose(const GURL& origin_url) override; + void ForceClose(const GURL& origin_url) override; // Called by the IndexedDBContext destructor so the factory can do cleanup. - virtual void ContextDestroyed() override; + void ContextDestroyed() override; // Called by the IndexedDBActiveBlobRegistry. - virtual void ReportOutstandingBlobs(const GURL& origin_url, - bool blobs_outstanding) override; + void ReportOutstandingBlobs(const GURL& origin_url, + bool blobs_outstanding) override; // Called by an IndexedDBDatabase when it is actually deleted. - virtual void DatabaseDeleted( + void DatabaseDeleted( const IndexedDBDatabase::Identifier& identifier) override; - virtual size_t GetConnectionCount(const GURL& origin_url) const override; + size_t GetConnectionCount(const GURL& origin_url) const override; protected: - virtual ~IndexedDBFactoryImpl(); + ~IndexedDBFactoryImpl() override; - virtual scoped_refptr<IndexedDBBackingStore> OpenBackingStore( + scoped_refptr<IndexedDBBackingStore> OpenBackingStore( const GURL& origin_url, const base::FilePath& data_directory, net::URLRequestContext* request_context, @@ -75,7 +73,7 @@ class CONTENT_EXPORT IndexedDBFactoryImpl : public IndexedDBFactory { bool* disk_full, leveldb::Status* s) override; - virtual scoped_refptr<IndexedDBBackingStore> OpenBackingStoreHelper( + scoped_refptr<IndexedDBBackingStore> OpenBackingStoreHelper( const GURL& origin_url, const base::FilePath& data_directory, net::URLRequestContext* request_context, diff --git a/content/browser/indexed_db/indexed_db_factory_unittest.cc b/content/browser/indexed_db/indexed_db_factory_unittest.cc index 141212e..70f8ae6 100644 --- a/content/browser/indexed_db/indexed_db_factory_unittest.cc +++ b/content/browser/indexed_db/indexed_db_factory_unittest.cc @@ -59,7 +59,7 @@ class MockIDBFactory : public IndexedDBFactoryImpl { } private: - virtual ~MockIDBFactory() {} + ~MockIDBFactory() override {} DISALLOW_COPY_AND_ASSIGN(MockIDBFactory); }; @@ -204,8 +204,8 @@ class DiskFullFactory : public IndexedDBFactoryImpl { : IndexedDBFactoryImpl(context) {} private: - virtual ~DiskFullFactory() {} - virtual scoped_refptr<IndexedDBBackingStore> OpenBackingStore( + ~DiskFullFactory() override {} + scoped_refptr<IndexedDBBackingStore> OpenBackingStore( const GURL& origin_url, const base::FilePath& data_directory, net::URLRequestContext* request_context, @@ -225,14 +225,14 @@ class LookingForQuotaErrorMockCallbacks : public IndexedDBCallbacks { public: LookingForQuotaErrorMockCallbacks() : IndexedDBCallbacks(NULL, 0, 0), error_called_(false) {} - virtual void OnError(const IndexedDBDatabaseError& error) override { + void OnError(const IndexedDBDatabaseError& error) override { error_called_ = true; EXPECT_EQ(blink::WebIDBDatabaseExceptionQuotaError, error.code()); } bool error_called() const { return error_called_; } private: - virtual ~LookingForQuotaErrorMockCallbacks() {} + ~LookingForQuotaErrorMockCallbacks() override {} bool error_called_; DISALLOW_COPY_AND_ASSIGN(LookingForQuotaErrorMockCallbacks); @@ -434,13 +434,13 @@ class UpgradeNeededCallbacks : public MockIndexedDBCallbacks { public: UpgradeNeededCallbacks() {} - virtual void OnSuccess(scoped_ptr<IndexedDBConnection> connection, - const IndexedDBDatabaseMetadata& metadata) override { + void OnSuccess(scoped_ptr<IndexedDBConnection> connection, + const IndexedDBDatabaseMetadata& metadata) override { EXPECT_TRUE(connection_.get()); EXPECT_FALSE(connection.get()); } - virtual void OnUpgradeNeeded( + void OnUpgradeNeeded( int64 old_version, scoped_ptr<IndexedDBConnection> connection, const content::IndexedDBDatabaseMetadata& metadata) override { @@ -448,7 +448,7 @@ class UpgradeNeededCallbacks : public MockIndexedDBCallbacks { } protected: - virtual ~UpgradeNeededCallbacks() {} + ~UpgradeNeededCallbacks() override {} private: DISALLOW_COPY_AND_ASSIGN(UpgradeNeededCallbacks); @@ -458,13 +458,13 @@ class ErrorCallbacks : public MockIndexedDBCallbacks { public: ErrorCallbacks() : MockIndexedDBCallbacks(false), saw_error_(false) {} - virtual void OnError(const IndexedDBDatabaseError& error) override { + void OnError(const IndexedDBDatabaseError& error) override { saw_error_= true; } bool saw_error() const { return saw_error_; } private: - virtual ~ErrorCallbacks() {} + ~ErrorCallbacks() override {} bool saw_error_; DISALLOW_COPY_AND_ASSIGN(ErrorCallbacks); diff --git a/content/browser/indexed_db/indexed_db_fake_backing_store.h b/content/browser/indexed_db/indexed_db_fake_backing_store.h index a37a7b3..9a4fd09 100644 --- a/content/browser/indexed_db/indexed_db_fake_backing_store.h +++ b/content/browser/indexed_db/indexed_db_fake_backing_store.h @@ -22,60 +22,56 @@ class IndexedDBFakeBackingStore : public IndexedDBBackingStore { IndexedDBFakeBackingStore(); IndexedDBFakeBackingStore(IndexedDBFactory* factory, base::SequencedTaskRunner* task_runner); - virtual std::vector<base::string16> GetDatabaseNames(leveldb::Status* s) - override; - virtual leveldb::Status GetIDBDatabaseMetaData(const base::string16& name, - IndexedDBDatabaseMetadata*, - bool* found) override; - virtual leveldb::Status CreateIDBDatabaseMetaData( - const base::string16& name, - const base::string16& version, - int64 int_version, - int64* row_id) override; - virtual bool UpdateIDBDatabaseIntVersion(Transaction*, - int64 row_id, - int64 version) override; - virtual leveldb::Status DeleteDatabase(const base::string16& name) override; - - virtual leveldb::Status CreateObjectStore(Transaction*, - int64 database_id, - int64 object_store_id, - const base::string16& name, - const IndexedDBKeyPath&, - bool auto_increment) override; - - virtual leveldb::Status DeleteObjectStore(Transaction* transaction, - int64 database_id, - int64 object_store_id) override; - - virtual leveldb::Status PutRecord( - IndexedDBBackingStore::Transaction* transaction, - int64 database_id, - int64 object_store_id, - const IndexedDBKey& key, - IndexedDBValue* value, - ScopedVector<storage::BlobDataHandle>* handles, - RecordIdentifier* record) override; - - virtual leveldb::Status ClearObjectStore(Transaction*, - int64 database_id, - int64 object_store_id) override; - virtual leveldb::Status DeleteRecord(Transaction*, - int64 database_id, - int64 object_store_id, - const RecordIdentifier&) override; - virtual leveldb::Status GetKeyGeneratorCurrentNumber(Transaction*, - int64 database_id, - int64 object_store_id, - int64* current_number) - override; - virtual leveldb::Status MaybeUpdateKeyGeneratorCurrentNumber( + std::vector<base::string16> GetDatabaseNames(leveldb::Status* s) override; + leveldb::Status GetIDBDatabaseMetaData(const base::string16& name, + IndexedDBDatabaseMetadata*, + bool* found) override; + leveldb::Status CreateIDBDatabaseMetaData(const base::string16& name, + const base::string16& version, + int64 int_version, + int64* row_id) override; + bool UpdateIDBDatabaseIntVersion(Transaction*, + int64 row_id, + int64 version) override; + leveldb::Status DeleteDatabase(const base::string16& name) override; + + leveldb::Status CreateObjectStore(Transaction*, + int64 database_id, + int64 object_store_id, + const base::string16& name, + const IndexedDBKeyPath&, + bool auto_increment) override; + + leveldb::Status DeleteObjectStore(Transaction* transaction, + int64 database_id, + int64 object_store_id) override; + + leveldb::Status PutRecord(IndexedDBBackingStore::Transaction* transaction, + int64 database_id, + int64 object_store_id, + const IndexedDBKey& key, + IndexedDBValue* value, + ScopedVector<storage::BlobDataHandle>* handles, + RecordIdentifier* record) override; + + leveldb::Status ClearObjectStore(Transaction*, + int64 database_id, + int64 object_store_id) override; + leveldb::Status DeleteRecord(Transaction*, + int64 database_id, + int64 object_store_id, + const RecordIdentifier&) override; + leveldb::Status GetKeyGeneratorCurrentNumber(Transaction*, + int64 database_id, + int64 object_store_id, + int64* current_number) override; + leveldb::Status MaybeUpdateKeyGeneratorCurrentNumber( Transaction*, int64 database_id, int64 object_store_id, int64 new_number, bool check_current) override; - virtual leveldb::Status KeyExistsInObjectStore( + leveldb::Status KeyExistsInObjectStore( Transaction*, int64 database_id, int64 object_store_id, @@ -83,64 +79,60 @@ class IndexedDBFakeBackingStore : public IndexedDBBackingStore { RecordIdentifier* found_record_identifier, bool* found) override; - virtual leveldb::Status CreateIndex(Transaction*, - int64 database_id, - int64 object_store_id, - int64 index_id, - const base::string16& name, - const IndexedDBKeyPath&, - bool is_unique, - bool is_multi_entry) override; - virtual leveldb::Status DeleteIndex(Transaction*, - int64 database_id, - int64 object_store_id, - int64 index_id) override; - virtual leveldb::Status PutIndexDataForRecord(Transaction*, - int64 database_id, - int64 object_store_id, - int64 index_id, - const IndexedDBKey&, - const RecordIdentifier&) - override; - virtual void ReportBlobUnused(int64 database_id, int64 blob_key) override; - virtual scoped_ptr<Cursor> OpenObjectStoreKeyCursor( + leveldb::Status CreateIndex(Transaction*, + int64 database_id, + int64 object_store_id, + int64 index_id, + const base::string16& name, + const IndexedDBKeyPath&, + bool is_unique, + bool is_multi_entry) override; + leveldb::Status DeleteIndex(Transaction*, + int64 database_id, + int64 object_store_id, + int64 index_id) override; + leveldb::Status PutIndexDataForRecord(Transaction*, + int64 database_id, + int64 object_store_id, + int64 index_id, + const IndexedDBKey&, + const RecordIdentifier&) override; + void ReportBlobUnused(int64 database_id, int64 blob_key) override; + scoped_ptr<Cursor> OpenObjectStoreKeyCursor( Transaction* transaction, int64 database_id, int64 object_store_id, const IndexedDBKeyRange& key_range, blink::WebIDBCursorDirection, leveldb::Status*) override; - virtual scoped_ptr<Cursor> OpenObjectStoreCursor( - Transaction* transaction, - int64 database_id, - int64 object_store_id, - const IndexedDBKeyRange& key_range, - blink::WebIDBCursorDirection, - leveldb::Status*) override; - virtual scoped_ptr<Cursor> OpenIndexKeyCursor( - Transaction* transaction, - int64 database_id, - int64 object_store_id, - int64 index_id, - const IndexedDBKeyRange& key_range, - blink::WebIDBCursorDirection, - leveldb::Status*) override; - virtual scoped_ptr<Cursor> OpenIndexCursor(Transaction* transaction, - int64 database_id, - int64 object_store_id, - int64 index_id, - const IndexedDBKeyRange& key_range, - blink::WebIDBCursorDirection, - leveldb::Status*) override; + scoped_ptr<Cursor> OpenObjectStoreCursor(Transaction* transaction, + int64 database_id, + int64 object_store_id, + const IndexedDBKeyRange& key_range, + blink::WebIDBCursorDirection, + leveldb::Status*) override; + scoped_ptr<Cursor> OpenIndexKeyCursor(Transaction* transaction, + int64 database_id, + int64 object_store_id, + int64 index_id, + const IndexedDBKeyRange& key_range, + blink::WebIDBCursorDirection, + leveldb::Status*) override; + scoped_ptr<Cursor> OpenIndexCursor(Transaction* transaction, + int64 database_id, + int64 object_store_id, + int64 index_id, + const IndexedDBKeyRange& key_range, + blink::WebIDBCursorDirection, + leveldb::Status*) override; class FakeTransaction : public IndexedDBBackingStore::Transaction { public: explicit FakeTransaction(leveldb::Status phase_two_result); - virtual void Begin() override; - virtual leveldb::Status CommitPhaseOne( - scoped_refptr<BlobWriteCallback>) override; - virtual leveldb::Status CommitPhaseTwo() override; - virtual void Rollback() override; + void Begin() override; + leveldb::Status CommitPhaseOne(scoped_refptr<BlobWriteCallback>) override; + leveldb::Status CommitPhaseTwo() override; + void Rollback() override; private: leveldb::Status result_; @@ -150,7 +142,7 @@ class IndexedDBFakeBackingStore : public IndexedDBBackingStore { protected: friend class base::RefCounted<IndexedDBFakeBackingStore>; - virtual ~IndexedDBFakeBackingStore(); + ~IndexedDBFakeBackingStore() override; private: DISALLOW_COPY_AND_ASSIGN(IndexedDBFakeBackingStore); diff --git a/content/browser/indexed_db/indexed_db_internals_ui.cc b/content/browser/indexed_db/indexed_db_internals_ui.cc index 951272a..472e1b9a 100644 --- a/content/browser/indexed_db/indexed_db_internals_ui.cc +++ b/content/browser/indexed_db/indexed_db_internals_ui.cc @@ -304,12 +304,12 @@ void IndexedDBInternalsUI::OnDownloadDataReady( class FileDeleter : public DownloadItem::Observer { public: explicit FileDeleter(const base::FilePath& temp_dir) : temp_dir_(temp_dir) {} - virtual ~FileDeleter(); + ~FileDeleter() override; - virtual void OnDownloadUpdated(DownloadItem* download) override; - virtual void OnDownloadOpened(DownloadItem* item) override {} - virtual void OnDownloadRemoved(DownloadItem* item) override {} - virtual void OnDownloadDestroyed(DownloadItem* item) override {} + void OnDownloadUpdated(DownloadItem* download) override; + void OnDownloadOpened(DownloadItem* item) override {} + void OnDownloadRemoved(DownloadItem* item) override {} + void OnDownloadDestroyed(DownloadItem* item) override {} private: const base::FilePath temp_dir_; diff --git a/content/browser/indexed_db/indexed_db_internals_ui.h b/content/browser/indexed_db/indexed_db_internals_ui.h index f51df01..157978f 100644 --- a/content/browser/indexed_db/indexed_db_internals_ui.h +++ b/content/browser/indexed_db/indexed_db_internals_ui.h @@ -27,7 +27,7 @@ class StoragePartition; class IndexedDBInternalsUI : public WebUIController { public: explicit IndexedDBInternalsUI(WebUI* web_ui); - virtual ~IndexedDBInternalsUI(); + ~IndexedDBInternalsUI() override; private: void GetAllOrigins(const base::ListValue* args); diff --git a/content/browser/indexed_db/indexed_db_quota_client.h b/content/browser/indexed_db/indexed_db_quota_client.h index cf60ecb..7894a65 100644 --- a/content/browser/indexed_db/indexed_db_quota_client.h +++ b/content/browser/indexed_db/indexed_db_quota_client.h @@ -27,27 +27,26 @@ class IndexedDBQuotaClient : public storage::QuotaClient, public: CONTENT_EXPORT explicit IndexedDBQuotaClient( IndexedDBContextImpl* indexed_db_context); - CONTENT_EXPORT virtual ~IndexedDBQuotaClient(); + CONTENT_EXPORT ~IndexedDBQuotaClient() override; // QuotaClient method overrides - virtual ID id() const override; - virtual void OnQuotaManagerDestroyed() override; - CONTENT_EXPORT virtual void GetOriginUsage( - const GURL& origin_url, - storage::StorageType type, - const GetUsageCallback& callback) override; - CONTENT_EXPORT virtual void GetOriginsForType( + ID id() const override; + void OnQuotaManagerDestroyed() override; + CONTENT_EXPORT void GetOriginUsage(const GURL& origin_url, + storage::StorageType type, + const GetUsageCallback& callback) override; + CONTENT_EXPORT void GetOriginsForType( storage::StorageType type, const GetOriginsCallback& callback) override; - CONTENT_EXPORT virtual void GetOriginsForHost( + CONTENT_EXPORT void GetOriginsForHost( storage::StorageType type, const std::string& host, const GetOriginsCallback& callback) override; - CONTENT_EXPORT virtual void DeleteOriginData( + CONTENT_EXPORT void DeleteOriginData( const GURL& origin, storage::StorageType type, const DeletionCallback& callback) override; - virtual bool DoesSupport(storage::StorageType type) const override; + bool DoesSupport(storage::StorageType type) const override; private: scoped_refptr<IndexedDBContextImpl> indexed_db_context_; diff --git a/content/browser/indexed_db/indexed_db_transaction.cc b/content/browser/indexed_db/indexed_db_transaction.cc index d2fc75f..6609e02 100644 --- a/content/browser/indexed_db/indexed_db_transaction.cc +++ b/content/browser/indexed_db/indexed_db_transaction.cc @@ -212,12 +212,12 @@ class BlobWriteCallbackImpl : public IndexedDBBackingStore::BlobWriteCallback { explicit BlobWriteCallbackImpl( scoped_refptr<IndexedDBTransaction> transaction) : transaction_(transaction) {} - virtual void Run(bool succeeded) override { + void Run(bool succeeded) override { transaction_->BlobWriteComplete(succeeded); } protected: - virtual ~BlobWriteCallbackImpl() {} + ~BlobWriteCallbackImpl() override {} private: scoped_refptr<IndexedDBTransaction> transaction_; diff --git a/content/browser/indexed_db/indexed_db_unittest.cc b/content/browser/indexed_db/indexed_db_unittest.cc index 6fbff66..ddb1fdc 100644 --- a/content/browser/indexed_db/indexed_db_unittest.cc +++ b/content/browser/indexed_db/indexed_db_unittest.cc @@ -130,10 +130,10 @@ class ForceCloseDBCallbacks : public IndexedDBCallbacks { idb_context_(idb_context), origin_url_(origin_url) {} - virtual void OnSuccess() override {} - virtual void OnSuccess(const std::vector<base::string16>&) override {} - virtual void OnSuccess(scoped_ptr<IndexedDBConnection> connection, - const IndexedDBDatabaseMetadata& metadata) override { + void OnSuccess() override {} + void OnSuccess(const std::vector<base::string16>&) override {} + void OnSuccess(scoped_ptr<IndexedDBConnection> connection, + const IndexedDBDatabaseMetadata& metadata) override { connection_ = connection.Pass(); idb_context_->ConnectionOpened(origin_url_, connection_.get()); } @@ -141,7 +141,7 @@ class ForceCloseDBCallbacks : public IndexedDBCallbacks { IndexedDBConnection* connection() { return connection_.get(); } protected: - virtual ~ForceCloseDBCallbacks() {} + ~ForceCloseDBCallbacks() override {} private: scoped_refptr<IndexedDBContextImpl> idb_context_; diff --git a/content/browser/indexed_db/leveldb/leveldb_database.cc b/content/browser/indexed_db/leveldb/leveldb_database.cc index 0b6546b..5f48cbe 100644 --- a/content/browser/indexed_db/leveldb/leveldb_database.cc +++ b/content/browser/indexed_db/leveldb/leveldb_database.cc @@ -128,7 +128,8 @@ class LockImpl : public LevelDBLock { public: explicit LockImpl(leveldb::Env* env, leveldb::FileLock* lock) : env_(env), lock_(lock) {} - virtual ~LockImpl() { env_->UnlockFile(lock_); } + ~LockImpl() override { env_->UnlockFile(lock_); } + private: leveldb::Env* env_; leveldb::FileLock* lock_; diff --git a/content/browser/indexed_db/leveldb/leveldb_database.h b/content/browser/indexed_db/leveldb/leveldb_database.h index 2db652f..ddc6aa5 100644 --- a/content/browser/indexed_db/leveldb/leveldb_database.h +++ b/content/browser/indexed_db/leveldb/leveldb_database.h @@ -59,15 +59,14 @@ class CONTENT_EXPORT LevelDBDatabase { public: explicit ComparatorAdapter(const LevelDBComparator* comparator); - virtual int Compare(const leveldb::Slice& a, - const leveldb::Slice& b) const override; + int Compare(const leveldb::Slice& a, + const leveldb::Slice& b) const override; - virtual const char* Name() const override; + const char* Name() const override; - virtual void FindShortestSeparator(std::string* start, - const leveldb::Slice& limit) const - override; - virtual void FindShortSuccessor(std::string* key) const override; + void FindShortestSeparator(std::string* start, + const leveldb::Slice& limit) const override; + void FindShortSuccessor(std::string* key) const override; private: const LevelDBComparator* comparator_; diff --git a/content/browser/indexed_db/leveldb/leveldb_iterator_impl.h b/content/browser/indexed_db/leveldb/leveldb_iterator_impl.h index be05327..72b92e0 100644 --- a/content/browser/indexed_db/leveldb/leveldb_iterator_impl.h +++ b/content/browser/indexed_db/leveldb/leveldb_iterator_impl.h @@ -14,14 +14,14 @@ namespace content { class CONTENT_EXPORT LevelDBIteratorImpl : public content::LevelDBIterator { public: - virtual ~LevelDBIteratorImpl(); - virtual bool IsValid() const override; - virtual leveldb::Status SeekToLast() override; - virtual leveldb::Status Seek(const base::StringPiece& target) override; - virtual leveldb::Status Next() override; - virtual leveldb::Status Prev() override; - virtual base::StringPiece Key() const override; - virtual base::StringPiece Value() const override; + ~LevelDBIteratorImpl() override; + bool IsValid() const override; + leveldb::Status SeekToLast() override; + leveldb::Status Seek(const base::StringPiece& target) override; + leveldb::Status Next() override; + leveldb::Status Prev() override; + base::StringPiece Key() const override; + base::StringPiece Value() const override; protected: explicit LevelDBIteratorImpl(scoped_ptr<leveldb::Iterator> iterator); diff --git a/content/browser/indexed_db/leveldb/leveldb_transaction.h b/content/browser/indexed_db/leveldb/leveldb_transaction.h index aec836e..28d7656 100644 --- a/content/browser/indexed_db/leveldb/leveldb_transaction.h +++ b/content/browser/indexed_db/leveldb/leveldb_transaction.h @@ -71,15 +71,15 @@ class CONTENT_EXPORT LevelDBTransaction class DataIterator : public LevelDBIterator { public: static scoped_ptr<DataIterator> Create(LevelDBTransaction* transaction); - virtual ~DataIterator(); - - virtual bool IsValid() const override; - virtual leveldb::Status SeekToLast() override; - virtual leveldb::Status Seek(const base::StringPiece& slice) override; - virtual leveldb::Status Next() override; - virtual leveldb::Status Prev() override; - virtual base::StringPiece Key() const override; - virtual base::StringPiece Value() const override; + ~DataIterator() override; + + bool IsValid() const override; + leveldb::Status SeekToLast() override; + leveldb::Status Seek(const base::StringPiece& slice) override; + leveldb::Status Next() override; + leveldb::Status Prev() override; + base::StringPiece Key() const override; + base::StringPiece Value() const override; bool IsDeleted() const; private: @@ -92,17 +92,17 @@ class CONTENT_EXPORT LevelDBTransaction class TransactionIterator : public LevelDBIterator { public: - virtual ~TransactionIterator(); + ~TransactionIterator() override; static scoped_ptr<TransactionIterator> Create( scoped_refptr<LevelDBTransaction> transaction); - virtual bool IsValid() const override; - virtual leveldb::Status SeekToLast() override; - virtual leveldb::Status Seek(const base::StringPiece& target) override; - virtual leveldb::Status Next() override; - virtual leveldb::Status Prev() override; - virtual base::StringPiece Key() const override; - virtual base::StringPiece Value() const override; + bool IsValid() const override; + leveldb::Status SeekToLast() override; + leveldb::Status Seek(const base::StringPiece& target) override; + leveldb::Status Next() override; + leveldb::Status Prev() override; + base::StringPiece Key() const override; + base::StringPiece Value() const override; void DataChanged(); private: diff --git a/content/browser/indexed_db/leveldb/leveldb_unittest.cc b/content/browser/indexed_db/leveldb/leveldb_unittest.cc index 8fe9023..7c64987 100644 --- a/content/browser/indexed_db/leveldb/leveldb_unittest.cc +++ b/content/browser/indexed_db/leveldb/leveldb_unittest.cc @@ -25,12 +25,12 @@ namespace { class SimpleComparator : public LevelDBComparator { public: - virtual int Compare(const base::StringPiece& a, - const base::StringPiece& b) const override { + int Compare(const base::StringPiece& a, + const base::StringPiece& b) const override { size_t len = std::min(a.size(), b.size()); return memcmp(a.begin(), b.begin(), len); } - virtual const char* Name() const override { return "temp_comparator"; } + const char* Name() const override { return "temp_comparator"; } }; } // namespace diff --git a/content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.cc b/content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.cc index ef2ecf0..a683f37 100644 --- a/content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.cc +++ b/content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.cc @@ -52,9 +52,9 @@ class LevelDBTestTansaction : public LevelDBTransaction { DCHECK_GT(fail_on_call_num, 0); } - virtual leveldb::Status Get(const base::StringPiece& key, - std::string* value, - bool* found) override { + leveldb::Status Get(const base::StringPiece& key, + std::string* value, + bool* found) override { if (fail_method_ != FAIL_METHOD_GET || ++current_call_num_ != fail_on_call_num_) return LevelDBTransaction::Get(key, value, found); @@ -63,7 +63,7 @@ class LevelDBTestTansaction : public LevelDBTransaction { return leveldb::Status::Corruption("Corrupted for the test"); } - virtual leveldb::Status Commit() override { + leveldb::Status Commit() override { if (fail_method_ != FAIL_METHOD_COMMIT || ++current_call_num_ != fail_on_call_num_) return LevelDBTransaction::Commit(); @@ -72,7 +72,7 @@ class LevelDBTestTansaction : public LevelDBTransaction { } private: - virtual ~LevelDBTestTansaction() {} + ~LevelDBTestTansaction() override {} FailMethod fail_method_; int fail_on_call_num_; @@ -86,14 +86,14 @@ class LevelDBTraceTansaction : public LevelDBTransaction { commit_tracer_(s_class_name, "Commit", tx_num), get_tracer_(s_class_name, "Get", tx_num) {} - virtual leveldb::Status Get(const base::StringPiece& key, - std::string* value, - bool* found) override { + leveldb::Status Get(const base::StringPiece& key, + std::string* value, + bool* found) override { get_tracer_.log_call(); return LevelDBTransaction::Get(key, value, found); } - virtual leveldb::Status Commit() override { + leveldb::Status Commit() override { commit_tracer_.log_call(); return LevelDBTransaction::Commit(); } @@ -101,7 +101,7 @@ class LevelDBTraceTansaction : public LevelDBTransaction { private: static const std::string s_class_name; - virtual ~LevelDBTraceTansaction() {} + ~LevelDBTraceTansaction() override {} FunctionTracer commit_tracer_; FunctionTracer get_tracer_; @@ -120,36 +120,36 @@ class LevelDBTraceIteratorImpl : public LevelDBIteratorImpl { prev_tracer_(s_class_name, "Prev", inst_num), key_tracer_(s_class_name, "Key", inst_num), value_tracer_(s_class_name, "Value", inst_num) {} - virtual ~LevelDBTraceIteratorImpl() {} + ~LevelDBTraceIteratorImpl() override {} private: static const std::string s_class_name; - virtual bool IsValid() const override { + bool IsValid() const override { is_valid_tracer_.log_call(); return LevelDBIteratorImpl::IsValid(); } - virtual leveldb::Status SeekToLast() override { + leveldb::Status SeekToLast() override { seek_to_last_tracer_.log_call(); return LevelDBIteratorImpl::SeekToLast(); } - virtual leveldb::Status Seek(const base::StringPiece& target) override { + leveldb::Status Seek(const base::StringPiece& target) override { seek_tracer_.log_call(); return LevelDBIteratorImpl::Seek(target); } - virtual leveldb::Status Next() override { + leveldb::Status Next() override { next_tracer_.log_call(); return LevelDBIteratorImpl::Next(); } - virtual leveldb::Status Prev() override { + leveldb::Status Prev() override { prev_tracer_.log_call(); return LevelDBIteratorImpl::Prev(); } - virtual base::StringPiece Key() const override { + base::StringPiece Key() const override { key_tracer_.log_call(); return LevelDBIteratorImpl::Key(); } - virtual base::StringPiece Value() const override { + base::StringPiece Value() const override { value_tracer_.log_call(); return LevelDBIteratorImpl::Value(); } @@ -174,10 +174,10 @@ class LevelDBTestIteratorImpl : public content::LevelDBIteratorImpl { fail_method_(fail_method), fail_on_call_num_(fail_on_call_num), current_call_num_(0) {} - virtual ~LevelDBTestIteratorImpl() {} + ~LevelDBTestIteratorImpl() override {} private: - virtual leveldb::Status Seek(const base::StringPiece& target) override { + leveldb::Status Seek(const base::StringPiece& target) override { if (fail_method_ != FAIL_METHOD_SEEK || ++current_call_num_ != fail_on_call_num_) return LevelDBIteratorImpl::Seek(target); diff --git a/content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.h b/content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.h index 201ef34..9e40b60 100644 --- a/content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.h +++ b/content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.h @@ -30,10 +30,9 @@ enum FailMethod { class MockBrowserTestIndexedDBClassFactory : public IndexedDBClassFactory { public: MockBrowserTestIndexedDBClassFactory(); - virtual ~MockBrowserTestIndexedDBClassFactory(); - virtual LevelDBTransaction* CreateLevelDBTransaction( - LevelDBDatabase* db) override; - virtual LevelDBIteratorImpl* CreateIteratorImpl( + ~MockBrowserTestIndexedDBClassFactory() override; + LevelDBTransaction* CreateLevelDBTransaction(LevelDBDatabase* db) override; + LevelDBIteratorImpl* CreateIteratorImpl( scoped_ptr<leveldb::Iterator> iterator) override; void FailOperation(FailClass failure_class, diff --git a/content/browser/indexed_db/mock_indexed_db_callbacks.h b/content/browser/indexed_db/mock_indexed_db_callbacks.h index 780555d..24743fe 100644 --- a/content/browser/indexed_db/mock_indexed_db_callbacks.h +++ b/content/browser/indexed_db/mock_indexed_db_callbacks.h @@ -17,16 +17,16 @@ class MockIndexedDBCallbacks : public IndexedDBCallbacks { MockIndexedDBCallbacks(); explicit MockIndexedDBCallbacks(bool expect_connection); - virtual void OnSuccess() override; - virtual void OnSuccess(int64 result) override; - virtual void OnSuccess(const std::vector<base::string16>& result) override; - virtual void OnSuccess(const IndexedDBKey& key) override; - virtual void OnSuccess(scoped_ptr<IndexedDBConnection> connection, - const IndexedDBDatabaseMetadata& metadata) override; + void OnSuccess() override; + void OnSuccess(int64 result) override; + void OnSuccess(const std::vector<base::string16>& result) override; + void OnSuccess(const IndexedDBKey& key) override; + void OnSuccess(scoped_ptr<IndexedDBConnection> connection, + const IndexedDBDatabaseMetadata& metadata) override; IndexedDBConnection* connection() { return connection_.get(); } protected: - virtual ~MockIndexedDBCallbacks(); + ~MockIndexedDBCallbacks() override; scoped_ptr<IndexedDBConnection> connection_; diff --git a/content/browser/indexed_db/mock_indexed_db_database_callbacks.h b/content/browser/indexed_db/mock_indexed_db_database_callbacks.h index b38542b..31a29645 100644 --- a/content/browser/indexed_db/mock_indexed_db_database_callbacks.h +++ b/content/browser/indexed_db/mock_indexed_db_database_callbacks.h @@ -14,17 +14,17 @@ class MockIndexedDBDatabaseCallbacks : public IndexedDBDatabaseCallbacks { public: MockIndexedDBDatabaseCallbacks(); - virtual void OnVersionChange(int64 old_version, int64 new_version) override {} - virtual void OnForcedClose() override; - virtual void OnAbort(int64 transaction_id, - const IndexedDBDatabaseError& error) override; - virtual void OnComplete(int64 transaction_id) override {} + void OnVersionChange(int64 old_version, int64 new_version) override {} + void OnForcedClose() override; + void OnAbort(int64 transaction_id, + const IndexedDBDatabaseError& error) override; + void OnComplete(int64 transaction_id) override {} bool abort_called() const { return abort_called_; } bool forced_close_called() const { return forced_close_called_; } private: - virtual ~MockIndexedDBDatabaseCallbacks() {} + ~MockIndexedDBDatabaseCallbacks() override {} bool abort_called_; bool forced_close_called_; diff --git a/content/browser/loader/async_resource_handler.cc b/content/browser/loader/async_resource_handler.cc index eb64f8b..5125bec 100644 --- a/content/browser/loader/async_resource_handler.cc +++ b/content/browser/loader/async_resource_handler.cc @@ -73,7 +73,7 @@ class DependentIOBuffer : public net::WrappedIOBuffer { backing_(backing) { } private: - virtual ~DependentIOBuffer() {} + ~DependentIOBuffer() override {} scoped_refptr<ResourceBuffer> backing_; }; diff --git a/content/browser/loader/async_resource_handler.h b/content/browser/loader/async_resource_handler.h index 6cf5dea..e2954f4 100644 --- a/content/browser/loader/async_resource_handler.h +++ b/content/browser/loader/async_resource_handler.h @@ -31,27 +31,26 @@ class AsyncResourceHandler : public ResourceHandler, public: AsyncResourceHandler(net::URLRequest* request, ResourceDispatcherHostImpl* rdh); - virtual ~AsyncResourceHandler(); + ~AsyncResourceHandler() override; - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; // ResourceHandler implementation: - virtual bool OnUploadProgress(uint64 position, uint64 size) override; - virtual bool OnRequestRedirected(const net::RedirectInfo& redirect_info, - ResourceResponse* response, - bool* defer) override; - virtual bool OnResponseStarted(ResourceResponse* response, - bool* defer) override; - virtual bool OnWillStart(const GURL& url, bool* defer) override; - virtual bool OnBeforeNetworkStart(const GURL& url, bool* defer) override; - virtual bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) override; - virtual bool OnReadCompleted(int bytes_read, bool* defer) override; - virtual void OnResponseCompleted(const net::URLRequestStatus& status, - const std::string& security_info, - bool* defer) override; - virtual void OnDataDownloaded(int bytes_downloaded) override; + bool OnUploadProgress(uint64 position, uint64 size) override; + bool OnRequestRedirected(const net::RedirectInfo& redirect_info, + ResourceResponse* response, + bool* defer) override; + bool OnResponseStarted(ResourceResponse* response, bool* defer) override; + bool OnWillStart(const GURL& url, bool* defer) override; + bool OnBeforeNetworkStart(const GURL& url, bool* defer) override; + bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, + int* buf_size, + int min_size) override; + bool OnReadCompleted(int bytes_read, bool* defer) override; + void OnResponseCompleted(const net::URLRequestStatus& status, + const std::string& security_info, + bool* defer) override; + void OnDataDownloaded(int bytes_downloaded) override; private: // IPC message handlers: diff --git a/content/browser/loader/buffered_resource_handler.cc b/content/browser/loader/buffered_resource_handler.cc index 8610696..f96b550 100644 --- a/content/browser/loader/buffered_resource_handler.cc +++ b/content/browser/loader/buffered_resource_handler.cc @@ -73,7 +73,7 @@ class DependentIOBuffer : public net::WrappedIOBuffer { } private: - virtual ~DependentIOBuffer() {} + ~DependentIOBuffer() override {} scoped_refptr<net::IOBuffer> buf_; }; diff --git a/content/browser/loader/buffered_resource_handler.h b/content/browser/loader/buffered_resource_handler.h index c6805af..8735359 100644 --- a/content/browser/loader/buffered_resource_handler.h +++ b/content/browser/loader/buffered_resource_handler.h @@ -28,26 +28,25 @@ class BufferedResourceHandler BufferedResourceHandler(scoped_ptr<ResourceHandler> next_handler, ResourceDispatcherHostImpl* host, net::URLRequest* request); - virtual ~BufferedResourceHandler(); + ~BufferedResourceHandler() override; private: // ResourceHandler implementation: - virtual void SetController(ResourceController* controller) override; - virtual bool OnResponseStarted(ResourceResponse* response, - bool* defer) override; - virtual bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) override; - virtual bool OnReadCompleted(int bytes_read, bool* defer) override; - virtual void OnResponseCompleted(const net::URLRequestStatus& status, - const std::string& security_info, - bool* defer) override; + void SetController(ResourceController* controller) override; + bool OnResponseStarted(ResourceResponse* response, bool* defer) override; + bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, + int* buf_size, + int min_size) override; + bool OnReadCompleted(int bytes_read, bool* defer) override; + void OnResponseCompleted(const net::URLRequestStatus& status, + const std::string& security_info, + bool* defer) override; // ResourceController implementation: - virtual void Resume() override; - virtual void Cancel() override; - virtual void CancelAndIgnore() override; - virtual void CancelWithError(int error_code) override; + void Resume() override; + void Cancel() override; + void CancelAndIgnore() override; + void CancelWithError(int error_code) override; bool ProcessResponse(bool* defer); diff --git a/content/browser/loader/certificate_resource_handler.h b/content/browser/loader/certificate_resource_handler.h index b6844b7..e8ce4ba 100644 --- a/content/browser/loader/certificate_resource_handler.h +++ b/content/browser/loader/certificate_resource_handler.h @@ -31,40 +31,39 @@ namespace content { class CertificateResourceHandler : public ResourceHandler { public: explicit CertificateResourceHandler(net::URLRequest* request); - virtual ~CertificateResourceHandler(); + ~CertificateResourceHandler() override; - virtual bool OnUploadProgress(uint64 position, uint64 size) override; + bool OnUploadProgress(uint64 position, uint64 size) override; // Not needed, as this event handler ought to be the final resource. - virtual bool OnRequestRedirected(const net::RedirectInfo& redirect_info, - ResourceResponse* resp, - bool* defer) override; + bool OnRequestRedirected(const net::RedirectInfo& redirect_info, + ResourceResponse* resp, + bool* defer) override; // Check if this indeed an X509 cert. - virtual bool OnResponseStarted(ResourceResponse* resp, - bool* defer) override; + bool OnResponseStarted(ResourceResponse* resp, bool* defer) override; // Pass-through implementation. - virtual bool OnWillStart(const GURL& url, bool* defer) override; + bool OnWillStart(const GURL& url, bool* defer) override; // Pass-through implementation. - virtual bool OnBeforeNetworkStart(const GURL& url, bool* defer) override; + bool OnBeforeNetworkStart(const GURL& url, bool* defer) override; // Create a new buffer to store received data. - virtual bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) override; + bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, + int* buf_size, + int min_size) override; // A read was completed, maybe allocate a new buffer for further data. - virtual bool OnReadCompleted(int bytes_read, bool* defer) override; + bool OnReadCompleted(int bytes_read, bool* defer) override; // Done downloading the certificate. - virtual void OnResponseCompleted(const net::URLRequestStatus& urs, - const std::string& sec_info, - bool* defer) override; + void OnResponseCompleted(const net::URLRequestStatus& urs, + const std::string& sec_info, + bool* defer) override; // N/A to cert downloading. - virtual void OnDataDownloaded(int bytes_downloaded) override; + void OnDataDownloaded(int bytes_downloaded) override; private: typedef std::vector<std::pair<scoped_refptr<net::IOBuffer>, diff --git a/content/browser/loader/cross_site_resource_handler.h b/content/browser/loader/cross_site_resource_handler.h index 13d532b..f041046 100644 --- a/content/browser/loader/cross_site_resource_handler.h +++ b/content/browser/loader/cross_site_resource_handler.h @@ -28,19 +28,17 @@ class CrossSiteResourceHandler : public LayeredResourceHandler { public: CrossSiteResourceHandler(scoped_ptr<ResourceHandler> next_handler, net::URLRequest* request); - virtual ~CrossSiteResourceHandler(); + ~CrossSiteResourceHandler() override; // ResourceHandler implementation: - virtual bool OnRequestRedirected(const net::RedirectInfo& redirect_info, - ResourceResponse* response, - bool* defer) override; - virtual bool OnResponseStarted(ResourceResponse* response, - bool* defer) override; - virtual bool OnReadCompleted(int bytes_read, - bool* defer) override; - virtual void OnResponseCompleted(const net::URLRequestStatus& status, - const std::string& security_info, - bool* defer) override; + bool OnRequestRedirected(const net::RedirectInfo& redirect_info, + ResourceResponse* response, + bool* defer) override; + bool OnResponseStarted(ResourceResponse* response, bool* defer) override; + bool OnReadCompleted(int bytes_read, bool* defer) override; + void OnResponseCompleted(const net::URLRequestStatus& status, + const std::string& security_info, + bool* defer) override; // We can now send the response to the new renderer, which will cause // WebContentsImpl to swap in the new renderer and destroy the old one. diff --git a/content/browser/loader/detachable_resource_handler.h b/content/browser/loader/detachable_resource_handler.h index ecacae0..64d23ef 100644 --- a/content/browser/loader/detachable_resource_handler.h +++ b/content/browser/loader/detachable_resource_handler.h @@ -37,7 +37,7 @@ class DetachableResourceHandler : public ResourceHandler, DetachableResourceHandler(net::URLRequest* request, base::TimeDelta cancel_delay, scoped_ptr<ResourceHandler> next_handler); - virtual ~DetachableResourceHandler(); + ~DetachableResourceHandler() override; bool is_detached() const { return next_handler_ == NULL; } void Detach(); @@ -47,29 +47,28 @@ class DetachableResourceHandler : public ResourceHandler, } // ResourceHandler implementation: - virtual void SetController(ResourceController* controller) override; - virtual bool OnUploadProgress(uint64 position, uint64 size) override; - virtual bool OnRequestRedirected(const net::RedirectInfo& redirect_info, - ResourceResponse* response, - bool* defer) override; - virtual bool OnResponseStarted(ResourceResponse* response, - bool* defer) override; - virtual bool OnWillStart(const GURL& url, bool* defer) override; - virtual bool OnBeforeNetworkStart(const GURL& url, bool* defer) override; - virtual bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) override; - virtual bool OnReadCompleted(int bytes_read, bool* defer) override; - virtual void OnResponseCompleted(const net::URLRequestStatus& status, - const std::string& security_info, - bool* defer) override; - virtual void OnDataDownloaded(int bytes_downloaded) override; + void SetController(ResourceController* controller) override; + bool OnUploadProgress(uint64 position, uint64 size) override; + bool OnRequestRedirected(const net::RedirectInfo& redirect_info, + ResourceResponse* response, + bool* defer) override; + bool OnResponseStarted(ResourceResponse* response, bool* defer) override; + bool OnWillStart(const GURL& url, bool* defer) override; + bool OnBeforeNetworkStart(const GURL& url, bool* defer) override; + bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, + int* buf_size, + int min_size) override; + bool OnReadCompleted(int bytes_read, bool* defer) override; + void OnResponseCompleted(const net::URLRequestStatus& status, + const std::string& security_info, + bool* defer) override; + void OnDataDownloaded(int bytes_downloaded) override; // ResourceController implementation: - virtual void Resume() override; - virtual void Cancel() override; - virtual void CancelAndIgnore() override; - virtual void CancelWithError(int error_code) override; + void Resume() override; + void Cancel() override; + void CancelAndIgnore() override; + void CancelWithError(int error_code) override; private: scoped_ptr<ResourceHandler> next_handler_; diff --git a/content/browser/loader/layered_resource_handler.h b/content/browser/loader/layered_resource_handler.h index 9f888df..0c098f9 100644 --- a/content/browser/loader/layered_resource_handler.h +++ b/content/browser/loader/layered_resource_handler.h @@ -21,27 +21,25 @@ class CONTENT_EXPORT LayeredResourceHandler : public ResourceHandler { public: LayeredResourceHandler(net::URLRequest* request, scoped_ptr<ResourceHandler> next_handler); - virtual ~LayeredResourceHandler(); + ~LayeredResourceHandler() override; // ResourceHandler implementation: - virtual void SetController(ResourceController* controller) override; - virtual bool OnUploadProgress(uint64 position, uint64 size) override; - virtual bool OnRequestRedirected(const net::RedirectInfo& redirect_info, - ResourceResponse* response, - bool* defer) override; - virtual bool OnResponseStarted(ResourceResponse* response, - bool* defer) override; - virtual bool OnWillStart(const GURL& url, bool* defer) override; - virtual bool OnBeforeNetworkStart(const GURL& url, bool* defer) override; - virtual bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) override; - virtual bool OnReadCompleted(int bytes_read, - bool* defer) override; - virtual void OnResponseCompleted(const net::URLRequestStatus& status, - const std::string& security_info, - bool* defer) override; - virtual void OnDataDownloaded(int bytes_downloaded) override; + void SetController(ResourceController* controller) override; + bool OnUploadProgress(uint64 position, uint64 size) override; + bool OnRequestRedirected(const net::RedirectInfo& redirect_info, + ResourceResponse* response, + bool* defer) override; + bool OnResponseStarted(ResourceResponse* response, bool* defer) override; + bool OnWillStart(const GURL& url, bool* defer) override; + bool OnBeforeNetworkStart(const GURL& url, bool* defer) override; + bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, + int* buf_size, + int min_size) override; + bool OnReadCompleted(int bytes_read, bool* defer) override; + void OnResponseCompleted(const net::URLRequestStatus& status, + const std::string& security_info, + bool* defer) override; + void OnDataDownloaded(int bytes_downloaded) override; scoped_ptr<ResourceHandler> next_handler_; }; diff --git a/content/browser/loader/power_save_block_resource_throttle.h b/content/browser/loader/power_save_block_resource_throttle.h index 8c1751e..a09293f 100644 --- a/content/browser/loader/power_save_block_resource_throttle.h +++ b/content/browser/loader/power_save_block_resource_throttle.h @@ -19,12 +19,12 @@ class PowerSaveBlocker; class PowerSaveBlockResourceThrottle : public ResourceThrottle { public: PowerSaveBlockResourceThrottle(); - virtual ~PowerSaveBlockResourceThrottle(); + ~PowerSaveBlockResourceThrottle() override; // ResourceThrottle overrides: - virtual void WillStartRequest(bool* defer) override; - virtual void WillProcessResponse(bool* defer) override; - virtual const char* GetNameForLogging() const override; + void WillStartRequest(bool* defer) override; + void WillProcessResponse(bool* defer) override; + const char* GetNameForLogging() const override; private: void ActivatePowerSaveBlocker(); diff --git a/content/browser/loader/redirect_to_file_resource_handler.cc b/content/browser/loader/redirect_to_file_resource_handler.cc index fc47ee3..00e6392 100644 --- a/content/browser/loader/redirect_to_file_resource_handler.cc +++ b/content/browser/loader/redirect_to_file_resource_handler.cc @@ -38,7 +38,7 @@ class DependentIOBuffer : public net::WrappedIOBuffer { backing_(backing) { } private: - virtual ~DependentIOBuffer() {} + ~DependentIOBuffer() override {} scoped_refptr<net::IOBuffer> backing_; }; diff --git a/content/browser/loader/redirect_to_file_resource_handler.h b/content/browser/loader/redirect_to_file_resource_handler.h index ef1bcb9..1778921 100644 --- a/content/browser/loader/redirect_to_file_resource_handler.h +++ b/content/browser/loader/redirect_to_file_resource_handler.h @@ -46,7 +46,7 @@ class CONTENT_EXPORT RedirectToFileResourceHandler // |next_handler|. RedirectToFileResourceHandler(scoped_ptr<ResourceHandler> next_handler, net::URLRequest* request); - virtual ~RedirectToFileResourceHandler(); + ~RedirectToFileResourceHandler() override; // Replace the CreateTemporaryFileStream implementation with a mocked one for // testing purposes. The function should create a net::FileStream and a @@ -56,16 +56,15 @@ class CONTENT_EXPORT RedirectToFileResourceHandler const CreateTemporaryFileStreamFunction& create_temporary_file_stream); // LayeredResourceHandler implementation: - virtual bool OnResponseStarted(ResourceResponse* response, - bool* defer) override; - virtual bool OnWillStart(const GURL& url, bool* defer) override; - virtual bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) override; - virtual bool OnReadCompleted(int bytes_read, bool* defer) override; - virtual void OnResponseCompleted(const net::URLRequestStatus& status, - const std::string& security_info, - bool* defer) override; + bool OnResponseStarted(ResourceResponse* response, bool* defer) override; + bool OnWillStart(const GURL& url, bool* defer) override; + bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, + int* buf_size, + int min_size) override; + bool OnReadCompleted(int bytes_read, bool* defer) override; + void OnResponseCompleted(const net::URLRequestStatus& status, + const std::string& security_info, + bool* defer) override; private: void DidCreateTemporaryFile(base::File::Error error_code, diff --git a/content/browser/loader/resource_dispatcher_host_browsertest.cc b/content/browser/loader/resource_dispatcher_host_browsertest.cc index 5f41e548..7e2e8b3 100644 --- a/content/browser/loader/resource_dispatcher_host_browsertest.cc +++ b/content/browser/loader/resource_dispatcher_host_browsertest.cc @@ -36,7 +36,7 @@ class ResourceDispatcherHostBrowserTest : public ContentBrowserTest, ResourceDispatcherHostBrowserTest() : got_downloads_(false) {} protected: - virtual void SetUpOnMainThread() override { + void SetUpOnMainThread() override { base::FilePath path = GetTestFilePath("", ""); BrowserThread::PostTask( BrowserThread::IO, @@ -50,9 +50,8 @@ class ResourceDispatcherHostBrowserTest : public ContentBrowserTest, base::Bind(&net::URLRequestFailedJob::AddUrlHandler)); } - virtual void OnDownloadCreated( - DownloadManager* manager, - DownloadItem* item) override { + void OnDownloadCreated(DownloadManager* manager, + DownloadItem* item) override { if (!got_downloads_) got_downloads_ = !!manager->InProgressCount(); } diff --git a/content/browser/loader/resource_dispatcher_host_impl.h b/content/browser/loader/resource_dispatcher_host_impl.h index 91a384b..465393b 100644 --- a/content/browser/loader/resource_dispatcher_host_impl.h +++ b/content/browser/loader/resource_dispatcher_host_impl.h @@ -71,16 +71,16 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl public ResourceLoaderDelegate { public: ResourceDispatcherHostImpl(); - virtual ~ResourceDispatcherHostImpl(); + ~ResourceDispatcherHostImpl() override; // Returns the current ResourceDispatcherHostImpl. May return NULL if it // hasn't been created yet. static ResourceDispatcherHostImpl* Get(); // ResourceDispatcherHost implementation: - virtual void SetDelegate(ResourceDispatcherHostDelegate* delegate) override; - virtual void SetAllowCrossOriginAuthPrompt(bool value) override; - virtual DownloadInterruptReason BeginDownload( + void SetDelegate(ResourceDispatcherHostDelegate* delegate) override; + void SetAllowCrossOriginAuthPrompt(bool value) override; + DownloadInterruptReason BeginDownload( scoped_ptr<net::URLRequest> request, const Referrer& referrer, bool is_content_initiated, @@ -91,10 +91,9 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl scoped_ptr<DownloadSaveInfo> save_info, uint32 download_id, const DownloadStartedCallback& started_callback) override; - virtual void ClearLoginDelegateForRequest(net::URLRequest* request) override; - virtual void BlockRequestsForRoute(int child_id, int route_id) override; - virtual void ResumeBlockedRequestsForRoute( - int child_id, int route_id) override; + void ClearLoginDelegateForRequest(net::URLRequest* request) override; + void BlockRequestsForRoute(int child_id, int route_id) override; + void ResumeBlockedRequestsForRoute(int child_id, int route_id) override; // Puts the resource dispatcher host in an inactive state (unable to begin // new requests). Cancels all pending requests. @@ -295,16 +294,14 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl friend class ResourceMessageDelegate; // ResourceLoaderDelegate implementation: - virtual ResourceDispatcherHostLoginDelegate* CreateLoginDelegate( + ResourceDispatcherHostLoginDelegate* CreateLoginDelegate( ResourceLoader* loader, net::AuthChallengeInfo* auth_info) override; - virtual bool HandleExternalProtocol(ResourceLoader* loader, - const GURL& url) override; - virtual void DidStartRequest(ResourceLoader* loader) override; - virtual void DidReceiveRedirect(ResourceLoader* loader, - const GURL& new_url) override; - virtual void DidReceiveResponse(ResourceLoader* loader) override; - virtual void DidFinishLoading(ResourceLoader* loader) override; + bool HandleExternalProtocol(ResourceLoader* loader, const GURL& url) override; + void DidStartRequest(ResourceLoader* loader) override; + void DidReceiveRedirect(ResourceLoader* loader, const GURL& new_url) override; + void DidReceiveResponse(ResourceLoader* loader) override; + void DidFinishLoading(ResourceLoader* loader) override; // An init helper that runs on the IO thread. void OnInit(); diff --git a/content/browser/loader/resource_dispatcher_host_unittest.cc b/content/browser/loader/resource_dispatcher_host_unittest.cc index ecbdaae..293cd5f 100644 --- a/content/browser/loader/resource_dispatcher_host_unittest.cc +++ b/content/browser/loader/resource_dispatcher_host_unittest.cc @@ -223,7 +223,7 @@ class TestFilter : public ResourceMessageFilter { int received_after_canceled() const { return received_after_canceled_; } // ResourceMessageFilter override - virtual bool Send(IPC::Message* msg) override { + bool Send(IPC::Message* msg) override { // No messages should be received when the process has been canceled. if (canceled_) received_after_canceled_++; @@ -235,7 +235,7 @@ class TestFilter : public ResourceMessageFilter { ResourceContext* resource_context() { return resource_context_; } protected: - virtual ~TestFilter() {} + ~TestFilter() override {} private: void GetContexts(const ResourceHostMsg_Request& request, @@ -265,12 +265,10 @@ class ForwardingFilter : public TestFilter { } // TestFilter override - virtual bool Send(IPC::Message* msg) override { - return dest_->Send(msg); - } + bool Send(IPC::Message* msg) override { return dest_->Send(msg); } private: - virtual ~ForwardingFilter() {} + ~ForwardingFilter() override {} IPC::Sender* dest_; @@ -286,7 +284,7 @@ class URLRequestTestDelayedNetworkJob : public net::URLRequestTestJob { : net::URLRequestTestJob(request, network_delegate) {} // Only start if not deferred for network start. - virtual void Start() override { + void Start() override { bool defer = false; NotifyBeforeNetworkStart(&defer); if (defer) @@ -294,12 +292,10 @@ class URLRequestTestDelayedNetworkJob : public net::URLRequestTestJob { net::URLRequestTestJob::Start(); } - virtual void ResumeNetworkStart() override { - net::URLRequestTestJob::StartAsync(); - } + void ResumeNetworkStart() override { net::URLRequestTestJob::StartAsync(); } private: - virtual ~URLRequestTestDelayedNetworkJob() {} + ~URLRequestTestDelayedNetworkJob() override {} DISALLOW_COPY_AND_ASSIGN(URLRequestTestDelayedNetworkJob); }; @@ -333,7 +329,7 @@ class URLRequestTestDelayedStartJob : public net::URLRequestTestJob { } // Do nothing until you're told to. - virtual void Start() override {} + void Start() override {} // Finish starting a URL request whose job is an instance of // URLRequestTestDelayedStartJob. It is illegal to call this routine @@ -364,7 +360,7 @@ class URLRequestTestDelayedStartJob : public net::URLRequestTestJob { } protected: - virtual ~URLRequestTestDelayedStartJob() { + ~URLRequestTestDelayedStartJob() override { for (URLRequestTestDelayedStartJob** job = &list_head_; *job; job = &(*job)->next_) { if (*job == this) { @@ -411,10 +407,10 @@ class URLRequestTestDelayedCompletionJob : public net::URLRequestTestJob { auto_advance) {} protected: - virtual ~URLRequestTestDelayedCompletionJob() {} + ~URLRequestTestDelayedCompletionJob() override {} private: - virtual bool NextReadAsync() override { return true; } + bool NextReadAsync() override { return true; } }; class URLRequestBigJob : public net::URLRequestSimpleJob { @@ -424,10 +420,10 @@ class URLRequestBigJob : public net::URLRequestSimpleJob { : net::URLRequestSimpleJob(request, network_delegate) { } - virtual int GetData(std::string* mime_type, - std::string* charset, - std::string* data, - const net::CompletionCallback& callback) const override { + int GetData(std::string* mime_type, + std::string* charset, + std::string* data, + const net::CompletionCallback& callback) const override { *mime_type = "text/plain"; *charset = "UTF-8"; @@ -444,7 +440,7 @@ class URLRequestBigJob : public net::URLRequestSimpleJob { } private: - virtual ~URLRequestBigJob() {} + ~URLRequestBigJob() override {} // big-job:substring,N static bool ParseURL(const GURL& url, std::string* text, int* count) { @@ -491,20 +487,20 @@ class TestURLRequestJobFactory : public net::URLRequestJobFactory { network_start_notification_ = notification; } - virtual net::URLRequestJob* MaybeCreateJobWithProtocolHandler( + net::URLRequestJob* MaybeCreateJobWithProtocolHandler( const std::string& scheme, net::URLRequest* request, net::NetworkDelegate* network_delegate) const override; - virtual bool IsHandledProtocol(const std::string& scheme) const override { + bool IsHandledProtocol(const std::string& scheme) const override { return supported_schemes_.count(scheme) > 0; } - virtual bool IsHandledURL(const GURL& url) const override { + bool IsHandledURL(const GURL& url) const override { return supported_schemes_.count(url.scheme()) > 0; } - virtual bool IsSafeRedirectTarget(const GURL& location) const override { + bool IsSafeRedirectTarget(const GURL& location) const override { return false; } @@ -526,9 +522,7 @@ class TestUserData : public base::SupportsUserData::Data { : was_deleted_(was_deleted) { } - virtual ~TestUserData() { - *was_deleted_ = true; - } + ~TestUserData() override { *was_deleted_ = true; } private: bool* was_deleted_; @@ -537,9 +531,9 @@ class TestUserData : public base::SupportsUserData::Data { class TransfersAllNavigationsContentBrowserClient : public TestContentBrowserClient { public: - virtual bool ShouldSwapProcessesForRedirect(ResourceContext* resource_context, - const GURL& current_url, - const GURL& new_url) override { + bool ShouldSwapProcessesForRedirect(ResourceContext* resource_context, + const GURL& current_url, + const GURL& new_url) override { return true; } }; @@ -566,13 +560,13 @@ class GenericResourceThrottle : public ResourceThrottle { error_code_for_cancellation_(code) { } - virtual ~GenericResourceThrottle() { + ~GenericResourceThrottle() override { if (active_throttle_ == this) active_throttle_ = NULL; } // ResourceThrottle implementation: - virtual void WillStartRequest(bool* defer) override { + void WillStartRequest(bool* defer) override { ASSERT_EQ(NULL, active_throttle_); if (flags_ & DEFER_STARTING_REQUEST) { active_throttle_ = this; @@ -588,7 +582,7 @@ class GenericResourceThrottle : public ResourceThrottle { } } - virtual void WillProcessResponse(bool* defer) override { + void WillProcessResponse(bool* defer) override { ASSERT_EQ(NULL, active_throttle_); if (flags_ & DEFER_PROCESSING_RESPONSE) { active_throttle_ = this; @@ -596,7 +590,7 @@ class GenericResourceThrottle : public ResourceThrottle { } } - virtual void WillStartUsingNetwork(bool* defer) override { + void WillStartUsingNetwork(bool* defer) override { ASSERT_EQ(NULL, active_throttle_); if (flags_ & DEFER_NETWORK_START) { @@ -605,7 +599,7 @@ class GenericResourceThrottle : public ResourceThrottle { } } - virtual const char* GetNameForLogging() const override { + const char* GetNameForLogging() const override { return "GenericResourceThrottle"; } @@ -657,12 +651,11 @@ class TestResourceDispatcherHostDelegate // ResourceDispatcherHostDelegate implementation: - virtual void RequestBeginning( - net::URLRequest* request, - ResourceContext* resource_context, - AppCacheService* appcache_service, - ResourceType resource_type, - ScopedVector<ResourceThrottle>* throttles) override { + void RequestBeginning(net::URLRequest* request, + ResourceContext* resource_context, + AppCacheService* appcache_service, + ResourceType resource_type, + ScopedVector<ResourceThrottle>* throttles) override { if (user_data_) { const void* key = user_data_.get(); request->SetUserData(key, user_data_.release()); @@ -729,7 +722,7 @@ class ResourceDispatcherHostTest : public testing::Test, } // IPC::Sender implementation - virtual bool Send(IPC::Message* msg) override { + bool Send(IPC::Message* msg) override { accum_.AddMessage(*msg); if (send_data_received_acks_ && diff --git a/content/browser/loader/resource_loader.h b/content/browser/loader/resource_loader.h index e4b6c96..d740ec0 100644 --- a/content/browser/loader/resource_loader.h +++ b/content/browser/loader/resource_loader.h @@ -35,7 +35,7 @@ class CONTENT_EXPORT ResourceLoader : public net::URLRequest::Delegate, ResourceLoader(scoped_ptr<net::URLRequest> request, scoped_ptr<ResourceHandler> handler, ResourceLoaderDelegate* delegate); - virtual ~ResourceLoader(); + ~ResourceLoader() override; void StartRequest(); void CancelRequest(bool from_renderer); @@ -59,32 +59,29 @@ class CONTENT_EXPORT ResourceLoader : public net::URLRequest::Delegate, FRIEND_TEST_ALL_PREFIXES(ResourceLoaderTest, ClientCertStoreNull); // net::URLRequest::Delegate implementation: - virtual void OnReceivedRedirect(net::URLRequest* request, - const net::RedirectInfo& redirect_info, - bool* defer) override; - virtual void OnAuthRequired(net::URLRequest* request, - net::AuthChallengeInfo* info) override; - virtual void OnCertificateRequested(net::URLRequest* request, - net::SSLCertRequestInfo* info) override; - virtual void OnSSLCertificateError(net::URLRequest* request, - const net::SSLInfo& info, - bool fatal) override; - virtual void OnBeforeNetworkStart(net::URLRequest* request, - bool* defer) override; - virtual void OnResponseStarted(net::URLRequest* request) override; - virtual void OnReadCompleted(net::URLRequest* request, - int bytes_read) override; + void OnReceivedRedirect(net::URLRequest* request, + const net::RedirectInfo& redirect_info, + bool* defer) override; + void OnAuthRequired(net::URLRequest* request, + net::AuthChallengeInfo* info) override; + void OnCertificateRequested(net::URLRequest* request, + net::SSLCertRequestInfo* info) override; + void OnSSLCertificateError(net::URLRequest* request, + const net::SSLInfo& info, + bool fatal) override; + void OnBeforeNetworkStart(net::URLRequest* request, bool* defer) override; + void OnResponseStarted(net::URLRequest* request) override; + void OnReadCompleted(net::URLRequest* request, int bytes_read) override; // SSLErrorHandler::Delegate implementation: - virtual void CancelSSLRequest(int error, - const net::SSLInfo* ssl_info) override; - virtual void ContinueSSLRequest() override; + void CancelSSLRequest(int error, const net::SSLInfo* ssl_info) override; + void ContinueSSLRequest() override; // ResourceController implementation: - virtual void Resume() override; - virtual void Cancel() override; - virtual void CancelAndIgnore() override; - virtual void CancelWithError(int error_code) override; + void Resume() override; + void Cancel() override; + void CancelAndIgnore() override; + void CancelWithError(int error_code) override; void StartRequestInternal(); void CancelRequestInternal(int error, bool from_renderer); diff --git a/content/browser/loader/resource_loader_unittest.cc b/content/browser/loader/resource_loader_unittest.cc index 50e1835..8da838c 100644 --- a/content/browser/loader/resource_loader_unittest.cc +++ b/content/browser/loader/resource_loader_unittest.cc @@ -44,7 +44,7 @@ class ClientCertStoreStub : public net::ClientCertStore { : response_(certs), request_count_(0) {} - virtual ~ClientCertStoreStub() {} + ~ClientCertStoreStub() override {} // Returns |cert_authorities| field of the certificate request passed in the // most recent call to GetClientCerts(). @@ -62,9 +62,9 @@ class ClientCertStoreStub : public net::ClientCertStore { } // net::ClientCertStore: - virtual void GetClientCerts(const net::SSLCertRequestInfo& cert_request_info, - net::CertificateList* selected_certs, - const base::Closure& callback) override { + void GetClientCerts(const net::SSLCertRequestInfo& cert_request_info, + net::CertificateList* selected_certs, + const base::Closure& callback) override { ++request_count_; requested_authorities_ = cert_request_info.cert_authorities; *selected_certs = response_; @@ -127,39 +127,38 @@ class ResourceHandlerStub : public ResourceHandler { } // ResourceHandler implementation: - virtual bool OnUploadProgress(uint64 position, uint64 size) override { + bool OnUploadProgress(uint64 position, uint64 size) override { NOTREACHED(); return true; } - virtual bool OnRequestRedirected(const net::RedirectInfo& redirect_info, - ResourceResponse* response, - bool* defer) override { + bool OnRequestRedirected(const net::RedirectInfo& redirect_info, + ResourceResponse* response, + bool* defer) override { NOTREACHED(); return true; } - virtual bool OnResponseStarted(ResourceResponse* response, - bool* defer) override { + bool OnResponseStarted(ResourceResponse* response, bool* defer) override { EXPECT_FALSE(response_.get()); response_ = response; return true; } - virtual bool OnWillStart(const GURL& url, bool* defer) override { + bool OnWillStart(const GURL& url, bool* defer) override { EXPECT_TRUE(start_url_.is_empty()); start_url_ = url; *defer = defer_request_on_will_start_; return true; } - virtual bool OnBeforeNetworkStart(const GURL& url, bool* defer) override { + bool OnBeforeNetworkStart(const GURL& url, bool* defer) override { return true; } - virtual bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) override { + bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, + int* buf_size, + int min_size) override { EXPECT_TRUE(expect_reads_); EXPECT_FALSE(received_on_will_read_); EXPECT_FALSE(received_eof_); @@ -171,7 +170,7 @@ class ResourceHandlerStub : public ResourceHandler { return true; } - virtual bool OnReadCompleted(int bytes_read, bool* defer) override { + bool OnReadCompleted(int bytes_read, bool* defer) override { EXPECT_TRUE(received_on_will_read_); EXPECT_TRUE(expect_reads_); EXPECT_FALSE(received_response_completed_); @@ -190,9 +189,9 @@ class ResourceHandlerStub : public ResourceHandler { return !cancel_on_read_completed_; } - virtual void OnResponseCompleted(const net::URLRequestStatus& status, - const std::string& security_info, - bool* defer) override { + void OnResponseCompleted(const net::URLRequestStatus& status, + const std::string& security_info, + bool* defer) override { EXPECT_FALSE(received_response_completed_); if (status.is_success() && expect_reads_) EXPECT_TRUE(received_eof_); @@ -201,7 +200,7 @@ class ResourceHandlerStub : public ResourceHandler { status_ = status; } - virtual void OnDataDownloaded(int bytes_downloaded) override { + void OnDataDownloaded(int bytes_downloaded) override { EXPECT_FALSE(expect_reads_); total_bytes_downloaded_ += bytes_downloaded; } @@ -229,7 +228,7 @@ class SelectCertificateBrowserClient : public TestContentBrowserClient { public: SelectCertificateBrowserClient() : call_count_(0) {} - virtual void SelectClientCertificate( + void SelectClientCertificate( int render_process_id, int render_view_id, net::SSLCertRequestInfo* cert_request_info, @@ -256,7 +255,7 @@ class ResourceContextStub : public MockResourceContext { explicit ResourceContextStub(net::URLRequestContext* test_request_context) : MockResourceContext(test_request_context) {} - virtual scoped_ptr<net::ClientCertStore> CreateClientCertStore() override { + scoped_ptr<net::ClientCertStore> CreateClientCertStore() override { return dummy_cert_store_.Pass(); } @@ -335,20 +334,20 @@ class ResourceLoaderTest : public testing::Test, } // ResourceLoaderDelegate: - virtual ResourceDispatcherHostLoginDelegate* CreateLoginDelegate( + ResourceDispatcherHostLoginDelegate* CreateLoginDelegate( ResourceLoader* loader, net::AuthChallengeInfo* auth_info) override { return NULL; } - virtual bool HandleExternalProtocol(ResourceLoader* loader, - const GURL& url) override { + bool HandleExternalProtocol(ResourceLoader* loader, + const GURL& url) override { return false; } - virtual void DidStartRequest(ResourceLoader* loader) override {} - virtual void DidReceiveRedirect(ResourceLoader* loader, - const GURL& new_url) override {} - virtual void DidReceiveResponse(ResourceLoader* loader) override {} - virtual void DidFinishLoading(ResourceLoader* loader) override {} + void DidStartRequest(ResourceLoader* loader) override {} + void DidReceiveRedirect(ResourceLoader* loader, + const GURL& new_url) override {} + void DidReceiveResponse(ResourceLoader* loader) override {} + void DidFinishLoading(ResourceLoader* loader) override {} content::TestBrowserThreadBundle thread_bundle_; @@ -497,7 +496,7 @@ class ResourceLoaderRedirectToFileTest : public ResourceLoaderTest { loader_.reset(); } - virtual scoped_ptr<ResourceHandler> WrapResourceHandler( + scoped_ptr<ResourceHandler> WrapResourceHandler( scoped_ptr<ResourceHandlerStub> leaf_handler, net::URLRequest* request) override { leaf_handler->set_expect_reads(false); diff --git a/content/browser/loader/resource_message_filter.h b/content/browser/loader/resource_message_filter.h index 2273f9a..3b52a77 100644 --- a/content/browser/loader/resource_message_filter.h +++ b/content/browser/loader/resource_message_filter.h @@ -51,8 +51,8 @@ class CONTENT_EXPORT ResourceMessageFilter : public BrowserMessageFilter { const GetContextsCallback& get_contexts_callback); // BrowserMessageFilter implementation. - virtual void OnChannelClosing() override; - virtual bool OnMessageReceived(const IPC::Message& message) override; + void OnChannelClosing() override; + bool OnMessageReceived(const IPC::Message& message) override; void GetContexts(const ResourceHostMsg_Request& request, ResourceContext** resource_context, @@ -84,7 +84,7 @@ class CONTENT_EXPORT ResourceMessageFilter : public BrowserMessageFilter { protected: // Protected destructor so that we can be overriden in tests. - virtual ~ResourceMessageFilter(); + ~ResourceMessageFilter() override; private: // The ID of the child process. diff --git a/content/browser/loader/resource_request_info_impl.h b/content/browser/loader/resource_request_info_impl.h index 866e38b..696eaa2 100644 --- a/content/browser/loader/resource_request_info_impl.h +++ b/content/browser/loader/resource_request_info_impl.h @@ -62,30 +62,29 @@ class ResourceRequestInfoImpl : public ResourceRequestInfo, ResourceContext* context, base::WeakPtr<ResourceMessageFilter> filter, bool is_async); - virtual ~ResourceRequestInfoImpl(); + ~ResourceRequestInfoImpl() override; // ResourceRequestInfo implementation: - virtual ResourceContext* GetContext() const override; - virtual int GetChildID() const override; - virtual int GetRouteID() const override; - virtual int GetOriginPID() const override; - virtual int GetRequestID() const override; - virtual int GetRenderFrameID() const override; - virtual bool IsMainFrame() const override; - virtual bool ParentIsMainFrame() const override; - virtual int GetParentRenderFrameID() const override; - virtual ResourceType GetResourceType() const override; - virtual int GetProcessType() const override; - virtual blink::WebReferrerPolicy GetReferrerPolicy() const override; - virtual blink::WebPageVisibilityState GetVisibilityState() const override; - virtual ui::PageTransition GetPageTransition() const override; - virtual bool HasUserGesture() const override; - virtual bool WasIgnoredByHandler() const override; - virtual bool GetAssociatedRenderFrame(int* render_process_id, - int* render_frame_id) const override; - virtual bool IsAsync() const override; - virtual bool IsDownload() const override; - + ResourceContext* GetContext() const override; + int GetChildID() const override; + int GetRouteID() const override; + int GetOriginPID() const override; + int GetRequestID() const override; + int GetRenderFrameID() const override; + bool IsMainFrame() const override; + bool ParentIsMainFrame() const override; + int GetParentRenderFrameID() const override; + ResourceType GetResourceType() const override; + int GetProcessType() const override; + blink::WebReferrerPolicy GetReferrerPolicy() const override; + blink::WebPageVisibilityState GetVisibilityState() const override; + ui::PageTransition GetPageTransition() const override; + bool HasUserGesture() const override; + bool WasIgnoredByHandler() const override; + bool GetAssociatedRenderFrame(int* render_process_id, + int* render_frame_id) const override; + bool IsAsync() const override; + bool IsDownload() const override; CONTENT_EXPORT void AssociateWithRequest(net::URLRequest* request); diff --git a/content/browser/loader/resource_scheduler.cc b/content/browser/loader/resource_scheduler.cc index 4f38802..6cc902e 100644 --- a/content/browser/loader/resource_scheduler.cc +++ b/content/browser/loader/resource_scheduler.cc @@ -134,9 +134,7 @@ class ResourceScheduler::ScheduledResourceRequest "url", request->url().spec()); } - virtual ~ScheduledResourceRequest() { - scheduler_->RemoveRequest(this); - } + ~ScheduledResourceRequest() override { scheduler_->RemoveRequest(this); } void Start() { TRACE_EVENT_ASYNC_STEP_PAST0("net", "URLRequest", request_, "Queued"); @@ -169,7 +167,7 @@ class ResourceScheduler::ScheduledResourceRequest private: // ResourceMessageDelegate interface: - virtual bool OnMessageReceived(const IPC::Message& message) override { + bool OnMessageReceived(const IPC::Message& message) override { bool handled = true; IPC_BEGIN_MESSAGE_MAP(ScheduledResourceRequest, message) IPC_MESSAGE_HANDLER(ResourceHostMsg_DidChangePriority, DidChangePriority) @@ -179,13 +177,9 @@ class ResourceScheduler::ScheduledResourceRequest } // ResourceThrottle interface: - virtual void WillStartRequest(bool* defer) override { - deferred_ = *defer = !ready_; - } + void WillStartRequest(bool* defer) override { deferred_ = *defer = !ready_; } - virtual const char* GetNameForLogging() const override { - return "ResourceScheduler"; - } + const char* GetNameForLogging() const override { return "ResourceScheduler"; } void DidChangePriority(int request_id, net::RequestPriority new_priority, int intra_priority_value) { diff --git a/content/browser/loader/resource_scheduler_filter.h b/content/browser/loader/resource_scheduler_filter.h index f07b443..0a6c23a 100644 --- a/content/browser/loader/resource_scheduler_filter.h +++ b/content/browser/loader/resource_scheduler_filter.h @@ -19,10 +19,10 @@ class ResourceSchedulerFilter : public BrowserMessageFilter { explicit ResourceSchedulerFilter(int child_id); // BrowserMessageFilter methods: - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; private: - virtual ~ResourceSchedulerFilter(); + ~ResourceSchedulerFilter() override; int child_id_; }; diff --git a/content/browser/loader/resource_scheduler_unittest.cc b/content/browser/loader/resource_scheduler_unittest.cc index 5b8ecf6..02807b3 100644 --- a/content/browser/loader/resource_scheduler_unittest.cc +++ b/content/browser/loader/resource_scheduler_unittest.cc @@ -56,7 +56,7 @@ class TestRequest : public ResourceController { url_request_(url_request.Pass()) { throttle_->set_controller_for_testing(this); } - virtual ~TestRequest() {} + ~TestRequest() override {} bool started() const { return started_; } @@ -66,7 +66,7 @@ class TestRequest : public ResourceController { started_ = !deferred; } - virtual void Cancel() override { + void Cancel() override { // Alert the scheduler that the request can be deleted. throttle_.reset(0); } @@ -75,9 +75,9 @@ class TestRequest : public ResourceController { protected: // ResourceController interface: - virtual void CancelAndIgnore() override {} - virtual void CancelWithError(int error_code) override {} - virtual void Resume() override { started_ = true; } + void CancelAndIgnore() override {} + void CancelWithError(int error_code) override {} + void Resume() override { started_ = true; } private: bool started_; @@ -96,7 +96,7 @@ class CancelingTestRequest : public TestRequest { } private: - virtual void Resume() override { + void Resume() override { TestRequest::Resume(); request_to_cancel_.reset(); } @@ -106,8 +106,8 @@ class CancelingTestRequest : public TestRequest { class FakeResourceContext : public ResourceContext { private: - virtual net::HostResolver* GetHostResolver() override { return NULL; } - virtual net::URLRequestContext* GetRequestContext() override { return NULL; } + net::HostResolver* GetHostResolver() override { return NULL; } + net::URLRequestContext* GetRequestContext() override { return NULL; } }; class FakeResourceMessageFilter : public ResourceMessageFilter { @@ -125,7 +125,7 @@ class FakeResourceMessageFilter : public ResourceMessageFilter { } private: - virtual ~FakeResourceMessageFilter() {} + ~FakeResourceMessageFilter() override {} void GetContexts(const ResourceHostMsg_Request& request, ResourceContext** resource_context, diff --git a/content/browser/loader/stream_resource_handler.h b/content/browser/loader/stream_resource_handler.h index cdce727..4ec226e 100644 --- a/content/browser/loader/stream_resource_handler.h +++ b/content/browser/loader/stream_resource_handler.h @@ -27,37 +27,36 @@ class StreamResourceHandler : public ResourceHandler { StreamResourceHandler(net::URLRequest* request, StreamRegistry* registry, const GURL& origin); - virtual ~StreamResourceHandler(); + ~StreamResourceHandler() override; - virtual void SetController(ResourceController* controller) override; + void SetController(ResourceController* controller) override; - virtual bool OnUploadProgress(uint64 position, uint64 size) override; + bool OnUploadProgress(uint64 position, uint64 size) override; // Not needed, as this event handler ought to be the final resource. - virtual bool OnRequestRedirected(const net::RedirectInfo& redirect_info, - ResourceResponse* resp, - bool* defer) override; + bool OnRequestRedirected(const net::RedirectInfo& redirect_info, + ResourceResponse* resp, + bool* defer) override; - virtual bool OnResponseStarted(ResourceResponse* resp, - bool* defer) override; + bool OnResponseStarted(ResourceResponse* resp, bool* defer) override; - virtual bool OnWillStart(const GURL& url, bool* defer) override; + bool OnWillStart(const GURL& url, bool* defer) override; - virtual bool OnBeforeNetworkStart(const GURL& url, bool* defer) override; + bool OnBeforeNetworkStart(const GURL& url, bool* defer) override; // Create a new buffer to store received data. - virtual bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) override; + bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, + int* buf_size, + int min_size) override; // A read was completed, forward the data to the Stream. - virtual bool OnReadCompleted(int bytes_read, bool* defer) override; + bool OnReadCompleted(int bytes_read, bool* defer) override; - virtual void OnResponseCompleted(const net::URLRequestStatus& status, - const std::string& sec_info, - bool* defer) override; + void OnResponseCompleted(const net::URLRequestStatus& status, + const std::string& sec_info, + bool* defer) override; - virtual void OnDataDownloaded(int bytes_downloaded) override; + void OnDataDownloaded(int bytes_downloaded) override; Stream* stream() { return writer_.stream(); } diff --git a/content/browser/loader/stream_writer.h b/content/browser/loader/stream_writer.h index b9f3e62..a611e26 100644 --- a/content/browser/loader/stream_writer.h +++ b/content/browser/loader/stream_writer.h @@ -29,7 +29,7 @@ class StreamWriter : public StreamWriteObserver { // Creates a new StreamWriter without an initialized Stream or controller. The // controller must be set before the writer is used. StreamWriter(); - virtual ~StreamWriter(); + ~StreamWriter() override; Stream* stream() { return stream_.get(); } @@ -68,8 +68,8 @@ class StreamWriter : public StreamWriteObserver { private: // StreamWriteObserver implementation. - virtual void OnSpaceAvailable(Stream* stream) override; - virtual void OnClose(Stream* stream) override; + void OnSpaceAvailable(Stream* stream) override; + void OnClose(Stream* stream) override; ResourceController* controller_; scoped_refptr<Stream> stream_; diff --git a/content/browser/loader/sync_resource_handler.h b/content/browser/loader/sync_resource_handler.h index 8828b80..09713e2 100644 --- a/content/browser/loader/sync_resource_handler.h +++ b/content/browser/loader/sync_resource_handler.h @@ -31,24 +31,23 @@ class SyncResourceHandler : public ResourceHandler { SyncResourceHandler(net::URLRequest* request, IPC::Message* result_message, ResourceDispatcherHostImpl* resource_dispatcher_host); - virtual ~SyncResourceHandler(); + ~SyncResourceHandler() override; - virtual bool OnUploadProgress(uint64 position, uint64 size) override; - virtual bool OnRequestRedirected(const net::RedirectInfo& redirect_info, - ResourceResponse* response, - bool* defer) override; - virtual bool OnResponseStarted(ResourceResponse* response, - bool* defer) override; - virtual bool OnWillStart(const GURL& url, bool* defer) override; - virtual bool OnBeforeNetworkStart(const GURL& url, bool* defer) override; - virtual bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) override; - virtual bool OnReadCompleted(int bytes_read, bool* defer) override; - virtual void OnResponseCompleted(const net::URLRequestStatus& status, - const std::string& security_info, - bool* defer) override; - virtual void OnDataDownloaded(int bytes_downloaded) override; + bool OnUploadProgress(uint64 position, uint64 size) override; + bool OnRequestRedirected(const net::RedirectInfo& redirect_info, + ResourceResponse* response, + bool* defer) override; + bool OnResponseStarted(ResourceResponse* response, bool* defer) override; + bool OnWillStart(const GURL& url, bool* defer) override; + bool OnBeforeNetworkStart(const GURL& url, bool* defer) override; + bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, + int* buf_size, + int min_size) override; + bool OnReadCompleted(int bytes_read, bool* defer) override; + void OnResponseCompleted(const net::URLRequestStatus& status, + const std::string& security_info, + bool* defer) override; + void OnDataDownloaded(int bytes_downloaded) override; private: enum { kReadBufSize = 3840 }; diff --git a/content/browser/loader/throttling_resource_handler.h b/content/browser/loader/throttling_resource_handler.h index 08e3580..0d1287d 100644 --- a/content/browser/loader/throttling_resource_handler.h +++ b/content/browser/loader/throttling_resource_handler.h @@ -29,22 +29,21 @@ class ThrottlingResourceHandler : public LayeredResourceHandler, ThrottlingResourceHandler(scoped_ptr<ResourceHandler> next_handler, net::URLRequest* request, ScopedVector<ResourceThrottle> throttles); - virtual ~ThrottlingResourceHandler(); + ~ThrottlingResourceHandler() override; // LayeredResourceHandler overrides: - virtual bool OnRequestRedirected(const net::RedirectInfo& redirect_info, - ResourceResponse* response, - bool* defer) override; - virtual bool OnResponseStarted(ResourceResponse* response, - bool* defer) override; - virtual bool OnWillStart(const GURL& url, bool* defer) override; - virtual bool OnBeforeNetworkStart(const GURL& url, bool* defer) override; + bool OnRequestRedirected(const net::RedirectInfo& redirect_info, + ResourceResponse* response, + bool* defer) override; + bool OnResponseStarted(ResourceResponse* response, bool* defer) override; + bool OnWillStart(const GURL& url, bool* defer) override; + bool OnBeforeNetworkStart(const GURL& url, bool* defer) override; // ResourceController implementation: - virtual void Cancel() override; - virtual void CancelAndIgnore() override; - virtual void CancelWithError(int error_code) override; - virtual void Resume() override; + void Cancel() override; + void CancelAndIgnore() override; + void CancelWithError(int error_code) override; + void Resume() override; private: void ResumeStart(); diff --git a/content/browser/loader/upload_data_stream_builder.cc b/content/browser/loader/upload_data_stream_builder.cc index 45b22b6..6419ead 100644 --- a/content/browser/loader/upload_data_stream_builder.cc +++ b/content/browser/loader/upload_data_stream_builder.cc @@ -30,7 +30,7 @@ class BytesElementReader : public net::UploadBytesElementReader { DCHECK_EQ(ResourceRequestBody::Element::TYPE_BYTES, element.type()); } - virtual ~BytesElementReader() {} + ~BytesElementReader() override {} private: scoped_refptr<ResourceRequestBody> resource_request_body_; @@ -55,7 +55,7 @@ class FileElementReader : public net::UploadFileElementReader { DCHECK_EQ(ResourceRequestBody::Element::TYPE_FILE, element.type()); } - virtual ~FileElementReader() {} + ~FileElementReader() override {} private: scoped_refptr<ResourceRequestBody> resource_request_body_; diff --git a/content/browser/mach_broker_mac.h b/content/browser/mach_broker_mac.h index 2f2ab13..9088ca7 100644 --- a/content/browser/mach_broker_mac.h +++ b/content/browser/mach_broker_mac.h @@ -64,25 +64,25 @@ class CONTENT_EXPORT MachBroker : public base::ProcessMetrics::PortProvider, void AddPlaceholderForPid(base::ProcessHandle pid); // Implement |ProcessMetrics::PortProvider|. - virtual mach_port_t TaskForPid(base::ProcessHandle process) const override; + mach_port_t TaskForPid(base::ProcessHandle process) const override; // Implement |BrowserChildProcessObserver|. - virtual void BrowserChildProcessHostDisconnected( - const ChildProcessData& data) override; - virtual void BrowserChildProcessCrashed( + void BrowserChildProcessHostDisconnected( const ChildProcessData& data) override; + void BrowserChildProcessCrashed(const ChildProcessData& data) override; // Implement |NotificationObserver|. - virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) override; + void Observe(int type, + const NotificationSource& source, + const NotificationDetails& details) override; + private: friend class MachBrokerTest; friend class MachListenerThreadDelegate; friend struct DefaultSingletonTraits<MachBroker>; MachBroker(); - virtual ~MachBroker(); + ~MachBroker() override; // Updates the mapping for |pid| to include the given |mach_info|. Does // nothing if PlaceholderForPid() has not already been called for the given diff --git a/content/browser/mach_broker_mac.mm b/content/browser/mach_broker_mac.mm index 4be771a..f2e5f98 100644 --- a/content/browser/mach_broker_mac.mm +++ b/content/browser/mach_broker_mac.mm @@ -85,7 +85,7 @@ class MachListenerThreadDelegate : public base::PlatformThread::Delegate { } // Implement |PlatformThread::Delegate|. - virtual void ThreadMain() override { + void ThreadMain() override { MachBroker_ParentRecvMsg msg; bzero(&msg, sizeof(msg)); msg.header.msgh_size = sizeof(msg); diff --git a/content/browser/manifest/manifest_manager_host.h b/content/browser/manifest/manifest_manager_host.h index cf9551d2..aea980f 100644 --- a/content/browser/manifest/manifest_manager_host.h +++ b/content/browser/manifest/manifest_manager_host.h @@ -21,7 +21,7 @@ struct Manifest; class ManifestManagerHost : public WebContentsObserver { public: explicit ManifestManagerHost(WebContents* web_contents); - virtual ~ManifestManagerHost(); + ~ManifestManagerHost() override; typedef base::Callback<void(const Manifest&)> GetManifestCallback; @@ -31,9 +31,8 @@ class ManifestManagerHost : public WebContentsObserver { void GetManifest(RenderFrameHost*, const GetManifestCallback&); // WebContentsObserver - virtual bool OnMessageReceived(const IPC::Message&, - RenderFrameHost*) override; - virtual void RenderFrameDeleted(RenderFrameHost*) override; + bool OnMessageReceived(const IPC::Message&, RenderFrameHost*) override; + void RenderFrameDeleted(RenderFrameHost*) override; private: typedef IDMap<GetManifestCallback, IDMapOwnPointer> CallbackMap; diff --git a/content/browser/media/capture/desktop_capture_device.cc b/content/browser/media/capture/desktop_capture_device.cc index e1d28ce..c77ee0c 100644 --- a/content/browser/media/capture/desktop_capture_device.cc +++ b/content/browser/media/capture/desktop_capture_device.cc @@ -53,7 +53,7 @@ class DesktopCaptureDevice::Core : public webrtc::DesktopCapturer::Callback { Core(scoped_refptr<base::SingleThreadTaskRunner> task_runner, scoped_ptr<webrtc::DesktopCapturer> capturer, DesktopMediaID::Type type); - virtual ~Core(); + ~Core() override; // Implementation of VideoCaptureDevice methods. void AllocateAndStart(const media::VideoCaptureParams& params, @@ -64,8 +64,8 @@ class DesktopCaptureDevice::Core : public webrtc::DesktopCapturer::Callback { private: // webrtc::DesktopCapturer::Callback interface - virtual webrtc::SharedMemory* CreateSharedMemory(size_t size) override; - virtual void OnCaptureCompleted(webrtc::DesktopFrame* frame) override; + webrtc::SharedMemory* CreateSharedMemory(size_t size) override; + void OnCaptureCompleted(webrtc::DesktopFrame* frame) override; // Chooses new output properties based on the supplied source size and the // properties requested to Allocate(), and dispatches OnFrameInfo[Changed] diff --git a/content/browser/media/capture/desktop_capture_device.h b/content/browser/media/capture/desktop_capture_device.h index 006848f..a9c3f00 100644 --- a/content/browser/media/capture/desktop_capture_device.h +++ b/content/browser/media/capture/desktop_capture_device.h @@ -35,12 +35,12 @@ class CONTENT_EXPORT DesktopCaptureDevice : public media::VideoCaptureDevice { static scoped_ptr<media::VideoCaptureDevice> Create( const DesktopMediaID& source); - virtual ~DesktopCaptureDevice(); + ~DesktopCaptureDevice() override; // VideoCaptureDevice interface. - virtual void AllocateAndStart(const media::VideoCaptureParams& params, - scoped_ptr<Client> client) override; - virtual void StopAndDeAllocate() override; + void AllocateAndStart(const media::VideoCaptureParams& params, + scoped_ptr<Client> client) override; + void StopAndDeAllocate() override; // Set the platform-dependent window id for the notification window. void SetNotificationWindowId(gfx::NativeViewId window_id); diff --git a/content/browser/media/capture/desktop_capture_device_unittest.cc b/content/browser/media/capture/desktop_capture_device_unittest.cc index 883fdc4..0388043 100644 --- a/content/browser/media/capture/desktop_capture_device_unittest.cc +++ b/content/browser/media/capture/desktop_capture_device_unittest.cc @@ -74,7 +74,7 @@ class InvertedDesktopFrame : public webrtc::DesktopFrame { set_capture_time_ms(frame->capture_time_ms()); mutable_updated_region()->Swap(frame->mutable_updated_region()); } - virtual ~InvertedDesktopFrame() {} + ~InvertedDesktopFrame() override {} private: scoped_ptr<webrtc::DesktopFrame> original_frame_; @@ -90,18 +90,16 @@ class FakeScreenCapturer : public webrtc::ScreenCapturer { frame_index_(0), generate_inverted_frames_(false) { } - virtual ~FakeScreenCapturer() {} + ~FakeScreenCapturer() override {} void set_generate_inverted_frames(bool generate_inverted_frames) { generate_inverted_frames_ = generate_inverted_frames; } // VideoFrameCapturer interface. - virtual void Start(Callback* callback) override { - callback_ = callback; - } + void Start(Callback* callback) override { callback_ = callback; } - virtual void Capture(const webrtc::DesktopRegion& region) override { + void Capture(const webrtc::DesktopRegion& region) override { webrtc::DesktopSize size; if (frame_index_ % 2 == 0) { size = webrtc::DesktopSize(kTestFrameWidth1, kTestFrameHeight1); @@ -116,17 +114,12 @@ class FakeScreenCapturer : public webrtc::ScreenCapturer { callback_->OnCaptureCompleted(frame); } - virtual void SetMouseShapeObserver( - MouseShapeObserver* mouse_shape_observer) override { - } + void SetMouseShapeObserver( + MouseShapeObserver* mouse_shape_observer) override {} - virtual bool GetScreenList(ScreenList* screens) override { - return false; - } + bool GetScreenList(ScreenList* screens) override { return false; } - virtual bool SelectScreen(webrtc::ScreenId id) override { - return false; - } + bool SelectScreen(webrtc::ScreenId id) override { return false; } private: Callback* callback_; diff --git a/content/browser/media/capture/video_capture_oracle_unittest.cc b/content/browser/media/capture/video_capture_oracle_unittest.cc index 4a05bf8..0ce0000 100644 --- a/content/browser/media/capture/video_capture_oracle_unittest.cc +++ b/content/browser/media/capture/video_capture_oracle_unittest.cc @@ -672,7 +672,7 @@ class AnimatedContentSamplerParameterizedTest protected: typedef std::pair<gfx::Rect, base::TimeTicks> Event; - virtual base::TimeDelta GetMinCapturePeriod() const override { + base::TimeDelta GetMinCapturePeriod() const override { return GetParam().min_capture_period; } diff --git a/content/browser/media/capture/web_contents_audio_input_stream.cc b/content/browser/media/capture/web_contents_audio_input_stream.cc index cdf7eb9..605124d 100644 --- a/content/browser/media/capture/web_contents_audio_input_stream.cc +++ b/content/browser/media/capture/web_contents_audio_input_stream.cc @@ -64,7 +64,7 @@ class WebContentsAudioInputStream::Impl CLOSED }; - virtual ~Impl(); + ~Impl() override; // Notifies the consumer callback that the stream is now dead. void ReportError(); @@ -79,12 +79,11 @@ class WebContentsAudioInputStream::Impl void UnmuteWebContentsAudio(); // AudioMirroringManager::MirroringDestination implementation - virtual void QueryForMatches( - const std::set<SourceFrameRef>& candidates, - const MatchesCallback& results_callback) override; + void QueryForMatches(const std::set<SourceFrameRef>& candidates, + const MatchesCallback& results_callback) override; void QueryForMatchesOnUIThread(const std::set<SourceFrameRef>& candidates, const MatchesCallback& results_callback); - virtual media::AudioOutputStream* AddInput( + media::AudioOutputStream* AddInput( const media::AudioParameters& params) override; // Callback which is run when |stream| is closed. Deletes |stream|. diff --git a/content/browser/media/capture/web_contents_audio_input_stream.h b/content/browser/media/capture/web_contents_audio_input_stream.h index a0468ff..d66d270 100644 --- a/content/browser/media/capture/web_contents_audio_input_stream.h +++ b/content/browser/media/capture/web_contents_audio_input_stream.h @@ -37,16 +37,16 @@ class CONTENT_EXPORT WebContentsAudioInputStream : NON_EXPORTED_BASE(public media::AudioInputStream) { public: // media::AudioInputStream implementation - virtual bool Open() override; - virtual void Start(AudioInputCallback* callback) override; - virtual void Stop() override; - virtual void Close() override; - virtual double GetMaxVolume() override; - virtual void SetVolume(double volume) override; - virtual double GetVolume() override; - virtual void SetAutomaticGainControl(bool enabled) override; - virtual bool GetAutomaticGainControl() override; - virtual bool IsMuted() override; + bool Open() override; + void Start(AudioInputCallback* callback) override; + void Stop() override; + void Close() override; + double GetMaxVolume() override; + void SetVolume(double volume) override; + double GetVolume() override; + void SetAutomaticGainControl(bool enabled) override; + bool GetAutomaticGainControl() override; + bool IsMuted() override; // Create a new audio mirroring session, or return NULL on error. |device_id| // should be in the format accepted by @@ -78,7 +78,7 @@ class CONTENT_EXPORT WebContentsAudioInputStream const scoped_refptr<WebContentsTracker>& tracker, media::VirtualAudioInputStream* mixer_stream); - virtual ~WebContentsAudioInputStream(); + ~WebContentsAudioInputStream() override; scoped_refptr<Impl> impl_; diff --git a/content/browser/media/capture/web_contents_audio_muter.cc b/content/browser/media/capture/web_contents_audio_muter.cc index 3a0d001..4d32192 100644 --- a/content/browser/media/capture/web_contents_audio_muter.cc +++ b/content/browser/media/capture/web_contents_audio_muter.cc @@ -33,17 +33,17 @@ class AudioDiscarder : public media::AudioOutputStream { : consumer_(media::AudioManager::Get()->GetWorkerTaskRunner(), params) {} // AudioOutputStream implementation. - virtual bool Open() override { return true; } - virtual void Start(AudioSourceCallback* callback) override { + bool Open() override { return true; } + void Start(AudioSourceCallback* callback) override { consumer_.Start(base::Bind(&AudioDiscarder::FetchAudioData, callback)); } - virtual void Stop() override { consumer_.Stop(); } - virtual void SetVolume(double volume) override {} - virtual void GetVolume(double* volume) override { *volume = 0; } - virtual void Close() override { delete this; } + void Stop() override { consumer_.Stop(); } + void SetVolume(double volume) override {} + void GetVolume(double* volume) override { *volume = 0; } + void Close() override { delete this; } private: - virtual ~AudioDiscarder() {} + ~AudioDiscarder() override {} static void FetchAudioData(AudioSourceCallback* callback, media::AudioBus* audio_bus) { @@ -73,11 +73,10 @@ class WebContentsAudioMuter::MuteDestination typedef AudioMirroringManager::SourceFrameRef SourceFrameRef; - virtual ~MuteDestination() {} + ~MuteDestination() override {} - virtual void QueryForMatches( - const std::set<SourceFrameRef>& candidates, - const MatchesCallback& results_callback) override { + void QueryForMatches(const std::set<SourceFrameRef>& candidates, + const MatchesCallback& results_callback) override { BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, @@ -104,7 +103,7 @@ class WebContentsAudioMuter::MuteDestination results_callback.Run(matches); } - virtual media::AudioOutputStream* AddInput( + media::AudioOutputStream* AddInput( const media::AudioParameters& params) override { return new AudioDiscarder(params); } diff --git a/content/browser/media/capture/web_contents_tracker.h b/content/browser/media/capture/web_contents_tracker.h index 799e695..f124eaa 100644 --- a/content/browser/media/capture/web_contents_tracker.h +++ b/content/browser/media/capture/web_contents_tracker.h @@ -61,7 +61,7 @@ class CONTENT_EXPORT WebContentsTracker protected: friend class base::RefCountedThreadSafe<WebContentsTracker>; - virtual ~WebContentsTracker(); + ~WebContentsTracker() override; private: // Determine the target RenderWidgetHost and, if different from that last @@ -82,18 +82,18 @@ class CONTENT_EXPORT WebContentsTracker // WebContentsObserver overrides: According to web_contents_observer.h, these // two method overrides are all that is necessary to track the set of active // RenderFrameHosts. - virtual void RenderFrameDeleted(RenderFrameHost* render_frame_host) override; - virtual void RenderFrameHostChanged(RenderFrameHost* old_host, - RenderFrameHost* new_host) override; + void RenderFrameDeleted(RenderFrameHost* render_frame_host) override; + void RenderFrameHostChanged(RenderFrameHost* old_host, + RenderFrameHost* new_host) override; // WebContentsObserver override to notify the client that the capture target // has been permanently lost. - virtual void WebContentsDestroyed() override; + void WebContentsDestroyed() override; // WebContentsObserver overrides to notify the client that the capture target // may have changed due to a separate fullscreen widget shown/destroyed. - virtual void DidShowFullscreenWidget(int routing_id) override; - virtual void DidDestroyFullscreenWidget(int routing_id) override; + void DidShowFullscreenWidget(int routing_id) override; + void DidDestroyFullscreenWidget(int routing_id) override; // If true, the client is interested in the showing/destruction of fullscreen // RenderWidgetHosts. diff --git a/content/browser/media/capture/web_contents_video_capture_device.cc b/content/browser/media/capture/web_contents_video_capture_device.cc index 1d87f01..2a10c94 100644 --- a/content/browser/media/capture/web_contents_video_capture_device.cc +++ b/content/browser/media/capture/web_contents_video_capture_device.cc @@ -142,7 +142,7 @@ class FrameSubscriber : public RenderWidgetHostViewFrameSubscriber { oracle_proxy_(oracle), delivery_log_(delivery_log) {} - virtual bool ShouldCaptureFrame( + bool ShouldCaptureFrame( const gfx::Rect& damage_rect, base::TimeTicks present_time, scoped_refptr<media::VideoFrame>* storage, @@ -185,12 +185,12 @@ class ContentCaptureSubscription : public content::NotificationObserver { const RenderWidgetHost& source, const scoped_refptr<ThreadSafeCaptureOracle>& oracle_proxy, const CaptureCallback& capture_callback); - virtual ~ContentCaptureSubscription(); + ~ContentCaptureSubscription() override; // content::NotificationObserver implementation. - virtual void Observe(int type, - const content::NotificationSource& source, - const content::NotificationDetails& details) override; + void Observe(int type, + const content::NotificationSource& source, + const content::NotificationDetails& details) override; private: void OnTimer(); @@ -229,12 +229,12 @@ void RenderVideoFrame(const SkBitmap& input, class WebContentsCaptureMachine : public VideoCaptureMachine { public: WebContentsCaptureMachine(int render_process_id, int main_render_frame_id); - virtual ~WebContentsCaptureMachine(); + ~WebContentsCaptureMachine() override; // VideoCaptureMachine overrides. - virtual bool Start(const scoped_refptr<ThreadSafeCaptureOracle>& oracle_proxy, - const media::VideoCaptureParams& params) override; - virtual void Stop(const base::Closure& callback) override; + bool Start(const scoped_refptr<ThreadSafeCaptureOracle>& oracle_proxy, + const media::VideoCaptureParams& params) override; + void Stop(const base::Closure& callback) override; // Starts a copy from the backing store or the composited surface. Must be run // on the UI BrowserThread. |deliver_frame_cb| will be run when the operation diff --git a/content/browser/media/capture/web_contents_video_capture_device.h b/content/browser/media/capture/web_contents_video_capture_device.h index abc28a0..d385a2b 100644 --- a/content/browser/media/capture/web_contents_video_capture_device.h +++ b/content/browser/media/capture/web_contents_video_capture_device.h @@ -32,12 +32,12 @@ class CONTENT_EXPORT WebContentsVideoCaptureDevice // |device_id|. Returns NULL if |device_id| is invalid. static media::VideoCaptureDevice* Create(const std::string& device_id); - virtual ~WebContentsVideoCaptureDevice(); + ~WebContentsVideoCaptureDevice() override; // VideoCaptureDevice implementation. - virtual void AllocateAndStart(const media::VideoCaptureParams& params, - scoped_ptr<Client> client) override; - virtual void StopAndDeAllocate() override; + void AllocateAndStart(const media::VideoCaptureParams& params, + scoped_ptr<Client> client) override; + void StopAndDeAllocate() override; private: WebContentsVideoCaptureDevice( diff --git a/content/browser/media/capture/web_contents_video_capture_device_unittest.cc b/content/browser/media/capture/web_contents_video_capture_device_unittest.cc index 42faca1..e9fa2a2 100644 --- a/content/browser/media/capture/web_contents_video_capture_device_unittest.cc +++ b/content/browser/media/capture/web_contents_video_capture_device_unittest.cc @@ -163,18 +163,18 @@ class CaptureTestView : public TestRenderWidgetHostView { : TestRenderWidgetHostView(rwh), controller_(controller) {} - virtual ~CaptureTestView() {} + ~CaptureTestView() override {} // TestRenderWidgetHostView overrides. - virtual gfx::Rect GetViewBounds() const override { + gfx::Rect GetViewBounds() const override { return gfx::Rect(100, 100, 100 + kTestWidth, 100 + kTestHeight); } - virtual bool CanCopyToVideoFrame() const override { + bool CanCopyToVideoFrame() const override { return controller_->CanCopyToVideoFrame(); } - virtual void CopyFromCompositingSurfaceToVideoFrame( + void CopyFromCompositingSurfaceToVideoFrame( const gfx::Rect& src_subrect, const scoped_refptr<media::VideoFrame>& target, const base::Callback<void(bool)>& callback) override { @@ -185,14 +185,12 @@ class CaptureTestView : public TestRenderWidgetHostView { controller_->SignalCopy(); } - virtual void BeginFrameSubscription( + void BeginFrameSubscription( scoped_ptr<RenderWidgetHostViewFrameSubscriber> subscriber) override { subscriber_.reset(subscriber.release()); } - virtual void EndFrameSubscription() override { - subscriber_.reset(); - } + void EndFrameSubscription() override { subscriber_.reset(); } // Simulate a compositor paint event for our subscriber. void SimulateUpdate() { @@ -248,7 +246,7 @@ class CaptureTestRenderViewHost : public TestRenderViewHost { } // TestRenderViewHost overrides. - virtual void CopyFromBackingStore( + void CopyFromBackingStore( const gfx::Rect& src_rect, const gfx::Size& accelerated_dst_size, const base::Callback<void(bool, const SkBitmap&)>& callback, @@ -286,12 +284,10 @@ class CaptureTestRenderViewHostFactory : public RenderViewHostFactory { RegisterFactory(this); } - virtual ~CaptureTestRenderViewHostFactory() { - UnregisterFactory(); - } + ~CaptureTestRenderViewHostFactory() override { UnregisterFactory(); } // RenderViewHostFactory implementation. - virtual RenderViewHost* CreateRenderViewHost( + RenderViewHost* CreateRenderViewHost( SiteInstance* instance, RenderViewHostDelegate* delegate, RenderWidgetHostDelegate* widget_delegate, @@ -318,11 +314,11 @@ class StubClient : public media::VideoCaptureDevice::Client { error_callback_(error_callback) { buffer_pool_ = new VideoCaptureBufferPool(2); } - virtual ~StubClient() {} + ~StubClient() override {} - virtual scoped_refptr<media::VideoCaptureDevice::Client::Buffer> - ReserveOutputBuffer(media::VideoFrame::Format format, - const gfx::Size& dimensions) override { + scoped_refptr<media::VideoCaptureDevice::Client::Buffer> ReserveOutputBuffer( + media::VideoFrame::Format format, + const gfx::Size& dimensions) override { CHECK_EQ(format, media::VideoFrame::I420); const size_t frame_bytes = media::VideoFrame::AllocationSize(media::VideoFrame::I420, dimensions); @@ -338,16 +334,15 @@ class StubClient : public media::VideoCaptureDevice::Client { new PoolBuffer(buffer_pool_, buffer_id, data, size)); } - virtual void OnIncomingCapturedData( - const uint8* data, - int length, - const media::VideoCaptureFormat& frame_format, - int rotation, - base::TimeTicks timestamp) override { + void OnIncomingCapturedData(const uint8* data, + int length, + const media::VideoCaptureFormat& frame_format, + int rotation, + base::TimeTicks timestamp) override { FAIL(); } - virtual void OnIncomingCapturedVideoFrame( + void OnIncomingCapturedVideoFrame( const scoped_refptr<Buffer>& buffer, const media::VideoCaptureFormat& buffer_format, const scoped_refptr<media::VideoFrame>& frame, @@ -364,9 +359,7 @@ class StubClient : public media::VideoCaptureDevice::Client { color_callback_.Run((SkColorSetRGB(yuv[0], yuv[1], yuv[2]))); } - virtual void OnError(const std::string& reason) override { - error_callback_.Run(); - } + void OnError(const std::string& reason) override { error_callback_.Run(); } private: class PoolBuffer : public media::VideoCaptureDevice::Client::Buffer { @@ -378,7 +371,7 @@ class StubClient : public media::VideoCaptureDevice::Client { : Buffer(buffer_id, data, size), pool_(pool) {} private: - virtual ~PoolBuffer() { pool_->RelinquishProducerReservation(id()); } + ~PoolBuffer() override { pool_->RelinquishProducerReservation(id()); } const scoped_refptr<VideoCaptureBufferPool> pool_; }; @@ -476,35 +469,31 @@ class FakeScreen : public gfx::Screen { FakeScreen() : the_one_display_(0x1337, gfx::Rect(0, 0, 2560, 1440)) { the_one_display_.set_device_scale_factor(kTestDeviceScaleFactor); } - virtual ~FakeScreen() {} + ~FakeScreen() override {} // gfx::Screen implementation (only what's needed for testing). - virtual bool IsDIPEnabled() override { return true; } - virtual gfx::Point GetCursorScreenPoint() override { return gfx::Point(); } - virtual gfx::NativeWindow GetWindowUnderCursor() override { return NULL; } - virtual gfx::NativeWindow GetWindowAtScreenPoint( - const gfx::Point& point) override { return NULL; } - virtual int GetNumDisplays() const override { return 1; } - virtual std::vector<gfx::Display> GetAllDisplays() const override { + bool IsDIPEnabled() override { return true; } + gfx::Point GetCursorScreenPoint() override { return gfx::Point(); } + gfx::NativeWindow GetWindowUnderCursor() override { return NULL; } + gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override { + return NULL; + } + int GetNumDisplays() const override { return 1; } + std::vector<gfx::Display> GetAllDisplays() const override { return std::vector<gfx::Display>(1, the_one_display_); } - virtual gfx::Display GetDisplayNearestWindow( - gfx::NativeView view) const override { - return the_one_display_; - } - virtual gfx::Display GetDisplayNearestPoint( - const gfx::Point& point) const override { + gfx::Display GetDisplayNearestWindow(gfx::NativeView view) const override { return the_one_display_; } - virtual gfx::Display GetDisplayMatching( - const gfx::Rect& match_rect) const override { + gfx::Display GetDisplayNearestPoint(const gfx::Point& point) const override { return the_one_display_; } - virtual gfx::Display GetPrimaryDisplay() const override { + gfx::Display GetDisplayMatching(const gfx::Rect& match_rect) const override { return the_one_display_; } - virtual void AddObserver(gfx::DisplayObserver* observer) override {} - virtual void RemoveObserver(gfx::DisplayObserver* observer) override {} + gfx::Display GetPrimaryDisplay() const override { return the_one_display_; } + void AddObserver(gfx::DisplayObserver* observer) override {} + void RemoveObserver(gfx::DisplayObserver* observer) override {} private: gfx::Display the_one_display_; diff --git a/content/browser/media/encrypted_media_browsertest.cc b/content/browser/media/encrypted_media_browsertest.cc index 88c02f9..8448851 100644 --- a/content/browser/media/encrypted_media_browsertest.cc +++ b/content/browser/media/encrypted_media_browsertest.cc @@ -124,7 +124,7 @@ class EncryptedMediaTest : public content::MediaBrowserTest, protected: // We want to fail quickly when a test fails because an error is encountered. - virtual void AddWaitForTitles(content::TitleWatcher* title_watcher) override { + void AddWaitForTitles(content::TitleWatcher* title_watcher) override { MediaBrowserTest::AddWaitForTitles(title_watcher); title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(kEmeNotSupportedError)); title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(kEmeKeyError)); diff --git a/content/browser/media/media_canplaytype_browsertest.cc b/content/browser/media/media_canplaytype_browsertest.cc index 6e295ec..e454de4 100644 --- a/content/browser/media/media_canplaytype_browsertest.cc +++ b/content/browser/media/media_canplaytype_browsertest.cc @@ -45,9 +45,7 @@ class MediaCanPlayTypeTest : public MediaBrowserTest { public: MediaCanPlayTypeTest() : url_("about:blank") { } - virtual void SetUpOnMainThread() override { - NavigateToURL(shell(), url_); - } + void SetUpOnMainThread() override { NavigateToURL(shell(), url_); } std::string CanPlay(const std::string& type) { std::string command("document.createElement('video').canPlayType("); diff --git a/content/browser/media/media_internals.cc b/content/browser/media/media_internals.cc index 3813e24..bdc47d0 100644 --- a/content/browser/media/media_internals.cc +++ b/content/browser/media/media_internals.cc @@ -68,16 +68,16 @@ class AudioLogImpl : public media::AudioLog { AudioLogImpl(int owner_id, media::AudioLogFactory::AudioComponent component, content::MediaInternals* media_internals); - virtual ~AudioLogImpl(); - - virtual void OnCreated(int component_id, - const media::AudioParameters& params, - const std::string& device_id) override; - virtual void OnStarted(int component_id) override; - virtual void OnStopped(int component_id) override; - virtual void OnClosed(int component_id) override; - virtual void OnError(int component_id) override; - virtual void OnSetVolume(int component_id, double volume) override; + ~AudioLogImpl() override; + + void OnCreated(int component_id, + const media::AudioParameters& params, + const std::string& device_id) override; + void OnStarted(int component_id) override; + void OnStopped(int component_id) override; + void OnClosed(int component_id) override; + void OnError(int component_id) override; + void OnSetVolume(int component_id, double volume) override; private: void SendSingleStringUpdate(int component_id, diff --git a/content/browser/media/media_internals.h b/content/browser/media/media_internals.h index 7b0652c..4c1b2ed 100644 --- a/content/browser/media/media_internals.h +++ b/content/browser/media/media_internals.h @@ -34,7 +34,7 @@ class CONTENT_EXPORT MediaInternals static MediaInternals* GetInstance(); - virtual ~MediaInternals(); + ~MediaInternals() override; // Called when a MediaEvent occurs. void OnMediaEvents(int render_process_id, @@ -56,8 +56,7 @@ class CONTENT_EXPORT MediaInternals const media::VideoCaptureDeviceInfos& video_capture_device_infos); // AudioLogFactory implementation. Safe to call from any thread. - virtual scoped_ptr<media::AudioLog> CreateAudioLog( - AudioComponent component) override; + scoped_ptr<media::AudioLog> CreateAudioLog(AudioComponent component) override; private: friend class AudioLogImpl; diff --git a/content/browser/media/media_internals_handler.h b/content/browser/media/media_internals_handler.h index 553babd..d984a96 100644 --- a/content/browser/media/media_internals_handler.h +++ b/content/browser/media/media_internals_handler.h @@ -21,10 +21,10 @@ class MediaInternalsProxy; class MediaInternalsMessageHandler : public WebUIMessageHandler { public: MediaInternalsMessageHandler(); - virtual ~MediaInternalsMessageHandler(); + ~MediaInternalsMessageHandler() override; // WebUIMessageHandler implementation. - virtual void RegisterMessages() override; + void RegisterMessages() override; // Javascript message handlers. void OnGetEverything(const base::ListValue* list); diff --git a/content/browser/media/media_internals_proxy.h b/content/browser/media/media_internals_proxy.h index c79f15f..c2672f0 100644 --- a/content/browser/media/media_internals_proxy.h +++ b/content/browser/media/media_internals_proxy.h @@ -35,9 +35,9 @@ class MediaInternalsProxy MediaInternalsProxy(); // NotificationObserver implementation. - virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) override; + void Observe(int type, + const NotificationSource& source, + const NotificationDetails& details) override; // Register a Handler and start receiving callbacks from MediaInternals. void Attach(MediaInternalsMessageHandler* handler); @@ -52,12 +52,12 @@ class MediaInternalsProxy void OnUpdate(const base::string16& update); // net::NetLog::ThreadSafeObserver implementation. Callable from any thread: - virtual void OnAddEntry(const net::NetLog::Entry& entry) override; + void OnAddEntry(const net::NetLog::Entry& entry) override; private: friend struct BrowserThread::DeleteOnThread<BrowserThread::UI>; friend class base::DeleteHelper<MediaInternalsProxy>; - virtual ~MediaInternalsProxy(); + ~MediaInternalsProxy() override; // Build a dictionary mapping constant names to values. base::Value* GetConstants(); diff --git a/content/browser/media/midi_dispatcher_host.h b/content/browser/media/midi_dispatcher_host.h index 55a3ae5..586e864 100644 --- a/content/browser/media/midi_dispatcher_host.h +++ b/content/browser/media/midi_dispatcher_host.h @@ -19,15 +19,15 @@ class BrowserContext; class MidiDispatcherHost : public WebContentsObserver { public: explicit MidiDispatcherHost(WebContents* web_contents); - virtual ~MidiDispatcherHost(); + ~MidiDispatcherHost() override; // WebContentsObserver implementation. - virtual void RenderFrameDeleted(RenderFrameHost* render_frame_host) override; - virtual void DidNavigateAnyFrame(RenderFrameHost* render_frame_host, - const LoadCommittedDetails& details, - const FrameNavigateParams& params) override; - virtual bool OnMessageReceived(const IPC::Message& message, - RenderFrameHost* render_frame_host) override; + void RenderFrameDeleted(RenderFrameHost* render_frame_host) override; + void DidNavigateAnyFrame(RenderFrameHost* render_frame_host, + const LoadCommittedDetails& details, + const FrameNavigateParams& params) override; + bool OnMessageReceived(const IPC::Message& message, + RenderFrameHost* render_frame_host) override; private: void OnRequestSysExPermission(RenderFrameHost* render_frame_host, diff --git a/content/browser/media/midi_host.h b/content/browser/media/midi_host.h index ef5f904..87be305 100644 --- a/content/browser/media/midi_host.h +++ b/content/browser/media/midi_host.h @@ -31,17 +31,16 @@ class CONTENT_EXPORT MidiHost MidiHost(int renderer_process_id, media::MidiManager* midi_manager); // BrowserMessageFilter implementation. - virtual void OnDestruct() const override; - virtual bool OnMessageReceived(const IPC::Message& message) override; + void OnDestruct() const override; + bool OnMessageReceived(const IPC::Message& message) override; // MidiManagerClient implementation. - virtual void CompleteStartSession(int client_id, - media::MidiResult result) override; - virtual void ReceiveMidiData(uint32 port, - const uint8* data, - size_t length, - double timestamp) override; - virtual void AccumulateMidiBytesSent(size_t n) override; + void CompleteStartSession(int client_id, media::MidiResult result) override; + void ReceiveMidiData(uint32 port, + const uint8* data, + size_t length, + double timestamp) override; + void AccumulateMidiBytesSent(size_t n) override; // Start session to access MIDI hardware. void OnStartSession(int client_id); @@ -56,7 +55,7 @@ class CONTENT_EXPORT MidiHost friend class base::DeleteHelper<MidiHost>; friend class BrowserThread; - virtual ~MidiHost(); + ~MidiHost() override; // Returns true if |data| fulfills the requirements of MidiOutput.send API // defined in the WebMIDI spec. diff --git a/content/browser/media/webrtc_internals.h b/content/browser/media/webrtc_internals.h index 861dd0c..db8693a 100644 --- a/content/browser/media/webrtc_internals.h +++ b/content/browser/media/webrtc_internals.h @@ -111,20 +111,20 @@ class CONTENT_EXPORT WebRTCInternals : public NotificationObserver, AecRecordingFileSelectionCanceled); WebRTCInternals(); - virtual ~WebRTCInternals(); + ~WebRTCInternals() override; void SendUpdate(const std::string& command, base::Value* value); // NotificationObserver implementation. - virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) override; + void Observe(int type, + const NotificationSource& source, + const NotificationDetails& details) override; // ui::SelectFileDialog::Listener implementation. - virtual void FileSelected(const base::FilePath& path, - int index, - void* unused_params) override; - virtual void FileSelectionCanceled(void* params) override; + void FileSelected(const base::FilePath& path, + int index, + void* unused_params) override; + void FileSelectionCanceled(void* params) override; // Called when a renderer exits (including crashes). void OnRendererExit(int render_process_id); diff --git a/content/browser/media/webrtc_internals_browsertest.cc b/content/browser/media/webrtc_internals_browsertest.cc index 8155662..e9b8b98 100644 --- a/content/browser/media/webrtc_internals_browsertest.cc +++ b/content/browser/media/webrtc_internals_browsertest.cc @@ -151,7 +151,7 @@ class MAYBE_WebRtcInternalsBrowserTest: public ContentBrowserTest { MAYBE_WebRtcInternalsBrowserTest() {} virtual ~MAYBE_WebRtcInternalsBrowserTest() {} - virtual void SetUpOnMainThread() override { + void SetUpOnMainThread() override { // We need fake devices in this test since we want to run on naked VMs. We // assume these switches are set by default in content_browsertests. ASSERT_TRUE(CommandLine::ForCurrentProcess()->HasSwitch( diff --git a/content/browser/media/webrtc_internals_message_handler.h b/content/browser/media/webrtc_internals_message_handler.h index a54f27d..b27e7f0 100644 --- a/content/browser/media/webrtc_internals_message_handler.h +++ b/content/browser/media/webrtc_internals_message_handler.h @@ -21,14 +21,13 @@ class WebRTCInternalsMessageHandler : public WebUIMessageHandler, public WebRTCInternalsUIObserver{ public: WebRTCInternalsMessageHandler(); - virtual ~WebRTCInternalsMessageHandler(); + ~WebRTCInternalsMessageHandler() override; // WebUIMessageHandler implementation. - virtual void RegisterMessages() override; + void RegisterMessages() override; // WebRTCInternalsUIObserver override. - virtual void OnUpdate(const std::string& command, - const base::Value* args) override; + void OnUpdate(const std::string& command, const base::Value* args) override; private: // Javascript message handler. diff --git a/content/browser/media/webrtc_internals_unittest.cc b/content/browser/media/webrtc_internals_unittest.cc index 5290910..afe3587 100644 --- a/content/browser/media/webrtc_internals_unittest.cc +++ b/content/browser/media/webrtc_internals_unittest.cc @@ -20,8 +20,7 @@ static const std::string kUrl = "u"; class MockWebRTCInternalsProxy : public WebRTCInternalsUIObserver { public: - virtual void OnUpdate(const std::string& command, - const base::Value* value) override { + void OnUpdate(const std::string& command, const base::Value* value) override { command_ = command; if (value) value_.reset(value->DeepCopy()); diff --git a/content/browser/message_port_message_filter.h b/content/browser/message_port_message_filter.h index caa030e..21bfbb2 100644 --- a/content/browser/message_port_message_filter.h +++ b/content/browser/message_port_message_filter.h @@ -22,9 +22,9 @@ class CONTENT_EXPORT MessagePortMessageFilter : public BrowserMessageFilter { explicit MessagePortMessageFilter(const NextRoutingIDCallback& callback); // BrowserMessageFilter implementation. - virtual void OnChannelClosing() override; - virtual bool OnMessageReceived(const IPC::Message& message) override; - virtual void OnDestruct() const override; + void OnChannelClosing() override; + bool OnMessageReceived(const IPC::Message& message) override; + void OnDestruct() const override; int GetNextRoutingID(); @@ -36,7 +36,7 @@ class CONTENT_EXPORT MessagePortMessageFilter : public BrowserMessageFilter { protected: // This is protected, so we can define sub classes for testing. - virtual ~MessagePortMessageFilter(); + ~MessagePortMessageFilter() override; private: friend class BrowserThread; diff --git a/content/browser/mime_registry_message_filter.h b/content/browser/mime_registry_message_filter.h index 8d97759..c4b110e 100644 --- a/content/browser/mime_registry_message_filter.h +++ b/content/browser/mime_registry_message_filter.h @@ -14,13 +14,12 @@ class MimeRegistryMessageFilter : public BrowserMessageFilter { public: MimeRegistryMessageFilter(); - virtual void OverrideThreadForMessage( - const IPC::Message& message, - BrowserThread::ID* thread) override; - virtual bool OnMessageReceived(const IPC::Message& message) override; + void OverrideThreadForMessage(const IPC::Message& message, + BrowserThread::ID* thread) override; + bool OnMessageReceived(const IPC::Message& message) override; private: - virtual ~MimeRegistryMessageFilter(); + ~MimeRegistryMessageFilter() override; void OnGetMimeTypeFromExtension(const base::FilePath::StringType& ext, std::string* mime_type); diff --git a/content/browser/net/browser_online_state_observer.h b/content/browser/net/browser_online_state_observer.h index 7d47b42..13d9e3d 100644 --- a/content/browser/net/browser_online_state_observer.h +++ b/content/browser/net/browser_online_state_observer.h @@ -16,10 +16,10 @@ class BrowserOnlineStateObserver : public net::NetworkChangeNotifier::ConnectionTypeObserver { public: BrowserOnlineStateObserver(); - virtual ~BrowserOnlineStateObserver(); + ~BrowserOnlineStateObserver() override; // ConnectionTypeObserver implementation. - virtual void OnConnectionTypeChanged( + void OnConnectionTypeChanged( net::NetworkChangeNotifier::ConnectionType type) override; private: diff --git a/content/browser/net/sqlite_persistent_cookie_store.h b/content/browser/net/sqlite_persistent_cookie_store.h index 69df24f..786b6b6 100644 --- a/content/browser/net/sqlite_persistent_cookie_store.h +++ b/content/browser/net/sqlite_persistent_cookie_store.h @@ -54,17 +54,17 @@ class CONTENT_EXPORT SQLitePersistentCookieStore CookieCryptoDelegate* crypto_delegate); // net::CookieMonster::PersistentCookieStore: - virtual void Load(const LoadedCallback& loaded_callback) override; - virtual void LoadCookiesForKey(const std::string& key, - const LoadedCallback& callback) override; - virtual void AddCookie(const net::CanonicalCookie& cc) override; - virtual void UpdateCookieAccessTime(const net::CanonicalCookie& cc) override; - virtual void DeleteCookie(const net::CanonicalCookie& cc) override; - virtual void SetForceKeepSessionState() override; - virtual void Flush(const base::Closure& callback) override; + void Load(const LoadedCallback& loaded_callback) override; + void LoadCookiesForKey(const std::string& key, + const LoadedCallback& callback) override; + void AddCookie(const net::CanonicalCookie& cc) override; + void UpdateCookieAccessTime(const net::CanonicalCookie& cc) override; + void DeleteCookie(const net::CanonicalCookie& cc) override; + void SetForceKeepSessionState() override; + void Flush(const base::Closure& callback) override; protected: - virtual ~SQLitePersistentCookieStore(); + ~SQLitePersistentCookieStore() override; private: class Backend; diff --git a/content/browser/net/sqlite_persistent_cookie_store_unittest.cc b/content/browser/net/sqlite_persistent_cookie_store_unittest.cc index 395b29f..510de0d 100644 --- a/content/browser/net/sqlite_persistent_cookie_store_unittest.cc +++ b/content/browser/net/sqlite_persistent_cookie_store_unittest.cc @@ -40,10 +40,10 @@ const base::FilePath::CharType kCookieFilename[] = FILE_PATH_LITERAL("Cookies"); class CookieCryptor : public content::CookieCryptoDelegate { public: CookieCryptor(); - virtual bool EncryptString(const std::string& plaintext, - std::string* ciphertext) override; - virtual bool DecryptString(const std::string& ciphertext, - std::string* plaintext) override; + bool EncryptString(const std::string& plaintext, + std::string* ciphertext) override; + bool DecryptString(const std::string& ciphertext, + std::string* plaintext) override; private: scoped_ptr<crypto::SymmetricKey> key_; diff --git a/content/browser/net/view_http_cache_job_factory.cc b/content/browser/net/view_http_cache_job_factory.cc index 57bf2ae..e80cac7 100644 --- a/content/browser/net/view_http_cache_job_factory.cc +++ b/content/browser/net/view_http_cache_job_factory.cc @@ -34,16 +34,15 @@ class ViewHttpCacheJob : public net::URLRequestJob { } // net::URLRequestJob implementation. - virtual void Start() override; - virtual void Kill() override; - virtual bool GetMimeType(std::string* mime_type) const override{ + void Start() override; + void Kill() override; + bool GetMimeType(std::string* mime_type) const override { return core_->GetMimeType(mime_type); } - virtual bool GetCharset(std::string* charset) override{ + bool GetCharset(std::string* charset) override { return core_->GetCharset(charset); } - virtual bool ReadRawData(net::IOBuffer* buf, - int buf_size, int *bytes_read) override{ + bool ReadRawData(net::IOBuffer* buf, int buf_size, int* bytes_read) override { return core_->ReadRawData(buf, buf_size, bytes_read); } @@ -83,7 +82,7 @@ class ViewHttpCacheJob : public net::URLRequestJob { DISALLOW_COPY_AND_ASSIGN(Core); }; - virtual ~ViewHttpCacheJob() {} + ~ViewHttpCacheJob() override {} void StartAsync(); void OnStartCompleted(); diff --git a/content/browser/net_info_browsertest.cc b/content/browser/net_info_browsertest.cc index 23a2968..cea6962 100644 --- a/content/browser/net_info_browsertest.cc +++ b/content/browser/net_info_browsertest.cc @@ -14,7 +14,7 @@ class NetInfoBrowserTest : public content::ContentBrowserTest { protected: - virtual void SetUpCommandLine(base::CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { // TODO(jkarlin): Once NetInfo is enabled on all platforms remove this // switch. command_line->AppendSwitch(switches::kEnableNetworkInformation); @@ -30,7 +30,7 @@ class NetInfoBrowserTest : public content::ContentBrowserTest { } #endif - virtual void SetUpOnMainThread() override { + void SetUpOnMainThread() override { net::NetworkChangeNotifier::SetTestNotificationsOnly(true); base::RunLoop().RunUntilIdle(); } diff --git a/content/browser/notification_service_impl.h b/content/browser/notification_service_impl.h index 7d0ecaa..2df369a 100644 --- a/content/browser/notification_service_impl.h +++ b/content/browser/notification_service_impl.h @@ -23,12 +23,12 @@ class CONTENT_EXPORT NotificationServiceImpl : public NotificationService { // Normally instantiated when the thread is created. Not all threads have // a NotificationService. Only one instance should be created per thread. NotificationServiceImpl(); - virtual ~NotificationServiceImpl(); + ~NotificationServiceImpl() override; // NotificationService: - virtual void Notify(int type, - const NotificationSource& source, - const NotificationDetails& details) override; + void Notify(int type, + const NotificationSource& source, + const NotificationDetails& details) override; private: friend class NotificationRegistrar; diff --git a/content/browser/notification_service_impl_unittest.cc b/content/browser/notification_service_impl_unittest.cc index 7bfedc5..1e71e64 100644 --- a/content/browser/notification_service_impl_unittest.cc +++ b/content/browser/notification_service_impl_unittest.cc @@ -22,9 +22,9 @@ class TestObserver : public NotificationObserver { int notification_count() const { return notification_count_; } - virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) override { + void Observe(int type, + const NotificationSource& source, + const NotificationDetails& details) override { ++notification_count_; } diff --git a/content/browser/pepper_flash_settings_helper_impl.h b/content/browser/pepper_flash_settings_helper_impl.h index a579ab1..9a5887b 100644 --- a/content/browser/pepper_flash_settings_helper_impl.h +++ b/content/browser/pepper_flash_settings_helper_impl.h @@ -19,20 +19,19 @@ class CONTENT_EXPORT PepperFlashSettingsHelperImpl PepperFlashSettingsHelperImpl(); // PepperFlashSettingsHelper implementation. - virtual void OpenChannelToBroker( - const base::FilePath& path, - const OpenChannelCallback& callback) override; + void OpenChannelToBroker(const base::FilePath& path, + const OpenChannelCallback& callback) override; // PpapiPluginProcessHost::BrokerClient implementation. - virtual void GetPpapiChannelInfo(base::ProcessHandle* renderer_handle, - int* renderer_id) override; - virtual void OnPpapiChannelOpened(const IPC::ChannelHandle& channel_handle, - base::ProcessId plugin_pid, - int plugin_child_id) override; - virtual bool OffTheRecord() override; + void GetPpapiChannelInfo(base::ProcessHandle* renderer_handle, + int* renderer_id) override; + void OnPpapiChannelOpened(const IPC::ChannelHandle& channel_handle, + base::ProcessId plugin_pid, + int plugin_child_id) override; + bool OffTheRecord() override; protected: - virtual ~PepperFlashSettingsHelperImpl(); + ~PepperFlashSettingsHelperImpl() override; private: OpenChannelCallback callback_; diff --git a/content/browser/plugin_browsertest.cc b/content/browser/plugin_browsertest.cc index 8caf7ea..a5ca6da 100644 --- a/content/browser/plugin_browsertest.cc +++ b/content/browser/plugin_browsertest.cc @@ -49,7 +49,7 @@ class PluginTest : public ContentBrowserTest { protected: PluginTest() {} - virtual void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(CommandLine* command_line) override { // Some NPAPI tests schedule garbage collection to force object tear-down. command_line->AppendSwitchASCII(switches::kJavaScriptFlags, "--expose_gc"); @@ -76,7 +76,7 @@ class PluginTest : public ContentBrowserTest { #endif } - virtual void SetUpOnMainThread() override { + void SetUpOnMainThread() override { base::FilePath path = GetTestFilePath("", ""); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind(&SetUrlRequestMock, path)); @@ -508,11 +508,10 @@ class TestResourceDispatcherHostDelegate private: // ResourceDispatcherHostDelegate implementation: - virtual void OnResponseStarted( - net::URLRequest* request, - ResourceContext* resource_context, - ResourceResponse* response, - IPC::Sender* sender) override { + void OnResponseStarted(net::URLRequest* request, + ResourceContext* resource_context, + ResourceResponse* response, + IPC::Sender* sender) override { // The URL below comes from plugin_geturl_test.cc. if (!EndsWith(request->url().spec(), "npapi/plugin_ref_target_page.html", diff --git a/content/browser/plugin_data_remover_impl.cc b/content/browser/plugin_data_remover_impl.cc index 1f6f615..f74b378 100644 --- a/content/browser/plugin_data_remover_impl.cc +++ b/content/browser/plugin_data_remover_impl.cc @@ -122,32 +122,28 @@ class PluginDataRemoverImpl::Context } // PluginProcessHost::Client methods. - virtual int ID() override { + int ID() override { // Generate a unique identifier for this PluginProcessHostClient. return ChildProcessHostImpl::GenerateChildProcessUniqueId(); } - virtual bool OffTheRecord() override { - return false; - } + bool OffTheRecord() override { return false; } - virtual ResourceContext* GetResourceContext() override { - return resource_context_; - } + ResourceContext* GetResourceContext() override { return resource_context_; } - virtual void SetPluginInfo(const WebPluginInfo& info) override {} + void SetPluginInfo(const WebPluginInfo& info) override {} - virtual void OnFoundPluginProcessHost(PluginProcessHost* host) override {} + void OnFoundPluginProcessHost(PluginProcessHost* host) override {} - virtual void OnSentPluginChannelRequest() override {} + void OnSentPluginChannelRequest() override {} - virtual void OnChannelOpened(const IPC::ChannelHandle& handle) override { + void OnChannelOpened(const IPC::ChannelHandle& handle) override { ConnectToChannel(handle, false); // Balancing the AddRef call. Release(); } - virtual void OnError() override { + void OnError() override { LOG(ERROR) << "Couldn't open plugin channel"; SignalDone(); // Balancing the AddRef call. @@ -155,16 +151,15 @@ class PluginDataRemoverImpl::Context } // PpapiPluginProcessHost::BrokerClient implementation. - virtual void GetPpapiChannelInfo(base::ProcessHandle* renderer_handle, - int* renderer_id) override { + void GetPpapiChannelInfo(base::ProcessHandle* renderer_handle, + int* renderer_id) override { *renderer_handle = base::kNullProcessHandle; *renderer_id = 0; } - virtual void OnPpapiChannelOpened( - const IPC::ChannelHandle& channel_handle, - base::ProcessId /* peer_pid */, - int /* child_id */) override { + void OnPpapiChannelOpened(const IPC::ChannelHandle& channel_handle, + base::ProcessId /* peer_pid */, + int /* child_id */) override { if (!channel_handle.name.empty()) ConnectToChannel(channel_handle, true); @@ -173,7 +168,7 @@ class PluginDataRemoverImpl::Context } // IPC::Listener methods. - virtual bool OnMessageReceived(const IPC::Message& message) override { + bool OnMessageReceived(const IPC::Message& message) override { IPC_BEGIN_MESSAGE_MAP(Context, message) IPC_MESSAGE_HANDLER(PluginProcessHostMsg_ClearSiteDataResult, OnClearSiteDataResult) @@ -185,7 +180,7 @@ class PluginDataRemoverImpl::Context return true; } - virtual void OnChannelError() override { + void OnChannelError() override { if (is_removing_) { NOTREACHED() << "Channel error"; SignalDone(); @@ -197,7 +192,7 @@ class PluginDataRemoverImpl::Context private: friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>; friend class base::DeleteHelper<Context>; - virtual ~Context() {} + ~Context() override {} IPC::Message* CreatePpapiClearSiteDataMsg(uint64 max_age) { base::FilePath profile_path = diff --git a/content/browser/plugin_data_remover_impl.h b/content/browser/plugin_data_remover_impl.h index 54964ea..704ebaa 100644 --- a/content/browser/plugin_data_remover_impl.h +++ b/content/browser/plugin_data_remover_impl.h @@ -17,10 +17,10 @@ namespace content { class CONTENT_EXPORT PluginDataRemoverImpl : public PluginDataRemover { public: explicit PluginDataRemoverImpl(BrowserContext* browser_context); - virtual ~PluginDataRemoverImpl(); + ~PluginDataRemoverImpl() override; // PluginDataRemover implementation: - virtual base::WaitableEvent* StartRemoving(base::Time begin_time) override; + base::WaitableEvent* StartRemoving(base::Time begin_time) override; // The plug-in whose data should be removed (usually Flash) is specified via // its MIME type. This method sets a different MIME type in order to call a diff --git a/content/browser/plugin_data_remover_impl_browsertest.cc b/content/browser/plugin_data_remover_impl_browsertest.cc index 9ea58b1..97adba9 100644 --- a/content/browser/plugin_data_remover_impl_browsertest.cc +++ b/content/browser/plugin_data_remover_impl_browsertest.cc @@ -28,7 +28,7 @@ class PluginDataRemoverTest : public ContentBrowserTest { base::MessageLoop::current()->Quit(); } - virtual void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(CommandLine* command_line) override { #if defined(OS_MACOSX) base::FilePath browser_directory; PathService::Get(base::DIR_MODULE, &browser_directory); diff --git a/content/browser/plugin_loader_posix.h b/content/browser/plugin_loader_posix.h index 4745004..5b1580c 100644 --- a/content/browser/plugin_loader_posix.h +++ b/content/browser/plugin_loader_posix.h @@ -55,14 +55,14 @@ class CONTENT_EXPORT PluginLoaderPosix void GetPlugins(const PluginService::GetPluginsCallback& callback); // UtilityProcessHostClient: - virtual void OnProcessCrashed(int exit_code) override; - virtual bool OnMessageReceived(const IPC::Message& message) override; + void OnProcessCrashed(int exit_code) override; + bool OnMessageReceived(const IPC::Message& message) override; // IPC::Sender: - virtual bool Send(IPC::Message* msg) override; + bool Send(IPC::Message* msg) override; private: - virtual ~PluginLoaderPosix(); + ~PluginLoaderPosix() override; // Called on the FILE thread to get the list of plugin paths to probe. void GetPluginsToLoad(); diff --git a/content/browser/plugin_process_host.cc b/content/browser/plugin_process_host.cc index c256759..2c10b09 100644 --- a/content/browser/plugin_process_host.cc +++ b/content/browser/plugin_process_host.cc @@ -104,7 +104,7 @@ class PluginSandboxedProcessLauncherDelegate #endif // OS_POSIX {} - virtual ~PluginSandboxedProcessLauncherDelegate() {} + ~PluginSandboxedProcessLauncherDelegate() override {} #if defined(OS_WIN) virtual bool ShouldSandbox() override { @@ -112,9 +112,7 @@ class PluginSandboxedProcessLauncherDelegate } #elif defined(OS_POSIX) - virtual base::ScopedFD TakeIpcFd() override { - return ipc_fd_.Pass(); - } + base::ScopedFD TakeIpcFd() override { return ipc_fd_.Pass(); } #endif // OS_WIN private: diff --git a/content/browser/plugin_process_host.h b/content/browser/plugin_process_host.h index 2b4f9df..1e8b678 100644 --- a/content/browser/plugin_process_host.h +++ b/content/browser/plugin_process_host.h @@ -75,10 +75,10 @@ class CONTENT_EXPORT PluginProcessHost : public BrowserChildProcessHostDelegate, }; PluginProcessHost(); - virtual ~PluginProcessHost(); + ~PluginProcessHost() override; // IPC::Sender implementation: - virtual bool Send(IPC::Message* message) override; + bool Send(IPC::Message* message) override; // Initialize the new plugin process, returning true on success. This must // be called before the object can be used. @@ -87,9 +87,9 @@ class CONTENT_EXPORT PluginProcessHost : public BrowserChildProcessHostDelegate, // Force the plugin process to shutdown (cleanly). void ForceShutdown(); - virtual bool OnMessageReceived(const IPC::Message& msg) override; - virtual void OnChannelConnected(int32 peer_pid) override; - virtual void OnChannelError() override; + bool OnMessageReceived(const IPC::Message& msg) override; + void OnChannelConnected(int32 peer_pid) override; + void OnChannelError() override; // Tells the plugin process to create a new channel for communication with a // renderer. When the plugin process responds with the channel name, @@ -147,8 +147,8 @@ class CONTENT_EXPORT PluginProcessHost : public BrowserChildProcessHostDelegate, void OnPluginSetCursorVisibility(bool visible); #endif - virtual bool CanShutdown() override; - virtual void OnProcessCrashed(int exit_code) override; + bool CanShutdown() override; + void OnProcessCrashed(int exit_code) override; void CancelRequests(); diff --git a/content/browser/plugin_service_impl.h b/content/browser/plugin_service_impl.h index 0b5cc5f..8770974 100644 --- a/content/browser/plugin_service_impl.h +++ b/content/browser/plugin_service_impl.h @@ -69,48 +69,46 @@ class CONTENT_EXPORT PluginServiceImpl static PluginServiceImpl* GetInstance(); // PluginService implementation: - virtual void Init() override; - virtual void StartWatchingPlugins() override; - virtual bool GetPluginInfoArray( - const GURL& url, - const std::string& mime_type, - bool allow_wildcard, - std::vector<WebPluginInfo>* info, - std::vector<std::string>* actual_mime_types) override; - virtual bool GetPluginInfo(int render_process_id, - int render_frame_id, - ResourceContext* context, - const GURL& url, - const GURL& page_url, - const std::string& mime_type, - bool allow_wildcard, - bool* is_stale, - WebPluginInfo* info, - std::string* actual_mime_type) override; - virtual bool GetPluginInfoByPath(const base::FilePath& plugin_path, - WebPluginInfo* info) override; - virtual base::string16 GetPluginDisplayNameByPath( + void Init() override; + void StartWatchingPlugins() override; + bool GetPluginInfoArray(const GURL& url, + const std::string& mime_type, + bool allow_wildcard, + std::vector<WebPluginInfo>* info, + std::vector<std::string>* actual_mime_types) override; + bool GetPluginInfo(int render_process_id, + int render_frame_id, + ResourceContext* context, + const GURL& url, + const GURL& page_url, + const std::string& mime_type, + bool allow_wildcard, + bool* is_stale, + WebPluginInfo* info, + std::string* actual_mime_type) override; + bool GetPluginInfoByPath(const base::FilePath& plugin_path, + WebPluginInfo* info) override; + base::string16 GetPluginDisplayNameByPath( const base::FilePath& path) override; - virtual void GetPlugins(const GetPluginsCallback& callback) override; - virtual PepperPluginInfo* GetRegisteredPpapiPluginInfo( + void GetPlugins(const GetPluginsCallback& callback) override; + PepperPluginInfo* GetRegisteredPpapiPluginInfo( const base::FilePath& plugin_path) override; - virtual void SetFilter(PluginServiceFilter* filter) override; - virtual PluginServiceFilter* GetFilter() override; - virtual void ForcePluginShutdown(const base::FilePath& plugin_path) override; - virtual bool IsPluginUnstable(const base::FilePath& plugin_path) override; - virtual void RefreshPlugins() override; - virtual void AddExtraPluginPath(const base::FilePath& path) override; - virtual void RemoveExtraPluginPath(const base::FilePath& path) override; - virtual void AddExtraPluginDir(const base::FilePath& path) override; - virtual void RegisterInternalPlugin( - const WebPluginInfo& info, bool add_at_beginning) override; - virtual void UnregisterInternalPlugin(const base::FilePath& path) override; - virtual void GetInternalPlugins( - std::vector<WebPluginInfo>* plugins) override; - virtual bool NPAPIPluginsSupported() override; - virtual void DisablePluginsDiscoveryForTesting() override; + void SetFilter(PluginServiceFilter* filter) override; + PluginServiceFilter* GetFilter() override; + void ForcePluginShutdown(const base::FilePath& plugin_path) override; + bool IsPluginUnstable(const base::FilePath& plugin_path) override; + void RefreshPlugins() override; + void AddExtraPluginPath(const base::FilePath& path) override; + void RemoveExtraPluginPath(const base::FilePath& path) override; + void AddExtraPluginDir(const base::FilePath& path) override; + void RegisterInternalPlugin(const WebPluginInfo& info, + bool add_at_beginning) override; + void UnregisterInternalPlugin(const base::FilePath& path) override; + void GetInternalPlugins(std::vector<WebPluginInfo>* plugins) override; + bool NPAPIPluginsSupported() override; + void DisablePluginsDiscoveryForTesting() override; #if defined(OS_MACOSX) - virtual void AppActivated() override; + void AppActivated() override; #elif defined(OS_WIN) virtual bool GetPluginInfoFromWindow(HWND window, base::string16* plugin_name, @@ -119,8 +117,8 @@ class CONTENT_EXPORT PluginServiceImpl // Returns true iff the given HWND is a plugin. bool IsPluginWindow(HWND window); #endif - virtual bool PpapiDevChannelSupported(BrowserContext* browser_context, - const GURL& document_url) override; + bool PpapiDevChannelSupported(BrowserContext* browser_context, + const GURL& document_url) override; // Returns the plugin process host corresponding to the plugin process that // has been started by this service. This will start a process to host the @@ -164,7 +162,7 @@ class CONTENT_EXPORT PluginServiceImpl // Creates the PluginServiceImpl object, but doesn't actually build the plugin // list yet. It's generated lazily. PluginServiceImpl(); - virtual ~PluginServiceImpl(); + ~PluginServiceImpl() override; #if defined(OS_WIN) void OnKeyChanged(base::win::RegKey* key); diff --git a/content/browser/plugin_service_impl_browsertest.cc b/content/browser/plugin_service_impl_browsertest.cc index 0a63d87..b8a3dfb 100644 --- a/content/browser/plugin_service_impl_browsertest.cc +++ b/content/browser/plugin_service_impl_browsertest.cc @@ -42,21 +42,19 @@ class MockPluginProcessHostClient : public PluginProcessHost::Client, expect_fail_(expect_fail) { } - virtual ~MockPluginProcessHostClient() { + ~MockPluginProcessHostClient() override { if (channel_) BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, channel_); } // PluginProcessHost::Client implementation. - virtual int ID() override { return 42; } - virtual bool OffTheRecord() override { return false; } - virtual ResourceContext* GetResourceContext() override { - return context_; - } - virtual void OnFoundPluginProcessHost(PluginProcessHost* host) override {} - virtual void OnSentPluginChannelRequest() override {} + int ID() override { return 42; } + bool OffTheRecord() override { return false; } + ResourceContext* GetResourceContext() override { return context_; } + void OnFoundPluginProcessHost(PluginProcessHost* host) override {} + void OnSentPluginChannelRequest() override {} - virtual void OnChannelOpened(const IPC::ChannelHandle& handle) override { + void OnChannelOpened(const IPC::ChannelHandle& handle) override { ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); ASSERT_TRUE(set_plugin_info_called_); ASSERT_TRUE(!channel_); @@ -64,36 +62,28 @@ class MockPluginProcessHostClient : public PluginProcessHost::Client, ASSERT_TRUE(channel_->Connect()); } - virtual void SetPluginInfo(const WebPluginInfo& info) override { + void SetPluginInfo(const WebPluginInfo& info) override { ASSERT_TRUE(info.mime_types.size()); ASSERT_EQ(kNPAPITestPluginMimeType, info.mime_types[0].mime_type); set_plugin_info_called_ = true; } - virtual void OnError() override { - Fail(); - } + void OnError() override { Fail(); } // IPC::Listener implementation. - virtual bool OnMessageReceived(const IPC::Message& message) override { + bool OnMessageReceived(const IPC::Message& message) override { Fail(); return false; } - virtual void OnChannelConnected(int32 peer_pid) override { + void OnChannelConnected(int32 peer_pid) override { if (expect_fail_) FAIL(); QuitMessageLoop(); } - virtual void OnChannelError() override { - Fail(); - } + void OnChannelError() override { Fail(); } #if defined(OS_POSIX) - virtual void OnChannelDenied() override { - Fail(); - } - virtual void OnChannelListenError() override { - Fail(); - } + void OnChannelDenied() override { Fail(); } + void OnChannelListenError() override { Fail(); } #endif private: @@ -119,17 +109,19 @@ class MockPluginServiceFilter : public content::PluginServiceFilter { public: MockPluginServiceFilter() {} - virtual bool IsPluginAvailable( - int render_process_id, - int render_view_id, - const void* context, - const GURL& url, - const GURL& policy_url, - WebPluginInfo* plugin) override { return true; } - - virtual bool CanLoadPlugin( - int render_process_id, - const base::FilePath& path) override { return false; } + bool IsPluginAvailable(int render_process_id, + int render_view_id, + const void* context, + const GURL& url, + const GURL& policy_url, + WebPluginInfo* plugin) override { + return true; + } + + bool CanLoadPlugin(int render_process_id, + const base::FilePath& path) override { + return false; + } }; class PluginServiceTest : public ContentBrowserTest { @@ -140,7 +132,7 @@ class PluginServiceTest : public ContentBrowserTest { return shell()->web_contents()->GetBrowserContext()->GetResourceContext(); } - virtual void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(CommandLine* command_line) override { #if defined(OS_MACOSX) base::FilePath browser_directory; PathService::Get(base::DIR_MODULE, &browser_directory); @@ -254,16 +246,16 @@ class MockCanceledBeforeSentPluginProcessHostClient on_found_plugin_process_host_called_(false), host_(NULL) {} - virtual ~MockCanceledBeforeSentPluginProcessHostClient() {} + ~MockCanceledBeforeSentPluginProcessHostClient() override {} // Client implementation. - virtual void SetPluginInfo(const WebPluginInfo& info) override { + void SetPluginInfo(const WebPluginInfo& info) override { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); ASSERT_TRUE(info.mime_types.size()); ASSERT_EQ(kNPAPITestPluginMimeType, info.mime_types[0].mime_type); set_plugin_info_called_ = true; } - virtual void OnFoundPluginProcessHost(PluginProcessHost* host) override { + void OnFoundPluginProcessHost(PluginProcessHost* host) override { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); set_on_found_plugin_process_host_called(); set_host(host); @@ -326,21 +318,21 @@ class MockCanceledAfterSentPluginProcessHostClient ResourceContext* context) : MockCanceledBeforeSentPluginProcessHostClient(context), on_sent_plugin_channel_request_called_(false) {} - virtual ~MockCanceledAfterSentPluginProcessHostClient() {} + ~MockCanceledAfterSentPluginProcessHostClient() override {} // Client implementation. - virtual int ID() override { return 42; } - virtual bool OffTheRecord() override { return false; } + int ID() override { return 42; } + bool OffTheRecord() override { return false; } // We override this guy again since we don't want to cancel yet. - virtual void OnFoundPluginProcessHost(PluginProcessHost* host) override { + void OnFoundPluginProcessHost(PluginProcessHost* host) override { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); set_on_found_plugin_process_host_called(); set_host(host); } - virtual void OnSentPluginChannelRequest() override { + void OnSentPluginChannelRequest() override { on_sent_plugin_channel_request_called_ = true; host()->CancelSentRequest(this); BrowserThread::PostTask( diff --git a/content/browser/power_monitor_message_broadcaster.h b/content/browser/power_monitor_message_broadcaster.h index 926193d..3221fad 100644 --- a/content/browser/power_monitor_message_broadcaster.h +++ b/content/browser/power_monitor_message_broadcaster.h @@ -21,12 +21,12 @@ class CONTENT_EXPORT PowerMonitorMessageBroadcaster : public base::PowerObserver { public: explicit PowerMonitorMessageBroadcaster(IPC::Sender* sender); - virtual ~PowerMonitorMessageBroadcaster(); + ~PowerMonitorMessageBroadcaster() override; // Implement PowerObserver. - virtual void OnPowerStateChange(bool on_battery_power) override; - virtual void OnSuspend() override; - virtual void OnResume() override; + void OnPowerStateChange(bool on_battery_power) override; + void OnSuspend() override; + void OnResume() override; void Init(); diff --git a/content/browser/power_monitor_message_broadcaster_unittest.cc b/content/browser/power_monitor_message_broadcaster_unittest.cc index 4a28d95..0f42fb4 100644 --- a/content/browser/power_monitor_message_broadcaster_unittest.cc +++ b/content/browser/power_monitor_message_broadcaster_unittest.cc @@ -17,9 +17,9 @@ class PowerMonitorMessageSender : public IPC::Sender { suspends_(0), resumes_(0) { } - virtual ~PowerMonitorMessageSender() {} + ~PowerMonitorMessageSender() override {} - virtual bool Send(IPC::Message* msg) override { + bool Send(IPC::Message* msg) override { switch (msg->type()) { case PowerMonitorMsg_Suspend::ID: suspends_++; diff --git a/content/browser/power_profiler/power_profiler_service_unittest.cc b/content/browser/power_profiler/power_profiler_service_unittest.cc index ad3961c..06a8b89 100644 --- a/content/browser/power_profiler/power_profiler_service_unittest.cc +++ b/content/browser/power_profiler/power_profiler_service_unittest.cc @@ -19,9 +19,9 @@ const int kDefaultSamplePeriodMs = 50; class TestPowerDataProvider : public PowerDataProvider { public: TestPowerDataProvider(int count) : num_events_to_send_(count) {} - virtual ~TestPowerDataProvider() {} + ~TestPowerDataProvider() override {} - virtual PowerEventVector GetData() override { + PowerEventVector GetData() override { PowerEventVector events; if (num_events_to_send_ == 0) return events; @@ -36,11 +36,11 @@ class TestPowerDataProvider : public PowerDataProvider { return events; } - virtual base::TimeDelta GetSamplingRate() override { + base::TimeDelta GetSamplingRate() override { return base::TimeDelta::FromMilliseconds(kDefaultSamplePeriodMs); } - virtual AccuracyLevel GetAccuracyLevel() override { return High; } + AccuracyLevel GetAccuracyLevel() override { return High; } private: int num_events_to_send_; @@ -52,9 +52,9 @@ class TestPowerProfilerObserver : public PowerProfilerObserver { TestPowerProfilerObserver() : valid_event_count_(0), total_num_events_received_(0) {} - virtual ~TestPowerProfilerObserver() {} + ~TestPowerProfilerObserver() override {} - virtual void OnPowerEvent(const PowerEventVector& events) override { + void OnPowerEvent(const PowerEventVector& events) override { if (IsValidEvent(events[0])) ++valid_event_count_; diff --git a/content/browser/power_save_blocker_impl.h b/content/browser/power_save_blocker_impl.h index 948aced..39ba8f2 100644 --- a/content/browser/power_save_blocker_impl.h +++ b/content/browser/power_save_blocker_impl.h @@ -14,7 +14,7 @@ namespace content { class PowerSaveBlockerImpl : public PowerSaveBlocker { public: PowerSaveBlockerImpl(PowerSaveBlockerType type, const std::string& reason); - virtual ~PowerSaveBlockerImpl(); + ~PowerSaveBlockerImpl() override; #if defined(OS_ANDROID) // In Android platform, the kPowerSaveBlockPreventDisplaySleep type of diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc index 34c3a7d..22b69ba 100644 --- a/content/browser/ppapi_plugin_process_host.cc +++ b/content/browser/ppapi_plugin_process_host.cc @@ -48,7 +48,7 @@ class PpapiPluginSandboxedProcessLauncherDelegate #endif // OS_POSIX is_broker_(is_broker) {} - virtual ~PpapiPluginSandboxedProcessLauncherDelegate() {} + ~PpapiPluginSandboxedProcessLauncherDelegate() override {} #if defined(OS_WIN) virtual bool ShouldSandbox() override { @@ -69,16 +69,14 @@ class PpapiPluginSandboxedProcessLauncherDelegate } #elif defined(OS_POSIX) - virtual bool ShouldUseZygote() override { + bool ShouldUseZygote() override { const base::CommandLine& browser_command_line = *base::CommandLine::ForCurrentProcess(); base::CommandLine::StringType plugin_launcher = browser_command_line .GetSwitchValueNative(switches::kPpapiPluginLauncher); return !is_broker_ && plugin_launcher.empty() && info_.is_sandboxed; } - virtual base::ScopedFD TakeIpcFd() override { - return ipc_fd_.Pass(); - } + base::ScopedFD TakeIpcFd() override { return ipc_fd_.Pass(); } #endif // OS_WIN private: @@ -101,13 +99,13 @@ class PpapiPluginProcessHost::PluginNetworkObserver net::NetworkChangeNotifier::AddConnectionTypeObserver(this); } - virtual ~PluginNetworkObserver() { + ~PluginNetworkObserver() override { net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); net::NetworkChangeNotifier::RemoveIPAddressObserver(this); } // IPAddressObserver implementation. - virtual void OnIPAddressChanged() override { + void OnIPAddressChanged() override { // TODO(brettw) bug 90246: This doesn't seem correct. The online/offline // notification seems like it should be sufficient, but I don't see that // when I unplug and replug my network cable. Sending this notification when @@ -118,7 +116,7 @@ class PpapiPluginProcessHost::PluginNetworkObserver } // ConnectionTypeObserver implementation. - virtual void OnConnectionTypeChanged( + void OnConnectionTypeChanged( net::NetworkChangeNotifier::ConnectionType type) override { process_host_->Send(new PpapiMsg_SetNetworkState( type != net::NetworkChangeNotifier::CONNECTION_NONE)); diff --git a/content/browser/ppapi_plugin_process_host.h b/content/browser/ppapi_plugin_process_host.h index ff58c30..3f90d30 100644 --- a/content/browser/ppapi_plugin_process_host.h +++ b/content/browser/ppapi_plugin_process_host.h @@ -60,15 +60,15 @@ class PpapiPluginProcessHost : public BrowserChildProcessHostDelegate, virtual ResourceContext* GetResourceContext() = 0; protected: - virtual ~PluginClient() {} + ~PluginClient() override {} }; class BrokerClient : public Client { protected: - virtual ~BrokerClient() {} + ~BrokerClient() override {} }; - virtual ~PpapiPluginProcessHost(); + ~PpapiPluginProcessHost() override; static PpapiPluginProcessHost* CreatePluginHost( const PepperPluginInfo& info, @@ -96,7 +96,7 @@ class PpapiPluginProcessHost : public BrowserChildProcessHostDelegate, std::vector<PpapiPluginProcessHost*>* hosts); // IPC::Sender implementation: - virtual bool Send(IPC::Message* message) override; + bool Send(IPC::Message* message) override; // Opens a new channel to the plugin. The client will be notified when the // channel is ready or if there's an error. @@ -126,12 +126,12 @@ class PpapiPluginProcessHost : public BrowserChildProcessHostDelegate, void RequestPluginChannel(Client* client); - virtual void OnProcessLaunched() override; + void OnProcessLaunched() override; - virtual void OnProcessCrashed(int exit_code) override; - virtual bool OnMessageReceived(const IPC::Message& msg) override; - virtual void OnChannelConnected(int32 peer_pid) override; - virtual void OnChannelError() override; + void OnProcessCrashed(int exit_code) override; + bool OnMessageReceived(const IPC::Message& msg) override; + void OnChannelConnected(int32 peer_pid) override; + void OnChannelError() override; void CancelRequests(); diff --git a/content/browser/profiler_controller_impl.h b/content/browser/profiler_controller_impl.h index b90e1f8..44e160c 100644 --- a/content/browser/profiler_controller_impl.h +++ b/content/browser/profiler_controller_impl.h @@ -25,7 +25,7 @@ class ProfilerControllerImpl : public ProfilerController { // Normally instantiated when the child process is launched. Only one instance // should be created per process. ProfilerControllerImpl(); - virtual ~ProfilerControllerImpl(); + ~ProfilerControllerImpl() override; // Notify the |subscriber_| that it should expect at least |pending_processes| // additional calls to OnProfilerDataCollected(). OnPendingProcess() may be @@ -42,9 +42,9 @@ class ProfilerControllerImpl : public ProfilerController { int process_type); // ProfilerController implementation: - virtual void Register(ProfilerSubscriber* subscriber) override; - virtual void Unregister(const ProfilerSubscriber* subscriber) override; - virtual void GetProfilerData(int sequence_number) override; + void Register(ProfilerSubscriber* subscriber) override; + void Unregister(const ProfilerSubscriber* subscriber) override; + void GetProfilerData(int sequence_number) override; private: friend struct DefaultSingletonTraits<ProfilerControllerImpl>; diff --git a/content/browser/profiler_message_filter.h b/content/browser/profiler_message_filter.h index 2d068cf..df4ce53 100644 --- a/content/browser/profiler_message_filter.h +++ b/content/browser/profiler_message_filter.h @@ -21,13 +21,13 @@ class ProfilerMessageFilter : public BrowserMessageFilter { explicit ProfilerMessageFilter(int process_type); // BrowserMessageFilter implementation. - virtual void OnChannelConnected(int32 peer_pid) override; + void OnChannelConnected(int32 peer_pid) override; // BrowserMessageFilter implementation. - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; protected: - virtual ~ProfilerMessageFilter(); + ~ProfilerMessageFilter() override; private: // Message handlers. diff --git a/content/browser/push_messaging_message_filter.h b/content/browser/push_messaging_message_filter.h index db9359e..cab1b5c 100644 --- a/content/browser/push_messaging_message_filter.h +++ b/content/browser/push_messaging_message_filter.h @@ -25,10 +25,10 @@ class PushMessagingMessageFilter : public BrowserMessageFilter { ServiceWorkerContextWrapper* service_worker_context); private: - virtual ~PushMessagingMessageFilter(); + ~PushMessagingMessageFilter() override; // BrowserMessageFilter implementation. - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; void OnRegister(int render_frame_id, int callbacks_id, diff --git a/content/browser/quota/mock_quota_manager.h b/content/browser/quota/mock_quota_manager.h index fd7a1c9..a6bba10 100644 --- a/content/browser/quota/mock_quota_manager.h +++ b/content/browser/quota/mock_quota_manager.h @@ -51,18 +51,16 @@ class MockQuotaManager : public QuotaManager { // updated when MockQuotaManagerProxy::NotifyStorageModified() is // called. The internal quota value can be updated by calling // a helper method MockQuotaManagerProxy::SetQuota(). - virtual void GetUsageAndQuota( - const GURL& origin, - storage::StorageType type, - const GetUsageAndQuotaCallback& callback) override; + void GetUsageAndQuota(const GURL& origin, + storage::StorageType type, + const GetUsageAndQuotaCallback& callback) override; // Overrides QuotaManager's implementation with a canned implementation that // allows clients to set up the origin database that should be queried. This // method will only search through the origins added explicitly via AddOrigin. - virtual void GetOriginsModifiedSince( - StorageType type, - base::Time modified_since, - const GetOriginsCallback& callback) override; + void GetOriginsModifiedSince(StorageType type, + base::Time modified_since, + const GetOriginsCallback& callback) override; // Removes an origin from the canned list of origins, but doesn't touch // anything on disk. The caller must provide |quota_client_mask| which @@ -70,10 +68,10 @@ class MockQuotaManager : public QuotaManager { // origin as a bitmask built from QuotaClient::IDs. Setting the mask to // QuotaClient::kAllClientsMask will remove all clients from the origin, // regardless of type. - virtual void DeleteOriginData(const GURL& origin, - StorageType type, - int quota_client_mask, - const StatusCallback& callback) override; + void DeleteOriginData(const GURL& origin, + StorageType type, + int quota_client_mask, + const StatusCallback& callback) override; // Helper method for updating internal quota info. void SetQuota(const GURL& origin, StorageType type, int64 quota); @@ -97,7 +95,7 @@ class MockQuotaManager : public QuotaManager { QuotaClient::ID quota_client) const; protected: - virtual ~MockQuotaManager(); + ~MockQuotaManager() override; private: friend class MockQuotaManagerProxy; diff --git a/content/browser/quota/mock_quota_manager_proxy.h b/content/browser/quota/mock_quota_manager_proxy.h index 23accc8..0f52f6d 100644 --- a/content/browser/quota/mock_quota_manager_proxy.h +++ b/content/browser/quota/mock_quota_manager_proxy.h @@ -23,18 +23,18 @@ class MockQuotaManagerProxy : public QuotaManagerProxy { MockQuotaManagerProxy(MockQuotaManager* quota_manager, base::SingleThreadTaskRunner* task_runner); - virtual void RegisterClient(QuotaClient* client) override; + void RegisterClient(QuotaClient* client) override; void SimulateQuotaManagerDestroyed(); // We don't mock them. - virtual void NotifyOriginInUse(const GURL& origin) override {} - virtual void NotifyOriginNoLongerInUse(const GURL& origin) override {} - virtual void SetUsageCacheEnabled(QuotaClient::ID client_id, - const GURL& origin, - StorageType type, - bool enabled) override {} - virtual void GetUsageAndQuota( + void NotifyOriginInUse(const GURL& origin) override {} + void NotifyOriginNoLongerInUse(const GURL& origin) override {} + void SetUsageCacheEnabled(QuotaClient::ID client_id, + const GURL& origin, + StorageType type, + bool enabled) override {} + void GetUsageAndQuota( base::SequencedTaskRunner* original_task_runner, const GURL& origin, StorageType type, @@ -44,18 +44,18 @@ class MockQuotaManagerProxy : public QuotaManagerProxy { // which can be accessed via notify_storage_accessed_count(). // The also records the |origin| and |type| in last_notified_origin_ and // last_notified_type_. - virtual void NotifyStorageAccessed(QuotaClient::ID client_id, - const GURL& origin, - StorageType type) override; + void NotifyStorageAccessed(QuotaClient::ID client_id, + const GURL& origin, + StorageType type) override; // Records the |origin|, |type| and |delta| as last_notified_origin_, // last_notified_type_ and last_notified_delta_ respecitvely. // If non-null MockQuotaManager is given to the constructor this also // updates the manager's internal usage information. - virtual void NotifyStorageModified(QuotaClient::ID client_id, - const GURL& origin, - StorageType type, - int64 delta) override; + void NotifyStorageModified(QuotaClient::ID client_id, + const GURL& origin, + StorageType type, + int64 delta) override; int notify_storage_accessed_count() const { return storage_accessed_count_; } int notify_storage_modified_count() const { return storage_modified_count_; } @@ -64,7 +64,7 @@ class MockQuotaManagerProxy : public QuotaManagerProxy { int64 last_notified_delta() const { return last_notified_delta_; } protected: - virtual ~MockQuotaManagerProxy(); + ~MockQuotaManagerProxy() override; private: MockQuotaManager* mock_manager() const { diff --git a/content/browser/quota/quota_backend_impl_unittest.cc b/content/browser/quota/quota_backend_impl_unittest.cc index 8a13ed6..4ea1ae7 100644 --- a/content/browser/quota/quota_backend_impl_unittest.cc +++ b/content/browser/quota/quota_backend_impl_unittest.cc @@ -46,27 +46,26 @@ class MockQuotaManagerProxy : public storage::QuotaManagerProxy { usage_(0), quota_(0) {} // We don't mock them. - virtual void NotifyOriginInUse(const GURL& origin) override {} - virtual void NotifyOriginNoLongerInUse(const GURL& origin) override {} - virtual void SetUsageCacheEnabled(storage::QuotaClient::ID client_id, - const GURL& origin, - storage::StorageType type, - bool enabled) override {} - - virtual void NotifyStorageModified(storage::QuotaClient::ID client_id, - const GURL& origin, - storage::StorageType type, - int64 delta) override { + void NotifyOriginInUse(const GURL& origin) override {} + void NotifyOriginNoLongerInUse(const GURL& origin) override {} + void SetUsageCacheEnabled(storage::QuotaClient::ID client_id, + const GURL& origin, + storage::StorageType type, + bool enabled) override {} + + void NotifyStorageModified(storage::QuotaClient::ID client_id, + const GURL& origin, + storage::StorageType type, + int64 delta) override { ++storage_modified_count_; usage_ += delta; ASSERT_LE(usage_, quota_); } - virtual void GetUsageAndQuota( - base::SequencedTaskRunner* original_task_runner, - const GURL& origin, - storage::StorageType type, - const GetUsageAndQuotaCallback& callback) override { + void GetUsageAndQuota(base::SequencedTaskRunner* original_task_runner, + const GURL& origin, + storage::StorageType type, + const GetUsageAndQuotaCallback& callback) override { callback.Run(storage::kQuotaStatusOk, usage_, quota_); } @@ -76,7 +75,7 @@ class MockQuotaManagerProxy : public storage::QuotaManagerProxy { void set_quota(int64 quota) { quota_ = quota; } protected: - virtual ~MockQuotaManagerProxy() {} + ~MockQuotaManagerProxy() override {} private: int storage_modified_count_; diff --git a/content/browser/quota/quota_reservation_manager_unittest.cc b/content/browser/quota/quota_reservation_manager_unittest.cc index eff98b4..66c42df 100644 --- a/content/browser/quota/quota_reservation_manager_unittest.cc +++ b/content/browser/quota/quota_reservation_manager_unittest.cc @@ -47,12 +47,12 @@ class FakeBackend : public QuotaReservationManager::QuotaBackend { FakeBackend() : on_memory_usage_(kInitialFileSize), on_disk_usage_(kInitialFileSize) {} - virtual ~FakeBackend() {} + ~FakeBackend() override {} - virtual void ReserveQuota(const GURL& origin, - storage::FileSystemType type, - int64 delta, - const ReserveQuotaCallback& callback) override { + void ReserveQuota(const GURL& origin, + storage::FileSystemType type, + int64 delta, + const ReserveQuotaCallback& callback) override { EXPECT_EQ(GURL(kOrigin), origin); EXPECT_EQ(kType, type); on_memory_usage_ += delta; @@ -61,28 +61,28 @@ class FakeBackend : public QuotaReservationManager::QuotaBackend { base::Bind(base::IgnoreResult(callback), base::File::FILE_OK, delta)); } - virtual void ReleaseReservedQuota(const GURL& origin, - storage::FileSystemType type, - int64 size) override { + void ReleaseReservedQuota(const GURL& origin, + storage::FileSystemType type, + int64 size) override { EXPECT_LE(0, size); EXPECT_EQ(GURL(kOrigin), origin); EXPECT_EQ(kType, type); on_memory_usage_ -= size; } - virtual void CommitQuotaUsage(const GURL& origin, - storage::FileSystemType type, - int64 delta) override { + void CommitQuotaUsage(const GURL& origin, + storage::FileSystemType type, + int64 delta) override { EXPECT_EQ(GURL(kOrigin), origin); EXPECT_EQ(kType, type); on_disk_usage_ += delta; on_memory_usage_ += delta; } - virtual void IncrementDirtyCount(const GURL& origin, - storage::FileSystemType type) override {} - virtual void DecrementDirtyCount(const GURL& origin, - storage::FileSystemType type) override {} + void IncrementDirtyCount(const GURL& origin, + storage::FileSystemType type) override {} + void DecrementDirtyCount(const GURL& origin, + storage::FileSystemType type) override {} int64 on_memory_usage() { return on_memory_usage_; } int64 on_disk_usage() { return on_disk_usage_; } diff --git a/content/browser/quota/quota_temporary_storage_evictor_unittest.cc b/content/browser/quota/quota_temporary_storage_evictor_unittest.cc index 25e212b..5954758 100644 --- a/content/browser/quota/quota_temporary_storage_evictor_unittest.cc +++ b/content/browser/quota/quota_temporary_storage_evictor_unittest.cc @@ -35,10 +35,9 @@ class MockQuotaEvictionHandler : public storage::QuotaEvictionHandler { error_on_evict_origin_data_(false), error_on_get_usage_and_quota_(false) {} - virtual void EvictOriginData( - const GURL& origin, - StorageType type, - const EvictOriginDataCallback& callback) override { + void EvictOriginData(const GURL& origin, + StorageType type, + const EvictOriginDataCallback& callback) override { if (error_on_evict_origin_data_) { callback.Run(storage::kQuotaErrorInvalidModification); return; @@ -49,7 +48,7 @@ class MockQuotaEvictionHandler : public storage::QuotaEvictionHandler { callback.Run(storage::kQuotaStatusOk); } - virtual void GetUsageAndQuotaForEviction( + void GetUsageAndQuotaForEviction( const UsageAndQuotaCallback& callback) override { if (error_on_get_usage_and_quota_) { callback.Run(storage::kQuotaErrorInvalidAccess, UsageAndQuota()); @@ -61,9 +60,8 @@ class MockQuotaEvictionHandler : public storage::QuotaEvictionHandler { callback.Run(storage::kQuotaStatusOk, quota_and_usage); } - virtual void GetLRUOrigin( - StorageType type, - const GetLRUOriginCallback& callback) override { + void GetLRUOrigin(StorageType type, + const GetLRUOriginCallback& callback) override { if (origin_order_.empty()) callback.Run(GURL()); else diff --git a/content/browser/quota/storage_monitor_unittest.cc b/content/browser/quota/storage_monitor_unittest.cc index 3ddc19b..10d1a87 100644 --- a/content/browser/quota/storage_monitor_unittest.cc +++ b/content/browser/quota/storage_monitor_unittest.cc @@ -51,7 +51,7 @@ class MockObserver : public StorageObserver { } // StorageObserver implementation: - virtual void OnStorageEvent(const StorageObserver::Event& event) override { + void OnStorageEvent(const StorageObserver::Event& event) override { events_.push_back(event); } @@ -86,7 +86,7 @@ class UsageMockQuotaManager : public QuotaManager { delayed_callback_.Run(callback_status_, callback_usage_, callback_quota_); } - virtual void GetUsageAndQuotaForWebApps( + void GetUsageAndQuotaForWebApps( const GURL& origin, StorageType type, const GetUsageAndQuotaCallback& callback) override { @@ -97,7 +97,7 @@ class UsageMockQuotaManager : public QuotaManager { } protected: - virtual ~UsageMockQuotaManager() {} + ~UsageMockQuotaManager() override {} private: int64 callback_usage_; diff --git a/content/browser/quota/usage_tracker_unittest.cc b/content/browser/quota/usage_tracker_unittest.cc index feb7a30..1e9a545 100644 --- a/content/browser/quota/usage_tracker_unittest.cc +++ b/content/browser/quota/usage_tracker_unittest.cc @@ -45,25 +45,23 @@ void DidGetUsage(bool* done, class MockQuotaClient : public QuotaClient { public: MockQuotaClient() {} - virtual ~MockQuotaClient() {} + ~MockQuotaClient() override {} - virtual ID id() const override { - return kFileSystem; - } + ID id() const override { return kFileSystem; } - virtual void OnQuotaManagerDestroyed() override {} + void OnQuotaManagerDestroyed() override {} - virtual void GetOriginUsage(const GURL& origin, - StorageType type, - const GetUsageCallback& callback) override { + void GetOriginUsage(const GURL& origin, + StorageType type, + const GetUsageCallback& callback) override { EXPECT_EQ(kStorageTypeTemporary, type); int64 usage = GetUsage(origin); base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(callback, usage)); } - virtual void GetOriginsForType(StorageType type, - const GetOriginsCallback& callback) override { + void GetOriginsForType(StorageType type, + const GetOriginsCallback& callback) override { EXPECT_EQ(kStorageTypeTemporary, type); std::set<GURL> origins; for (UsageMap::const_iterator itr = usage_map_.begin(); @@ -74,9 +72,9 @@ class MockQuotaClient : public QuotaClient { base::Bind(callback, origins)); } - virtual void GetOriginsForHost(StorageType type, - const std::string& host, - const GetOriginsCallback& callback) override { + void GetOriginsForHost(StorageType type, + const std::string& host, + const GetOriginsCallback& callback) override { EXPECT_EQ(kStorageTypeTemporary, type); std::set<GURL> origins; for (UsageMap::const_iterator itr = usage_map_.begin(); @@ -88,16 +86,16 @@ class MockQuotaClient : public QuotaClient { base::Bind(callback, origins)); } - virtual void DeleteOriginData(const GURL& origin, - StorageType type, - const DeletionCallback& callback) override { + void DeleteOriginData(const GURL& origin, + StorageType type, + const DeletionCallback& callback) override { EXPECT_EQ(kStorageTypeTemporary, type); usage_map_.erase(origin); base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, kQuotaStatusOk)); } - virtual bool DoesSupport(storage::StorageType type) const override { + bool DoesSupport(storage::StorageType type) const override { return type == storage::kStorageTypeTemporary; } diff --git a/content/browser/quota_dispatcher_host.cc b/content/browser/quota_dispatcher_host.cc index ce78362..2ea8a5e 100644 --- a/content/browser/quota_dispatcher_host.cc +++ b/content/browser/quota_dispatcher_host.cc @@ -68,7 +68,7 @@ class QuotaDispatcherHost::QueryUsageAndQuotaDispatcher int request_id) : RequestDispatcher(dispatcher_host, request_id), weak_factory_(this) {} - virtual ~QueryUsageAndQuotaDispatcher() {} + ~QueryUsageAndQuotaDispatcher() override {} void QueryStorageUsageAndQuota(const GURL& origin, StorageType type) { quota_manager()->GetUsageAndQuotaForWebApps( @@ -112,7 +112,7 @@ class QuotaDispatcherHost::RequestQuotaDispatcher // TODO(nhiroki): The backend should accept uint64 values. requested_quota_ = base::saturated_cast<int64>(params_.requested_size); } - virtual ~RequestQuotaDispatcher() {} + ~RequestQuotaDispatcher() override {} void Start() { DCHECK(dispatcher_host()); diff --git a/content/browser/quota_dispatcher_host.h b/content/browser/quota_dispatcher_host.h index 79ea104..8a30f22 100644 --- a/content/browser/quota_dispatcher_host.h +++ b/content/browser/quota_dispatcher_host.h @@ -31,10 +31,10 @@ class QuotaDispatcherHost : public BrowserMessageFilter { QuotaPermissionContext* permission_context); // BrowserMessageFilter: - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; protected: - virtual ~QuotaDispatcherHost(); + ~QuotaDispatcherHost() override; private: class RequestDispatcher; diff --git a/content/browser/renderer_host/clipboard_message_filter.h b/content/browser/renderer_host/clipboard_message_filter.h index 98a2ca3..792bfc5 100644 --- a/content/browser/renderer_host/clipboard_message_filter.h +++ b/content/browser/renderer_host/clipboard_message_filter.h @@ -21,12 +21,12 @@ class ClipboardMessageFilter : public BrowserMessageFilter { public: ClipboardMessageFilter(); - virtual void OverrideThreadForMessage( - const IPC::Message& message, - BrowserThread::ID* thread) override; - virtual bool OnMessageReceived(const IPC::Message& message) override; + void OverrideThreadForMessage(const IPC::Message& message, + BrowserThread::ID* thread) override; + bool OnMessageReceived(const IPC::Message& message) override; + private: - virtual ~ClipboardMessageFilter(); + ~ClipboardMessageFilter() override; void OnWriteObjectsAsync(const ui::Clipboard::ObjectMap& objects); void OnWriteObjectsSync(const ui::Clipboard::ObjectMap& objects, diff --git a/content/browser/renderer_host/database_message_filter.h b/content/browser/renderer_host/database_message_filter.h index b61816c..dcac74a 100644 --- a/content/browser/renderer_host/database_message_filter.h +++ b/content/browser/renderer_host/database_message_filter.h @@ -20,18 +20,17 @@ class DatabaseMessageFilter : public BrowserMessageFilter, explicit DatabaseMessageFilter(storage::DatabaseTracker* db_tracker); // BrowserMessageFilter implementation. - virtual void OnChannelClosing() override; - virtual void OverrideThreadForMessage( - const IPC::Message& message, - BrowserThread::ID* thread) override; - virtual bool OnMessageReceived(const IPC::Message& message) override; + void OnChannelClosing() override; + void OverrideThreadForMessage(const IPC::Message& message, + BrowserThread::ID* thread) override; + bool OnMessageReceived(const IPC::Message& message) override; storage::DatabaseTracker* database_tracker() const { return db_tracker_.get(); } private: - virtual ~DatabaseMessageFilter(); + ~DatabaseMessageFilter() override; class PromptDelegate; @@ -72,10 +71,10 @@ class DatabaseMessageFilter : public BrowserMessageFilter, int error); // DatabaseTracker::Observer callbacks (file thread) - virtual void OnDatabaseSizeChanged(const std::string& origin_identifier, - const base::string16& database_name, - int64 database_size) override; - virtual void OnDatabaseScheduledForDeletion( + void OnDatabaseSizeChanged(const std::string& origin_identifier, + const base::string16& database_name, + int64 database_size) override; + void OnDatabaseScheduledForDeletion( const std::string& origin_identifier, const base::string16& database_name) override; diff --git a/content/browser/renderer_host/delegated_frame_evictor.h b/content/browser/renderer_host/delegated_frame_evictor.h index 7855b31..796b6c2 100644 --- a/content/browser/renderer_host/delegated_frame_evictor.h +++ b/content/browser/renderer_host/delegated_frame_evictor.h @@ -20,7 +20,7 @@ class CONTENT_EXPORT DelegatedFrameEvictor : public RendererFrameManagerClient { public: // |client| must outlive |this|. explicit DelegatedFrameEvictor(DelegatedFrameEvictorClient* client); - virtual ~DelegatedFrameEvictor(); + ~DelegatedFrameEvictor() override; void SwappedFrame(bool visible); void DiscardedFrame(); @@ -31,7 +31,7 @@ class CONTENT_EXPORT DelegatedFrameEvictor : public RendererFrameManagerClient { private: // RendererFrameManagerClient implementation. - virtual void EvictCurrentFrame() override; + void EvictCurrentFrame() override; DelegatedFrameEvictorClient* client_; bool has_frame_; diff --git a/content/browser/renderer_host/file_utilities_message_filter.h b/content/browser/renderer_host/file_utilities_message_filter.h index 515b4c4..54a5830 100644 --- a/content/browser/renderer_host/file_utilities_message_filter.h +++ b/content/browser/renderer_host/file_utilities_message_filter.h @@ -21,12 +21,12 @@ class FileUtilitiesMessageFilter : public BrowserMessageFilter { explicit FileUtilitiesMessageFilter(int process_id); // BrowserMessageFilter implementation. - virtual void OverrideThreadForMessage( - const IPC::Message& message, - BrowserThread::ID* thread) override; - virtual bool OnMessageReceived(const IPC::Message& message) override; + void OverrideThreadForMessage(const IPC::Message& message, + BrowserThread::ID* thread) override; + bool OnMessageReceived(const IPC::Message& message) override; + private: - virtual ~FileUtilitiesMessageFilter(); + ~FileUtilitiesMessageFilter() override; typedef void (*FileInfoWriteFunc)(IPC::Message* reply_msg, const base::File::Info& file_info); diff --git a/content/browser/renderer_host/gamepad_browser_message_filter.h b/content/browser/renderer_host/gamepad_browser_message_filter.h index 316676c..e5dc8ae 100644 --- a/content/browser/renderer_host/gamepad_browser_message_filter.h +++ b/content/browser/renderer_host/gamepad_browser_message_filter.h @@ -22,18 +22,16 @@ class GamepadBrowserMessageFilter : GamepadBrowserMessageFilter(); // BrowserMessageFilter implementation. - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; // GamepadConsumer implementation. - virtual void OnGamepadConnected( - unsigned index, - const blink::WebGamepad& gamepad) override; - virtual void OnGamepadDisconnected( - unsigned index, - const blink::WebGamepad& gamepad) override; + void OnGamepadConnected(unsigned index, + const blink::WebGamepad& gamepad) override; + void OnGamepadDisconnected(unsigned index, + const blink::WebGamepad& gamepad) override; private: - virtual ~GamepadBrowserMessageFilter(); + ~GamepadBrowserMessageFilter() override; void OnGamepadStartPolling(base::SharedMemoryHandle* renderer_handle); void OnGamepadStopPolling(); diff --git a/content/browser/renderer_host/gpu_message_filter.h b/content/browser/renderer_host/gpu_message_filter.h index d2f0ace..57dfe9b 100644 --- a/content/browser/renderer_host/gpu_message_filter.h +++ b/content/browser/renderer_host/gpu_message_filter.h @@ -37,7 +37,7 @@ class GpuMessageFilter : public BrowserMessageFilter { RenderWidgetHelper* render_widget_helper); // BrowserMessageFilter methods: - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; // This set of API is used to subscribe to frame presentation events. // See RenderWidgetHostViewFrameSubscriber for more details. @@ -52,7 +52,7 @@ class GpuMessageFilter : public BrowserMessageFilter { struct CreateViewCommandBufferRequest; struct FrameSubscription; - virtual ~GpuMessageFilter(); + ~GpuMessageFilter() override; // Message handlers called on the browser IO thread: void OnEstablishGpuChannel(CauseForGpuLaunch, diff --git a/content/browser/renderer_host/input/gesture_event_queue_unittest.cc b/content/browser/renderer_host/input/gesture_event_queue_unittest.cc index 3fbae1e..ea5a19c 100644 --- a/content/browser/renderer_host/input/gesture_event_queue_unittest.cc +++ b/content/browser/renderer_host/input/gesture_event_queue_unittest.cc @@ -45,7 +45,7 @@ class GestureEventQueueTest : public testing::Test, } // GestureEventQueueClient - virtual void SendGestureEventImmediately( + void SendGestureEventImmediately( const GestureEventWithLatencyInfo& event) override { ++sent_gesture_event_count_; if (sync_ack_result_) { @@ -54,9 +54,8 @@ class GestureEventQueueTest : public testing::Test, } } - virtual void OnGestureEventAck( - const GestureEventWithLatencyInfo& event, - InputEventAckState ack_result) override { + void OnGestureEventAck(const GestureEventWithLatencyInfo& event, + InputEventAckState ack_result) override { ++acked_gesture_event_count_; last_acked_event_ = event.event; if (sync_followup_event_) { @@ -66,9 +65,8 @@ class GestureEventQueueTest : public testing::Test, } // TouchpadTapSuppressionControllerClient - virtual void SendMouseEventImmediately( - const MouseEventWithLatencyInfo& event) override { - } + void SendMouseEventImmediately( + const MouseEventWithLatencyInfo& event) override {} protected: static GestureEventQueue::Config DefaultConfig() { diff --git a/content/browser/renderer_host/input/gesture_text_selector.h b/content/browser/renderer_host/input/gesture_text_selector.h index 5e339a6..e494045 100644 --- a/content/browser/renderer_host/input/gesture_text_selector.h +++ b/content/browser/renderer_host/input/gesture_text_selector.h @@ -37,7 +37,7 @@ class CONTENT_EXPORT GestureTextSelectorClient { class CONTENT_EXPORT GestureTextSelector : public ui::SimpleGestureListener { public: explicit GestureTextSelector(GestureTextSelectorClient* client); - virtual ~GestureTextSelector(); + ~GestureTextSelector() override; // This should be called before |event| is seen by the platform gesture // detector or forwarded to web content. @@ -49,11 +49,11 @@ class CONTENT_EXPORT GestureTextSelector : public ui::SimpleGestureListener { ShouldStartTextSelection); // SimpleGestureListener implementation. - virtual bool OnSingleTapUp(const ui::MotionEvent& e) override; - virtual bool OnScroll(const ui::MotionEvent& e1, - const ui::MotionEvent& e2, - float distance_x, - float distance_y) override; + bool OnSingleTapUp(const ui::MotionEvent& e) override; + bool OnScroll(const ui::MotionEvent& e1, + const ui::MotionEvent& e2, + float distance_x, + float distance_y) override; static bool ShouldStartTextSelection(const ui::MotionEvent& event); diff --git a/content/browser/renderer_host/input/gesture_text_selector_unittest.cc b/content/browser/renderer_host/input/gesture_text_selector_unittest.cc index ee8240e..3070586 100644 --- a/content/browser/renderer_host/input/gesture_text_selector_unittest.cc +++ b/content/browser/renderer_host/input/gesture_text_selector_unittest.cc @@ -37,17 +37,17 @@ class GestureTextSelectorTest : public testing::Test, } // GestureTextSelectorClient implementation. - virtual void ShowSelectionHandlesAutomatically() override { + void ShowSelectionHandlesAutomatically() override { event_log_.push_back("Show"); } - virtual void SelectRange(float x1, float y1, float x2, float y2) override { + void SelectRange(float x1, float y1, float x2, float y2) override { std::stringstream ss; ss << "SelectRange(" << x1 << ", " << y1 << ", " << x2 << ", " << y2 << ")"; event_log_.push_back(ss.str()); } - virtual void LongPress(base::TimeTicks time, float x, float y) override { + void LongPress(base::TimeTicks time, float x, float y) override { event_log_.push_back("LongPress"); } diff --git a/content/browser/renderer_host/input/input_router.h b/content/browser/renderer_host/input/input_router.h index 1b30815..96b68c3 100644 --- a/content/browser/renderer_host/input/input_router.h +++ b/content/browser/renderer_host/input/input_router.h @@ -22,7 +22,7 @@ class InputRouterClient; // received, it is free to customize when those events are dispatched. class InputRouter : public IPC::Listener { public: - virtual ~InputRouter() {} + ~InputRouter() override {} // Should be called only in response to |SetNeedsFlush| requests made via // the |InputRouterClient|. diff --git a/content/browser/renderer_host/input/input_router_impl.h b/content/browser/renderer_host/input/input_router_impl.h index 0f7b023..b08c1e3 100644 --- a/content/browser/renderer_host/input/input_router_impl.h +++ b/content/browser/renderer_host/input/input_router_impl.h @@ -53,49 +53,46 @@ class CONTENT_EXPORT InputRouterImpl InputAckHandler* ack_handler, int routing_id, const Config& config); - virtual ~InputRouterImpl(); + ~InputRouterImpl() override; // InputRouter - virtual void Flush() override; - virtual bool SendInput(scoped_ptr<IPC::Message> message) override; - virtual void SendMouseEvent( - const MouseEventWithLatencyInfo& mouse_event) override; - virtual void SendWheelEvent( + void Flush() override; + bool SendInput(scoped_ptr<IPC::Message> message) override; + void SendMouseEvent(const MouseEventWithLatencyInfo& mouse_event) override; + void SendWheelEvent( const MouseWheelEventWithLatencyInfo& wheel_event) override; - virtual void SendKeyboardEvent( - const NativeWebKeyboardEvent& key_event, - const ui::LatencyInfo& latency_info, - bool is_keyboard_shortcut) override; - virtual void SendGestureEvent( + void SendKeyboardEvent(const NativeWebKeyboardEvent& key_event, + const ui::LatencyInfo& latency_info, + bool is_keyboard_shortcut) override; + void SendGestureEvent( const GestureEventWithLatencyInfo& gesture_event) override; - virtual void SendTouchEvent( - const TouchEventWithLatencyInfo& touch_event) override; - virtual const NativeWebKeyboardEvent* GetLastKeyboardEvent() const override; - virtual bool ShouldForwardTouchEvent() const override; - virtual void OnViewUpdated(int view_flags) override; - virtual bool HasPendingEvents() const override; + void SendTouchEvent(const TouchEventWithLatencyInfo& touch_event) override; + const NativeWebKeyboardEvent* GetLastKeyboardEvent() const override; + bool ShouldForwardTouchEvent() const override; + void OnViewUpdated(int view_flags) override; + bool HasPendingEvents() const override; // IPC::Listener - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; private: friend class InputRouterImplTest; // TouchpadTapSuppressionControllerClient - virtual void SendMouseEventImmediately( + void SendMouseEventImmediately( const MouseEventWithLatencyInfo& mouse_event) override; // TouchEventQueueClient - virtual void SendTouchEventImmediately( + void SendTouchEventImmediately( const TouchEventWithLatencyInfo& touch_event) override; - virtual void OnTouchEventAck(const TouchEventWithLatencyInfo& event, - InputEventAckState ack_result) override; + void OnTouchEventAck(const TouchEventWithLatencyInfo& event, + InputEventAckState ack_result) override; // GetureEventFilterClient - virtual void SendGestureEventImmediately( + void SendGestureEventImmediately( const GestureEventWithLatencyInfo& gesture_event) override; - virtual void OnGestureEventAck(const GestureEventWithLatencyInfo& event, - InputEventAckState ack_result) override; + void OnGestureEventAck(const GestureEventWithLatencyInfo& event, + InputEventAckState ack_result) override; bool SendMoveCaret(scoped_ptr<IPC::Message> message); bool SendSelectRange(scoped_ptr<IPC::Message> message); diff --git a/content/browser/renderer_host/input/input_router_impl_perftest.cc b/content/browser/renderer_host/input/input_router_impl_perftest.cc index 0538392..28576b3 100644 --- a/content/browser/renderer_host/input/input_router_impl_perftest.cc +++ b/content/browser/renderer_host/input/input_router_impl_perftest.cc @@ -28,26 +28,26 @@ namespace { class NullInputAckHandler : public InputAckHandler { public: NullInputAckHandler() : ack_count_(0) {} - virtual ~NullInputAckHandler() {} + ~NullInputAckHandler() override {} // InputAckHandler - virtual void OnKeyboardEventAck(const NativeWebKeyboardEvent& event, - InputEventAckState ack_result) override { + void OnKeyboardEventAck(const NativeWebKeyboardEvent& event, + InputEventAckState ack_result) override { ++ack_count_; } - virtual void OnWheelEventAck(const MouseWheelEventWithLatencyInfo& event, - InputEventAckState ack_result) override { + void OnWheelEventAck(const MouseWheelEventWithLatencyInfo& event, + InputEventAckState ack_result) override { ++ack_count_; } - virtual void OnTouchEventAck(const TouchEventWithLatencyInfo& event, - InputEventAckState ack_result) override { + void OnTouchEventAck(const TouchEventWithLatencyInfo& event, + InputEventAckState ack_result) override { ++ack_count_; } - virtual void OnGestureEventAck(const GestureEventWithLatencyInfo& event, - InputEventAckState ack_result) override { + void OnGestureEventAck(const GestureEventWithLatencyInfo& event, + InputEventAckState ack_result) override { ++ack_count_; } - virtual void OnUnexpectedEventAck(UnexpectedEventAckType type) override { + void OnUnexpectedEventAck(UnexpectedEventAckType type) override { ++ack_count_; } @@ -66,28 +66,28 @@ class NullInputAckHandler : public InputAckHandler { class NullInputRouterClient : public InputRouterClient { public: NullInputRouterClient() {} - virtual ~NullInputRouterClient() {} + ~NullInputRouterClient() override {} // InputRouterClient - virtual InputEventAckState FilterInputEvent( + InputEventAckState FilterInputEvent( const blink::WebInputEvent& input_event, const ui::LatencyInfo& latency_info) override { return INPUT_EVENT_ACK_STATE_NOT_CONSUMED; } - virtual void IncrementInFlightEventCount() override {} - virtual void DecrementInFlightEventCount() override {} - virtual void OnHasTouchEventHandlers(bool has_handlers) override {} - virtual void DidFlush() override {} - virtual void SetNeedsFlush() override {} - virtual void DidOverscroll(const DidOverscrollParams& params) override {} + void IncrementInFlightEventCount() override {} + void DecrementInFlightEventCount() override {} + void OnHasTouchEventHandlers(bool has_handlers) override {} + void DidFlush() override {} + void SetNeedsFlush() override {} + void DidOverscroll(const DidOverscrollParams& params) override {} }; class NullIPCSender : public IPC::Sender { public: NullIPCSender() : sent_count_(0) {} - virtual ~NullIPCSender() {} + ~NullIPCSender() override {} - virtual bool Send(IPC::Message* message) override { + bool Send(IPC::Message* message) override { delete message; ++sent_count_; return true; diff --git a/content/browser/renderer_host/input/mock_input_ack_handler.h b/content/browser/renderer_host/input/mock_input_ack_handler.h index 126eaa9..93f7cca 100644 --- a/content/browser/renderer_host/input/mock_input_ack_handler.h +++ b/content/browser/renderer_host/input/mock_input_ack_handler.h @@ -15,18 +15,18 @@ class InputRouter; class MockInputAckHandler : public InputAckHandler { public: MockInputAckHandler(); - virtual ~MockInputAckHandler(); + ~MockInputAckHandler() override; // InputAckHandler - virtual void OnKeyboardEventAck(const NativeWebKeyboardEvent& event, - InputEventAckState ack_result) override; - virtual void OnWheelEventAck(const MouseWheelEventWithLatencyInfo& event, - InputEventAckState ack_result) override; - virtual void OnTouchEventAck(const TouchEventWithLatencyInfo& event, - InputEventAckState ack_result) override; - virtual void OnGestureEventAck(const GestureEventWithLatencyInfo& event, - InputEventAckState ack_result) override; - virtual void OnUnexpectedEventAck(UnexpectedEventAckType type) override; + void OnKeyboardEventAck(const NativeWebKeyboardEvent& event, + InputEventAckState ack_result) override; + void OnWheelEventAck(const MouseWheelEventWithLatencyInfo& event, + InputEventAckState ack_result) override; + void OnTouchEventAck(const TouchEventWithLatencyInfo& event, + InputEventAckState ack_result) override; + void OnGestureEventAck(const GestureEventWithLatencyInfo& event, + InputEventAckState ack_result) override; + void OnUnexpectedEventAck(UnexpectedEventAckType type) override; size_t GetAndResetAckCount(); diff --git a/content/browser/renderer_host/input/mock_input_router_client.h b/content/browser/renderer_host/input/mock_input_router_client.h index 3eb5a25..a552ac0 100644 --- a/content/browser/renderer_host/input/mock_input_router_client.h +++ b/content/browser/renderer_host/input/mock_input_router_client.h @@ -17,18 +17,18 @@ class InputRouter; class MockInputRouterClient : public InputRouterClient { public: MockInputRouterClient(); - virtual ~MockInputRouterClient(); + ~MockInputRouterClient() override; // InputRouterClient - virtual InputEventAckState FilterInputEvent( + InputEventAckState FilterInputEvent( const blink::WebInputEvent& input_event, const ui::LatencyInfo& latency_info) override; - virtual void IncrementInFlightEventCount() override; - virtual void DecrementInFlightEventCount() override; - virtual void OnHasTouchEventHandlers(bool has_handlers) override; - virtual void SetNeedsFlush() override; - virtual void DidFlush() override; - virtual void DidOverscroll(const DidOverscrollParams& params) override; + void IncrementInFlightEventCount() override; + void DecrementInFlightEventCount() override; + void OnHasTouchEventHandlers(bool has_handlers) override; + void SetNeedsFlush() override; + void DidFlush() override; + void DidOverscroll(const DidOverscrollParams& params) override; bool GetAndResetFilterEventCalled(); size_t GetAndResetDidFlushCount(); diff --git a/content/browser/renderer_host/input/motion_event_web.h b/content/browser/renderer_host/input/motion_event_web.h index 4bd0be8..8177a9f 100644 --- a/content/browser/renderer_host/input/motion_event_web.h +++ b/content/browser/renderer_host/input/motion_event_web.h @@ -14,28 +14,28 @@ namespace content { class MotionEventWeb : public ui::MotionEvent { public: explicit MotionEventWeb(const blink::WebTouchEvent& event); - virtual ~MotionEventWeb(); + ~MotionEventWeb() override; // ui::MotionEvent - virtual int GetId() const override; - virtual Action GetAction() const override; - virtual int GetActionIndex() const override; - virtual size_t GetPointerCount() const override; - virtual int GetPointerId(size_t pointer_index) const override; - virtual float GetX(size_t pointer_index) const override; - virtual float GetY(size_t pointer_index) const override; - virtual float GetRawX(size_t pointer_index) const override; - virtual float GetRawY(size_t pointer_index) const override; - virtual float GetTouchMajor(size_t pointer_index) const override; - virtual float GetTouchMinor(size_t pointer_index) const override; - virtual float GetOrientation(size_t pointer_index) const override; - virtual float GetPressure(size_t pointer_index) const override; - virtual base::TimeTicks GetEventTime() const override; - virtual ToolType GetToolType(size_t pointer_index) const override; - virtual int GetButtonState() const override; - virtual int GetFlags() const override; - virtual scoped_ptr<MotionEvent> Clone() const override; - virtual scoped_ptr<MotionEvent> Cancel() const override; + int GetId() const override; + Action GetAction() const override; + int GetActionIndex() const override; + size_t GetPointerCount() const override; + int GetPointerId(size_t pointer_index) const override; + float GetX(size_t pointer_index) const override; + float GetY(size_t pointer_index) const override; + float GetRawX(size_t pointer_index) const override; + float GetRawY(size_t pointer_index) const override; + float GetTouchMajor(size_t pointer_index) const override; + float GetTouchMinor(size_t pointer_index) const override; + float GetOrientation(size_t pointer_index) const override; + float GetPressure(size_t pointer_index) const override; + base::TimeTicks GetEventTime() const override; + ToolType GetToolType(size_t pointer_index) const override; + int GetButtonState() const override; + int GetFlags() const override; + scoped_ptr<MotionEvent> Clone() const override; + scoped_ptr<MotionEvent> Cancel() const override; private: blink::WebTouchEvent event_; diff --git a/content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc b/content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc index 69eaf9b..6be46f3 100644 --- a/content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc +++ b/content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc @@ -47,10 +47,10 @@ class MockSyntheticGesture : public SyntheticGesture { step_count_(0) { *finished_ = false; } - virtual ~MockSyntheticGesture() {} + ~MockSyntheticGesture() override {} - virtual Result ForwardInputEvents(const base::TimeTicks& timestamp, - SyntheticGestureTarget* target) override { + Result ForwardInputEvents(const base::TimeTicks& timestamp, + SyntheticGestureTarget* target) override { step_count_++; if (step_count_ == num_steps_) { *finished_ = true; @@ -75,22 +75,19 @@ class MockSyntheticGestureTarget : public SyntheticGestureTarget { MockSyntheticGestureTarget() : flush_requested_(false), pointer_assumed_stopped_time_ms_(kPointerAssumedStoppedTimeMs) {} - virtual ~MockSyntheticGestureTarget() {} + ~MockSyntheticGestureTarget() override {} // SyntheticGestureTarget: - virtual void DispatchInputEventToPlatform( - const WebInputEvent& event) override {} + void DispatchInputEventToPlatform(const WebInputEvent& event) override {} - virtual void SetNeedsFlush() override { - flush_requested_ = true; - } + void SetNeedsFlush() override { flush_requested_ = true; } - virtual SyntheticGestureParams::GestureSourceType + SyntheticGestureParams::GestureSourceType GetDefaultSyntheticGestureSourceType() const override { return SyntheticGestureParams::TOUCH_INPUT; } - virtual base::TimeDelta PointerAssumedStoppedTime() const override { + base::TimeDelta PointerAssumedStoppedTime() const override { return base::TimeDelta::FromMilliseconds(pointer_assumed_stopped_time_ms_); } @@ -98,11 +95,9 @@ class MockSyntheticGestureTarget : public SyntheticGestureTarget { pointer_assumed_stopped_time_ms_ = time_ms; } - virtual float GetTouchSlopInDips() const override { - return kTouchSlopInDips; - } + float GetTouchSlopInDips() const override { return kTouchSlopInDips; } - virtual float GetMinScalingSpanInDips() const override { + float GetMinScalingSpanInDips() const override { return kMinScalingSpanInDips; } @@ -118,7 +113,7 @@ class MockSyntheticGestureTarget : public SyntheticGestureTarget { class MockScrollGestureTarget : public MockSyntheticGestureTarget { public: MockScrollGestureTarget() : total_abs_scroll_distance_length_(0) {} - virtual ~MockScrollGestureTarget() {} + ~MockScrollGestureTarget() override {} gfx::Vector2dF start_to_end_distance() const { return start_to_end_distance_; @@ -135,10 +130,9 @@ class MockScrollGestureTarget : public MockSyntheticGestureTarget { class MockScrollMouseTarget : public MockScrollGestureTarget { public: MockScrollMouseTarget() {} - virtual ~MockScrollMouseTarget() {} + ~MockScrollMouseTarget() override {} - virtual void DispatchInputEventToPlatform( - const WebInputEvent& event) override { + void DispatchInputEventToPlatform(const WebInputEvent& event) override { ASSERT_EQ(event.type, WebInputEvent::MouseWheel); const WebMouseWheelEvent& mouse_wheel_event = static_cast<const WebMouseWheelEvent&>(event); @@ -151,10 +145,9 @@ class MockScrollMouseTarget : public MockScrollGestureTarget { class MockScrollTouchTarget : public MockScrollGestureTarget { public: MockScrollTouchTarget() : started_(false) {} - virtual ~MockScrollTouchTarget() {} + ~MockScrollTouchTarget() override {} - virtual void DispatchInputEventToPlatform( - const WebInputEvent& event) override { + void DispatchInputEventToPlatform(const WebInputEvent& event) override { ASSERT_TRUE(WebInputEvent::isTouchEventType(event.type)); const WebTouchEvent& touch_event = static_cast<const WebTouchEvent&>(event); ASSERT_EQ(touch_event.touchesLength, 1U); @@ -200,10 +193,9 @@ class MockSyntheticPinchTouchTarget : public MockSyntheticGestureTarget { last_pointer_distance_(0), zoom_direction_(ZOOM_DIRECTION_UNKNOWN), started_(false) {} - virtual ~MockSyntheticPinchTouchTarget() {} + ~MockSyntheticPinchTouchTarget() override {} - virtual void DispatchInputEventToPlatform( - const WebInputEvent& event) override { + void DispatchInputEventToPlatform(const WebInputEvent& event) override { ASSERT_TRUE(WebInputEvent::isTouchEventType(event.type)); const WebTouchEvent& touch_event = static_cast<const WebTouchEvent&>(event); ASSERT_EQ(touch_event.touchesLength, 2U); @@ -278,7 +270,7 @@ class MockSyntheticPinchTouchTarget : public MockSyntheticGestureTarget { class MockSyntheticTapGestureTarget : public MockSyntheticGestureTarget { public: MockSyntheticTapGestureTarget() : state_(NOT_STARTED) {} - virtual ~MockSyntheticTapGestureTarget() {} + ~MockSyntheticTapGestureTarget() override {} bool GestureFinished() const { return state_ == FINISHED; } gfx::PointF position() const { return position_; } @@ -300,10 +292,9 @@ class MockSyntheticTapGestureTarget : public MockSyntheticGestureTarget { class MockSyntheticTapTouchTarget : public MockSyntheticTapGestureTarget { public: MockSyntheticTapTouchTarget() {} - virtual ~MockSyntheticTapTouchTarget() {} + ~MockSyntheticTapTouchTarget() override {} - virtual void DispatchInputEventToPlatform( - const WebInputEvent& event) override { + void DispatchInputEventToPlatform(const WebInputEvent& event) override { ASSERT_TRUE(WebInputEvent::isTouchEventType(event.type)); const WebTouchEvent& touch_event = static_cast<const WebTouchEvent&>(event); ASSERT_EQ(touch_event.touchesLength, 1U); @@ -333,10 +324,9 @@ class MockSyntheticTapTouchTarget : public MockSyntheticTapGestureTarget { class MockSyntheticTapMouseTarget : public MockSyntheticTapGestureTarget { public: MockSyntheticTapMouseTarget() {} - virtual ~MockSyntheticTapMouseTarget() {} + ~MockSyntheticTapMouseTarget() override {} - virtual void DispatchInputEventToPlatform( - const WebInputEvent& event) override { + void DispatchInputEventToPlatform(const WebInputEvent& event) override { ASSERT_TRUE(WebInputEvent::isMouseEventType(event.type)); const WebMouseEvent& mouse_event = static_cast<const WebMouseEvent&>(event); diff --git a/content/browser/renderer_host/input/synthetic_gesture_target_base.h b/content/browser/renderer_host/input/synthetic_gesture_target_base.h index a95c5d4..d48be11 100644 --- a/content/browser/renderer_host/input/synthetic_gesture_target_base.h +++ b/content/browser/renderer_host/input/synthetic_gesture_target_base.h @@ -25,7 +25,7 @@ class RenderWidgetHostImpl; class SyntheticGestureTargetBase : public SyntheticGestureTarget { public: explicit SyntheticGestureTargetBase(RenderWidgetHostImpl* host); - virtual ~SyntheticGestureTargetBase(); + ~SyntheticGestureTargetBase() override; virtual void DispatchWebTouchEventToPlatform( const blink::WebTouchEvent& web_touch, @@ -40,19 +40,18 @@ class SyntheticGestureTargetBase : public SyntheticGestureTarget { const ui::LatencyInfo& latency_info); // SyntheticGestureTarget: - virtual void DispatchInputEventToPlatform( - const blink::WebInputEvent& event) override; + void DispatchInputEventToPlatform(const blink::WebInputEvent& event) override; - virtual void SetNeedsFlush() override; + void SetNeedsFlush() override; - virtual SyntheticGestureParams::GestureSourceType - GetDefaultSyntheticGestureSourceType() const override; + SyntheticGestureParams::GestureSourceType + GetDefaultSyntheticGestureSourceType() const override; - virtual base::TimeDelta PointerAssumedStoppedTime() const override; + base::TimeDelta PointerAssumedStoppedTime() const override; - virtual float GetTouchSlopInDips() const override; + float GetTouchSlopInDips() const override; - virtual float GetMinScalingSpanInDips() const override; + float GetMinScalingSpanInDips() const override; protected: RenderWidgetHostImpl* render_widget_host() const { return host_; } diff --git a/content/browser/renderer_host/input/synthetic_pinch_gesture.h b/content/browser/renderer_host/input/synthetic_pinch_gesture.h index 60530c1..71e79ec 100644 --- a/content/browser/renderer_host/input/synthetic_pinch_gesture.h +++ b/content/browser/renderer_host/input/synthetic_pinch_gesture.h @@ -18,9 +18,9 @@ namespace content { class CONTENT_EXPORT SyntheticPinchGesture : public SyntheticGesture { public: explicit SyntheticPinchGesture(const SyntheticPinchGestureParams& params); - virtual ~SyntheticPinchGesture(); + ~SyntheticPinchGesture() override; - virtual SyntheticGesture::Result ForwardInputEvents( + SyntheticGesture::Result ForwardInputEvents( const base::TimeTicks& timestamp, SyntheticGestureTarget* target) override; diff --git a/content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.h b/content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.h index 5940f9a..080e2db 100644 --- a/content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.h +++ b/content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.h @@ -28,9 +28,9 @@ class CONTENT_EXPORT SyntheticSmoothScrollGesture : public SyntheticGesture { public: explicit SyntheticSmoothScrollGesture( const SyntheticSmoothScrollGestureParams& params); - virtual ~SyntheticSmoothScrollGesture(); + ~SyntheticSmoothScrollGesture() override; - virtual SyntheticGesture::Result ForwardInputEvents( + SyntheticGesture::Result ForwardInputEvents( const base::TimeTicks& timestamp, SyntheticGestureTarget* target) override; diff --git a/content/browser/renderer_host/input/synthetic_tap_gesture.h b/content/browser/renderer_host/input/synthetic_tap_gesture.h index b73f861..a42b2dd 100644 --- a/content/browser/renderer_host/input/synthetic_tap_gesture.h +++ b/content/browser/renderer_host/input/synthetic_tap_gesture.h @@ -16,9 +16,9 @@ namespace content { class CONTENT_EXPORT SyntheticTapGesture : public SyntheticGesture { public: explicit SyntheticTapGesture(const SyntheticTapGestureParams& params); - virtual ~SyntheticTapGesture(); + ~SyntheticTapGesture() override; - virtual SyntheticGesture::Result ForwardInputEvents( + SyntheticGesture::Result ForwardInputEvents( const base::TimeTicks& timestamp, SyntheticGestureTarget* target) override; diff --git a/content/browser/renderer_host/input/touch_action_browsertest.cc b/content/browser/renderer_host/input/touch_action_browsertest.cc index a4f59cd..6222232 100644 --- a/content/browser/renderer_host/input/touch_action_browsertest.cc +++ b/content/browser/renderer_host/input/touch_action_browsertest.cc @@ -97,7 +97,7 @@ class TouchActionBrowserTest : public ContentBrowserTest { } // ContentBrowserTest: - virtual void SetUpCommandLine(CommandLine* cmd) override { + void SetUpCommandLine(CommandLine* cmd) override { cmd->AppendSwitchASCII(switches::kTouchEvents, switches::kTouchEventsEnabled); // TODO(rbyers): Remove this switch once touch-action ships. diff --git a/content/browser/renderer_host/input/touch_emulator.h b/content/browser/renderer_host/input/touch_emulator.h index 7cadc52..c364eb9 100644 --- a/content/browser/renderer_host/input/touch_emulator.h +++ b/content/browser/renderer_host/input/touch_emulator.h @@ -18,7 +18,7 @@ namespace content { class CONTENT_EXPORT TouchEmulator : public ui::GestureProviderClient { public: explicit TouchEmulator(TouchEmulatorClient* client); - virtual ~TouchEmulator(); + ~TouchEmulator() override; void Enable(); void Disable(); @@ -45,7 +45,7 @@ class CONTENT_EXPORT TouchEmulator : public ui::GestureProviderClient { private: // ui::GestureProviderClient implementation. - virtual void OnGestureEvent(const ui::GestureEventData& gesture) override; + void OnGestureEvent(const ui::GestureEventData& gesture) override; // Returns cursor size in DIP. gfx::SizeF InitCursorFromResource( diff --git a/content/browser/renderer_host/input/touch_emulator_unittest.cc b/content/browser/renderer_host/input/touch_emulator_unittest.cc index 498da56..caaf894 100644 --- a/content/browser/renderer_host/input/touch_emulator_unittest.cc +++ b/content/browser/renderer_host/input/touch_emulator_unittest.cc @@ -67,13 +67,11 @@ class TouchEmulatorTest : public testing::Test, #endif } - virtual void ForwardGestureEvent( - const blink::WebGestureEvent& event) override { + void ForwardGestureEvent(const blink::WebGestureEvent& event) override { forwarded_events_.push_back(event.type); } - virtual void ForwardEmulatedTouchEvent( - const blink::WebTouchEvent& event) override { + void ForwardEmulatedTouchEvent(const blink::WebTouchEvent& event) override { forwarded_events_.push_back(event.type); EXPECT_EQ(1U, event.touchesLength); EXPECT_EQ(last_mouse_x_, event.touches[0].position.x); @@ -86,9 +84,9 @@ class TouchEmulatorTest : public testing::Test, } } - virtual void SetCursor(const WebCursor& cursor) override {} + void SetCursor(const WebCursor& cursor) override {} - virtual void ShowContextMenuAtPoint(const gfx::Point& point) override {} + void ShowContextMenuAtPoint(const gfx::Point& point) override {} protected: TouchEmulator* emulator() const { diff --git a/content/browser/renderer_host/input/touch_event_queue_unittest.cc b/content/browser/renderer_host/input/touch_event_queue_unittest.cc index 7ac519e..6bcec4f 100644 --- a/content/browser/renderer_host/input/touch_event_queue_unittest.cc +++ b/content/browser/renderer_host/input/touch_event_queue_unittest.cc @@ -47,7 +47,7 @@ class TouchEventQueueTest : public testing::Test, } // TouchEventQueueClient - virtual void SendTouchEventImmediately( + void SendTouchEventImmediately( const TouchEventWithLatencyInfo& event) override { ++sent_event_count_; last_sent_event_ = event.event; @@ -57,9 +57,8 @@ class TouchEventQueueTest : public testing::Test, } } - virtual void OnTouchEventAck( - const TouchEventWithLatencyInfo& event, - InputEventAckState ack_result) override { + void OnTouchEventAck(const TouchEventWithLatencyInfo& event, + InputEventAckState ack_result) override { ++acked_event_count_; last_acked_event_ = event.event; last_acked_event_state_ = ack_result; diff --git a/content/browser/renderer_host/input/touch_handle_unittest.cc b/content/browser/renderer_host/input/touch_handle_unittest.cc index 03903c3..28ba7a5 100644 --- a/content/browser/renderer_host/input/touch_handle_unittest.cc +++ b/content/browser/renderer_host/input/touch_handle_unittest.cc @@ -34,24 +34,24 @@ struct MockDrawableData { class MockTouchHandleDrawable : public TouchHandleDrawable { public: explicit MockTouchHandleDrawable(MockDrawableData* data) : data_(data) {} - virtual ~MockTouchHandleDrawable() {} + ~MockTouchHandleDrawable() override {} - virtual void SetEnabled(bool enabled) override { data_->enabled = enabled; } + void SetEnabled(bool enabled) override { data_->enabled = enabled; } - virtual void SetOrientation(TouchHandleOrientation orientation) override { + void SetOrientation(TouchHandleOrientation orientation) override { data_->orientation = orientation; } - virtual void SetAlpha(float alpha) override { data_->alpha = alpha; } + void SetAlpha(float alpha) override { data_->alpha = alpha; } - virtual void SetFocus(const gfx::PointF& position) override { + void SetFocus(const gfx::PointF& position) override { // Anchor focus to the top left of the rect (regardless of orientation). data_->rect.set_origin(position); } - virtual void SetVisible(bool visible) override { data_->visible = visible; } + void SetVisible(bool visible) override { data_->visible = visible; } - virtual bool IntersectsWith(const gfx::RectF& rect) const override { + bool IntersectsWith(const gfx::RectF& rect) const override { return data_->rect.Intersects(rect); } @@ -72,36 +72,34 @@ class TouchHandleTest : public testing::Test, public TouchHandleClient { virtual ~TouchHandleTest() {} // TouchHandleClient implementation. - virtual void OnHandleDragBegin(const TouchHandle& handle) override { + void OnHandleDragBegin(const TouchHandle& handle) override { dragging_ = true; } - virtual void OnHandleDragUpdate(const TouchHandle& handle, - const gfx::PointF& new_position) override { + void OnHandleDragUpdate(const TouchHandle& handle, + const gfx::PointF& new_position) override { dragged_ = true; drag_position_ = new_position; } - virtual void OnHandleDragEnd(const TouchHandle& handle) override { + void OnHandleDragEnd(const TouchHandle& handle) override { dragging_ = false; } - virtual void OnHandleTapped(const TouchHandle& handle) override { - tapped_ = true; - } + void OnHandleTapped(const TouchHandle& handle) override { tapped_ = true; } - virtual void SetNeedsAnimate() override { needs_animate_ = true; } + void SetNeedsAnimate() override { needs_animate_ = true; } - virtual scoped_ptr<TouchHandleDrawable> CreateDrawable() override { + scoped_ptr<TouchHandleDrawable> CreateDrawable() override { return scoped_ptr<TouchHandleDrawable>( new MockTouchHandleDrawable(&drawable_data_)); } - virtual base::TimeDelta GetTapTimeout() const override { + base::TimeDelta GetTapTimeout() const override { return base::TimeDelta::FromMilliseconds(kDefaultTapTimeoutMs); } - virtual float GetTapSlop() const override { return kDefaultTapSlop; } + float GetTapSlop() const override { return kDefaultTapSlop; } void Animate(TouchHandle& handle) { needs_animate_ = false; diff --git a/content/browser/renderer_host/input/touch_input_browsertest.cc b/content/browser/renderer_host/input/touch_input_browsertest.cc index e25b6be..95e5f73 100644 --- a/content/browser/renderer_host/input/touch_input_browsertest.cc +++ b/content/browser/renderer_host/input/touch_input_browsertest.cc @@ -97,7 +97,7 @@ class InputEventMessageFilter : public BrowserMessageFilter { InputEventAckState last_ack_state() const { return state_; } protected: - virtual ~InputEventMessageFilter() {} + ~InputEventMessageFilter() override {} private: void ReceivedEventAck(WebInputEvent::Type type, InputEventAckState state) { @@ -108,7 +108,7 @@ class InputEventMessageFilter : public BrowserMessageFilter { } // BrowserMessageFilter: - virtual bool OnMessageReceived(const IPC::Message& message) override { + bool OnMessageReceived(const IPC::Message& message) override { if (message.type() == InputHostMsg_HandleInputEvent_ACK::ID) { InputHostMsg_HandleInputEvent_ACK::Param params; InputHostMsg_HandleInputEvent_ACK::Read(&message, ¶ms); @@ -159,7 +159,7 @@ class TouchInputBrowserTest : public ContentBrowserTest { host->GetProcess()->AddFilter(filter_.get()); } - virtual void SetUpCommandLine(CommandLine* cmd) override { + void SetUpCommandLine(CommandLine* cmd) override { cmd->AppendSwitchASCII(switches::kTouchEvents, switches::kTouchEventsEnabled); } diff --git a/content/browser/renderer_host/input/touch_selection_controller.h b/content/browser/renderer_host/input/touch_selection_controller.h index 4e33594..1ded1a97 100644 --- a/content/browser/renderer_host/input/touch_selection_controller.h +++ b/content/browser/renderer_host/input/touch_selection_controller.h @@ -44,7 +44,7 @@ class CONTENT_EXPORT TouchSelectionController : public TouchHandleClient { TouchSelectionController(TouchSelectionControllerClient* client, base::TimeDelta tap_timeout, float tap_slop); - virtual ~TouchSelectionController(); + ~TouchSelectionController() override; // To be called when the selection bounds have changed. // Note that such updates will trigger handle updates only if preceded @@ -86,15 +86,15 @@ class CONTENT_EXPORT TouchSelectionController : public TouchHandleClient { enum InputEventType { TAP, LONG_PRESS, INPUT_EVENT_TYPE_NONE }; // TouchHandleClient implementation. - virtual void OnHandleDragBegin(const TouchHandle& handle) override; - virtual void OnHandleDragUpdate(const TouchHandle& handle, - const gfx::PointF& new_position) override; - virtual void OnHandleDragEnd(const TouchHandle& handle) override; - virtual void OnHandleTapped(const TouchHandle& handle) override; - virtual void SetNeedsAnimate() override; - virtual scoped_ptr<TouchHandleDrawable> CreateDrawable() override; - virtual base::TimeDelta GetTapTimeout() const override; - virtual float GetTapSlop() const override; + void OnHandleDragBegin(const TouchHandle& handle) override; + void OnHandleDragUpdate(const TouchHandle& handle, + const gfx::PointF& new_position) override; + void OnHandleDragEnd(const TouchHandle& handle) override; + void OnHandleTapped(const TouchHandle& handle) override; + void SetNeedsAnimate() override; + scoped_ptr<TouchHandleDrawable> CreateDrawable() override; + base::TimeDelta GetTapTimeout() const override; + float GetTapSlop() const override; void ShowInsertionHandleAutomatically(); void ShowSelectionHandlesAutomatically(); diff --git a/content/browser/renderer_host/input/touch_selection_controller_unittest.cc b/content/browser/renderer_host/input/touch_selection_controller_unittest.cc index 1ffd384..1b3451e 100644 --- a/content/browser/renderer_host/input/touch_selection_controller_unittest.cc +++ b/content/browser/renderer_host/input/touch_selection_controller_unittest.cc @@ -19,13 +19,13 @@ class MockTouchHandleDrawable : public TouchHandleDrawable { public: explicit MockTouchHandleDrawable(bool* contains_point) : intersects_rect_(contains_point) {} - virtual ~MockTouchHandleDrawable() {} - virtual void SetEnabled(bool enabled) override {} - virtual void SetOrientation(TouchHandleOrientation orientation) override {} - virtual void SetAlpha(float alpha) override {} - virtual void SetFocus(const gfx::PointF& position) override {} - virtual void SetVisible(bool visible) override {} - virtual bool IntersectsWith(const gfx::RectF& rect) const override { + ~MockTouchHandleDrawable() override {} + void SetEnabled(bool enabled) override {} + void SetOrientation(TouchHandleOrientation orientation) override {} + void SetAlpha(float alpha) override {} + void SetFocus(const gfx::PointF& position) override {} + void SetVisible(bool visible) override {} + bool IntersectsWith(const gfx::RectF& rect) const override { return *intersects_rect_; } @@ -60,29 +60,29 @@ class TouchSelectionControllerTest : public testing::Test, // TouchSelectionControllerClient implementation. - virtual bool SupportsAnimation() const override { return animation_enabled_; } + bool SupportsAnimation() const override { return animation_enabled_; } - virtual void SetNeedsAnimate() override { needs_animate_ = true; } + void SetNeedsAnimate() override { needs_animate_ = true; } - virtual void MoveCaret(const gfx::PointF& position) override { + void MoveCaret(const gfx::PointF& position) override { caret_moved_ = true; caret_position_ = position; } - virtual void SelectBetweenCoordinates(const gfx::PointF& start, - const gfx::PointF& end) override { + void SelectBetweenCoordinates(const gfx::PointF& start, + const gfx::PointF& end) override { selection_moved_ = true; selection_start_ = start; selection_end_ = end; } - virtual void OnSelectionEvent(SelectionEventType event, - const gfx::PointF& end_position) override { + void OnSelectionEvent(SelectionEventType event, + const gfx::PointF& end_position) override { last_event_ = event; last_event_start_ = end_position; } - virtual scoped_ptr<TouchHandleDrawable> CreateDrawable() override { + scoped_ptr<TouchHandleDrawable> CreateDrawable() override { return scoped_ptr<TouchHandleDrawable>( new MockTouchHandleDrawable(&dragging_enabled_)); } diff --git a/content/browser/renderer_host/input/touchpad_tap_suppression_controller.h b/content/browser/renderer_host/input/touchpad_tap_suppression_controller.h index 6f93f1d..64e5d47 100644 --- a/content/browser/renderer_host/input/touchpad_tap_suppression_controller.h +++ b/content/browser/renderer_host/input/touchpad_tap_suppression_controller.h @@ -30,7 +30,7 @@ class TouchpadTapSuppressionController : public TapSuppressionControllerClient { TouchpadTapSuppressionController( TouchpadTapSuppressionControllerClient* client, const TapSuppressionController::Config& config); - virtual ~TouchpadTapSuppressionController(); + ~TouchpadTapSuppressionController() override; // Should be called on arrival of GestureFlingCancel events. void GestureFlingCancel(); @@ -52,8 +52,8 @@ class TouchpadTapSuppressionController : public TapSuppressionControllerClient { friend class MockRenderWidgetHost; // TapSuppressionControllerClient implementation. - virtual void DropStashedTapDown() override; - virtual void ForwardStashedTapDown() override; + void DropStashedTapDown() override; + void ForwardStashedTapDown() override; TouchpadTapSuppressionControllerClient* client_; MouseEventWithLatencyInfo stashed_mouse_down_; diff --git a/content/browser/renderer_host/input/touchscreen_tap_suppression_controller.h b/content/browser/renderer_host/input/touchscreen_tap_suppression_controller.h index 2b3e21d..35ff274 100644 --- a/content/browser/renderer_host/input/touchscreen_tap_suppression_controller.h +++ b/content/browser/renderer_host/input/touchscreen_tap_suppression_controller.h @@ -22,7 +22,7 @@ class TouchscreenTapSuppressionController TouchscreenTapSuppressionController( GestureEventQueue* geq, const TapSuppressionController::Config& config); - virtual ~TouchscreenTapSuppressionController(); + ~TouchscreenTapSuppressionController() override; // Should be called on arrival of GestureFlingCancel events. void GestureFlingCancel(); @@ -37,8 +37,8 @@ class TouchscreenTapSuppressionController private: // TapSuppressionControllerClient implementation. - virtual void DropStashedTapDown() override; - virtual void ForwardStashedTapDown() override; + void DropStashedTapDown() override; + void ForwardStashedTapDown() override; GestureEventQueue* gesture_event_queue_; diff --git a/content/browser/renderer_host/media/audio_input_device_manager.h b/content/browser/renderer_host/media/audio_input_device_manager.h index b744603..a2d4ca4 100644 --- a/content/browser/renderer_host/media/audio_input_device_manager.h +++ b/content/browser/renderer_host/media/audio_input_device_manager.h @@ -45,13 +45,13 @@ class CONTENT_EXPORT AudioInputDeviceManager : public MediaStreamProvider { const StreamDeviceInfo* GetOpenedDeviceInfoById(int session_id); // MediaStreamProvider implementation, called on IO thread. - virtual void Register(MediaStreamProviderListener* listener, - const scoped_refptr<base::SingleThreadTaskRunner>& - device_task_runner) override; - virtual void Unregister() override; - virtual void EnumerateDevices(MediaStreamType stream_type) override; - virtual int Open(const StreamDeviceInfo& device) override; - virtual void Close(int session_id) override; + void Register(MediaStreamProviderListener* listener, + const scoped_refptr<base::SingleThreadTaskRunner>& + device_task_runner) override; + void Unregister() override; + void EnumerateDevices(MediaStreamType stream_type) override; + int Open(const StreamDeviceInfo& device) override; + void Close(int session_id) override; void UseFakeDevice(); bool ShouldUseFakeDevice() const; @@ -73,7 +73,7 @@ class CONTENT_EXPORT AudioInputDeviceManager : public MediaStreamProvider { void GetFakeDeviceNames(media::AudioDeviceNames* device_names); typedef std::vector<StreamDeviceInfo> StreamDeviceList; - virtual ~AudioInputDeviceManager(); + ~AudioInputDeviceManager() override; // Enumerates audio input devices on media stream device thread. void EnumerateOnDeviceThread(MediaStreamType stream_type); diff --git a/content/browser/renderer_host/media/audio_input_renderer_host.h b/content/browser/renderer_host/media/audio_input_renderer_host.h index 43dd3bb..b847bf6 100644 --- a/content/browser/renderer_host/media/audio_input_renderer_host.h +++ b/content/browser/renderer_host/media/audio_input_renderer_host.h @@ -107,19 +107,19 @@ class CONTENT_EXPORT AudioInputRendererHost media::UserInputMonitor* user_input_monitor); // BrowserMessageFilter implementation. - virtual void OnChannelClosing() override; - virtual void OnDestruct() const override; - virtual bool OnMessageReceived(const IPC::Message& message) override; + void OnChannelClosing() override; + void OnDestruct() const override; + bool OnMessageReceived(const IPC::Message& message) override; // AudioInputController::EventHandler implementation. - virtual void OnCreated(media::AudioInputController* controller) override; - virtual void OnRecording(media::AudioInputController* controller) override; - virtual void OnError(media::AudioInputController* controller, - media::AudioInputController::ErrorCode error_code) override; - virtual void OnData(media::AudioInputController* controller, - const media::AudioBus* data) override; - virtual void OnLog(media::AudioInputController* controller, - const std::string& message) override; + void OnCreated(media::AudioInputController* controller) override; + void OnRecording(media::AudioInputController* controller) override; + void OnError(media::AudioInputController* controller, + media::AudioInputController::ErrorCode error_code) override; + void OnData(media::AudioInputController* controller, + const media::AudioBus* data) override; + void OnLog(media::AudioInputController* controller, + const std::string& message) override; private: // TODO(henrika): extend test suite (compare AudioRenderHost) @@ -130,7 +130,7 @@ class CONTENT_EXPORT AudioInputRendererHost struct AudioEntry; typedef std::map<int, AudioEntry*> AudioEntryMap; - virtual ~AudioInputRendererHost(); + ~AudioInputRendererHost() override; // Methods called on IO thread ---------------------------------------------- diff --git a/content/browser/renderer_host/media/audio_input_sync_writer.h b/content/browser/renderer_host/media/audio_input_sync_writer.h index 65e8622..1ace401 100644 --- a/content/browser/renderer_host/media/audio_input_sync_writer.h +++ b/content/browser/renderer_host/media/audio_input_sync_writer.h @@ -32,14 +32,14 @@ class AudioInputSyncWriter : public media::AudioInputController::SyncWriter { int shared_memory_segment_count, const media::AudioParameters& params); - virtual ~AudioInputSyncWriter(); + ~AudioInputSyncWriter() override; // media::AudioInputController::SyncWriter implementation. - virtual void UpdateRecordedBytes(uint32 bytes) override; - virtual void Write(const media::AudioBus* data, - double volume, - bool key_pressed) override; - virtual void Close() override; + void UpdateRecordedBytes(uint32 bytes) override; + void Write(const media::AudioBus* data, + double volume, + bool key_pressed) override; + void Close() override; bool Init(); bool PrepareForeignSocket(base::ProcessHandle process_handle, diff --git a/content/browser/renderer_host/media/audio_renderer_host.cc b/content/browser/renderer_host/media/audio_renderer_host.cc index 3c31820..43555fc 100644 --- a/content/browser/renderer_host/media/audio_renderer_host.cc +++ b/content/browser/renderer_host/media/audio_renderer_host.cc @@ -42,7 +42,7 @@ class AudioRendererHost::AudioEntry const std::string& output_device_id, scoped_ptr<base::SharedMemory> shared_memory, scoped_ptr<media::AudioOutputController::SyncReader> reader); - virtual ~AudioEntry(); + ~AudioEntry() override; int stream_id() const { return stream_id_; @@ -69,12 +69,11 @@ class AudioRendererHost::AudioEntry private: // media::AudioOutputController::EventHandler implementation. - virtual void OnCreated() override; - virtual void OnPlaying() override; - virtual void OnPaused() override; - virtual void OnError() override; - virtual void OnDeviceChange(int new_buffer_size, int new_sample_rate) - override; + void OnCreated() override; + void OnPlaying() override; + void OnPaused() override; + void OnError() override; + void OnDeviceChange(int new_buffer_size, int new_sample_rate) override; AudioRendererHost* const host_; const int stream_id_; diff --git a/content/browser/renderer_host/media/audio_renderer_host.h b/content/browser/renderer_host/media/audio_renderer_host.h index 8959cdd..11bc13f 100644 --- a/content/browser/renderer_host/media/audio_renderer_host.h +++ b/content/browser/renderer_host/media/audio_renderer_host.h @@ -81,9 +81,9 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter { const RenderViewHost::GetAudioOutputControllersCallback& callback) const; // BrowserMessageFilter implementation. - virtual void OnChannelClosing() override; - virtual void OnDestruct() const override; - virtual bool OnMessageReceived(const IPC::Message& message) override; + void OnChannelClosing() override; + void OnDestruct() const override; + bool OnMessageReceived(const IPC::Message& message) override; // Returns true if any streams managed by this host are actively playing. Can // be called from any thread. @@ -105,7 +105,7 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter { class AudioEntry; typedef std::map<int, AudioEntry*> AudioEntryMap; - virtual ~AudioRendererHost(); + ~AudioRendererHost() override; // Methods called on IO thread ---------------------------------------------- diff --git a/content/browser/renderer_host/media/audio_sync_reader.h b/content/browser/renderer_host/media/audio_sync_reader.h index 0a563cd..16af192 100644 --- a/content/browser/renderer_host/media/audio_sync_reader.h +++ b/content/browser/renderer_host/media/audio_sync_reader.h @@ -31,12 +31,12 @@ class AudioSyncReader : public media::AudioOutputController::SyncReader { AudioSyncReader(base::SharedMemory* shared_memory, const media::AudioParameters& params); - virtual ~AudioSyncReader(); + ~AudioSyncReader() override; // media::AudioOutputController::SyncReader implementations. - virtual void UpdatePendingBytes(uint32 bytes) override; - virtual void Read(media::AudioBus* dest) override; - virtual void Close() override; + void UpdatePendingBytes(uint32 bytes) override; + void Read(media::AudioBus* dest) override; + void Close() override; bool Init(); bool PrepareForeignSocket(base::ProcessHandle process_handle, diff --git a/content/browser/renderer_host/media/media_capture_devices_impl.h b/content/browser/renderer_host/media/media_capture_devices_impl.h index 8fefa4d..77174cc 100644 --- a/content/browser/renderer_host/media/media_capture_devices_impl.h +++ b/content/browser/renderer_host/media/media_capture_devices_impl.h @@ -15,8 +15,8 @@ class MediaCaptureDevicesImpl : public MediaCaptureDevices { static MediaCaptureDevicesImpl* GetInstance(); // Overriden from MediaCaptureDevices - virtual const MediaStreamDevices& GetAudioCaptureDevices() override; - virtual const MediaStreamDevices& GetVideoCaptureDevices() override; + const MediaStreamDevices& GetAudioCaptureDevices() override; + const MediaStreamDevices& GetVideoCaptureDevices() override; // Called by MediaStreamManager to notify the change of media capture // devices, these 2 methods are called in IO thread. @@ -26,7 +26,7 @@ class MediaCaptureDevicesImpl : public MediaCaptureDevices { private: friend struct DefaultSingletonTraits<MediaCaptureDevicesImpl>; MediaCaptureDevicesImpl(); - virtual ~MediaCaptureDevicesImpl(); + ~MediaCaptureDevicesImpl() override; void UpdateAudioDevicesOnUIThread(const content::MediaStreamDevices& devices); void UpdateVideoDevicesOnUIThread(const content::MediaStreamDevices& devices); diff --git a/content/browser/renderer_host/media/media_stream_dispatcher_host.h b/content/browser/renderer_host/media/media_stream_dispatcher_host.h index 87c95d4..f35ae26 100644 --- a/content/browser/renderer_host/media/media_stream_dispatcher_host.h +++ b/content/browser/renderer_host/media/media_stream_dispatcher_host.h @@ -33,34 +33,33 @@ class CONTENT_EXPORT MediaStreamDispatcherHost : public BrowserMessageFilter, MediaStreamManager* media_stream_manager); // MediaStreamRequester implementation. - virtual void StreamGenerated( - int render_frame_id, - int page_request_id, - const std::string& label, - const StreamDeviceInfoArray& audio_devices, - const StreamDeviceInfoArray& video_devices) override; - virtual void StreamGenerationFailed( + void StreamGenerated(int render_frame_id, + int page_request_id, + const std::string& label, + const StreamDeviceInfoArray& audio_devices, + const StreamDeviceInfoArray& video_devices) override; + void StreamGenerationFailed( int render_frame_id, int page_request_id, content::MediaStreamRequestResult result) override; - virtual void DeviceStopped(int render_frame_id, - const std::string& label, - const StreamDeviceInfo& device) override; - virtual void DevicesEnumerated(int render_frame_id, - int page_request_id, - const std::string& label, - const StreamDeviceInfoArray& devices) override; - virtual void DeviceOpened(int render_frame_id, - int page_request_id, - const std::string& label, - const StreamDeviceInfo& video_device) override; + void DeviceStopped(int render_frame_id, + const std::string& label, + const StreamDeviceInfo& device) override; + void DevicesEnumerated(int render_frame_id, + int page_request_id, + const std::string& label, + const StreamDeviceInfoArray& devices) override; + void DeviceOpened(int render_frame_id, + int page_request_id, + const std::string& label, + const StreamDeviceInfo& video_device) override; // BrowserMessageFilter implementation. - virtual bool OnMessageReceived(const IPC::Message& message) override; - virtual void OnChannelClosing() override; + bool OnMessageReceived(const IPC::Message& message) override; + void OnChannelClosing() override; protected: - virtual ~MediaStreamDispatcherHost(); + ~MediaStreamDispatcherHost() override; private: friend class MockMediaStreamDispatcherHost; diff --git a/content/browser/renderer_host/media/media_stream_manager.h b/content/browser/renderer_host/media/media_stream_manager.h index d5dbf9f..78c722e 100644 --- a/content/browser/renderer_host/media/media_stream_manager.h +++ b/content/browser/renderer_host/media/media_stream_manager.h @@ -72,7 +72,7 @@ class CONTENT_EXPORT MediaStreamManager MediaRequestResponseCallback; explicit MediaStreamManager(media::AudioManager* audio_manager); - virtual ~MediaStreamManager(); + ~MediaStreamManager() override; // Used to access VideoCaptureManager. VideoCaptureManager* video_capture_manager(); @@ -165,18 +165,14 @@ class CONTENT_EXPORT MediaStreamManager void EnsureDeviceMonitorStarted(); // Implements MediaStreamProviderListener. - virtual void Opened(MediaStreamType stream_type, - int capture_session_id) override; - virtual void Closed(MediaStreamType stream_type, - int capture_session_id) override; - virtual void DevicesEnumerated(MediaStreamType stream_type, - const StreamDeviceInfoArray& devices) override; - virtual void Aborted(MediaStreamType stream_type, - int capture_session_id) override; + void Opened(MediaStreamType stream_type, int capture_session_id) override; + void Closed(MediaStreamType stream_type, int capture_session_id) override; + void DevicesEnumerated(MediaStreamType stream_type, + const StreamDeviceInfoArray& devices) override; + void Aborted(MediaStreamType stream_type, int capture_session_id) override; // Implements base::SystemMonitor::DevicesChangedObserver. - virtual void OnDevicesChanged( - base::SystemMonitor::DeviceType device_type) override; + void OnDevicesChanged(base::SystemMonitor::DeviceType device_type) override; // Called by the tests to specify a fake UI that should be used for next // generated stream (or when using --use-fake-ui-for-media-stream). @@ -195,7 +191,7 @@ class CONTENT_EXPORT MediaStreamManager // But for some tests which use TestBrowserThreadBundle, we need to call // WillDestroyCurrentMessageLoop explicitly because the notification happens // too late. (see http://crbug.com/247525#c14). - virtual void WillDestroyCurrentMessageLoop() override; + void WillDestroyCurrentMessageLoop() override; // Sends log messages to the render process hosts whose corresponding render // processes are making device requests, to be used by the @@ -208,8 +204,8 @@ class CONTENT_EXPORT MediaStreamManager static void SendMessageToNativeLog(const std::string& message); // base::PowerObserver overrides. - virtual void OnSuspend() override; - virtual void OnResume() override; + void OnSuspend() override; + void OnResume() override; protected: // Used for testing. diff --git a/content/browser/renderer_host/media/media_stream_manager_unittest.cc b/content/browser/renderer_host/media/media_stream_manager_unittest.cc index 15da678..51ab0a5 100644 --- a/content/browser/renderer_host/media/media_stream_manager_unittest.cc +++ b/content/browser/renderer_host/media/media_stream_manager_unittest.cc @@ -55,9 +55,9 @@ typedef media::FakeAudioManager AudioManagerPlatform; class MockAudioManager : public AudioManagerPlatform { public: MockAudioManager() : AudioManagerPlatform(&fake_audio_log_factory_) {} - virtual ~MockAudioManager() {} + ~MockAudioManager() override {} - virtual void GetAudioInputDeviceNames( + void GetAudioInputDeviceNames( media::AudioDeviceNames* device_names) override { DCHECK(device_names->empty()); if (HasAudioInputDevices()) { diff --git a/content/browser/renderer_host/media/media_stream_track_metrics_host.h b/content/browser/renderer_host/media/media_stream_track_metrics_host.h index 5f36f26..35235db 100644 --- a/content/browser/renderer_host/media/media_stream_track_metrics_host.h +++ b/content/browser/renderer_host/media/media_stream_track_metrics_host.h @@ -31,10 +31,10 @@ class MediaStreamTrackMetricsHost explicit MediaStreamTrackMetricsHost(); protected: - virtual ~MediaStreamTrackMetricsHost(); + ~MediaStreamTrackMetricsHost() override; // BrowserMessageFilter override. - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; private: void OnAddTrack(uint64 id, bool is_audio, bool is_remote); diff --git a/content/browser/renderer_host/media/media_stream_ui_proxy.h b/content/browser/renderer_host/media/media_stream_ui_proxy.h index c61bbfa..23fc592 100644 --- a/content/browser/renderer_host/media/media_stream_ui_proxy.h +++ b/content/browser/renderer_host/media/media_stream_ui_proxy.h @@ -90,23 +90,22 @@ class CONTENT_EXPORT MediaStreamUIProxy { class CONTENT_EXPORT FakeMediaStreamUIProxy : public MediaStreamUIProxy { public: explicit FakeMediaStreamUIProxy(); - virtual ~FakeMediaStreamUIProxy(); + ~FakeMediaStreamUIProxy() override; void SetAvailableDevices(const MediaStreamDevices& devices); void SetMicAccess(bool access); void SetCameraAccess(bool access); // MediaStreamUIProxy overrides. - virtual void RequestAccess( - const MediaStreamRequest& request, - const ResponseCallback& response_callback) override; - virtual void CheckAccess(const GURL& security_origin, - MediaStreamType type, - int render_process_id, - int render_frame_id, - const base::Callback<void(bool)>& callback) override; - virtual void OnStarted(const base::Closure& stop_callback, - const WindowIdCallback& window_id_callback) override; + void RequestAccess(const MediaStreamRequest& request, + const ResponseCallback& response_callback) override; + void CheckAccess(const GURL& security_origin, + MediaStreamType type, + int render_process_id, + int render_frame_id, + const base::Callback<void(bool)>& callback) override; + void OnStarted(const base::Closure& stop_callback, + const WindowIdCallback& window_id_callback) override; private: // This is used for RequestAccess(). diff --git a/content/browser/renderer_host/media/peer_connection_tracker_host.h b/content/browser/renderer_host/media/peer_connection_tracker_host.h index f1f3521..0d7b506 100644 --- a/content/browser/renderer_host/media/peer_connection_tracker_host.h +++ b/content/browser/renderer_host/media/peer_connection_tracker_host.h @@ -26,17 +26,17 @@ class PeerConnectionTrackerHost : public BrowserMessageFilter, PeerConnectionTrackerHost(int render_process_id); // content::BrowserMessageFilter override. - virtual bool OnMessageReceived(const IPC::Message& message) override; - virtual void OverrideThreadForMessage(const IPC::Message& message, - BrowserThread::ID* thread) override; - virtual void OnChannelConnected(int32 peer_pid) override; - virtual void OnChannelClosing() override; + bool OnMessageReceived(const IPC::Message& message) override; + void OverrideThreadForMessage(const IPC::Message& message, + BrowserThread::ID* thread) override; + void OnChannelConnected(int32 peer_pid) override; + void OnChannelClosing() override; // base::PowerObserver override. - virtual void OnSuspend() override; + void OnSuspend() override; protected: - virtual ~PeerConnectionTrackerHost(); + ~PeerConnectionTrackerHost() override; private: // Handlers for peer connection messages coming from the renderer. diff --git a/content/browser/renderer_host/media/video_capture_controller.cc b/content/browser/renderer_host/media/video_capture_controller.cc index 18a5e5d..c0b462b 100644 --- a/content/browser/renderer_host/media/video_capture_controller.cc +++ b/content/browser/renderer_host/media/video_capture_controller.cc @@ -53,7 +53,7 @@ class PoolBuffer : public media::VideoCaptureDevice::Client::Buffer { } private: - virtual ~PoolBuffer() { pool_->RelinquishProducerReservation(id()); } + ~PoolBuffer() override { pool_->RelinquishProducerReservation(id()); } const scoped_refptr<VideoCaptureBufferPool> pool_; }; @@ -61,11 +61,9 @@ class PoolBuffer : public media::VideoCaptureDevice::Client::Buffer { class SyncPointClientImpl : public media::VideoFrame::SyncPointClient { public: explicit SyncPointClientImpl(GLHelper* gl_helper) : gl_helper_(gl_helper) {} - virtual ~SyncPointClientImpl() {} - virtual uint32 InsertSyncPoint() override { - return gl_helper_->InsertSyncPoint(); - } - virtual void WaitSyncPoint(uint32 sync_point) override { + ~SyncPointClientImpl() override {} + uint32 InsertSyncPoint() override { return gl_helper_->InsertSyncPoint(); } + void WaitSyncPoint(uint32 sync_point) override { gl_helper_->WaitSyncPoint(sync_point); } @@ -156,24 +154,23 @@ class VideoCaptureController::VideoCaptureDeviceClient explicit VideoCaptureDeviceClient( const base::WeakPtr<VideoCaptureController>& controller, const scoped_refptr<VideoCaptureBufferPool>& buffer_pool); - virtual ~VideoCaptureDeviceClient(); + ~VideoCaptureDeviceClient() override; // VideoCaptureDevice::Client implementation. - virtual scoped_refptr<Buffer> ReserveOutputBuffer( - media::VideoFrame::Format format, - const gfx::Size& size) override; - virtual void OnIncomingCapturedData(const uint8* data, - int length, - const VideoCaptureFormat& frame_format, - int rotation, - base::TimeTicks timestamp) override; - virtual void OnIncomingCapturedVideoFrame( + scoped_refptr<Buffer> ReserveOutputBuffer(media::VideoFrame::Format format, + const gfx::Size& size) override; + void OnIncomingCapturedData(const uint8* data, + int length, + const VideoCaptureFormat& frame_format, + int rotation, + base::TimeTicks timestamp) override; + void OnIncomingCapturedVideoFrame( const scoped_refptr<Buffer>& buffer, const VideoCaptureFormat& buffer_format, const scoped_refptr<media::VideoFrame>& frame, base::TimeTicks timestamp) override; - virtual void OnError(const std::string& reason) override; - virtual void OnLog(const std::string& message) override; + void OnError(const std::string& reason) override; + void OnLog(const std::string& message) override; private: scoped_refptr<Buffer> DoReserveOutputBuffer(media::VideoFrame::Format format, diff --git a/content/browser/renderer_host/media/video_capture_host.h b/content/browser/renderer_host/media/video_capture_host.h index cf6e73f..1fd9813 100644 --- a/content/browser/renderer_host/media/video_capture_host.h +++ b/content/browser/renderer_host/media/video_capture_host.h @@ -71,29 +71,29 @@ class CONTENT_EXPORT VideoCaptureHost explicit VideoCaptureHost(MediaStreamManager* media_stream_manager); // BrowserMessageFilter implementation. - virtual void OnChannelClosing() override; - virtual void OnDestruct() const override; - virtual bool OnMessageReceived(const IPC::Message& message) override; + void OnChannelClosing() override; + void OnDestruct() const override; + bool OnMessageReceived(const IPC::Message& message) override; // VideoCaptureControllerEventHandler implementation. - virtual void OnError(const VideoCaptureControllerID& id) override; - virtual void OnBufferCreated(const VideoCaptureControllerID& id, - base::SharedMemoryHandle handle, - int length, - int buffer_id) override; - virtual void OnBufferDestroyed(const VideoCaptureControllerID& id, - int buffer_id) override; - virtual void OnBufferReady(const VideoCaptureControllerID& id, - int buffer_id, - const media::VideoCaptureFormat& format, - const gfx::Rect& visible_rect, - base::TimeTicks timestamp) override; - virtual void OnMailboxBufferReady(const VideoCaptureControllerID& id, - int buffer_id, - const gpu::MailboxHolder& mailbox_holder, - const media::VideoCaptureFormat& format, - base::TimeTicks timestamp) override; - virtual void OnEnded(const VideoCaptureControllerID& id) override; + void OnError(const VideoCaptureControllerID& id) override; + void OnBufferCreated(const VideoCaptureControllerID& id, + base::SharedMemoryHandle handle, + int length, + int buffer_id) override; + void OnBufferDestroyed(const VideoCaptureControllerID& id, + int buffer_id) override; + void OnBufferReady(const VideoCaptureControllerID& id, + int buffer_id, + const media::VideoCaptureFormat& format, + const gfx::Rect& visible_rect, + base::TimeTicks timestamp) override; + void OnMailboxBufferReady(const VideoCaptureControllerID& id, + int buffer_id, + const gpu::MailboxHolder& mailbox_holder, + const media::VideoCaptureFormat& format, + base::TimeTicks timestamp) override; + void OnEnded(const VideoCaptureControllerID& id) override; private: friend class BrowserThread; @@ -101,7 +101,7 @@ class CONTENT_EXPORT VideoCaptureHost friend class MockVideoCaptureHost; friend class VideoCaptureHostTest; - virtual ~VideoCaptureHost(); + ~VideoCaptureHost() override; // IPC message: Start capture on the VideoCaptureDevice referenced by // |session_id|. |device_id| is an id created by VideoCaptureMessageFilter diff --git a/content/browser/renderer_host/media/video_capture_manager.h b/content/browser/renderer_host/media/video_capture_manager.h index 1914f97..a42fc53 100644 --- a/content/browser/renderer_host/media/video_capture_manager.h +++ b/content/browser/renderer_host/media/video_capture_manager.h @@ -45,17 +45,17 @@ class CONTENT_EXPORT VideoCaptureManager : public MediaStreamProvider { scoped_ptr<media::VideoCaptureDeviceFactory> factory); // Implements MediaStreamProvider. - virtual void Register(MediaStreamProviderListener* listener, - const scoped_refptr<base::SingleThreadTaskRunner>& - device_task_runner) override; + void Register(MediaStreamProviderListener* listener, + const scoped_refptr<base::SingleThreadTaskRunner>& + device_task_runner) override; - virtual void Unregister() override; + void Unregister() override; - virtual void EnumerateDevices(MediaStreamType stream_type) override; + void EnumerateDevices(MediaStreamType stream_type) override; - virtual int Open(const StreamDeviceInfo& device) override; + int Open(const StreamDeviceInfo& device) override; - virtual void Close(int capture_session_id) override; + void Close(int capture_session_id) override; // Called by VideoCaptureHost to locate a capture device for |capture_params|, // adding the Host as a client of the device's controller if successful. The @@ -132,7 +132,7 @@ class CONTENT_EXPORT VideoCaptureManager : public MediaStreamProvider { } private: - virtual ~VideoCaptureManager(); + ~VideoCaptureManager() override; struct DeviceEntry; // Checks to see if |entry| has no clients left on its controller. If so, diff --git a/content/browser/renderer_host/media/webrtc_identity_service_host.h b/content/browser/renderer_host/media/webrtc_identity_service_host.h index 2033e67..1cc1f6b 100644 --- a/content/browser/renderer_host/media/webrtc_identity_service_host.h +++ b/content/browser/renderer_host/media/webrtc_identity_service_host.h @@ -30,10 +30,10 @@ class CONTENT_EXPORT WebRTCIdentityServiceHost : public BrowserMessageFilter { scoped_refptr<WebRTCIdentityStore> identity_store); protected: - virtual ~WebRTCIdentityServiceHost(); + ~WebRTCIdentityServiceHost() override; // content::BrowserMessageFilter override. - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; private: // |sequence_number| is the same as in the OnRequestIdentity call. diff --git a/content/browser/renderer_host/media/webrtc_identity_service_host_unittest.cc b/content/browser/renderer_host/media/webrtc_identity_service_host_unittest.cc index b5fb68e..4a9c5d2 100644 --- a/content/browser/renderer_host/media/webrtc_identity_service_host_unittest.cc +++ b/content/browser/renderer_host/media/webrtc_identity_service_host_unittest.cc @@ -29,11 +29,10 @@ class MockWebRTCIdentityStore : public WebRTCIdentityStore { public: MockWebRTCIdentityStore() : WebRTCIdentityStore(base::FilePath(), NULL) {} - virtual base::Closure RequestIdentity( - const GURL& origin, - const std::string& identity_name, - const std::string& common_name, - const CompletionCallback& callback) override { + base::Closure RequestIdentity(const GURL& origin, + const std::string& identity_name, + const std::string& common_name, + const CompletionCallback& callback) override { EXPECT_TRUE(callback_.is_null()); callback_ = callback; @@ -51,7 +50,7 @@ class MockWebRTCIdentityStore : public WebRTCIdentityStore { } private: - virtual ~MockWebRTCIdentityStore() {} + ~MockWebRTCIdentityStore() override {} void OnCancel() { callback_.Reset(); } @@ -67,13 +66,13 @@ class WebRTCIdentityServiceHostForTest : public WebRTCIdentityServiceHost { policy->Add(FAKE_RENDERER_ID); } - virtual bool Send(IPC::Message* message) override { + bool Send(IPC::Message* message) override { messages_.push_back(*message); delete message; return true; } - virtual bool OnMessageReceived(const IPC::Message& message) override { + bool OnMessageReceived(const IPC::Message& message) override { return WebRTCIdentityServiceHost::OnMessageReceived(message); } @@ -84,7 +83,7 @@ class WebRTCIdentityServiceHostForTest : public WebRTCIdentityServiceHost { void ClearMessages() { messages_.clear(); } private: - virtual ~WebRTCIdentityServiceHostForTest() { + ~WebRTCIdentityServiceHostForTest() override { ChildProcessSecurityPolicyImpl* policy = ChildProcessSecurityPolicyImpl::GetInstance(); policy->Remove(FAKE_RENDERER_ID); diff --git a/content/browser/renderer_host/memory_benchmark_message_filter.h b/content/browser/renderer_host/memory_benchmark_message_filter.h index cd32ba4..d30e3a7 100644 --- a/content/browser/renderer_host/memory_benchmark_message_filter.h +++ b/content/browser/renderer_host/memory_benchmark_message_filter.h @@ -15,9 +15,10 @@ class MemoryBenchmarkMessageFilter : public BrowserMessageFilter { public: MemoryBenchmarkMessageFilter(); - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; + private: - virtual ~MemoryBenchmarkMessageFilter(); + ~MemoryBenchmarkMessageFilter() override; void OnHeapProfilerDump(const std::string& reason); diff --git a/content/browser/renderer_host/p2p/socket_dispatcher_host.h b/content/browser/renderer_host/p2p/socket_dispatcher_host.h index 692a927..18b18df 100644 --- a/content/browser/renderer_host/p2p/socket_dispatcher_host.h +++ b/content/browser/renderer_host/p2p/socket_dispatcher_host.h @@ -39,12 +39,12 @@ class P2PSocketDispatcherHost net::URLRequestContextGetter* url_context); // content::BrowserMessageFilter overrides. - virtual void OnChannelClosing() override; - virtual void OnDestruct() const override; - virtual bool OnMessageReceived(const IPC::Message& message) override; + void OnChannelClosing() override; + void OnDestruct() const override; + bool OnMessageReceived(const IPC::Message& message) override; // net::NetworkChangeNotifier::IPAddressObserver interface. - virtual void OnIPAddressChanged() override; + void OnIPAddressChanged() override; // Starts the RTP packet header dumping. Must be called on the IO thread. void StartRtpDump( @@ -56,7 +56,7 @@ class P2PSocketDispatcherHost void StopRtpDumpOnUIThread(bool incoming, bool outgoing); protected: - virtual ~P2PSocketDispatcherHost(); + ~P2PSocketDispatcherHost() override; private: friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>; diff --git a/content/browser/renderer_host/p2p/socket_host_tcp.h b/content/browser/renderer_host/p2p/socket_host_tcp.h index 24aeb97..e532ae7 100644 --- a/content/browser/renderer_host/p2p/socket_host_tcp.h +++ b/content/browser/renderer_host/p2p/socket_host_tcp.h @@ -32,21 +32,22 @@ class CONTENT_EXPORT P2PSocketHostTcpBase : public P2PSocketHost { int socket_id, P2PSocketType type, net::URLRequestContextGetter* url_context); - virtual ~P2PSocketHostTcpBase(); + ~P2PSocketHostTcpBase() override; bool InitAccepted(const net::IPEndPoint& remote_address, net::StreamSocket* socket); // P2PSocketHost overrides. - virtual bool Init(const net::IPEndPoint& local_address, - const P2PHostAndIPEndPoint& remote_address) override; - virtual void Send(const net::IPEndPoint& to, - const std::vector<char>& data, - const rtc::PacketOptions& options, - uint64 packet_id) override; - virtual P2PSocketHost* AcceptIncomingTcpConnection( - const net::IPEndPoint& remote_address, int id) override; - virtual bool SetOption(P2PSocketOption option, int value) override; + bool Init(const net::IPEndPoint& local_address, + const P2PHostAndIPEndPoint& remote_address) override; + void Send(const net::IPEndPoint& to, + const std::vector<char>& data, + const rtc::PacketOptions& options, + uint64 packet_id) override; + P2PSocketHost* AcceptIncomingTcpConnection( + const net::IPEndPoint& remote_address, + int id) override; + bool SetOption(P2PSocketOption option, int value) override; protected: // Derived classes will provide the implementation. @@ -104,13 +105,14 @@ class CONTENT_EXPORT P2PSocketHostTcp : public P2PSocketHostTcpBase { int socket_id, P2PSocketType type, net::URLRequestContextGetter* url_context); - virtual ~P2PSocketHostTcp(); + ~P2PSocketHostTcp() override; protected: - virtual int ProcessInput(char* input, int input_len) override; - virtual void DoSend(const net::IPEndPoint& to, - const std::vector<char>& data, - const rtc::PacketOptions& options) override; + int ProcessInput(char* input, int input_len) override; + void DoSend(const net::IPEndPoint& to, + const std::vector<char>& data, + const rtc::PacketOptions& options) override; + private: DISALLOW_COPY_AND_ASSIGN(P2PSocketHostTcp); }; @@ -126,13 +128,14 @@ class CONTENT_EXPORT P2PSocketHostStunTcp : public P2PSocketHostTcpBase { P2PSocketType type, net::URLRequestContextGetter* url_context); - virtual ~P2PSocketHostStunTcp(); + ~P2PSocketHostStunTcp() override; protected: - virtual int ProcessInput(char* input, int input_len) override; - virtual void DoSend(const net::IPEndPoint& to, - const std::vector<char>& data, - const rtc::PacketOptions& options) override; + int ProcessInput(char* input, int input_len) override; + void DoSend(const net::IPEndPoint& to, + const std::vector<char>& data, + const rtc::PacketOptions& options) override; + private: int GetExpectedPacketSize(const char* data, int len, int* pad_bytes); diff --git a/content/browser/renderer_host/p2p/socket_host_tcp_server.h b/content/browser/renderer_host/p2p/socket_host_tcp_server.h index f34cf38..df20532 100644 --- a/content/browser/renderer_host/p2p/socket_host_tcp_server.h +++ b/content/browser/renderer_host/p2p/socket_host_tcp_server.h @@ -31,19 +31,19 @@ class CONTENT_EXPORT P2PSocketHostTcpServer : public P2PSocketHost { P2PSocketHostTcpServer(IPC::Sender* message_sender, int socket_id, P2PSocketType client_type); - virtual ~P2PSocketHostTcpServer(); + ~P2PSocketHostTcpServer() override; // P2PSocketHost overrides. - virtual bool Init(const net::IPEndPoint& local_address, - const P2PHostAndIPEndPoint& remote_address) override; - virtual void Send(const net::IPEndPoint& to, - const std::vector<char>& data, - const rtc::PacketOptions& options, - uint64 packet_id) override; - virtual P2PSocketHost* AcceptIncomingTcpConnection( - const net::IPEndPoint& remote_address, int id) override; - virtual bool SetOption(P2PSocketOption option, int value) override; - + bool Init(const net::IPEndPoint& local_address, + const P2PHostAndIPEndPoint& remote_address) override; + void Send(const net::IPEndPoint& to, + const std::vector<char>& data, + const rtc::PacketOptions& options, + uint64 packet_id) override; + P2PSocketHost* AcceptIncomingTcpConnection( + const net::IPEndPoint& remote_address, + int id) override; + bool SetOption(P2PSocketOption option, int value) override; private: friend class P2PSocketHostTcpServerTest; diff --git a/content/browser/renderer_host/p2p/socket_host_tcp_server_unittest.cc b/content/browser/renderer_host/p2p/socket_host_tcp_server_unittest.cc index 6db5c16..bc8649a 100644 --- a/content/browser/renderer_host/p2p/socket_host_tcp_server_unittest.cc +++ b/content/browser/renderer_host/p2p/socket_host_tcp_server_unittest.cc @@ -26,7 +26,7 @@ class FakeServerSocket : public net::ServerSocket { accept_socket_(NULL) { } - virtual ~FakeServerSocket() {} + ~FakeServerSocket() override {} bool listening() { return listening_; } @@ -47,19 +47,19 @@ class FakeServerSocket : public net::ServerSocket { } } - virtual int Listen(const net::IPEndPoint& address, int backlog) override { + int Listen(const net::IPEndPoint& address, int backlog) override { local_address_ = address; listening_ = true; return net::OK; } - virtual int GetLocalAddress(net::IPEndPoint* address) const override { + int GetLocalAddress(net::IPEndPoint* address) const override { *address = local_address_; return net::OK; } - virtual int Accept(scoped_ptr<net::StreamSocket>* socket, - const net::CompletionCallback& callback) override { + int Accept(scoped_ptr<net::StreamSocket>* socket, + const net::CompletionCallback& callback) override { DCHECK(socket); if (!incoming_sockets_.empty()) { socket->reset(incoming_sockets_.front()); diff --git a/content/browser/renderer_host/p2p/socket_host_test_utils.h b/content/browser/renderer_host/p2p/socket_host_test_utils.h index 5ba645d..acab45f 100644 --- a/content/browser/renderer_host/p2p/socket_host_test_utils.h +++ b/content/browser/renderer_host/p2p/socket_host_test_utils.h @@ -31,7 +31,7 @@ class MockIPCSender : public IPC::Sender { class FakeSocket : public net::StreamSocket { public: FakeSocket(std::string* written_data); - virtual ~FakeSocket(); + ~FakeSocket() override; void set_async_write(bool async_write) { async_write_ = async_write; } void AppendInputData(const char* data, int data_size); @@ -41,26 +41,28 @@ class FakeSocket : public net::StreamSocket { void SetLocalAddress(const net::IPEndPoint& local_address); // net::Socket implementation. - virtual int Read(net::IOBuffer* buf, int buf_len, - const net::CompletionCallback& callback) override; - virtual int Write(net::IOBuffer* buf, int buf_len, - const net::CompletionCallback& callback) override; - virtual int SetReceiveBufferSize(int32 size) override; - virtual int SetSendBufferSize(int32 size) override; - virtual int Connect(const net::CompletionCallback& callback) override; - virtual void Disconnect() override; - virtual bool IsConnected() const override; - virtual bool IsConnectedAndIdle() const override; - virtual int GetPeerAddress(net::IPEndPoint* address) const override; - virtual int GetLocalAddress(net::IPEndPoint* address) const override; - virtual const net::BoundNetLog& NetLog() const override; - virtual void SetSubresourceSpeculation() override; - virtual void SetOmniboxSpeculation() override; - virtual bool WasEverUsed() const override; - virtual bool UsingTCPFastOpen() const override; - virtual bool WasNpnNegotiated() const override; - virtual net::NextProto GetNegotiatedProtocol() const override; - virtual bool GetSSLInfo(net::SSLInfo* ssl_info) override; + int Read(net::IOBuffer* buf, + int buf_len, + const net::CompletionCallback& callback) override; + int Write(net::IOBuffer* buf, + int buf_len, + const net::CompletionCallback& callback) override; + int SetReceiveBufferSize(int32 size) override; + int SetSendBufferSize(int32 size) override; + int Connect(const net::CompletionCallback& callback) override; + void Disconnect() override; + bool IsConnected() const override; + bool IsConnectedAndIdle() const override; + int GetPeerAddress(net::IPEndPoint* address) const override; + int GetLocalAddress(net::IPEndPoint* address) const override; + const net::BoundNetLog& NetLog() const override; + void SetSubresourceSpeculation() override; + void SetOmniboxSpeculation() override; + bool WasEverUsed() const override; + bool UsingTCPFastOpen() const override; + bool WasNpnNegotiated() const override; + net::NextProto GetNegotiatedProtocol() const override; + bool GetSSLInfo(net::SSLInfo* ssl_info) override; private: void DoAsyncWrite(scoped_refptr<net::IOBuffer> buf, int buf_len, diff --git a/content/browser/renderer_host/p2p/socket_host_udp.h b/content/browser/renderer_host/p2p/socket_host_udp.h index 263e972..6db6faa 100644 --- a/content/browser/renderer_host/p2p/socket_host_udp.h +++ b/content/browser/renderer_host/p2p/socket_host_udp.h @@ -29,18 +29,19 @@ class CONTENT_EXPORT P2PSocketHostUdp : public P2PSocketHost { P2PSocketHostUdp(IPC::Sender* message_sender, int socket_id, P2PMessageThrottler* throttler); - virtual ~P2PSocketHostUdp(); + ~P2PSocketHostUdp() override; // P2PSocketHost overrides. - virtual bool Init(const net::IPEndPoint& local_address, - const P2PHostAndIPEndPoint& remote_address) override; - virtual void Send(const net::IPEndPoint& to, - const std::vector<char>& data, - const rtc::PacketOptions& options, - uint64 packet_id) override; - virtual P2PSocketHost* AcceptIncomingTcpConnection( - const net::IPEndPoint& remote_address, int id) override; - virtual bool SetOption(P2PSocketOption option, int value) override; + bool Init(const net::IPEndPoint& local_address, + const P2PHostAndIPEndPoint& remote_address) override; + void Send(const net::IPEndPoint& to, + const std::vector<char>& data, + const rtc::PacketOptions& options, + uint64 packet_id) override; + P2PSocketHost* AcceptIncomingTcpConnection( + const net::IPEndPoint& remote_address, + int id) override; + bool SetOption(P2PSocketOption option, int value) override; private: friend class P2PSocketHostUdpTest; diff --git a/content/browser/renderer_host/p2p/socket_host_udp_unittest.cc b/content/browser/renderer_host/p2p/socket_host_udp_unittest.cc index 076c752..ae02349 100644 --- a/content/browser/renderer_host/p2p/socket_host_udp_unittest.cc +++ b/content/browser/renderer_host/p2p/socket_host_udp_unittest.cc @@ -29,7 +29,7 @@ namespace { class FakeTiming : public rtc::Timing { public: FakeTiming() : now_(0.0) {} - virtual double TimerNow() override { return now_; } + double TimerNow() override { return now_; } void set_now(double now) { now_ = now; } private: @@ -46,27 +46,27 @@ class FakeDatagramServerSocket : public net::DatagramServerSocket { : sent_packets_(sent_packets) { } - virtual void Close() override { - } + void Close() override {} - virtual int GetPeerAddress(net::IPEndPoint* address) const override { + int GetPeerAddress(net::IPEndPoint* address) const override { NOTREACHED(); return net::ERR_SOCKET_NOT_CONNECTED; } - virtual int GetLocalAddress(net::IPEndPoint* address) const override { + int GetLocalAddress(net::IPEndPoint* address) const override { *address = address_; return 0; } - virtual int Listen(const net::IPEndPoint& address) override { + int Listen(const net::IPEndPoint& address) override { address_ = address; return 0; } - virtual int RecvFrom(net::IOBuffer* buf, int buf_len, - net::IPEndPoint* address, - const net::CompletionCallback& callback) override { + int RecvFrom(net::IOBuffer* buf, + int buf_len, + net::IPEndPoint* address, + const net::CompletionCallback& callback) override { CHECK(recv_callback_.is_null()); if (incoming_packets_.size() > 0) { scoped_refptr<net::IOBuffer> buffer(buf); @@ -85,22 +85,19 @@ class FakeDatagramServerSocket : public net::DatagramServerSocket { } } - virtual int SendTo(net::IOBuffer* buf, int buf_len, - const net::IPEndPoint& address, - const net::CompletionCallback& callback) override { + int SendTo(net::IOBuffer* buf, + int buf_len, + const net::IPEndPoint& address, + const net::CompletionCallback& callback) override { scoped_refptr<net::IOBuffer> buffer(buf); std::vector<char> data_vector(buffer->data(), buffer->data() + buf_len); sent_packets_->push_back(UDPPacket(address, data_vector)); return buf_len; } - virtual int SetReceiveBufferSize(int32 size) override { - return net::OK; - } + int SetReceiveBufferSize(int32 size) override { return net::OK; } - virtual int SetSendBufferSize(int32 size) override { - return net::OK; - } + int SetSendBufferSize(int32 size) override { return net::OK; } void ReceivePacket(const net::IPEndPoint& address, std::vector<char> data) { if (!recv_callback_.is_null()) { @@ -116,53 +113,43 @@ class FakeDatagramServerSocket : public net::DatagramServerSocket { } } - virtual const net::BoundNetLog& NetLog() const override { - return net_log_; - } + const net::BoundNetLog& NetLog() const override { return net_log_; } - virtual void AllowAddressReuse() override { - NOTIMPLEMENTED(); - } + void AllowAddressReuse() override { NOTIMPLEMENTED(); } - virtual void AllowBroadcast() override { - NOTIMPLEMENTED(); - } + void AllowBroadcast() override { NOTIMPLEMENTED(); } - virtual int JoinGroup( - const net::IPAddressNumber& group_address) const override { + int JoinGroup(const net::IPAddressNumber& group_address) const override { NOTIMPLEMENTED(); return net::ERR_NOT_IMPLEMENTED; } - virtual int LeaveGroup( - const net::IPAddressNumber& group_address) const override { + int LeaveGroup(const net::IPAddressNumber& group_address) const override { NOTIMPLEMENTED(); return net::ERR_NOT_IMPLEMENTED; } - virtual int SetMulticastInterface(uint32 interface_index) override { + int SetMulticastInterface(uint32 interface_index) override { NOTIMPLEMENTED(); return net::ERR_NOT_IMPLEMENTED; } - virtual int SetMulticastTimeToLive(int time_to_live) override { + int SetMulticastTimeToLive(int time_to_live) override { NOTIMPLEMENTED(); return net::ERR_NOT_IMPLEMENTED; } - virtual int SetMulticastLoopbackMode(bool loopback) override { + int SetMulticastLoopbackMode(bool loopback) override { NOTIMPLEMENTED(); return net::ERR_NOT_IMPLEMENTED; } - virtual int SetDiffServCodePoint(net::DiffServCodePoint dscp) override { + int SetDiffServCodePoint(net::DiffServCodePoint dscp) override { NOTIMPLEMENTED(); return net::ERR_NOT_IMPLEMENTED; } - virtual void DetachFromThread() override { - NOTIMPLEMENTED(); - } + void DetachFromThread() override { NOTIMPLEMENTED(); } private: net::IPEndPoint address_; diff --git a/content/browser/renderer_host/pepper/browser_ppapi_host_impl.h b/content/browser/renderer_host/pepper/browser_ppapi_host_impl.h index 932fb09..bd0c61d 100644 --- a/content/browser/renderer_host/pepper/browser_ppapi_host_impl.h +++ b/content/browser/renderer_host/pepper/browser_ppapi_host_impl.h @@ -42,22 +42,21 @@ class CONTENT_EXPORT BrowserPpapiHostImpl : public BrowserPpapiHost { const base::FilePath& profile_data_directory, bool in_process, bool external_plugin); - virtual ~BrowserPpapiHostImpl(); + ~BrowserPpapiHostImpl() override; // BrowserPpapiHost. - virtual ppapi::host::PpapiHost* GetPpapiHost() override; - virtual base::ProcessHandle GetPluginProcessHandle() const override; - virtual bool IsValidInstance(PP_Instance instance) const override; - virtual bool GetRenderFrameIDsForInstance(PP_Instance instance, - int* render_process_id, - int* render_frame_id) const - override; - virtual const std::string& GetPluginName() override; - virtual const base::FilePath& GetPluginPath() override; - virtual const base::FilePath& GetProfileDataDirectory() override; - virtual GURL GetDocumentURLForInstance(PP_Instance instance) override; - virtual GURL GetPluginURLForInstance(PP_Instance instance) override; - virtual void SetOnKeepaliveCallback( + ppapi::host::PpapiHost* GetPpapiHost() override; + base::ProcessHandle GetPluginProcessHandle() const override; + bool IsValidInstance(PP_Instance instance) const override; + bool GetRenderFrameIDsForInstance(PP_Instance instance, + int* render_process_id, + int* render_frame_id) const override; + const std::string& GetPluginName() override; + const base::FilePath& GetPluginPath() override; + const base::FilePath& GetProfileDataDirectory() override; + GURL GetDocumentURLForInstance(PP_Instance instance) override; + GURL GetPluginURLForInstance(PP_Instance instance) override; + void SetOnKeepaliveCallback( const BrowserPpapiHost::OnKeepaliveCallback& callback) override; void set_plugin_process_handle(base::ProcessHandle handle) { @@ -93,12 +92,12 @@ class CONTENT_EXPORT BrowserPpapiHostImpl : public BrowserPpapiHost { BrowserPpapiHostImpl* browser_ppapi_host_impl); // IPC::MessageFilter. - virtual bool OnMessageReceived(const IPC::Message& msg) override; + bool OnMessageReceived(const IPC::Message& msg) override; void OnHostDestroyed(); private: - virtual ~HostMessageFilter(); + ~HostMessageFilter() override; void OnKeepalive(); void OnHostMsgLogInterfaceUsage(int hash) const; diff --git a/content/browser/renderer_host/pepper/content_browser_pepper_host_factory.h b/content/browser/renderer_host/pepper/content_browser_pepper_host_factory.h index 31a0a0e..84161f33 100644 --- a/content/browser/renderer_host/pepper/content_browser_pepper_host_factory.h +++ b/content/browser/renderer_host/pepper/content_browser_pepper_host_factory.h @@ -26,9 +26,9 @@ class ContentBrowserPepperHostFactory : public ppapi::host::HostFactory { // Non-owning pointer to the filter must outlive this class. explicit ContentBrowserPepperHostFactory(BrowserPpapiHostImpl* host); - virtual ~ContentBrowserPepperHostFactory(); + ~ContentBrowserPepperHostFactory() override; - virtual scoped_ptr<ppapi::host::ResourceHost> CreateResourceHost( + scoped_ptr<ppapi::host::ResourceHost> CreateResourceHost( ppapi::host::PpapiHost* host, const ppapi::proxy::ResourceMessageCallParams& params, PP_Instance instance, diff --git a/content/browser/renderer_host/pepper/pepper_browser_font_singleton_host.cc b/content/browser/renderer_host/pepper/pepper_browser_font_singleton_host.cc index 08f4180..e2c909c 100644 --- a/content/browser/renderer_host/pepper/pepper_browser_font_singleton_host.cc +++ b/content/browser/renderer_host/pepper/pepper_browser_font_singleton_host.cc @@ -23,14 +23,14 @@ class FontMessageFilter : public ppapi::host::ResourceMessageFilter { FontMessageFilter(); // ppapi::host::ResourceMessageFilter implementation. - virtual scoped_refptr<base::TaskRunner> OverrideTaskRunnerForMessage( + scoped_refptr<base::TaskRunner> OverrideTaskRunnerForMessage( const IPC::Message& msg) override; - virtual int32_t OnResourceMessageReceived( + int32_t OnResourceMessageReceived( const IPC::Message& msg, ppapi::host::HostMessageContext* context) override; private: - virtual ~FontMessageFilter(); + ~FontMessageFilter() override; // Message handler. int32_t OnHostMsgGetFontFamilies(ppapi::host::HostMessageContext* context); diff --git a/content/browser/renderer_host/pepper/pepper_browser_font_singleton_host.h b/content/browser/renderer_host/pepper/pepper_browser_font_singleton_host.h index c002e63..643be70 100644 --- a/content/browser/renderer_host/pepper/pepper_browser_font_singleton_host.h +++ b/content/browser/renderer_host/pepper/pepper_browser_font_singleton_host.h @@ -17,7 +17,7 @@ class PepperBrowserFontSingletonHost : public ppapi::host::ResourceHost { PepperBrowserFontSingletonHost(BrowserPpapiHost* host, PP_Instance instance, PP_Resource resource); - virtual ~PepperBrowserFontSingletonHost(); + ~PepperBrowserFontSingletonHost() override; private: DISALLOW_COPY_AND_ASSIGN(PepperBrowserFontSingletonHost); diff --git a/content/browser/renderer_host/pepper/pepper_external_file_ref_backend.h b/content/browser/renderer_host/pepper/pepper_external_file_ref_backend.h index 693349e..f3c3c94 100644 --- a/content/browser/renderer_host/pepper/pepper_external_file_ref_backend.h +++ b/content/browser/renderer_host/pepper/pepper_external_file_ref_backend.h @@ -25,29 +25,28 @@ class PepperExternalFileRefBackend : public PepperFileRefBackend { PepperExternalFileRefBackend(ppapi::host::PpapiHost* host, int render_process_id, const base::FilePath& path); - virtual ~PepperExternalFileRefBackend(); + ~PepperExternalFileRefBackend() override; // PepperFileRefBackend overrides. - virtual int32_t MakeDirectory(ppapi::host::ReplyMessageContext context, - int32_t make_directory_flags) override; - virtual int32_t Touch(ppapi::host::ReplyMessageContext context, - PP_Time last_accessed_time, - PP_Time last_modified_time) override; - virtual int32_t Delete(ppapi::host::ReplyMessageContext context) override; - virtual int32_t Rename(ppapi::host::ReplyMessageContext context, - PepperFileRefHost* new_file_ref) override; - virtual int32_t Query(ppapi::host::ReplyMessageContext context) override; - virtual int32_t ReadDirectoryEntries(ppapi::host::ReplyMessageContext context) - override; - virtual int32_t GetAbsolutePath(ppapi::host::ReplyMessageContext context) - override; - virtual storage::FileSystemURL GetFileSystemURL() const override; - virtual base::FilePath GetExternalFilePath() const override; + int32_t MakeDirectory(ppapi::host::ReplyMessageContext context, + int32_t make_directory_flags) override; + int32_t Touch(ppapi::host::ReplyMessageContext context, + PP_Time last_accessed_time, + PP_Time last_modified_time) override; + int32_t Delete(ppapi::host::ReplyMessageContext context) override; + int32_t Rename(ppapi::host::ReplyMessageContext context, + PepperFileRefHost* new_file_ref) override; + int32_t Query(ppapi::host::ReplyMessageContext context) override; + int32_t ReadDirectoryEntries( + ppapi::host::ReplyMessageContext context) override; + int32_t GetAbsolutePath(ppapi::host::ReplyMessageContext context) override; + storage::FileSystemURL GetFileSystemURL() const override; + base::FilePath GetExternalFilePath() const override; - virtual int32_t CanRead() const override; - virtual int32_t CanWrite() const override; - virtual int32_t CanCreate() const override; - virtual int32_t CanReadWrite() const override; + int32_t CanRead() const override; + int32_t CanWrite() const override; + int32_t CanCreate() const override; + int32_t CanReadWrite() const override; private: // Generic reply callback. diff --git a/content/browser/renderer_host/pepper/pepper_file_io_host.h b/content/browser/renderer_host/pepper/pepper_file_io_host.h index 4930535..36f7dba 100644 --- a/content/browser/renderer_host/pepper/pepper_file_io_host.h +++ b/content/browser/renderer_host/pepper/pepper_file_io_host.h @@ -38,10 +38,10 @@ class PepperFileIOHost : public ppapi::host::ResourceHost, PepperFileIOHost(BrowserPpapiHostImpl* host, PP_Instance instance, PP_Resource resource); - virtual ~PepperFileIOHost(); + ~PepperFileIOHost() override; // ppapi::host::ResourceHost override. - virtual int32_t OnResourceMessageReceived( + int32_t OnResourceMessageReceived( const IPC::Message& msg, ppapi::host::HostMessageContext* context) override; diff --git a/content/browser/renderer_host/pepper/pepper_file_ref_host.h b/content/browser/renderer_host/pepper/pepper_file_ref_host.h index 60e814b..5f6d11e 100644 --- a/content/browser/renderer_host/pepper/pepper_file_ref_host.h +++ b/content/browser/renderer_host/pepper/pepper_file_ref_host.h @@ -65,13 +65,13 @@ class CONTENT_EXPORT PepperFileRefHost PP_Resource resource, const base::FilePath& external_path); - virtual ~PepperFileRefHost(); + ~PepperFileRefHost() override; // ResourceHost overrides. - virtual int32_t OnResourceMessageReceived( + int32_t OnResourceMessageReceived( const IPC::Message& msg, ppapi::host::HostMessageContext* context) override; - virtual bool IsFileRefHost() override; + bool IsFileRefHost() override; // Required to support Rename(). PP_FileSystemType GetFileSystemType() const; diff --git a/content/browser/renderer_host/pepper/pepper_file_system_browser_host.h b/content/browser/renderer_host/pepper/pepper_file_system_browser_host.h index 7a63699..669adde 100644 --- a/content/browser/renderer_host/pepper/pepper_file_system_browser_host.h +++ b/content/browser/renderer_host/pepper/pepper_file_system_browser_host.h @@ -37,7 +37,7 @@ class CONTENT_EXPORT PepperFileSystemBrowserHost PP_Instance instance, PP_Resource resource, PP_FileSystemType type); - virtual ~PepperFileSystemBrowserHost(); + ~PepperFileSystemBrowserHost() override; // Opens the PepperFileSystemBrowserHost to use an existing file system at the // given |root_url|. The file system at |root_url| must already be opened and @@ -46,10 +46,10 @@ class CONTENT_EXPORT PepperFileSystemBrowserHost void OpenExisting(const GURL& root_url, const base::Closure& callback); // ppapi::host::ResourceHost overrides. - virtual int32_t OnResourceMessageReceived( + int32_t OnResourceMessageReceived( const IPC::Message& msg, ppapi::host::HostMessageContext* context) override; - virtual bool IsFileSystemHost() override; + bool IsFileSystemHost() override; // Supports FileRefs direct access on the host side. PP_FileSystemType GetType() const { return type_; } diff --git a/content/browser/renderer_host/pepper/pepper_flash_file_message_filter.h b/content/browser/renderer_host/pepper/pepper_flash_file_message_filter.h index 923a508..301f97e 100644 --- a/content/browser/renderer_host/pepper/pepper_flash_file_message_filter.h +++ b/content/browser/renderer_host/pepper/pepper_flash_file_message_filter.h @@ -43,12 +43,12 @@ class PepperFlashFileMessageFilter : public ppapi::host::ResourceMessageFilter { typedef base::Callback<bool(int, const base::FilePath&)> CheckPermissionsCallback; - virtual ~PepperFlashFileMessageFilter(); + ~PepperFlashFileMessageFilter() override; // ppapi::host::ResourceMessageFilter overrides. - virtual scoped_refptr<base::TaskRunner> OverrideTaskRunnerForMessage( + scoped_refptr<base::TaskRunner> OverrideTaskRunnerForMessage( const IPC::Message& msg) override; - virtual int32_t OnResourceMessageReceived( + int32_t OnResourceMessageReceived( const IPC::Message& msg, ppapi::host::HostMessageContext* context) override; diff --git a/content/browser/renderer_host/pepper/pepper_gamepad_host.h b/content/browser/renderer_host/pepper/pepper_gamepad_host.h index a64692c..8d6ee73 100644 --- a/content/browser/renderer_host/pepper/pepper_gamepad_host.h +++ b/content/browser/renderer_host/pepper/pepper_gamepad_host.h @@ -37,19 +37,17 @@ class CONTENT_EXPORT PepperGamepadHost : PP_Instance instance, PP_Resource resource); - virtual ~PepperGamepadHost(); + ~PepperGamepadHost() override; - virtual int32_t OnResourceMessageReceived( + int32_t OnResourceMessageReceived( const IPC::Message& msg, ppapi::host::HostMessageContext* context) override; // GamepadConsumer implementation. - virtual void OnGamepadConnected( - unsigned index, - const blink::WebGamepad& gamepad) override {} - virtual void OnGamepadDisconnected( - unsigned index, - const blink::WebGamepad& gamepad) override {} + void OnGamepadConnected(unsigned index, + const blink::WebGamepad& gamepad) override {} + void OnGamepadDisconnected(unsigned index, + const blink::WebGamepad& gamepad) override {} private: int32_t OnRequestMemory(ppapi::host::HostMessageContext* context); diff --git a/content/browser/renderer_host/pepper/pepper_host_resolver_message_filter.h b/content/browser/renderer_host/pepper/pepper_host_resolver_message_filter.h index 45675c1..a532184 100644 --- a/content/browser/renderer_host/pepper/pepper_host_resolver_message_filter.h +++ b/content/browser/renderer_host/pepper/pepper_host_resolver_message_filter.h @@ -43,15 +43,15 @@ class CONTENT_EXPORT PepperHostResolverMessageFilter bool private_api); protected: - virtual ~PepperHostResolverMessageFilter(); + ~PepperHostResolverMessageFilter() override; private: typedef std::vector<PP_NetAddress_Private> NetAddressList; // ppapi::host::ResourceMessageFilter overrides. - virtual scoped_refptr<base::TaskRunner> OverrideTaskRunnerForMessage( + scoped_refptr<base::TaskRunner> OverrideTaskRunnerForMessage( const IPC::Message& message) override; - virtual int32_t OnResourceMessageReceived( + int32_t OnResourceMessageReceived( const IPC::Message& msg, ppapi::host::HostMessageContext* context) override; diff --git a/content/browser/renderer_host/pepper/pepper_internal_file_ref_backend.h b/content/browser/renderer_host/pepper/pepper_internal_file_ref_backend.h index 8bd1053..e210763 100644 --- a/content/browser/renderer_host/pepper/pepper_internal_file_ref_backend.h +++ b/content/browser/renderer_host/pepper/pepper_internal_file_ref_backend.h @@ -28,29 +28,28 @@ class PepperInternalFileRefBackend : public PepperFileRefBackend { int render_process_id, base::WeakPtr<PepperFileSystemBrowserHost> fs_host, const std::string& path); - virtual ~PepperInternalFileRefBackend(); + ~PepperInternalFileRefBackend() override; // PepperFileRefBackend overrides. - virtual int32_t MakeDirectory(ppapi::host::ReplyMessageContext context, - int32_t make_directory_flags) override; - virtual int32_t Touch(ppapi::host::ReplyMessageContext context, - PP_Time last_accessed_time, - PP_Time last_modified_time) override; - virtual int32_t Delete(ppapi::host::ReplyMessageContext context) override; - virtual int32_t Rename(ppapi::host::ReplyMessageContext context, - PepperFileRefHost* new_file_ref) override; - virtual int32_t Query(ppapi::host::ReplyMessageContext context) override; - virtual int32_t ReadDirectoryEntries(ppapi::host::ReplyMessageContext context) - override; - virtual int32_t GetAbsolutePath(ppapi::host::ReplyMessageContext context) - override; - virtual storage::FileSystemURL GetFileSystemURL() const override; - virtual base::FilePath GetExternalFilePath() const override; - - virtual int32_t CanRead() const override; - virtual int32_t CanWrite() const override; - virtual int32_t CanCreate() const override; - virtual int32_t CanReadWrite() const override; + int32_t MakeDirectory(ppapi::host::ReplyMessageContext context, + int32_t make_directory_flags) override; + int32_t Touch(ppapi::host::ReplyMessageContext context, + PP_Time last_accessed_time, + PP_Time last_modified_time) override; + int32_t Delete(ppapi::host::ReplyMessageContext context) override; + int32_t Rename(ppapi::host::ReplyMessageContext context, + PepperFileRefHost* new_file_ref) override; + int32_t Query(ppapi::host::ReplyMessageContext context) override; + int32_t ReadDirectoryEntries( + ppapi::host::ReplyMessageContext context) override; + int32_t GetAbsolutePath(ppapi::host::ReplyMessageContext context) override; + storage::FileSystemURL GetFileSystemURL() const override; + base::FilePath GetExternalFilePath() const override; + + int32_t CanRead() const override; + int32_t CanWrite() const override; + int32_t CanCreate() const override; + int32_t CanReadWrite() const override; private: // Generic reply callback. diff --git a/content/browser/renderer_host/pepper/pepper_message_filter.h b/content/browser/renderer_host/pepper/pepper_message_filter.h index 1767cf8..02a89ad 100644 --- a/content/browser/renderer_host/pepper/pepper_message_filter.h +++ b/content/browser/renderer_host/pepper/pepper_message_filter.h @@ -24,10 +24,10 @@ class PepperMessageFilter : public BrowserMessageFilter { PepperMessageFilter(); // BrowserMessageFilter methods. - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; protected: - virtual ~PepperMessageFilter(); + ~PepperMessageFilter() override; private: void OnX509CertificateParseDER(const std::vector<char>& der, diff --git a/content/browser/renderer_host/pepper/pepper_network_monitor_host.h b/content/browser/renderer_host/pepper/pepper_network_monitor_host.h index 13886ba..7197421 100644 --- a/content/browser/renderer_host/pepper/pepper_network_monitor_host.h +++ b/content/browser/renderer_host/pepper/pepper_network_monitor_host.h @@ -26,10 +26,10 @@ class CONTENT_EXPORT PepperNetworkMonitorHost PP_Instance instance, PP_Resource resource); - virtual ~PepperNetworkMonitorHost(); + ~PepperNetworkMonitorHost() override; // net::NetworkChangeNotifier::IPAddressObserver interface. - virtual void OnIPAddressChanged() override; + void OnIPAddressChanged() override; private: void OnPermissionCheckResult(bool can_use_network_monitor); diff --git a/content/browser/renderer_host/pepper/pepper_network_proxy_host.h b/content/browser/renderer_host/pepper/pepper_network_proxy_host.h index 3b8aec83..eddbc89 100644 --- a/content/browser/renderer_host/pepper/pepper_network_proxy_host.h +++ b/content/browser/renderer_host/pepper/pepper_network_proxy_host.h @@ -37,7 +37,7 @@ class CONTENT_EXPORT PepperNetworkProxyHost : public ppapi::host::ResourceHost { PP_Instance instance, PP_Resource resource); - virtual ~PepperNetworkProxyHost(); + ~PepperNetworkProxyHost() override; private: // We retrieve the appropriate URLRequestContextGetter and whether this API @@ -55,7 +55,7 @@ class CONTENT_EXPORT PepperNetworkProxyHost : public ppapi::host::ResourceHost { void DidGetUIThreadData(const UIThreadData&); // ResourceHost implementation. - virtual int32_t OnResourceMessageReceived( + int32_t OnResourceMessageReceived( const IPC::Message& msg, ppapi::host::HostMessageContext* context) override; diff --git a/content/browser/renderer_host/pepper/pepper_print_settings_manager.cc b/content/browser/renderer_host/pepper/pepper_print_settings_manager.cc index db9c5d2..aa9c4dd 100644 --- a/content/browser/renderer_host/pepper/pepper_print_settings_manager.cc +++ b/content/browser/renderer_host/pepper/pepper_print_settings_manager.cc @@ -47,8 +47,8 @@ PP_Rect PrintAreaToPPPrintArea(const gfx::Rect& print_area, class PrintingContextDelegate : public printing::PrintingContext::Delegate { public: // PrintingContext::Delegate methods. - virtual gfx::NativeView GetParentView() override { return NULL; } - virtual std::string GetAppLocale() override { + gfx::NativeView GetParentView() override { return NULL; } + std::string GetAppLocale() override { return GetContentClient()->browser()->GetApplicationLocale(); } }; diff --git a/content/browser/renderer_host/pepper/pepper_print_settings_manager.h b/content/browser/renderer_host/pepper/pepper_print_settings_manager.h index 2ff5465..9199e72 100644 --- a/content/browser/renderer_host/pepper/pepper_print_settings_manager.h +++ b/content/browser/renderer_host/pepper/pepper_print_settings_manager.h @@ -32,10 +32,10 @@ class CONTENT_EXPORT PepperPrintSettingsManagerImpl : public PepperPrintSettingsManager { public: PepperPrintSettingsManagerImpl() {} - virtual ~PepperPrintSettingsManagerImpl() {} + ~PepperPrintSettingsManagerImpl() override {} // PepperPrintSettingsManager implementation. - virtual void GetDefaultPrintSettings( + void GetDefaultPrintSettings( PepperPrintSettingsManager::Callback callback) override; private: diff --git a/content/browser/renderer_host/pepper/pepper_printing_host.h b/content/browser/renderer_host/pepper/pepper_printing_host.h index 327a3b8..fb2536d 100644 --- a/content/browser/renderer_host/pepper/pepper_printing_host.h +++ b/content/browser/renderer_host/pepper/pepper_printing_host.h @@ -22,10 +22,10 @@ class CONTENT_EXPORT PepperPrintingHost : public ppapi::host::ResourceHost { PP_Instance instance, PP_Resource resource, scoped_ptr<PepperPrintSettingsManager> print_settings_manager); - virtual ~PepperPrintingHost(); + ~PepperPrintingHost() override; // ppapi::host::ResourceHost implementation. - virtual int32_t OnResourceMessageReceived( + int32_t OnResourceMessageReceived( const IPC::Message& msg, ppapi::host::HostMessageContext* context) override; diff --git a/content/browser/renderer_host/pepper/pepper_printing_host_unittest.cc b/content/browser/renderer_host/pepper/pepper_printing_host_unittest.cc index c2a9633..1dddfbb 100644 --- a/content/browser/renderer_host/pepper/pepper_printing_host_unittest.cc +++ b/content/browser/renderer_host/pepper/pepper_printing_host_unittest.cc @@ -21,10 +21,10 @@ namespace { class MockPepperPrintSettingsManager : public PepperPrintSettingsManager { public: MockPepperPrintSettingsManager(const PP_PrintSettings_Dev& settings); - virtual ~MockPepperPrintSettingsManager() {} + ~MockPepperPrintSettingsManager() override {} // PepperPrintSettingsManager implementation. - virtual void GetDefaultPrintSettings( + void GetDefaultPrintSettings( PepperPrintSettingsManager::Callback callback) override; private: diff --git a/content/browser/renderer_host/pepper/pepper_renderer_connection.h b/content/browser/renderer_host/pepper/pepper_renderer_connection.h index 14fc112..109da1f 100644 --- a/content/browser/renderer_host/pepper/pepper_renderer_connection.h +++ b/content/browser/renderer_host/pepper/pepper_renderer_connection.h @@ -36,10 +36,10 @@ class PepperRendererConnection : public BrowserMessageFilter { explicit PepperRendererConnection(int render_process_id); // BrowserMessageFilter overrides. - virtual bool OnMessageReceived(const IPC::Message& msg) override; + bool OnMessageReceived(const IPC::Message& msg) override; private: - virtual ~PepperRendererConnection(); + ~PepperRendererConnection() override; // Returns the host for the child process for the given |child_process_id|. // If |child_process_id| is 0, returns the host owned by this diff --git a/content/browser/renderer_host/pepper/pepper_tcp_server_socket_message_filter.h b/content/browser/renderer_host/pepper/pepper_tcp_server_socket_message_filter.h index 23d449c..b1bc22f 100644 --- a/content/browser/renderer_host/pepper/pepper_tcp_server_socket_message_filter.h +++ b/content/browser/renderer_host/pepper/pepper_tcp_server_socket_message_filter.h @@ -41,7 +41,7 @@ class CONTENT_EXPORT PepperTCPServerSocketMessageFilter static size_t GetNumInstances(); protected: - virtual ~PepperTCPServerSocketMessageFilter(); + ~PepperTCPServerSocketMessageFilter() override; private: enum State { @@ -53,9 +53,9 @@ class CONTENT_EXPORT PepperTCPServerSocketMessageFilter }; // ppapi::host::ResourceMessageFilter overrides. - virtual scoped_refptr<base::TaskRunner> OverrideTaskRunnerForMessage( + scoped_refptr<base::TaskRunner> OverrideTaskRunnerForMessage( const IPC::Message& message) override; - virtual int32_t OnResourceMessageReceived( + int32_t OnResourceMessageReceived( const IPC::Message& msg, ppapi::host::HostMessageContext* context) override; diff --git a/content/browser/renderer_host/pepper/pepper_tcp_socket_message_filter.h b/content/browser/renderer_host/pepper/pepper_tcp_socket_message_filter.h index 0e4d5cb..7c9250f 100644 --- a/content/browser/renderer_host/pepper/pepper_tcp_socket_message_filter.h +++ b/content/browser/renderer_host/pepper/pepper_tcp_socket_message_filter.h @@ -63,12 +63,12 @@ class CONTENT_EXPORT PepperTCPSocketMessageFilter static size_t GetNumInstances(); private: - virtual ~PepperTCPSocketMessageFilter(); + ~PepperTCPSocketMessageFilter() override; // ppapi::host::ResourceMessageFilter overrides. - virtual scoped_refptr<base::TaskRunner> OverrideTaskRunnerForMessage( + scoped_refptr<base::TaskRunner> OverrideTaskRunnerForMessage( const IPC::Message& message) override; - virtual int32_t OnResourceMessageReceived( + int32_t OnResourceMessageReceived( const IPC::Message& msg, ppapi::host::HostMessageContext* context) override; diff --git a/content/browser/renderer_host/pepper/pepper_truetype_font_host.h b/content/browser/renderer_host/pepper/pepper_truetype_font_host.h index 25ef72d..b449547 100644 --- a/content/browser/renderer_host/pepper/pepper_truetype_font_host.h +++ b/content/browser/renderer_host/pepper/pepper_truetype_font_host.h @@ -28,9 +28,9 @@ class CONTENT_EXPORT PepperTrueTypeFontHost : public ppapi::host::ResourceHost { PP_Resource resource, const ppapi::proxy::SerializedTrueTypeFontDesc& desc); - virtual ~PepperTrueTypeFontHost(); + ~PepperTrueTypeFontHost() override; - virtual int32_t OnResourceMessageReceived( + int32_t OnResourceMessageReceived( const IPC::Message& msg, ppapi::host::HostMessageContext* context) override; diff --git a/content/browser/renderer_host/pepper/pepper_truetype_font_list_host.cc b/content/browser/renderer_host/pepper/pepper_truetype_font_list_host.cc index 177ff12..3730724 100644 --- a/content/browser/renderer_host/pepper/pepper_truetype_font_list_host.cc +++ b/content/browser/renderer_host/pepper/pepper_truetype_font_list_host.cc @@ -27,14 +27,14 @@ class FontMessageFilter : public ppapi::host::ResourceMessageFilter { FontMessageFilter(); // ppapi::host::ResourceMessageFilter implementation. - virtual scoped_refptr<base::TaskRunner> OverrideTaskRunnerForMessage( + scoped_refptr<base::TaskRunner> OverrideTaskRunnerForMessage( const IPC::Message& msg) override; - virtual int32_t OnResourceMessageReceived( + int32_t OnResourceMessageReceived( const IPC::Message& msg, ppapi::host::HostMessageContext* context) override; private: - virtual ~FontMessageFilter(); + ~FontMessageFilter() override; // Message handlers. int32_t OnHostMsgGetFontFamilies(ppapi::host::HostMessageContext* context); diff --git a/content/browser/renderer_host/pepper/pepper_truetype_font_list_host.h b/content/browser/renderer_host/pepper/pepper_truetype_font_list_host.h index 69a471b..19999ca 100644 --- a/content/browser/renderer_host/pepper/pepper_truetype_font_list_host.h +++ b/content/browser/renderer_host/pepper/pepper_truetype_font_list_host.h @@ -17,7 +17,7 @@ class PepperTrueTypeFontListHost : public ppapi::host::ResourceHost { PepperTrueTypeFontListHost(BrowserPpapiHost* host, PP_Instance instance, PP_Resource resource); - virtual ~PepperTrueTypeFontListHost(); + ~PepperTrueTypeFontListHost() override; private: DISALLOW_COPY_AND_ASSIGN(PepperTrueTypeFontListHost); diff --git a/content/browser/renderer_host/pepper/pepper_truetype_font_mac.mm b/content/browser/renderer_host/pepper/pepper_truetype_font_mac.mm index fb4bc45..1e52e17 100644 --- a/content/browser/renderer_host/pepper/pepper_truetype_font_mac.mm +++ b/content/browser/renderer_host/pepper/pepper_truetype_font_mac.mm @@ -98,16 +98,15 @@ class PepperTrueTypeFontMac : public PepperTrueTypeFont { PepperTrueTypeFontMac(); // PepperTrueTypeFont implementation. - virtual int32_t Initialize( - ppapi::proxy::SerializedTrueTypeFontDesc* desc) override; - virtual int32_t GetTableTags(std::vector<uint32_t>* tags) override; - virtual int32_t GetTable(uint32_t table_tag, - int32_t offset, - int32_t max_data_length, - std::string* data) override; + int32_t Initialize(ppapi::proxy::SerializedTrueTypeFontDesc* desc) override; + int32_t GetTableTags(std::vector<uint32_t>* tags) override; + int32_t GetTable(uint32_t table_tag, + int32_t offset, + int32_t max_data_length, + std::string* data) override; private: - virtual ~PepperTrueTypeFontMac() override; + ~PepperTrueTypeFontMac() override; virtual int32_t GetEntireFont(int32_t offset, int32_t max_data_length, diff --git a/content/browser/renderer_host/pepper/pepper_udp_socket_message_filter.h b/content/browser/renderer_host/pepper/pepper_udp_socket_message_filter.h index 1a1dccb..1aa2c36ca 100644 --- a/content/browser/renderer_host/pepper/pepper_udp_socket_message_filter.h +++ b/content/browser/renderer_host/pepper/pepper_udp_socket_message_filter.h @@ -53,13 +53,13 @@ class CONTENT_EXPORT PepperUDPSocketMessageFilter static size_t GetNumInstances(); protected: - virtual ~PepperUDPSocketMessageFilter(); + ~PepperUDPSocketMessageFilter() override; private: // ppapi::host::ResourceMessageFilter overrides. - virtual scoped_refptr<base::TaskRunner> OverrideTaskRunnerForMessage( + scoped_refptr<base::TaskRunner> OverrideTaskRunnerForMessage( const IPC::Message& message) override; - virtual int32_t OnResourceMessageReceived( + int32_t OnResourceMessageReceived( const IPC::Message& msg, ppapi::host::HostMessageContext* context) override; diff --git a/content/browser/renderer_host/pepper/quota_reservation_unittest.cc b/content/browser/renderer_host/pepper/quota_reservation_unittest.cc index ed9d249..7c75c32 100644 --- a/content/browser/renderer_host/pepper/quota_reservation_unittest.cc +++ b/content/browser/renderer_host/pepper/quota_reservation_unittest.cc @@ -33,9 +33,9 @@ const int kFile3ID = 3; class FakeBackend : public QuotaReservationManager::QuotaBackend { public: FakeBackend() {} - virtual ~FakeBackend() {} + ~FakeBackend() override {} - virtual void ReserveQuota( + void ReserveQuota( const GURL& origin, storage::FileSystemType type, int64 delta, @@ -45,18 +45,18 @@ class FakeBackend : public QuotaReservationManager::QuotaBackend { base::Bind(base::IgnoreResult(callback), base::File::FILE_OK, delta)); } - virtual void ReleaseReservedQuota(const GURL& origin, - storage::FileSystemType type, - int64 size) override {} + void ReleaseReservedQuota(const GURL& origin, + storage::FileSystemType type, + int64 size) override {} - virtual void CommitQuotaUsage(const GURL& origin, - storage::FileSystemType type, - int64 delta) override {} + void CommitQuotaUsage(const GURL& origin, + storage::FileSystemType type, + int64 delta) override {} - virtual void IncrementDirtyCount(const GURL& origin, - storage::FileSystemType type) override {} - virtual void DecrementDirtyCount(const GURL& origin, - storage::FileSystemType type) override {} + void IncrementDirtyCount(const GURL& origin, + storage::FileSystemType type) override {} + void DecrementDirtyCount(const GURL& origin, + storage::FileSystemType type) override {} private: DISALLOW_COPY_AND_ASSIGN(FakeBackend); diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc index 4146c91..4d221b6 100644 --- a/content/browser/renderer_host/render_message_filter.cc +++ b/content/browser/renderer_host/render_message_filter.cc @@ -160,27 +160,23 @@ class OpenChannelToPpapiPluginCallback context_(context) { } - virtual void GetPpapiChannelInfo(base::ProcessHandle* renderer_handle, - int* renderer_id) override { + void GetPpapiChannelInfo(base::ProcessHandle* renderer_handle, + int* renderer_id) override { *renderer_handle = filter()->PeerHandle(); *renderer_id = filter()->render_process_id(); } - virtual void OnPpapiChannelOpened(const IPC::ChannelHandle& channel_handle, - base::ProcessId plugin_pid, - int plugin_child_id) override { + void OnPpapiChannelOpened(const IPC::ChannelHandle& channel_handle, + base::ProcessId plugin_pid, + int plugin_child_id) override { ViewHostMsg_OpenChannelToPepperPlugin::WriteReplyParams( reply_msg(), channel_handle, plugin_pid, plugin_child_id); SendReplyAndDeleteThis(); } - virtual bool OffTheRecord() override { - return filter()->OffTheRecord(); - } + bool OffTheRecord() override { return filter()->OffTheRecord(); } - virtual ResourceContext* GetResourceContext() override { - return context_; - } + ResourceContext* GetResourceContext() override { return context_; } private: ResourceContext* context_; @@ -195,26 +191,24 @@ class OpenChannelToPpapiBrokerCallback routing_id_(routing_id) { } - virtual ~OpenChannelToPpapiBrokerCallback() {} + ~OpenChannelToPpapiBrokerCallback() override {} - virtual void GetPpapiChannelInfo(base::ProcessHandle* renderer_handle, - int* renderer_id) override { + void GetPpapiChannelInfo(base::ProcessHandle* renderer_handle, + int* renderer_id) override { *renderer_handle = filter_->PeerHandle(); *renderer_id = filter_->render_process_id(); } - virtual void OnPpapiChannelOpened(const IPC::ChannelHandle& channel_handle, - base::ProcessId plugin_pid, - int /* plugin_child_id */) override { + void OnPpapiChannelOpened(const IPC::ChannelHandle& channel_handle, + base::ProcessId plugin_pid, + int /* plugin_child_id */) override { filter_->Send(new ViewMsg_PpapiBrokerChannelCreated(routing_id_, plugin_pid, channel_handle)); delete this; } - virtual bool OffTheRecord() override { - return filter_->OffTheRecord(); - } + bool OffTheRecord() override { return filter_->OffTheRecord(); } private: scoped_refptr<RenderMessageFilter> filter_; @@ -237,15 +231,11 @@ class RenderMessageFilter::OpenChannelToNpapiPluginCallback sent_plugin_channel_request_(false) { } - virtual int ID() override { - return filter()->render_process_id(); - } + int ID() override { return filter()->render_process_id(); } - virtual ResourceContext* GetResourceContext() override { - return context_; - } + ResourceContext* GetResourceContext() override { return context_; } - virtual bool OffTheRecord() override { + bool OffTheRecord() override { if (filter()->OffTheRecord()) return true; if (GetContentClient()->browser()->AllowSaveLocalState(context_)) @@ -259,26 +249,22 @@ class RenderMessageFilter::OpenChannelToNpapiPluginCallback return false; } - virtual void SetPluginInfo(const WebPluginInfo& info) override { - info_ = info; - } + void SetPluginInfo(const WebPluginInfo& info) override { info_ = info; } - virtual void OnFoundPluginProcessHost(PluginProcessHost* host) override { + void OnFoundPluginProcessHost(PluginProcessHost* host) override { DCHECK(host); host_ = host; } - virtual void OnSentPluginChannelRequest() override { + void OnSentPluginChannelRequest() override { sent_plugin_channel_request_ = true; } - virtual void OnChannelOpened(const IPC::ChannelHandle& handle) override { + void OnChannelOpened(const IPC::ChannelHandle& handle) override { WriteReplyAndDeleteThis(handle); } - virtual void OnError() override { - WriteReplyAndDeleteThis(IPC::ChannelHandle()); - } + void OnError() override { WriteReplyAndDeleteThis(IPC::ChannelHandle()); } PluginProcessHost* host() const { return host_; diff --git a/content/browser/renderer_host/render_message_filter.h b/content/browser/renderer_host/render_message_filter.h index 5aa9054..e9e68d0 100644 --- a/content/browser/renderer_host/render_message_filter.h +++ b/content/browser/renderer_host/render_message_filter.h @@ -102,12 +102,12 @@ class CONTENT_EXPORT RenderMessageFilter : public BrowserMessageFilter { DOMStorageContextWrapper* dom_storage_context); // IPC::MessageFilter methods: - virtual void OnChannelClosing() override; + void OnChannelClosing() override; // BrowserMessageFilter methods: - virtual bool OnMessageReceived(const IPC::Message& message) override; - virtual void OnDestruct() const override; - virtual base::TaskRunner* OverrideTaskRunnerForMessage( + bool OnMessageReceived(const IPC::Message& message) override; + void OnDestruct() const override; + base::TaskRunner* OverrideTaskRunnerForMessage( const IPC::Message& message) override; bool OffTheRecord() const; @@ -120,7 +120,7 @@ class CONTENT_EXPORT RenderMessageFilter : public BrowserMessageFilter { net::CookieStore* GetCookieStoreForURL(const GURL& url); protected: - virtual ~RenderMessageFilter(); + ~RenderMessageFilter() override; // This method will be overridden by TestSaveImageFromDataURL class for test. virtual void DownloadUrl(int render_view_id, diff --git a/content/browser/renderer_host/render_process_host_browsertest.cc b/content/browser/renderer_host/render_process_host_browsertest.cc index d684d78..f2856bf 100644 --- a/content/browser/renderer_host/render_process_host_browsertest.cc +++ b/content/browser/renderer_host/render_process_host_browsertest.cc @@ -42,12 +42,12 @@ class RenderProcessHostTest : public ContentBrowserTest, protected: // RenderProcessHostObserver: - virtual void RenderProcessExited(RenderProcessHost* host, - base::TerminationStatus status, - int exit_code) override { + void RenderProcessExited(RenderProcessHost* host, + base::TerminationStatus status, + int exit_code) override { ++process_exits_; } - virtual void RenderProcessHostDestroyed(RenderProcessHost* host) override { + void RenderProcessHostDestroyed(RenderProcessHost* host) override { ++host_destructions_; } @@ -120,14 +120,14 @@ class ShellCloser : public RenderProcessHostObserver { protected: // RenderProcessHostObserver: - virtual void RenderProcessExited(RenderProcessHost* host, - base::TerminationStatus status, - int exit_code) override { + void RenderProcessExited(RenderProcessHost* host, + base::TerminationStatus status, + int exit_code) override { logging_string_->append("ShellCloser::RenderProcessExited "); shell_->Close(); } - virtual void RenderProcessHostDestroyed(RenderProcessHost* host) override { + void RenderProcessHostDestroyed(RenderProcessHost* host) override { logging_string_->append("ShellCloser::RenderProcessHostDestroyed "); } @@ -144,13 +144,13 @@ class ObserverLogger : public RenderProcessHostObserver { protected: // RenderProcessHostObserver: - virtual void RenderProcessExited(RenderProcessHost* host, - base::TerminationStatus status, - int exit_code) override { + void RenderProcessExited(RenderProcessHost* host, + base::TerminationStatus status, + int exit_code) override { logging_string_->append("ObserverLogger::RenderProcessExited "); } - virtual void RenderProcessHostDestroyed(RenderProcessHost* host) override { + void RenderProcessHostDestroyed(RenderProcessHost* host) override { logging_string_->append("ObserverLogger::RenderProcessHostDestroyed "); host_destroyed_ = true; } diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index f9b5f01..fa0a406 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -311,7 +311,7 @@ class RendererSandboxedProcessLauncherDelegate #endif // OS_POSIX {} - virtual ~RendererSandboxedProcessLauncherDelegate() {} + ~RendererSandboxedProcessLauncherDelegate() override {} #if defined(OS_WIN) virtual void PreSpawnTarget(sandbox::TargetPolicy* policy, @@ -321,16 +321,14 @@ class RendererSandboxedProcessLauncherDelegate } #elif defined(OS_POSIX) - virtual bool ShouldUseZygote() override { + bool ShouldUseZygote() override { const base::CommandLine& browser_command_line = *base::CommandLine::ForCurrentProcess(); base::CommandLine::StringType renderer_prefix = browser_command_line.GetSwitchValueNative(switches::kRendererCmdPrefix); return renderer_prefix.empty(); } - virtual base::ScopedFD TakeIpcFd() override { - return ipc_fd_.Pass(); - } + base::ScopedFD TakeIpcFd() override { return ipc_fd_.Pass(); } #endif // OS_WIN private: @@ -344,7 +342,7 @@ const char kSessionStorageHolderKey[] = "kSessionStorageHolderKey"; class SessionStorageHolder : public base::SupportsUserData::Data { public: SessionStorageHolder() {} - virtual ~SessionStorageHolder() {} + ~SessionStorageHolder() override {} void Hold(const SessionStorageNamespaceMap& sessions, int view_route_id) { session_storage_namespaces_awaiting_close_[view_route_id] = sessions; diff --git a/content/browser/renderer_host/render_process_host_impl.h b/content/browser/renderer_host/render_process_host_impl.h index 4a679aa..7ab0dc2 100644 --- a/content/browser/renderer_host/render_process_host_impl.h +++ b/content/browser/renderer_host/render_process_host_impl.h @@ -87,70 +87,68 @@ class CONTENT_EXPORT RenderProcessHostImpl RenderProcessHostImpl(BrowserContext* browser_context, StoragePartitionImpl* storage_partition_impl, bool is_isolated_guest); - virtual ~RenderProcessHostImpl(); + ~RenderProcessHostImpl() override; // RenderProcessHost implementation (public portion). - virtual void EnableSendQueue() override; - virtual bool Init() override; - virtual int GetNextRoutingID() override; - virtual void AddRoute(int32 routing_id, IPC::Listener* listener) override; - virtual void RemoveRoute(int32 routing_id) override; - virtual void AddObserver(RenderProcessHostObserver* observer) override; - virtual void RemoveObserver(RenderProcessHostObserver* observer) override; - virtual void ReceivedBadMessage() override; - virtual void WidgetRestored() override; - virtual void WidgetHidden() override; - virtual int VisibleWidgetCount() const override; - virtual bool IsIsolatedGuest() const override; - virtual StoragePartition* GetStoragePartition() const override; - virtual bool FastShutdownIfPossible() override; - virtual void DumpHandles() override; - virtual base::ProcessHandle GetHandle() const override; - virtual BrowserContext* GetBrowserContext() const override; - virtual bool InSameStoragePartition( - StoragePartition* partition) const override; - virtual int GetID() const override; - virtual bool HasConnection() const override; - virtual void SetIgnoreInputEvents(bool ignore_input_events) override; - virtual bool IgnoreInputEvents() const override; - virtual void Cleanup() override; - virtual void AddPendingView() override; - virtual void RemovePendingView() override; - virtual void SetSuddenTerminationAllowed(bool enabled) override; - virtual bool SuddenTerminationAllowed() const override; - virtual IPC::ChannelProxy* GetChannel() override; - virtual void AddFilter(BrowserMessageFilter* filter) override; - virtual bool FastShutdownForPageCount(size_t count) override; - virtual bool FastShutdownStarted() const override; - virtual base::TimeDelta GetChildProcessIdleTime() const override; - virtual void ResumeRequestsForView(int route_id) override; - virtual void FilterURL(bool empty_allowed, GURL* url) override; + void EnableSendQueue() override; + bool Init() override; + int GetNextRoutingID() override; + void AddRoute(int32 routing_id, IPC::Listener* listener) override; + void RemoveRoute(int32 routing_id) override; + void AddObserver(RenderProcessHostObserver* observer) override; + void RemoveObserver(RenderProcessHostObserver* observer) override; + void ReceivedBadMessage() override; + void WidgetRestored() override; + void WidgetHidden() override; + int VisibleWidgetCount() const override; + bool IsIsolatedGuest() const override; + StoragePartition* GetStoragePartition() const override; + bool FastShutdownIfPossible() override; + void DumpHandles() override; + base::ProcessHandle GetHandle() const override; + BrowserContext* GetBrowserContext() const override; + bool InSameStoragePartition(StoragePartition* partition) const override; + int GetID() const override; + bool HasConnection() const override; + void SetIgnoreInputEvents(bool ignore_input_events) override; + bool IgnoreInputEvents() const override; + void Cleanup() override; + void AddPendingView() override; + void RemovePendingView() override; + void SetSuddenTerminationAllowed(bool enabled) override; + bool SuddenTerminationAllowed() const override; + IPC::ChannelProxy* GetChannel() override; + void AddFilter(BrowserMessageFilter* filter) override; + bool FastShutdownForPageCount(size_t count) override; + bool FastShutdownStarted() const override; + base::TimeDelta GetChildProcessIdleTime() const override; + void ResumeRequestsForView(int route_id) override; + void FilterURL(bool empty_allowed, GURL* url) override; #if defined(ENABLE_WEBRTC) - virtual void EnableAecDump(const base::FilePath& file) override; - virtual void DisableAecDump() override; - virtual void SetWebRtcLogMessageCallback( + void EnableAecDump(const base::FilePath& file) override; + void DisableAecDump() override; + void SetWebRtcLogMessageCallback( base::Callback<void(const std::string&)> callback) override; - virtual WebRtcStopRtpDumpCallback StartRtpDump( + WebRtcStopRtpDumpCallback StartRtpDump( bool incoming, bool outgoing, const WebRtcRtpPacketCallback& packet_callback) override; #endif - virtual void ResumeDeferredNavigation(const GlobalRequestID& request_id) - override; - virtual void NotifyTimezoneChange() override; - virtual ServiceRegistry* GetServiceRegistry() override; + void ResumeDeferredNavigation(const GlobalRequestID& request_id) override; + void NotifyTimezoneChange() override; + ServiceRegistry* GetServiceRegistry() override; // IPC::Sender via RenderProcessHost. - virtual bool Send(IPC::Message* msg) override; + bool Send(IPC::Message* msg) override; // IPC::Listener via RenderProcessHost. - virtual bool OnMessageReceived(const IPC::Message& msg) override; - virtual void OnChannelConnected(int32 peer_pid) override; - virtual void OnChannelError() override; - virtual void OnBadMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& msg) override; + void OnChannelConnected(int32 peer_pid) override; + void OnChannelError() override; + void OnBadMessageReceived(const IPC::Message& message) override; // ChildProcessLauncher::Client implementation. - virtual void OnProcessLaunched() override; + void OnProcessLaunched() override; scoped_refptr<AudioRendererHost> audio_renderer_host() const; @@ -323,7 +321,7 @@ class CONTENT_EXPORT RenderProcessHostImpl // Handle termination of our process. void ProcessDied(bool already_dead); - virtual void OnGpuSwitching() override; + void OnGpuSwitching() override; #if defined(ENABLE_WEBRTC) void OnRegisterAecDumpConsumer(int id); diff --git a/content/browser/renderer_host/render_view_host_browsertest.cc b/content/browser/renderer_host/render_view_host_browsertest.cc index db4a21e..2fdaf0aa 100644 --- a/content/browser/renderer_host/render_view_host_browsertest.cc +++ b/content/browser/renderer_host/render_view_host_browsertest.cc @@ -34,11 +34,10 @@ class RenderViewHostTestWebContentsObserver : public WebContentsObserver { explicit RenderViewHostTestWebContentsObserver(WebContents* web_contents) : WebContentsObserver(web_contents), navigation_count_(0) {} - virtual ~RenderViewHostTestWebContentsObserver() {} + ~RenderViewHostTestWebContentsObserver() override {} - virtual void DidNavigateMainFrame( - const LoadCommittedDetails& details, - const FrameNavigateParams& params) override { + void DidNavigateMainFrame(const LoadCommittedDetails& details, + const FrameNavigateParams& params) override { observed_socket_address_ = params.socket_address; base_url_ = params.base_url; ++navigation_count_; diff --git a/content/browser/renderer_host/render_view_host_impl.h b/content/browser/renderer_host/render_view_host_impl.h index aa23096..c6fdf05 100644 --- a/content/browser/renderer_host/render_view_host_impl.h +++ b/content/browser/renderer_host/render_view_host_impl.h @@ -110,69 +110,68 @@ class CONTENT_EXPORT RenderViewHostImpl bool swapped_out, bool hidden, bool has_initialized_audio_host); - virtual ~RenderViewHostImpl(); + ~RenderViewHostImpl() override; // RenderViewHost implementation. - virtual RenderFrameHost* GetMainFrame() override; - virtual void AllowBindings(int binding_flags) override; - virtual void ClearFocusedElement() override; - virtual bool IsFocusedElementEditable() override; - virtual void ClosePage() override; - virtual void CopyImageAt(int x, int y) override; - virtual void SaveImageAt(int x, int y) override; - virtual void DirectoryEnumerationFinished( + RenderFrameHost* GetMainFrame() override; + void AllowBindings(int binding_flags) override; + void ClearFocusedElement() override; + bool IsFocusedElementEditable() override; + void ClosePage() override; + void CopyImageAt(int x, int y) override; + void SaveImageAt(int x, int y) override; + void DirectoryEnumerationFinished( int request_id, const std::vector<base::FilePath>& files) override; - virtual void DisableScrollbarsForThreshold(const gfx::Size& size) override; - virtual void DragSourceEndedAt( - int client_x, int client_y, int screen_x, int screen_y, - blink::WebDragOperation operation) override; - virtual void DragSourceSystemDragEnded() override; - virtual void DragTargetDragEnter( - const DropData& drop_data, - const gfx::Point& client_pt, - const gfx::Point& screen_pt, - blink::WebDragOperationsMask operations_allowed, - int key_modifiers) override; - virtual void DragTargetDragOver( - const gfx::Point& client_pt, - const gfx::Point& screen_pt, - blink::WebDragOperationsMask operations_allowed, - int key_modifiers) override; - virtual void DragTargetDragLeave() override; - virtual void DragTargetDrop(const gfx::Point& client_pt, - const gfx::Point& screen_pt, - int key_modifiers) override; - virtual void EnableAutoResize(const gfx::Size& min_size, - const gfx::Size& max_size) override; - virtual void DisableAutoResize(const gfx::Size& new_size) override; - virtual void EnablePreferredSizeMode() override; - virtual void ExecuteMediaPlayerActionAtLocation( + void DisableScrollbarsForThreshold(const gfx::Size& size) override; + void DragSourceEndedAt(int client_x, + int client_y, + int screen_x, + int screen_y, + blink::WebDragOperation operation) override; + void DragSourceSystemDragEnded() override; + void DragTargetDragEnter(const DropData& drop_data, + const gfx::Point& client_pt, + const gfx::Point& screen_pt, + blink::WebDragOperationsMask operations_allowed, + int key_modifiers) override; + void DragTargetDragOver(const gfx::Point& client_pt, + const gfx::Point& screen_pt, + blink::WebDragOperationsMask operations_allowed, + int key_modifiers) override; + void DragTargetDragLeave() override; + void DragTargetDrop(const gfx::Point& client_pt, + const gfx::Point& screen_pt, + int key_modifiers) override; + void EnableAutoResize(const gfx::Size& min_size, + const gfx::Size& max_size) override; + void DisableAutoResize(const gfx::Size& new_size) override; + void EnablePreferredSizeMode() override; + void ExecuteMediaPlayerActionAtLocation( const gfx::Point& location, const blink::WebMediaPlayerAction& action) override; - virtual void ExecutePluginActionAtLocation( + void ExecutePluginActionAtLocation( const gfx::Point& location, const blink::WebPluginAction& action) override; - virtual void ExitFullscreen() override; - virtual void FilesSelectedInChooser( + void ExitFullscreen() override; + void FilesSelectedInChooser( const std::vector<content::FileChooserFileInfo>& files, FileChooserParams::Mode permissions) override; - virtual RenderViewHostDelegate* GetDelegate() const override; - virtual int GetEnabledBindings() const override; - virtual SiteInstanceImpl* GetSiteInstance() const override; - virtual bool IsRenderViewLive() const override; - virtual void NotifyMoveOrResizeStarted() override; - virtual void SetWebUIProperty(const std::string& name, - const std::string& value) override; - virtual void Zoom(PageZoom zoom) override; - virtual void SyncRendererPrefs() override; - virtual WebPreferences GetWebkitPreferences() override; - virtual void UpdateWebkitPreferences( - const WebPreferences& prefs) override; - virtual void OnWebkitPreferencesChanged() override; - virtual void GetAudioOutputControllers( + RenderViewHostDelegate* GetDelegate() const override; + int GetEnabledBindings() const override; + SiteInstanceImpl* GetSiteInstance() const override; + bool IsRenderViewLive() const override; + void NotifyMoveOrResizeStarted() override; + void SetWebUIProperty(const std::string& name, + const std::string& value) override; + void Zoom(PageZoom zoom) override; + void SyncRendererPrefs() override; + WebPreferences GetWebkitPreferences() override; + void UpdateWebkitPreferences(const WebPreferences& prefs) override; + void OnWebkitPreferencesChanged() override; + void GetAudioOutputControllers( const GetAudioOutputControllersCallback& callback) const override; - virtual void SelectWordAroundCaret() override; + void SelectWordAroundCaret() override; #if defined(OS_ANDROID) virtual void ActivateNearestFindResult(int request_id, @@ -262,22 +261,20 @@ class CONTENT_EXPORT RenderViewHostImpl } // RenderWidgetHost public overrides. - virtual void Init() override; - virtual void Shutdown() override; - virtual void WasHidden() override; - virtual void WasShown(const ui::LatencyInfo& latency_info) override; - virtual bool IsRenderView() const override; - virtual bool OnMessageReceived(const IPC::Message& msg) override; - virtual void GotFocus() override; - virtual void LostCapture() override; - virtual void LostMouseLock() override; - virtual void SetIsLoading(bool is_loading) override; - virtual void ForwardMouseEvent( - const blink::WebMouseEvent& mouse_event) override; - virtual void OnPointerEventActivate() override; - virtual void ForwardKeyboardEvent( - const NativeWebKeyboardEvent& key_event) override; - virtual gfx::Rect GetRootWindowResizerRect() const override; + void Init() override; + void Shutdown() override; + void WasHidden() override; + void WasShown(const ui::LatencyInfo& latency_info) override; + bool IsRenderView() const override; + bool OnMessageReceived(const IPC::Message& msg) override; + void GotFocus() override; + void LostCapture() override; + void LostMouseLock() override; + void SetIsLoading(bool is_loading) override; + void ForwardMouseEvent(const blink::WebMouseEvent& mouse_event) override; + void OnPointerEventActivate() override; + void ForwardKeyboardEvent(const NativeWebKeyboardEvent& key_event) override; + gfx::Rect GetRootWindowResizerRect() const override; // Creates a new RenderView with the given route id. void CreateNewWindow( @@ -333,15 +330,15 @@ class CONTENT_EXPORT RenderViewHostImpl protected: // RenderWidgetHost protected overrides. - virtual void OnUserGesture() override; - virtual void NotifyRendererUnresponsive() override; - virtual void NotifyRendererResponsive() override; - virtual void OnRenderAutoResized(const gfx::Size& size) override; - virtual void RequestToLockMouse(bool user_gesture, - bool last_unlocked_by_target) override; - virtual bool IsFullscreen() const override; - virtual void OnFocus() override; - virtual void OnBlur() override; + void OnUserGesture() override; + void NotifyRendererUnresponsive() override; + void NotifyRendererResponsive() override; + void OnRenderAutoResized(const gfx::Size& size) override; + void RequestToLockMouse(bool user_gesture, + bool last_unlocked_by_target) override; + bool IsFullscreen() const override; + void OnFocus() override; + void OnBlur() override; // IPC message handlers. void OnShowView(int route_id, diff --git a/content/browser/renderer_host/render_view_host_unittest.cc b/content/browser/renderer_host/render_view_host_unittest.cc index 017a364..1389f8d 100644 --- a/content/browser/renderer_host/render_view_host_unittest.cc +++ b/content/browser/renderer_host/render_view_host_unittest.cc @@ -29,9 +29,9 @@ namespace content { class RenderViewHostTestBrowserClient : public TestContentBrowserClient { public: RenderViewHostTestBrowserClient() {} - virtual ~RenderViewHostTestBrowserClient() {} + ~RenderViewHostTestBrowserClient() override {} - virtual bool IsHandledURL(const GURL& url) override { + bool IsHandledURL(const GURL& url) override { return url.scheme() == url::kFileScheme; } @@ -119,18 +119,18 @@ TEST_F(RenderViewHostTest, DontGrantBindingsToSharedProcess) { class MockDraggingRenderViewHostDelegateView : public RenderViewHostDelegateView { public: - virtual ~MockDraggingRenderViewHostDelegateView() {} - virtual void StartDragging(const DropData& drop_data, - blink::WebDragOperationsMask allowed_ops, - const gfx::ImageSkia& image, - const gfx::Vector2d& image_offset, - const DragEventSourceInfo& event_info) override { + ~MockDraggingRenderViewHostDelegateView() override {} + void StartDragging(const DropData& drop_data, + blink::WebDragOperationsMask allowed_ops, + const gfx::ImageSkia& image, + const gfx::Vector2d& image_offset, + const DragEventSourceInfo& event_info) override { drag_url_ = drop_data.url; html_base_url_ = drop_data.html_base_url; } - virtual void UpdateDragCursor(blink::WebDragOperation operation) override {} - virtual void GotFocus() override {} - virtual void TakeFocus(bool reverse) override {} + void UpdateDragCursor(blink::WebDragOperation operation) override {} + void GotFocus() override {} + void TakeFocus(bool reverse) override {} virtual void UpdatePreferredSize(const gfx::Size& pref_size) {} GURL drag_url() { @@ -284,12 +284,12 @@ class TestSaveImageFromDataURL : public RenderMessageFilter { } protected: - virtual ~TestSaveImageFromDataURL() { } - virtual void DownloadUrl(int render_view_id, - const GURL& url, - const Referrer& referrer, - const base::string16& suggested_name, - const bool use_prompt) const override { + ~TestSaveImageFromDataURL() override {} + void DownloadUrl(int render_view_id, + const GURL& url, + const Referrer& referrer, + const base::string16& suggested_name, + const bool use_prompt) const override { url_string_ = url.spec(); is_downloaded_ = true; } diff --git a/content/browser/renderer_host/render_widget_host_browsertest.cc b/content/browser/renderer_host/render_widget_host_browsertest.cc index fae4127..e85a485 100644 --- a/content/browser/renderer_host/render_widget_host_browsertest.cc +++ b/content/browser/renderer_host/render_widget_host_browsertest.cc @@ -19,7 +19,7 @@ class RenderWidgetHostBrowserTest : public ContentBrowserTest { public: RenderWidgetHostBrowserTest() {} - virtual void SetUpOnMainThread() override { + void SetUpOnMainThread() override { ASSERT_TRUE(PathService::Get(DIR_TEST_DATA, &test_dir_)); } diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc index f152c57..47cfba2 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc @@ -124,8 +124,7 @@ class RenderWidgetHostIteratorImpl : public RenderWidgetHostIterator { : current_index_(0) { } - virtual ~RenderWidgetHostIteratorImpl() { - } + ~RenderWidgetHostIteratorImpl() override {} void Add(RenderWidgetHost* host) { hosts_.push_back(RenderWidgetHostID(host->GetProcess()->GetID(), @@ -133,7 +132,7 @@ class RenderWidgetHostIteratorImpl : public RenderWidgetHostIterator { } // RenderWidgetHostIterator: - virtual RenderWidgetHost* GetNextHost() override { + RenderWidgetHost* GetNextHost() override { RenderWidgetHost* host = NULL; while (current_index_ < hosts_.size() && !host) { RenderWidgetHostID id = hosts_[current_index_]; diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h index f0da2fb..de95733 100644 --- a/content/browser/renderer_host/render_widget_host_impl.h +++ b/content/browser/renderer_host/render_widget_host_impl.h @@ -106,7 +106,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl RenderProcessHost* process, int routing_id, bool hidden); - virtual ~RenderWidgetHostImpl(); + ~RenderWidgetHostImpl() override; // Similar to RenderWidgetHost::FromID, but returning the Impl object. static RenderWidgetHostImpl* FromID(int32 process_id, int32 routing_id); @@ -126,47 +126,41 @@ class CONTENT_EXPORT RenderWidgetHostImpl } // RenderWidgetHost implementation. - virtual void UpdateTextDirection(blink::WebTextDirection direction) override; - virtual void NotifyTextDirection() override; - virtual void Focus() override; - virtual void Blur() override; - virtual void SetActive(bool active) override; - virtual void CopyFromBackingStore( + void UpdateTextDirection(blink::WebTextDirection direction) override; + void NotifyTextDirection() override; + void Focus() override; + void Blur() override; + void SetActive(bool active) override; + void CopyFromBackingStore( const gfx::Rect& src_rect, const gfx::Size& accelerated_dst_size, const base::Callback<void(bool, const SkBitmap&)>& callback, const SkColorType color_type) override; - virtual bool CanCopyFromBackingStore() override; + bool CanCopyFromBackingStore() override; #if defined(OS_ANDROID) virtual void LockBackingStore() override; virtual void UnlockBackingStore() override; #endif - virtual void ForwardMouseEvent( - const blink::WebMouseEvent& mouse_event) override; - virtual void ForwardWheelEvent( - const blink::WebMouseWheelEvent& wheel_event) override; - virtual void ForwardKeyboardEvent( - const NativeWebKeyboardEvent& key_event) override; - virtual RenderProcessHost* GetProcess() const override; - virtual int GetRoutingID() const override; - virtual RenderWidgetHostView* GetView() const override; - virtual bool IsLoading() const override; - virtual bool IsRenderView() const override; - virtual void ResizeRectChanged(const gfx::Rect& new_rect) override; - virtual void RestartHangMonitorTimeout() override; - virtual void SetIgnoreInputEvents(bool ignore_input_events) override; - virtual void WasResized() override; - virtual void AddKeyPressEventCallback( + void ForwardMouseEvent(const blink::WebMouseEvent& mouse_event) override; + void ForwardWheelEvent(const blink::WebMouseWheelEvent& wheel_event) override; + void ForwardKeyboardEvent(const NativeWebKeyboardEvent& key_event) override; + RenderProcessHost* GetProcess() const override; + int GetRoutingID() const override; + RenderWidgetHostView* GetView() const override; + bool IsLoading() const override; + bool IsRenderView() const override; + void ResizeRectChanged(const gfx::Rect& new_rect) override; + void RestartHangMonitorTimeout() override; + void SetIgnoreInputEvents(bool ignore_input_events) override; + void WasResized() override; + void AddKeyPressEventCallback(const KeyPressEventCallback& callback) override; + void RemoveKeyPressEventCallback( const KeyPressEventCallback& callback) override; - virtual void RemoveKeyPressEventCallback( - const KeyPressEventCallback& callback) override; - virtual void AddMouseEventCallback( - const MouseEventCallback& callback) override; - virtual void RemoveMouseEventCallback( - const MouseEventCallback& callback) override; - virtual void GetWebScreenInfo(blink::WebScreenInfo* result) override; + void AddMouseEventCallback(const MouseEventCallback& callback) override; + void RemoveMouseEventCallback(const MouseEventCallback& callback) override; + void GetWebScreenInfo(blink::WebScreenInfo* result) override; - virtual SkColorType PreferredReadbackFormat() override; + SkColorType PreferredReadbackFormat() override; // Forces redraw in the renderer and when the update reaches the browser // grabs snapshot from the compositor. Returns PNG-encoded snapshot. @@ -199,10 +193,10 @@ class CONTENT_EXPORT RenderWidgetHostImpl virtual void Shutdown(); // IPC::Listener - virtual bool OnMessageReceived(const IPC::Message& msg) override; + bool OnMessageReceived(const IPC::Message& msg) override; // Sends a message to the corresponding object in the renderer. - virtual bool Send(IPC::Message* msg) override; + bool Send(IPC::Message* msg) override; // Indicates if the page has finished loading. virtual void SetIsLoading(bool is_loading); @@ -278,12 +272,12 @@ class CONTENT_EXPORT RenderWidgetHostImpl void SetTouchEventEmulationEnabled(bool enabled); // TouchEmulatorClient implementation. - virtual void ForwardGestureEvent( + void ForwardGestureEvent( const blink::WebGestureEvent& gesture_event) override; - virtual void ForwardEmulatedTouchEvent( + void ForwardEmulatedTouchEvent( const blink::WebTouchEvent& touch_event) override; - virtual void SetCursor(const WebCursor& cursor) override; - virtual void ShowContextMenuAtPoint(const gfx::Point& point) override; + void SetCursor(const WebCursor& cursor) override; + void ShowContextMenuAtPoint(const gfx::Point& point) override; // Queues a synthetic gesture for testing purposes. Invokes the on_complete // callback when the gesture is finished running. @@ -437,7 +431,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl void FlushInput(); // InputRouterClient - virtual void SetNeedsFlush() override; + void SetNeedsFlush() override; // Indicates whether the renderer drives the RenderWidgetHosts's size or the // other way around. @@ -484,7 +478,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl #endif protected: - virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() override; + RenderWidgetHostImpl* AsRenderWidgetHostImpl() override; // Create a LatencyInfo struct with INPUT_EVENT_LATENCY_RWH_COMPONENT // component if it is not already in |original|. And if |original| is @@ -643,25 +637,25 @@ class CONTENT_EXPORT RenderWidgetHostImpl bool KeyPressListenersHandleEvent(const NativeWebKeyboardEvent& event); // InputRouterClient - virtual InputEventAckState FilterInputEvent( + InputEventAckState FilterInputEvent( const blink::WebInputEvent& event, const ui::LatencyInfo& latency_info) override; - virtual void IncrementInFlightEventCount() override; - virtual void DecrementInFlightEventCount() override; - virtual void OnHasTouchEventHandlers(bool has_handlers) override; - virtual void DidFlush() override; - virtual void DidOverscroll(const DidOverscrollParams& params) override; + void IncrementInFlightEventCount() override; + void DecrementInFlightEventCount() override; + void OnHasTouchEventHandlers(bool has_handlers) override; + void DidFlush() override; + void DidOverscroll(const DidOverscrollParams& params) override; // InputAckHandler - virtual void OnKeyboardEventAck(const NativeWebKeyboardEvent& event, - InputEventAckState ack_result) override; - virtual void OnWheelEventAck(const MouseWheelEventWithLatencyInfo& event, - InputEventAckState ack_result) override; - virtual void OnTouchEventAck(const TouchEventWithLatencyInfo& event, - InputEventAckState ack_result) override; - virtual void OnGestureEventAck(const GestureEventWithLatencyInfo& event, - InputEventAckState ack_result) override; - virtual void OnUnexpectedEventAck(UnexpectedEventAckType type) override; + void OnKeyboardEventAck(const NativeWebKeyboardEvent& event, + InputEventAckState ack_result) override; + void OnWheelEventAck(const MouseWheelEventWithLatencyInfo& event, + InputEventAckState ack_result) override; + void OnTouchEventAck(const TouchEventWithLatencyInfo& event, + InputEventAckState ack_result) override; + void OnGestureEventAck(const GestureEventWithLatencyInfo& event, + InputEventAckState ack_result) override; + void OnUnexpectedEventAck(UnexpectedEventAckType type) override; void OnSyntheticGestureCompleted(SyntheticGesture::Result result); diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc index 56e90a5..5d610ae 100644 --- a/content/browser/renderer_host/render_widget_host_unittest.cc +++ b/content/browser/renderer_host/render_widget_host_unittest.cc @@ -67,50 +67,45 @@ class MockInputRouter : public InputRouter { message_received_(false), client_(client) { } - virtual ~MockInputRouter() {} + ~MockInputRouter() override {} // InputRouter - virtual void Flush() override { - flush_called_ = true; - } - virtual bool SendInput(scoped_ptr<IPC::Message> message) override { + void Flush() override { flush_called_ = true; } + bool SendInput(scoped_ptr<IPC::Message> message) override { send_event_called_ = true; return true; } - virtual void SendMouseEvent( - const MouseEventWithLatencyInfo& mouse_event) override { + void SendMouseEvent(const MouseEventWithLatencyInfo& mouse_event) override { sent_mouse_event_ = true; } - virtual void SendWheelEvent( + void SendWheelEvent( const MouseWheelEventWithLatencyInfo& wheel_event) override { sent_wheel_event_ = true; } - virtual void SendKeyboardEvent( - const NativeWebKeyboardEvent& key_event, - const ui::LatencyInfo& latency_info, - bool is_shortcut) override { + void SendKeyboardEvent(const NativeWebKeyboardEvent& key_event, + const ui::LatencyInfo& latency_info, + bool is_shortcut) override { sent_keyboard_event_ = true; } - virtual void SendGestureEvent( + void SendGestureEvent( const GestureEventWithLatencyInfo& gesture_event) override { sent_gesture_event_ = true; } - virtual void SendTouchEvent( - const TouchEventWithLatencyInfo& touch_event) override { + void SendTouchEvent(const TouchEventWithLatencyInfo& touch_event) override { send_touch_event_not_cancelled_ = client_->FilterInputEvent(touch_event.event, touch_event.latency) == INPUT_EVENT_ACK_STATE_NOT_CONSUMED; } - virtual const NativeWebKeyboardEvent* GetLastKeyboardEvent() const override { + const NativeWebKeyboardEvent* GetLastKeyboardEvent() const override { NOTREACHED(); return NULL; } - virtual bool ShouldForwardTouchEvent() const override { return true; } - virtual void OnViewUpdated(int view_flags) override {} - virtual bool HasPendingEvents() const override { return false; } + bool ShouldForwardTouchEvent() const override { return true; } + void OnViewUpdated(int view_flags) override {} + bool HasPendingEvents() const override { return false; } // IPC::Listener - virtual bool OnMessageReceived(const IPC::Message& message) override { + bool OnMessageReceived(const IPC::Message& message) override { message_received_ = true; return false; } @@ -151,9 +146,8 @@ class MockRenderWidgetHost : public RenderWidgetHostImpl { using RenderWidgetHostImpl::resize_ack_pending_; using RenderWidgetHostImpl::input_router_; - virtual void OnTouchEventAck( - const TouchEventWithLatencyInfo& event, - InputEventAckState ack_result) override { + void OnTouchEventAck(const TouchEventWithLatencyInfo& event, + InputEventAckState ack_result) override { // Sniff touch acks. acked_touch_event_type_ = event.event.type; RenderWidgetHostImpl::OnTouchEventAck(event, ack_result); @@ -185,7 +179,7 @@ class MockRenderWidgetHost : public RenderWidgetHostImpl { } protected: - virtual void NotifyRendererUnresponsive() override { + void NotifyRendererUnresponsive() override { unresponsive_timer_fired_ = true; } @@ -205,8 +199,7 @@ class RenderWidgetHostProcess : public MockRenderProcessHost { : MockRenderProcessHost(browser_context), update_msg_reply_flags_(0) { } - virtual ~RenderWidgetHostProcess() { - } + ~RenderWidgetHostProcess() override {} void set_update_msg_reply_flags(int flags) { update_msg_reply_flags_ = flags; @@ -215,7 +208,7 @@ class RenderWidgetHostProcess : public MockRenderProcessHost { // Fills the given update parameters with resonable default values. void InitUpdateRectParams(ViewHostMsg_UpdateRect_Params* params); - virtual bool HasConnection() const override { return true; } + bool HasConnection() const override { return true; } protected: // Indicates the flags that should be sent with a repaint request. This @@ -278,27 +271,25 @@ class TestView : public TestRenderWidgetHostView { } // RenderWidgetHostView override. - virtual gfx::Rect GetViewBounds() const override { - return bounds_; - } - virtual void ProcessAckedTouchEvent(const TouchEventWithLatencyInfo& touch, - InputEventAckState ack_result) override { + gfx::Rect GetViewBounds() const override { return bounds_; } + void ProcessAckedTouchEvent(const TouchEventWithLatencyInfo& touch, + InputEventAckState ack_result) override { acked_event_ = touch.event; ++acked_event_count_; } - virtual void WheelEventAck(const WebMouseWheelEvent& event, - InputEventAckState ack_result) override { + void WheelEventAck(const WebMouseWheelEvent& event, + InputEventAckState ack_result) override { if (ack_result == INPUT_EVENT_ACK_STATE_CONSUMED) return; unhandled_wheel_event_count_++; unhandled_wheel_event_ = event; } - virtual void GestureEventAck(const WebGestureEvent& event, - InputEventAckState ack_result) override { + void GestureEventAck(const WebGestureEvent& event, + InputEventAckState ack_result) override { gesture_event_type_ = event.type; ack_result_ = ack_result; } - virtual gfx::Size GetPhysicalBackingSize() const override { + gfx::Size GetPhysicalBackingSize() const override { if (use_fake_physical_backing_size_) return mock_physical_backing_size_; return TestRenderWidgetHostView::GetPhysicalBackingSize(); @@ -342,7 +333,7 @@ class MockRenderWidgetHostDelegate : public RenderWidgetHostDelegate { handle_wheel_event_(false), handle_wheel_event_called_(false) { } - virtual ~MockRenderWidgetHostDelegate() {} + ~MockRenderWidgetHostDelegate() override {} // Tests that make sure we ignore keyboard event acknowledgments to events we // didn't send work by making sure we didn't call UnhandledKeyboardEvent(). @@ -375,21 +366,19 @@ class MockRenderWidgetHostDelegate : public RenderWidgetHostDelegate { } protected: - virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, - bool* is_keyboard_shortcut) override { + bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, + bool* is_keyboard_shortcut) override { prehandle_keyboard_event_type_ = event.type; prehandle_keyboard_event_called_ = true; return prehandle_keyboard_event_; } - virtual void HandleKeyboardEvent( - const NativeWebKeyboardEvent& event) override { + void HandleKeyboardEvent(const NativeWebKeyboardEvent& event) override { unhandled_keyboard_event_type_ = event.type; unhandled_keyboard_event_called_ = true; } - virtual bool HandleWheelEvent( - const blink::WebMouseWheelEvent& event) override { + bool HandleWheelEvent(const blink::WebMouseWheelEvent& event) override { handle_wheel_event_called_ = true; return handle_wheel_event_; } diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h index 7dd1c80..d30bc5d 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.h +++ b/content/browser/renderer_host/render_widget_host_view_base.h @@ -66,24 +66,24 @@ typedef const base::Callback<void(bool, const SkBitmap&)> class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, public IPC::Listener { public: - virtual ~RenderWidgetHostViewBase(); + ~RenderWidgetHostViewBase() override; // RenderWidgetHostView implementation. - virtual void SetBackgroundOpaque(bool opaque) override; - virtual bool GetBackgroundOpaque() override; - virtual ui::TextInputClient* GetTextInputClient() override; - virtual bool IsShowingContextMenu() const override; - virtual void SetShowingContextMenu(bool showing_menu) override; - virtual base::string16 GetSelectedText() const override; - virtual bool IsMouseLocked() override; - virtual gfx::Size GetVisibleViewportSize() const override; - virtual void SetInsets(const gfx::Insets& insets) override; - virtual void BeginFrameSubscription( + void SetBackgroundOpaque(bool opaque) override; + bool GetBackgroundOpaque() override; + ui::TextInputClient* GetTextInputClient() override; + bool IsShowingContextMenu() const override; + void SetShowingContextMenu(bool showing_menu) override; + base::string16 GetSelectedText() const override; + bool IsMouseLocked() override; + gfx::Size GetVisibleViewportSize() const override; + void SetInsets(const gfx::Insets& insets) override; + void BeginFrameSubscription( scoped_ptr<RenderWidgetHostViewFrameSubscriber> subscriber) override; - virtual void EndFrameSubscription() override; + void EndFrameSubscription() override; // IPC::Listener implementation: - virtual bool OnMessageReceived(const IPC::Message& msg) override; + bool OnMessageReceived(const IPC::Message& msg) override; // Called by the host when the input flush has completed. void OnDidFlushInput(); diff --git a/content/browser/renderer_host/render_widget_host_view_browsertest.cc b/content/browser/renderer_host/render_widget_host_view_browsertest.cc index 81917b6..dff9e9c 100644 --- a/content/browser/renderer_host/render_widget_host_view_browsertest.cc +++ b/content/browser/renderer_host/render_widget_host_view_browsertest.cc @@ -61,7 +61,7 @@ class RenderWidgetHostViewBrowserTest : public ContentBrowserTest { callback_invoke_count_(0), frames_captured_(0) {} - virtual void SetUpOnMainThread() override { + void SetUpOnMainThread() override { ASSERT_TRUE(PathService::Get(DIR_TEST_DATA, &test_dir_)); } @@ -218,7 +218,7 @@ class CompositingRenderWidgetHostViewBrowserTest test_dir().AppendASCII("rwhv_compositing_animation.html")); } - virtual bool SetUpSourceSurface(const char* wait_message) override { + bool SetUpSourceSurface(const char* wait_message) override { content::DOMMessageQueue message_queue; NavigateToURL(shell(), TestUrl()); if (wait_message != NULL) { @@ -247,10 +247,10 @@ class FakeFrameSubscriber : public RenderWidgetHostViewFrameSubscriber { : callback_(callback) { } - virtual bool ShouldCaptureFrame(const gfx::Rect& damage_rect, - base::TimeTicks present_time, - scoped_refptr<media::VideoFrame>* storage, - DeliverFrameCallback* callback) override { + bool ShouldCaptureFrame(const gfx::Rect& damage_rect, + base::TimeTicks present_time, + scoped_refptr<media::VideoFrame>* storage, + DeliverFrameCallback* callback) override { // Only allow one frame capture to be made. Otherwise, the compositor could // start multiple captures, unbounded, and eventually its own limiter logic // will begin invoking |callback| with a |false| result. This flakes out @@ -505,9 +505,7 @@ class CompositingRenderWidgetHostViewBrowserTestTabCapture void SetAllowableError(int amount) { allowable_error_ = amount; } void SetExcludeRect(gfx::Rect exclude) { exclude_rect_ = exclude; } - virtual GURL TestUrl() override { - return GURL(test_url_); - } + GURL TestUrl() override { return GURL(test_url_); } void SetTestUrl(std::string url) { test_url_ = url; } @@ -754,13 +752,13 @@ class CompositingRenderWidgetHostViewBrowserTestTabCaptureHighDPI CompositingRenderWidgetHostViewBrowserTestTabCaptureHighDPI() {} protected: - virtual void SetUpCommandLine(base::CommandLine* cmd) override { + void SetUpCommandLine(base::CommandLine* cmd) override { CompositingRenderWidgetHostViewBrowserTestTabCapture::SetUpCommandLine(cmd); cmd->AppendSwitchASCII(switches::kForceDeviceScaleFactor, base::StringPrintf("%f", scale())); } - virtual bool ShouldContinueAfterTestURLLoad() override { + bool ShouldContinueAfterTestURLLoad() override { // Short-circuit a pass for platforms where setting up high-DPI fails. const float actual_scale_factor = GetScaleFactorForView(GetRenderWidgetHostView()); diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h index d58c05b..acab4f0 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.h +++ b/content/browser/renderer_host/render_widget_host_view_mac.h @@ -216,7 +216,7 @@ class CONTENT_EXPORT RenderWidgetHostViewMac // TODO(lazyboy): Remove |is_guest_view_hack| once BrowserPlugin has migrated // to use RWHVChildFrame (http://crbug.com/330264). RenderWidgetHostViewMac(RenderWidgetHost* widget, bool is_guest_view_hack); - virtual ~RenderWidgetHostViewMac(); + ~RenderWidgetHostViewMac() override; RenderWidgetHostViewCocoa* cocoa_view() const { return cocoa_view_; } @@ -228,107 +228,104 @@ class CONTENT_EXPORT RenderWidgetHostViewMac void SetAllowPauseForResizeOrRepaint(bool allow); // RenderWidgetHostView implementation. - virtual bool OnMessageReceived(const IPC::Message& msg) override; - virtual void InitAsChild(gfx::NativeView parent_view) override; - virtual RenderWidgetHost* GetRenderWidgetHost() const override; - virtual void SetSize(const gfx::Size& size) override; - virtual void SetBounds(const gfx::Rect& rect) override; - virtual gfx::Vector2dF GetLastScrollOffset() const override; - virtual gfx::NativeView GetNativeView() const override; - virtual gfx::NativeViewId GetNativeViewId() const override; - virtual gfx::NativeViewAccessible GetNativeViewAccessible() override; - virtual bool HasFocus() const override; - virtual bool IsSurfaceAvailableForCopy() const override; - virtual void Show() override; - virtual void Hide() override; - virtual bool IsShowing() override; - virtual gfx::Rect GetViewBounds() const override; - virtual void SetShowingContextMenu(bool showing) override; - virtual void SetActive(bool active) override; - virtual void SetTakesFocusOnlyOnMouseDown(bool flag) override; - virtual void SetWindowVisibility(bool visible) override; - virtual void WindowFrameChanged() override; - virtual void ShowDefinitionForSelection() override; - virtual bool SupportsSpeech() const override; - virtual void SpeakSelection() override; - virtual bool IsSpeaking() const override; - virtual void StopSpeaking() override; - virtual void SetBackgroundOpaque(bool opaque) override; + bool OnMessageReceived(const IPC::Message& msg) override; + void InitAsChild(gfx::NativeView parent_view) override; + RenderWidgetHost* GetRenderWidgetHost() const override; + void SetSize(const gfx::Size& size) override; + void SetBounds(const gfx::Rect& rect) override; + gfx::Vector2dF GetLastScrollOffset() const override; + gfx::NativeView GetNativeView() const override; + gfx::NativeViewId GetNativeViewId() const override; + gfx::NativeViewAccessible GetNativeViewAccessible() override; + bool HasFocus() const override; + bool IsSurfaceAvailableForCopy() const override; + void Show() override; + void Hide() override; + bool IsShowing() override; + gfx::Rect GetViewBounds() const override; + void SetShowingContextMenu(bool showing) override; + void SetActive(bool active) override; + void SetTakesFocusOnlyOnMouseDown(bool flag) override; + void SetWindowVisibility(bool visible) override; + void WindowFrameChanged() override; + void ShowDefinitionForSelection() override; + bool SupportsSpeech() const override; + void SpeakSelection() override; + bool IsSpeaking() const override; + void StopSpeaking() override; + void SetBackgroundOpaque(bool opaque) override; // Implementation of RenderWidgetHostViewBase. - virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, - const gfx::Rect& pos) override; - virtual void InitAsFullscreen( - RenderWidgetHostView* reference_host_view) override; - virtual void WasShown() override; - virtual void WasHidden() override; - virtual void MovePluginWindows( - const std::vector<WebPluginGeometry>& moves) override; - virtual void Focus() override; - virtual void Blur() override; - virtual void UpdateCursor(const WebCursor& cursor) override; - virtual void SetIsLoading(bool is_loading) override; - virtual void TextInputTypeChanged(ui::TextInputType type, - ui::TextInputMode input_mode, - bool can_compose_inline) override; - virtual void ImeCancelComposition() override; - virtual void ImeCompositionRangeChanged( + void InitAsPopup(RenderWidgetHostView* parent_host_view, + const gfx::Rect& pos) override; + void InitAsFullscreen(RenderWidgetHostView* reference_host_view) override; + void WasShown() override; + void WasHidden() override; + void MovePluginWindows(const std::vector<WebPluginGeometry>& moves) override; + void Focus() override; + void Blur() override; + void UpdateCursor(const WebCursor& cursor) override; + void SetIsLoading(bool is_loading) override; + void TextInputTypeChanged(ui::TextInputType type, + ui::TextInputMode input_mode, + bool can_compose_inline) override; + void ImeCancelComposition() override; + void ImeCompositionRangeChanged( const gfx::Range& range, const std::vector<gfx::Rect>& character_bounds) override; - virtual void RenderProcessGone(base::TerminationStatus status, - int error_code) override; - virtual void RenderWidgetHostGone() override; - virtual void Destroy() override; - virtual void SetTooltipText(const base::string16& tooltip_text) override; - virtual void SelectionChanged(const base::string16& text, - size_t offset, - const gfx::Range& range) override; - virtual void SelectionBoundsChanged( + void RenderProcessGone(base::TerminationStatus status, + int error_code) override; + void RenderWidgetHostGone() override; + void Destroy() override; + void SetTooltipText(const base::string16& tooltip_text) override; + void SelectionChanged(const base::string16& text, + size_t offset, + const gfx::Range& range) override; + void SelectionBoundsChanged( const ViewHostMsg_SelectionBounds_Params& params) override; - virtual void CopyFromCompositingSurface( + void CopyFromCompositingSurface( const gfx::Rect& src_subrect, const gfx::Size& dst_size, const base::Callback<void(bool, const SkBitmap&)>& callback, SkColorType color_type) override; - virtual void CopyFromCompositingSurfaceToVideoFrame( + void CopyFromCompositingSurfaceToVideoFrame( const gfx::Rect& src_subrect, const scoped_refptr<media::VideoFrame>& target, const base::Callback<void(bool)>& callback) override; - virtual bool CanCopyToVideoFrame() const override; - virtual bool CanSubscribeFrame() const override; - virtual void BeginFrameSubscription( + bool CanCopyToVideoFrame() const override; + bool CanSubscribeFrame() const override; + void BeginFrameSubscription( scoped_ptr<RenderWidgetHostViewFrameSubscriber> subscriber) override; - virtual void EndFrameSubscription() override; - virtual void OnSwapCompositorFrame( - uint32 output_surface_id, scoped_ptr<cc::CompositorFrame> frame) override; - virtual BrowserAccessibilityManager* CreateBrowserAccessibilityManager( + void EndFrameSubscription() override; + void OnSwapCompositorFrame(uint32 output_surface_id, + scoped_ptr<cc::CompositorFrame> frame) override; + BrowserAccessibilityManager* CreateBrowserAccessibilityManager( BrowserAccessibilityDelegate* delegate) override; - virtual gfx::Point AccessibilityOriginInScreen(const gfx::Rect& bounds) - override; - virtual void AccessibilityShowMenu(const gfx::Point& point) override; - virtual bool PostProcessEventForPluginIme( + gfx::Point AccessibilityOriginInScreen(const gfx::Rect& bounds) override; + void AccessibilityShowMenu(const gfx::Point& point) override; + bool PostProcessEventForPluginIme( const NativeWebKeyboardEvent& event) override; - virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) override; - virtual void GetScreenInfo(blink::WebScreenInfo* results) override; - virtual gfx::Rect GetBoundsInRootWindow() override; - virtual gfx::GLSurfaceHandle GetCompositingSurface() override; + bool HasAcceleratedSurface(const gfx::Size& desired_size) override; + void GetScreenInfo(blink::WebScreenInfo* results) override; + gfx::Rect GetBoundsInRootWindow() override; + gfx::GLSurfaceHandle GetCompositingSurface() override; - virtual bool LockMouse() override; - virtual void UnlockMouse() override; - virtual void WheelEventAck(const blink::WebMouseWheelEvent& event, - InputEventAckState ack_result) override; + bool LockMouse() override; + void UnlockMouse() override; + void WheelEventAck(const blink::WebMouseWheelEvent& event, + InputEventAckState ack_result) override; // IPC::Sender implementation. - virtual bool Send(IPC::Message* message) override; + bool Send(IPC::Message* message) override; - virtual SkColorType PreferredReadbackFormat() override; + SkColorType PreferredReadbackFormat() override; // gfx::DisplayObserver implementation. - virtual void OnDisplayAdded(const gfx::Display& new_display) override; - virtual void OnDisplayRemoved(const gfx::Display& old_display) override; - virtual void OnDisplayMetricsChanged(const gfx::Display& display, - uint32_t metrics) override; + void OnDisplayAdded(const gfx::Display& new_display) override; + void OnDisplayRemoved(const gfx::Display& old_display) override; + void OnDisplayMetricsChanged(const gfx::Display& display, + uint32_t metrics) override; // Forwards the mouse event to the renderer. void ForwardMouseEvent(const blink::WebMouseEvent& event); @@ -419,20 +416,19 @@ class CONTENT_EXPORT RenderWidgetHostViewMac void PauseForPendingResizeOrRepaintsAndDraw(); // DelegatedFrameHostClient implementation. - virtual ui::Compositor* GetCompositor() const override; - virtual ui::Layer* GetLayer() override; - virtual RenderWidgetHostImpl* GetHost() override; - virtual bool IsVisible() override; - virtual scoped_ptr<ResizeLock> CreateResizeLock( - bool defer_compositor_lock) override; - virtual gfx::Size DesiredFrameSize() override; - virtual float CurrentDeviceScaleFactor() override; - virtual gfx::Size ConvertViewSizeToPixel(const gfx::Size& size) override; - virtual DelegatedFrameHost* GetDelegatedFrameHost() const override; + ui::Compositor* GetCompositor() const override; + ui::Layer* GetLayer() override; + RenderWidgetHostImpl* GetHost() override; + bool IsVisible() override; + scoped_ptr<ResizeLock> CreateResizeLock(bool defer_compositor_lock) override; + gfx::Size DesiredFrameSize() override; + float CurrentDeviceScaleFactor() override; + gfx::Size ConvertViewSizeToPixel(const gfx::Size& size) override; + DelegatedFrameHost* GetDelegatedFrameHost() const override; // BrowserCompositorViewMacClient implementation. - virtual bool BrowserCompositorViewShouldAckImmediately() const override; - virtual void BrowserCompositorViewFrameSwapped( + bool BrowserCompositorViewShouldAckImmediately() const override; + void BrowserCompositorViewFrameSwapped( const std::vector<ui::LatencyInfo>& latency_info) override; private: diff --git a/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm b/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm index ab9c945..6ecb669 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm @@ -72,7 +72,7 @@ bool CheckObjectRespondsToEditCommands(NSArray* edit_commands, id test_obj) { class MockRenderWidgetHostDelegate : public RenderWidgetHostDelegate { public: MockRenderWidgetHostDelegate() {} - virtual ~MockRenderWidgetHostDelegate() {} + ~MockRenderWidgetHostDelegate() override {} }; // Create a RenderWidget for which we can filter messages. @@ -86,7 +86,7 @@ class RenderWidgetHostEditCommandCounter : public RenderWidgetHostImpl { edit_command_message_count_(0) { } - virtual bool Send(IPC::Message* message) override { + bool Send(IPC::Message* message) override { if (message->type() == InputMsg_ExecuteEditCommand::ID) edit_command_message_count_++; return RenderWidgetHostImpl::Send(message); diff --git a/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm b/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm index feea4ab..a51d5a8 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm @@ -91,7 +91,7 @@ namespace { class MockRenderWidgetHostDelegate : public RenderWidgetHostDelegate { public: MockRenderWidgetHostDelegate() {} - virtual ~MockRenderWidgetHostDelegate() {} + ~MockRenderWidgetHostDelegate() override {} }; class MockRenderWidgetHostImpl : public RenderWidgetHostImpl { diff --git a/content/browser/renderer_host/render_widget_resize_helper.cc b/content/browser/renderer_host/render_widget_resize_helper.cc index 212fcf1..3cc329d 100644 --- a/content/browser/renderer_host/render_widget_resize_helper.cc +++ b/content/browser/renderer_host/render_widget_resize_helper.cc @@ -72,21 +72,20 @@ class PumpableTaskRunner void RemoveWrappedTaskFromQueue(WrappedTask* task); // base::SingleThreadTaskRunner implementation: - virtual bool PostDelayedTask(const tracked_objects::Location& from_here, - const base::Closure& task, - base::TimeDelta delay) override; + bool PostDelayedTask(const tracked_objects::Location& from_here, + const base::Closure& task, + base::TimeDelta delay) override; - virtual bool PostNonNestableDelayedTask( - const tracked_objects::Location& from_here, - const base::Closure& task, - base::TimeDelta delay) override; + bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, + const base::Closure& task, + base::TimeDelta delay) override; - virtual bool RunsTasksOnCurrentThread() const override; + bool RunsTasksOnCurrentThread() const override; private: friend class WrappedTask; - virtual ~PumpableTaskRunner(); + ~PumpableTaskRunner() override; // A queue of live messages. Must hold |task_queue_lock_| to access. Tasks // are added only on the IO thread and removed only on the UI thread. The diff --git a/content/browser/renderer_host/socket_stream_dispatcher_host.h b/content/browser/renderer_host/socket_stream_dispatcher_host.h index a06a9ba..af1b83b 100644 --- a/content/browser/renderer_host/socket_stream_dispatcher_host.h +++ b/content/browser/renderer_host/socket_stream_dispatcher_host.h @@ -37,32 +37,32 @@ class SocketStreamDispatcherHost : public BrowserMessageFilter, ResourceContext* resource_context); // BrowserMessageFilter: - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; // Make this object inactive. // Remove all active SocketStreamHost objects. void Shutdown(); // SocketStream::Delegate: - virtual void OnConnected(net::SocketStream* socket, - int max_pending_send_allowed) override; - virtual void OnSentData(net::SocketStream* socket, int amount_sent) override; - virtual void OnReceivedData(net::SocketStream* socket, - const char* data, int len) override; - virtual void OnClose(net::SocketStream* socket) override; - virtual void OnError(const net::SocketStream* socket, int error) override; - virtual void OnSSLCertificateError(net::SocketStream* socket, - const net::SSLInfo& ssl_info, - bool fatal) override; - virtual bool CanGetCookies(net::SocketStream* socket, - const GURL& url) override; - virtual bool CanSetCookie(net::SocketStream* request, - const GURL& url, - const std::string& cookie_line, - net::CookieOptions* options) override; + void OnConnected(net::SocketStream* socket, + int max_pending_send_allowed) override; + void OnSentData(net::SocketStream* socket, int amount_sent) override; + void OnReceivedData(net::SocketStream* socket, + const char* data, + int len) override; + void OnClose(net::SocketStream* socket) override; + void OnError(const net::SocketStream* socket, int error) override; + void OnSSLCertificateError(net::SocketStream* socket, + const net::SSLInfo& ssl_info, + bool fatal) override; + bool CanGetCookies(net::SocketStream* socket, const GURL& url) override; + bool CanSetCookie(net::SocketStream* request, + const GURL& url, + const std::string& cookie_line, + net::CookieOptions* options) override; protected: - virtual ~SocketStreamDispatcherHost(); + ~SocketStreamDispatcherHost() override; private: // Message handlers called by OnMessageReceived. diff --git a/content/browser/renderer_host/socket_stream_host.cc b/content/browser/renderer_host/socket_stream_host.cc index 17ed383..deef6cc 100644 --- a/content/browser/renderer_host/socket_stream_host.cc +++ b/content/browser/renderer_host/socket_stream_host.cc @@ -18,7 +18,7 @@ const char* kSocketIdKey = "socketId"; class SocketStreamId : public net::SocketStream::UserData { public: explicit SocketStreamId(int socket_id) : socket_id_(socket_id) {} - virtual ~SocketStreamId() {} + ~SocketStreamId() override {} int socket_id() const { return socket_id_; } private: diff --git a/content/browser/renderer_host/socket_stream_host.h b/content/browser/renderer_host/socket_stream_host.h index 73e8f72..94234fb 100644 --- a/content/browser/renderer_host/socket_stream_host.h +++ b/content/browser/renderer_host/socket_stream_host.h @@ -34,7 +34,7 @@ class SocketStreamHost : public SSLErrorHandler::Delegate { int child_id, int render_frame_id, int socket_id); - virtual ~SocketStreamHost(); + ~SocketStreamHost() override; // Gets socket_id associated with |socket|. static int SocketIdFromSocketStream(const net::SocketStream* socket); @@ -58,9 +58,8 @@ class SocketStreamHost : public SSLErrorHandler::Delegate { base::WeakPtr<SSLErrorHandler::Delegate> AsSSLErrorHandlerDelegate(); // SSLErrorHandler::Delegate methods: - virtual void CancelSSLRequest(int error, - const net::SSLInfo* ssl_info) override; - virtual void ContinueSSLRequest() override; + void CancelSSLRequest(int error, const net::SSLInfo* ssl_info) override; + void ContinueSSLRequest() override; private: net::SocketStream::Delegate* delegate_; diff --git a/content/browser/renderer_host/software_frame_manager.h b/content/browser/renderer_host/software_frame_manager.h index 496a89a..5572985 100644 --- a/content/browser/renderer_host/software_frame_manager.h +++ b/content/browser/renderer_host/software_frame_manager.h @@ -39,7 +39,7 @@ class CONTENT_EXPORT SoftwareFrameManager : public RendererFrameManagerClient { public: explicit SoftwareFrameManager( base::WeakPtr<SoftwareFrameManagerClient> client); - virtual ~SoftwareFrameManager(); + ~SoftwareFrameManager() override; // Swaps to a new frame from shared memory. This frame is guaranteed to // not be evicted until SwapToNewFrameComplete is called. @@ -64,7 +64,7 @@ class CONTENT_EXPORT SoftwareFrameManager : public RendererFrameManagerClient { private: // Called by SoftwareFrameMemoryManager to demand that the current frame // be evicted. - virtual void EvictCurrentFrame() override; + void EvictCurrentFrame() override; base::WeakPtr<SoftwareFrameManagerClient> client_; diff --git a/content/browser/renderer_host/software_frame_manager_unittest.cc b/content/browser/renderer_host/software_frame_manager_unittest.cc index 8cbd0af..0569f25 100644 --- a/content/browser/renderer_host/software_frame_manager_unittest.cc +++ b/content/browser/renderer_host/software_frame_manager_unittest.cc @@ -25,13 +25,11 @@ class FakeSoftwareFrameManagerClient : public SoftwareFrameManagerClient { HostSharedBitmapManager::current()->ProcessRemoved( base::GetCurrentProcessHandle()); } - virtual void SoftwareFrameWasFreed(uint32 output_surface_id, - unsigned frame_id) override { + void SoftwareFrameWasFreed(uint32 output_surface_id, + unsigned frame_id) override { freed_frames_.push_back(std::make_pair(output_surface_id, frame_id)); } - virtual void ReleaseReferencesToSoftwareFrame() override { - ++evicted_count_; - } + void ReleaseReferencesToSoftwareFrame() override { ++evicted_count_; } bool SwapToNewFrame(uint32 output_surface, unsigned frame_id) { cc::SoftwareFrameData frame; diff --git a/content/browser/renderer_host/text_input_client_mac_unittest.mm b/content/browser/renderer_host/text_input_client_mac_unittest.mm index eddff7b..e208ccd 100644 --- a/content/browser/renderer_host/text_input_client_mac_unittest.mm +++ b/content/browser/renderer_host/text_input_client_mac_unittest.mm @@ -26,7 +26,7 @@ const int64 kTaskDelayMs = 200; class MockRenderWidgetHostDelegate : public RenderWidgetHostDelegate { public: MockRenderWidgetHostDelegate() {} - virtual ~MockRenderWidgetHostDelegate() {} + ~MockRenderWidgetHostDelegate() override {} }; // This test does not test the WebKit side of the dictionary system (which diff --git a/content/browser/renderer_host/text_input_client_message_filter.h b/content/browser/renderer_host/text_input_client_message_filter.h index be72ddc..1918620 100644 --- a/content/browser/renderer_host/text_input_client_message_filter.h +++ b/content/browser/renderer_host/text_input_client_message_filter.h @@ -25,10 +25,10 @@ class CONTENT_EXPORT TextInputClientMessageFilter explicit TextInputClientMessageFilter(int child_id); // BrowserMessageFilter override: - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; protected: - virtual ~TextInputClientMessageFilter(); + ~TextInputClientMessageFilter() override; private: // IPC Message handlers: diff --git a/content/browser/renderer_host/websocket_dispatcher_host.h b/content/browser/renderer_host/websocket_dispatcher_host.h index 2ef0380..b9cdd34 100644 --- a/content/browser/renderer_host/websocket_dispatcher_host.h +++ b/content/browser/renderer_host/websocket_dispatcher_host.h @@ -56,7 +56,7 @@ class CONTENT_EXPORT WebSocketDispatcherHost : public BrowserMessageFilter { const WebSocketHostFactory& websocket_host_factory); // BrowserMessageFilter: - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; // The following methods are used by WebSocketHost::EventInterface to send // IPCs from the browser to the renderer or child process. Any of them may @@ -116,7 +116,7 @@ class CONTENT_EXPORT WebSocketDispatcherHost : public BrowserMessageFilter { private: typedef base::hash_map<int, WebSocketHost*> WebSocketHostTable; - virtual ~WebSocketDispatcherHost(); + ~WebSocketDispatcherHost() override; WebSocketHost* CreateWebSocketHost(int routing_id); diff --git a/content/browser/renderer_host/websocket_dispatcher_host_unittest.cc b/content/browser/renderer_host/websocket_dispatcher_host_unittest.cc index 3986ea5..d59a3c4 100644 --- a/content/browser/renderer_host/websocket_dispatcher_host_unittest.cc +++ b/content/browser/renderer_host/websocket_dispatcher_host_unittest.cc @@ -35,14 +35,14 @@ class MockWebSocketHost : public WebSocketHost { net::URLRequestContext* url_request_context, WebSocketDispatcherHostTest* owner); - virtual ~MockWebSocketHost() {} + ~MockWebSocketHost() override {} - virtual bool OnMessageReceived(const IPC::Message& message) override { + bool OnMessageReceived(const IPC::Message& message) override { received_messages_.push_back(message); return true; } - virtual void GoAway() override; + void GoAway() override; std::vector<IPC::Message> received_messages_; base::WeakPtr<WebSocketDispatcherHostTest> owner_; diff --git a/content/browser/renderer_host/websocket_host.cc b/content/browser/renderer_host/websocket_host.cc index 7749be8..9b557fe 100644 --- a/content/browser/renderer_host/websocket_host.cc +++ b/content/browser/renderer_host/websocket_host.cc @@ -88,28 +88,27 @@ class WebSocketEventHandler : public net::WebSocketEventInterface { WebSocketEventHandler(WebSocketDispatcherHost* dispatcher, int routing_id, int render_frame_id); - virtual ~WebSocketEventHandler(); + ~WebSocketEventHandler() override; // net::WebSocketEventInterface implementation - virtual ChannelState OnAddChannelResponse( - bool fail, - const std::string& selected_subprotocol, - const std::string& extensions) override; - virtual ChannelState OnDataFrame(bool fin, - WebSocketMessageType type, - const std::vector<char>& data) override; - virtual ChannelState OnClosingHandshake() override; - virtual ChannelState OnFlowControl(int64 quota) override; - virtual ChannelState OnDropChannel(bool was_clean, - uint16 code, - const std::string& reason) override; - virtual ChannelState OnFailChannel(const std::string& message) override; - virtual ChannelState OnStartOpeningHandshake( + ChannelState OnAddChannelResponse(bool fail, + const std::string& selected_subprotocol, + const std::string& extensions) override; + ChannelState OnDataFrame(bool fin, + WebSocketMessageType type, + const std::vector<char>& data) override; + ChannelState OnClosingHandshake() override; + ChannelState OnFlowControl(int64 quota) override; + ChannelState OnDropChannel(bool was_clean, + uint16 code, + const std::string& reason) override; + ChannelState OnFailChannel(const std::string& message) override; + ChannelState OnStartOpeningHandshake( scoped_ptr<net::WebSocketHandshakeRequestInfo> request) override; - virtual ChannelState OnFinishOpeningHandshake( + ChannelState OnFinishOpeningHandshake( scoped_ptr<net::WebSocketHandshakeResponseInfo> response) override; - virtual ChannelState OnSSLCertificateError( + ChannelState OnSSLCertificateError( scoped_ptr<net::WebSocketEventInterface::SSLErrorCallbacks> callbacks, const GURL& url, const net::SSLInfo& ssl_info, @@ -120,14 +119,13 @@ class WebSocketEventHandler : public net::WebSocketEventInterface { public: SSLErrorHandlerDelegate( scoped_ptr<net::WebSocketEventInterface::SSLErrorCallbacks> callbacks); - virtual ~SSLErrorHandlerDelegate(); + ~SSLErrorHandlerDelegate() override; base::WeakPtr<SSLErrorHandler::Delegate> GetWeakPtr(); // SSLErrorHandler::Delegate methods - virtual void CancelSSLRequest(int error, - const net::SSLInfo* ssl_info) override; - virtual void ContinueSSLRequest() override; + void CancelSSLRequest(int error, const net::SSLInfo* ssl_info) override; + void ContinueSSLRequest() override; private: scoped_ptr<net::WebSocketEventInterface::SSLErrorCallbacks> callbacks_; diff --git a/content/browser/resolve_proxy_msg_helper.h b/content/browser/resolve_proxy_msg_helper.h index ac313ee..f076d97 100644 --- a/content/browser/resolve_proxy_msg_helper.h +++ b/content/browser/resolve_proxy_msg_helper.h @@ -38,14 +38,14 @@ class CONTENT_EXPORT ResolveProxyMsgHelper : public BrowserMessageFilter { explicit ResolveProxyMsgHelper(net::ProxyService* proxy_service); // BrowserMessageFilter implementation - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; void OnResolveProxy(const GURL& url, IPC::Message* reply_msg); protected: // Destruction cancels the current outstanding request, and clears the // pending queue. - virtual ~ResolveProxyMsgHelper(); + ~ResolveProxyMsgHelper() override; private: // Callback for the ProxyService (bound to |callback_|). diff --git a/content/browser/resolve_proxy_msg_helper_unittest.cc b/content/browser/resolve_proxy_msg_helper_unittest.cc index 3ddac35..1a19018 100644 --- a/content/browser/resolve_proxy_msg_helper_unittest.cc +++ b/content/browser/resolve_proxy_msg_helper_unittest.cc @@ -18,10 +18,9 @@ namespace content { // This ProxyConfigService always returns "http://pac" as the PAC url to use. class MockProxyConfigService : public net::ProxyConfigService { public: - virtual void AddObserver(Observer* observer) override {} - virtual void RemoveObserver(Observer* observer) override {} - virtual ConfigAvailability GetLatestProxyConfig( - net::ProxyConfig* results) override { + void AddObserver(Observer* observer) override {} + void RemoveObserver(Observer* observer) override {} + ConfigAvailability GetLatestProxyConfig(net::ProxyConfig* results) override { *results = net::ProxyConfig::CreateFromCustomPacURL(GURL("http://pac")); return CONFIG_VALID; } @@ -34,14 +33,14 @@ class TestResolveProxyMsgHelper : public ResolveProxyMsgHelper { IPC::Listener* listener) : ResolveProxyMsgHelper(proxy_service), listener_(listener) {} - virtual bool Send(IPC::Message* message) override { + bool Send(IPC::Message* message) override { listener_->OnMessageReceived(*message); delete message; return true; } protected: - virtual ~TestResolveProxyMsgHelper() {} + ~TestResolveProxyMsgHelper() override {} IPC::Listener* listener_; }; @@ -87,7 +86,7 @@ class ResolveProxyMsgHelperTest : public testing::Test, public IPC::Listener { scoped_ptr<PendingResult> pending_result_; private: - virtual bool OnMessageReceived(const IPC::Message& msg) override { + bool OnMessageReceived(const IPC::Message& msg) override { TupleTypes<ViewHostMsg_ResolveProxy::ReplyParam>::ValueTuple reply_data; EXPECT_TRUE(ViewHostMsg_ResolveProxy::ReadReplyParam(&msg, &reply_data)); DCHECK(!pending_result_.get()); diff --git a/content/browser/screen_orientation/screen_orientation_browsertest.cc b/content/browser/screen_orientation/screen_orientation_browsertest.cc index c79cad0..1246136 100644 --- a/content/browser/screen_orientation/screen_orientation_browsertest.cc +++ b/content/browser/screen_orientation/screen_orientation_browsertest.cc @@ -32,7 +32,7 @@ class ScreenOrientationBrowserTest : public ContentBrowserTest { ScreenOrientationBrowserTest() { } - virtual void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(CommandLine* command_line) override { command_line->AppendSwitch( switches::kEnableExperimentalWebPlatformFeatures); } diff --git a/content/browser/screen_orientation/screen_orientation_dispatcher_host_impl.h b/content/browser/screen_orientation/screen_orientation_dispatcher_host_impl.h index c22d65b..a884083 100644 --- a/content/browser/screen_orientation/screen_orientation_dispatcher_host_impl.h +++ b/content/browser/screen_orientation/screen_orientation_dispatcher_host_impl.h @@ -24,19 +24,19 @@ class CONTENT_EXPORT ScreenOrientationDispatcherHostImpl public WebContentsObserver { public: explicit ScreenOrientationDispatcherHostImpl(WebContents* web_contents); - virtual ~ScreenOrientationDispatcherHostImpl(); + ~ScreenOrientationDispatcherHostImpl() override; // ScreenOrientationDispatcherHost: - virtual void NotifyLockSuccess(int request_id) override; - virtual void NotifyLockError(int request_id, - blink::WebLockOrientationError error) override; - virtual void OnOrientationChange() override; + void NotifyLockSuccess(int request_id) override; + void NotifyLockError(int request_id, + blink::WebLockOrientationError error) override; + void OnOrientationChange() override; // WebContentsObserver: - virtual bool OnMessageReceived(const IPC::Message&, - RenderFrameHost* render_frame_host) override; - virtual void DidNavigateMainFrame(const LoadCommittedDetails& details, - const FrameNavigateParams& params) override; + bool OnMessageReceived(const IPC::Message&, + RenderFrameHost* render_frame_host) override; + void DidNavigateMainFrame(const LoadCommittedDetails& details, + const FrameNavigateParams& params) override; private: void OnLockRequest(RenderFrameHost* render_frame_host, diff --git a/content/browser/security_exploit_browsertest.cc b/content/browser/security_exploit_browsertest.cc index 21b3a56..2a1be07 100644 --- a/content/browser/security_exploit_browsertest.cc +++ b/content/browser/security_exploit_browsertest.cc @@ -84,7 +84,7 @@ RenderViewHostImpl* PrepareToDuplicateHosts(Shell* shell, class SecurityExploitBrowserTest : public ContentBrowserTest { public: SecurityExploitBrowserTest() {} - virtual void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(CommandLine* command_line) override { ASSERT_TRUE(test_server()->Start()); // Add a host resolver rule to map all outgoing requests to the test server. diff --git a/content/browser/service_worker/embedded_worker_test_helper.h b/content/browser/service_worker/embedded_worker_test_helper.h index 06e7374..fa24671 100644 --- a/content/browser/service_worker/embedded_worker_test_helper.h +++ b/content/browser/service_worker/embedded_worker_test_helper.h @@ -46,17 +46,17 @@ class EmbeddedWorkerTestHelper : public IPC::Sender, // Initialize this helper for |context|, and enable this as an IPC // sender for |mock_render_process_id|. explicit EmbeddedWorkerTestHelper(int mock_render_process_id); - virtual ~EmbeddedWorkerTestHelper(); + ~EmbeddedWorkerTestHelper() override; // Call this to simulate add/associate a process to a pattern. // This also registers this sender for the process. void SimulateAddProcessToPattern(const GURL& pattern, int process_id); // IPC::Sender implementation. - virtual bool Send(IPC::Message* message) override; + bool Send(IPC::Message* message) override; // IPC::Listener implementation. - virtual bool OnMessageReceived(const IPC::Message& msg) override; + bool OnMessageReceived(const IPC::Message& msg) override; // IPC sink for EmbeddedWorker messages. IPC::TestSink* ipc_sink() { return &sink_; } diff --git a/content/browser/service_worker/service_worker_browsertest.cc b/content/browser/service_worker/service_worker_browsertest.cc index ad9a0cc..28e6a09 100644 --- a/content/browser/service_worker/service_worker_browsertest.cc +++ b/content/browser/service_worker/service_worker_browsertest.cc @@ -145,7 +145,7 @@ class WorkerActivatedObserver RunOnIOThread(base::Bind(&WorkerActivatedObserver::InitOnIOThread, this)); } // ServiceWorkerContextObserver overrides. - virtual void OnVersionStateChanged(int64 version_id) override { + void OnVersionStateChanged(int64 version_id) override { DCHECK_CURRENTLY_ON(BrowserThread::IO); const ServiceWorkerVersion* version = context_->context()->GetLiveVersion(version_id); @@ -160,7 +160,7 @@ class WorkerActivatedObserver private: friend class base::RefCountedThreadSafe<WorkerActivatedObserver>; - virtual ~WorkerActivatedObserver() {} + ~WorkerActivatedObserver() override {} void InitOnIOThread() { context_->AddObserver(this); } void Quit() { run_loop_.Quit(); } @@ -192,10 +192,10 @@ class LongLivedResourceInterceptor : public net::URLRequestInterceptor { public: LongLivedResourceInterceptor(const std::string& body) : body_(body) {} - virtual ~LongLivedResourceInterceptor() {} + ~LongLivedResourceInterceptor() override {} // net::URLRequestInterceptor implementation - virtual net::URLRequestJob* MaybeInterceptRequest( + net::URLRequestJob* MaybeInterceptRequest( net::URLRequest* request, net::NetworkDelegate* network_delegate) const override { const char kHeaders[] = @@ -262,12 +262,12 @@ class ServiceWorkerBrowserTest : public ContentBrowserTest { protected: typedef ServiceWorkerBrowserTest self; - virtual void SetUpCommandLine(base::CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch( switches::kEnableExperimentalWebPlatformFeatures); } - virtual void SetUpOnMainThread() override { + void SetUpOnMainThread() override { ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); StoragePartition* partition = BrowserContext::GetDefaultStoragePartition( shell()->web_contents()->GetBrowserContext()); @@ -283,7 +283,7 @@ class ServiceWorkerBrowserTest : public ContentBrowserTest { RunOnIOThread(base::Bind(&self::SetUpOnIOThread, this)); } - virtual void TearDownOnMainThread() override { + void TearDownOnMainThread() override { RunOnIOThread(base::Bind(&self::TearDownOnIOThread, this)); wrapper_ = NULL; } @@ -313,7 +313,7 @@ class EmbeddedWorkerBrowserTest : public ServiceWorkerBrowserTest, pause_mode_(DONT_PAUSE) {} virtual ~EmbeddedWorkerBrowserTest() {} - virtual void TearDownOnIOThread() override { + void TearDownOnIOThread() override { if (worker_) { worker_->RemoveListener(this); worker_.reset(); @@ -367,19 +367,19 @@ class EmbeddedWorkerBrowserTest : public ServiceWorkerBrowserTest, protected: // EmbeddedWorkerInstance::Observer overrides: - virtual void OnStarted() override { + void OnStarted() override { ASSERT_TRUE(worker_ != NULL); ASSERT_FALSE(done_closure_.is_null()); last_worker_status_ = worker_->status(); BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, done_closure_); } - virtual void OnStopped() override { + void OnStopped() override { ASSERT_TRUE(worker_ != NULL); ASSERT_FALSE(done_closure_.is_null()); last_worker_status_ = worker_->status(); BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, done_closure_); } - virtual void OnPausedAfterDownload() override { + void OnPausedAfterDownload() override { if (pause_mode_ == PAUSE_THEN_RESUME) worker_->ResumeAfterDownload(); else if (pause_mode_ == PAUSE_THEN_STOP) @@ -387,18 +387,16 @@ class EmbeddedWorkerBrowserTest : public ServiceWorkerBrowserTest, else ASSERT_TRUE(false); } - virtual void OnReportException(const base::string16& error_message, - int line_number, - int column_number, - const GURL& source_url) override {} - virtual void OnReportConsoleMessage(int source_identifier, - int message_level, - const base::string16& message, - int line_number, - const GURL& source_url) override {} - virtual bool OnMessageReceived(const IPC::Message& message) override { - return false; - } + void OnReportException(const base::string16& error_message, + int line_number, + int column_number, + const GURL& source_url) override {} + void OnReportConsoleMessage(int source_identifier, + int message_level, + const base::string16& message, + int line_number, + const GURL& source_url) override {} + bool OnMessageReceived(const IPC::Message& message) override { return false; } scoped_ptr<EmbeddedWorkerInstance> worker_; EmbeddedWorkerInstance::Status last_worker_status_; @@ -420,7 +418,7 @@ class ServiceWorkerVersionBrowserTest : public ServiceWorkerBrowserTest { virtual ~ServiceWorkerVersionBrowserTest() {} - virtual void TearDownOnIOThread() override { + void TearDownOnIOThread() override { registration_ = NULL; version_ = NULL; } diff --git a/content/browser/service_worker/service_worker_cache.cc b/content/browser/service_worker/service_worker_cache.cc index ddff117..5026cef 100644 --- a/content/browser/service_worker/service_worker_cache.cc +++ b/content/browser/service_worker/service_worker_cache.cc @@ -113,31 +113,30 @@ class BlobReader : public net::URLRequest::Delegate { } // net::URLRequest::Delegate overrides for reading blobs. - virtual void OnReceivedRedirect(net::URLRequest* request, - const net::RedirectInfo& redirect_info, - bool* defer_redirect) override { + void OnReceivedRedirect(net::URLRequest* request, + const net::RedirectInfo& redirect_info, + bool* defer_redirect) override { NOTREACHED(); } - virtual void OnAuthRequired(net::URLRequest* request, - net::AuthChallengeInfo* auth_info) override { + void OnAuthRequired(net::URLRequest* request, + net::AuthChallengeInfo* auth_info) override { NOTREACHED(); } - virtual void OnCertificateRequested( + void OnCertificateRequested( net::URLRequest* request, net::SSLCertRequestInfo* cert_request_info) override { NOTREACHED(); } - virtual void OnSSLCertificateError(net::URLRequest* request, - const net::SSLInfo& ssl_info, - bool fatal) override { + void OnSSLCertificateError(net::URLRequest* request, + const net::SSLInfo& ssl_info, + bool fatal) override { NOTREACHED(); } - virtual void OnBeforeNetworkStart(net::URLRequest* request, - bool* defer) override { + void OnBeforeNetworkStart(net::URLRequest* request, bool* defer) override { NOTREACHED(); } - virtual void OnResponseStarted(net::URLRequest* request) override { + void OnResponseStarted(net::URLRequest* request) override { if (!request->status().is_success()) { callback_.Run(false); return; @@ -153,8 +152,7 @@ class BlobReader : public net::URLRequest::Delegate { OnReadCompleted(blob_request_.get(), bytes_read); } - virtual void OnReadCompleted(net::URLRequest* request, - int bytes_read) override { + void OnReadCompleted(net::URLRequest* request, int bytes_read) override { if (!request->status().is_success()) { callback_.Run(false); return; diff --git a/content/browser/service_worker/service_worker_cache_listener.h b/content/browser/service_worker/service_worker_cache_listener.h index e62925d..a4dbf66 100644 --- a/content/browser/service_worker/service_worker_cache_listener.h +++ b/content/browser/service_worker/service_worker_cache_listener.h @@ -28,10 +28,10 @@ class ServiceWorkerCacheListener : public EmbeddedWorkerInstance::Listener { public: ServiceWorkerCacheListener(ServiceWorkerVersion* version, base::WeakPtr<ServiceWorkerContextCore> context); - virtual ~ServiceWorkerCacheListener(); + ~ServiceWorkerCacheListener() override; // From EmbeddedWorkerInstance::Listener: - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; private: // The message receiver functions for the CacheStorage API: diff --git a/content/browser/service_worker/service_worker_cache_quota_client.h b/content/browser/service_worker/service_worker_cache_quota_client.h index 65ab018..8211149 100644 --- a/content/browser/service_worker/service_worker_cache_quota_client.h +++ b/content/browser/service_worker/service_worker_cache_quota_client.h @@ -25,23 +25,23 @@ class CONTENT_EXPORT ServiceWorkerCacheQuotaClient public: explicit ServiceWorkerCacheQuotaClient( base::WeakPtr<ServiceWorkerCacheStorageManager> cache_manager); - virtual ~ServiceWorkerCacheQuotaClient(); + ~ServiceWorkerCacheQuotaClient() override; // QuotaClient overrides - virtual ID id() const override; - virtual void OnQuotaManagerDestroyed() override; - virtual void GetOriginUsage(const GURL& origin_url, - storage::StorageType type, - const GetUsageCallback& callback) override; - virtual void GetOriginsForType(storage::StorageType type, - const GetOriginsCallback& callback) override; - virtual void GetOriginsForHost(storage::StorageType type, - const std::string& host, - const GetOriginsCallback& callback) override; - virtual void DeleteOriginData(const GURL& origin, - storage::StorageType type, - const DeletionCallback& callback) override; - virtual bool DoesSupport(storage::StorageType type) const override; + ID id() const override; + void OnQuotaManagerDestroyed() override; + void GetOriginUsage(const GURL& origin_url, + storage::StorageType type, + const GetUsageCallback& callback) override; + void GetOriginsForType(storage::StorageType type, + const GetOriginsCallback& callback) override; + void GetOriginsForHost(storage::StorageType type, + const std::string& host, + const GetOriginsCallback& callback) override; + void DeleteOriginData(const GURL& origin, + storage::StorageType type, + const DeletionCallback& callback) override; + bool DoesSupport(storage::StorageType type) const override; private: base::WeakPtr<ServiceWorkerCacheStorageManager> cache_manager_; diff --git a/content/browser/service_worker/service_worker_cache_storage.cc b/content/browser/service_worker/service_worker_cache_storage.cc index c388c2b..e048c68 100644 --- a/content/browser/service_worker/service_worker_cache_storage.cc +++ b/content/browser/service_worker/service_worker_cache_storage.cc @@ -89,41 +89,41 @@ class ServiceWorkerCacheStorage::MemoryLoader const GURL& origin) : CacheLoader(cache_task_runner, request_context, blob_context, origin) {} - virtual scoped_refptr<ServiceWorkerCache> CreateServiceWorkerCache( + scoped_refptr<ServiceWorkerCache> CreateServiceWorkerCache( const std::string& cache_name) override { return ServiceWorkerCache::CreateMemoryCache(request_context_, blob_context_); } - virtual void CreateCache(const std::string& cache_name, - const CacheCallback& callback) override { + void CreateCache(const std::string& cache_name, + const CacheCallback& callback) override { scoped_refptr<ServiceWorkerCache> cache = ServiceWorkerCache::CreateMemoryCache(request_context_, blob_context_); cache_refs_.insert(std::make_pair(cache_name, cache)); callback.Run(cache); } - virtual void CleanUpDeletedCache(const std::string& cache_name, - const BoolCallback& callback) override { + void CleanUpDeletedCache(const std::string& cache_name, + const BoolCallback& callback) override { CacheRefMap::iterator it = cache_refs_.find(cache_name); DCHECK(it != cache_refs_.end()); cache_refs_.erase(it); callback.Run(true); } - virtual void WriteIndex(const StringVector& cache_names, - const BoolCallback& callback) override { + void WriteIndex(const StringVector& cache_names, + const BoolCallback& callback) override { callback.Run(false); } - virtual void LoadIndex(scoped_ptr<std::vector<std::string> > cache_names, - const StringVectorCallback& callback) override { + void LoadIndex(scoped_ptr<std::vector<std::string>> cache_names, + const StringVectorCallback& callback) override { callback.Run(cache_names.Pass()); } private: typedef std::map<std::string, scoped_refptr<ServiceWorkerCache> > CacheRefMap; - virtual ~MemoryLoader() {} + ~MemoryLoader() override {} // Keep a reference to each cache to ensure that it's not freed before the // client calls ServiceWorkerCacheStorage::Delete or the CacheStorage is @@ -143,7 +143,7 @@ class ServiceWorkerCacheStorage::SimpleCacheLoader origin_path_(origin_path), weak_ptr_factory_(this) {} - virtual scoped_refptr<ServiceWorkerCache> CreateServiceWorkerCache( + scoped_refptr<ServiceWorkerCache> CreateServiceWorkerCache( const std::string& cache_name) override { DCHECK_CURRENTLY_ON(BrowserThread::IO); @@ -153,8 +153,8 @@ class ServiceWorkerCacheStorage::SimpleCacheLoader blob_context_); } - virtual void CreateCache(const std::string& cache_name, - const CacheCallback& callback) override { + void CreateCache(const std::string& cache_name, + const CacheCallback& callback) override { DCHECK_CURRENTLY_ON(BrowserThread::IO); // 1. Delete the cache's directory if it exists. @@ -192,8 +192,8 @@ class ServiceWorkerCacheStorage::SimpleCacheLoader callback.Run(loader->CreateServiceWorkerCache(cache_name)); } - virtual void CleanUpDeletedCache(const std::string& cache_name, - const BoolCallback& callback) override { + void CleanUpDeletedCache(const std::string& cache_name, + const BoolCallback& callback) override { DCHECK_CURRENTLY_ON(BrowserThread::IO); // 1. Delete the cache's directory. (CleanUpDeleteCacheDirInPool) @@ -216,8 +216,8 @@ class ServiceWorkerCacheStorage::SimpleCacheLoader original_loop->PostTask(FROM_HERE, base::Bind(callback, rv)); } - virtual void WriteIndex(const StringVector& cache_names, - const BoolCallback& callback) override { + void WriteIndex(const StringVector& cache_names, + const BoolCallback& callback) override { DCHECK_CURRENTLY_ON(BrowserThread::IO); // 1. Create the index file as a string. (WriteIndex) @@ -267,8 +267,8 @@ class ServiceWorkerCacheStorage::SimpleCacheLoader original_loop->PostTask(FROM_HERE, base::Bind(callback, rv)); } - virtual void LoadIndex(scoped_ptr<std::vector<std::string> > names, - const StringVectorCallback& callback) override { + void LoadIndex(scoped_ptr<std::vector<std::string>> names, + const StringVectorCallback& callback) override { DCHECK_CURRENTLY_ON(BrowserThread::IO); // 1. Read the file from disk. (LoadIndexReadFileInPool) @@ -320,7 +320,7 @@ class ServiceWorkerCacheStorage::SimpleCacheLoader } private: - virtual ~SimpleCacheLoader() {} + ~SimpleCacheLoader() override {} static std::string HexedHash(const std::string& value) { std::string value_hash = base::SHA1HashString(value); diff --git a/content/browser/service_worker/service_worker_cache_storage_manager_unittest.cc b/content/browser/service_worker/service_worker_cache_storage_manager_unittest.cc index b82774a..09d3537 100644 --- a/content/browser/service_worker/service_worker_cache_storage_manager_unittest.cc +++ b/content/browser/service_worker/service_worker_cache_storage_manager_unittest.cc @@ -223,13 +223,13 @@ class ServiceWorkerCacheStorageManagerTest : public testing::Test { class ServiceWorkerCacheStorageManagerMemoryOnlyTest : public ServiceWorkerCacheStorageManagerTest { - virtual bool MemoryOnly() override { return true; } + bool MemoryOnly() override { return true; } }; class ServiceWorkerCacheStorageManagerTestP : public ServiceWorkerCacheStorageManagerTest, public testing::WithParamInterface<bool> { - virtual bool MemoryOnly() override { return !GetParam(); } + bool MemoryOnly() override { return !GetParam(); } }; TEST_F(ServiceWorkerCacheStorageManagerTest, TestsRunOnIOThread) { @@ -515,7 +515,7 @@ class ServiceWorkerCacheQuotaClientTest class ServiceWorkerCacheQuotaClientTestP : public ServiceWorkerCacheQuotaClientTest, public testing::WithParamInterface<bool> { - virtual bool MemoryOnly() override { return !GetParam(); } + bool MemoryOnly() override { return !GetParam(); } }; TEST_P(ServiceWorkerCacheQuotaClientTestP, QuotaID) { diff --git a/content/browser/service_worker/service_worker_cache_unittest.cc b/content/browser/service_worker/service_worker_cache_unittest.cc index ad937da..b1cd1d9 100644 --- a/content/browser/service_worker/service_worker_cache_unittest.cc +++ b/content/browser/service_worker/service_worker_cache_unittest.cc @@ -286,7 +286,7 @@ class ServiceWorkerCacheTest : public testing::Test { class ServiceWorkerCacheTestP : public ServiceWorkerCacheTest, public testing::WithParamInterface<bool> { - virtual bool MemoryOnly() override { return !GetParam(); } + bool MemoryOnly() override { return !GetParam(); } }; TEST_P(ServiceWorkerCacheTestP, PutNoBody) { diff --git a/content/browser/service_worker/service_worker_context_core.h b/content/browser/service_worker/service_worker_context_core.h index 87c6909..63522ea 100644 --- a/content/browser/service_worker/service_worker_context_core.h +++ b/content/browser/service_worker/service_worker_context_core.h @@ -108,23 +108,23 @@ class CONTENT_EXPORT ServiceWorkerContextCore ServiceWorkerContextCore( ServiceWorkerContextCore* old_context, ServiceWorkerContextWrapper* wrapper); - virtual ~ServiceWorkerContextCore(); + ~ServiceWorkerContextCore() override; // ServiceWorkerVersion::Listener overrides. - virtual void OnWorkerStarted(ServiceWorkerVersion* version) override; - virtual void OnWorkerStopped(ServiceWorkerVersion* version) override; - virtual void OnVersionStateChanged(ServiceWorkerVersion* version) override; - virtual void OnErrorReported(ServiceWorkerVersion* version, - const base::string16& error_message, - int line_number, - int column_number, - const GURL& source_url) override; - virtual void OnReportConsoleMessage(ServiceWorkerVersion* version, - int source_identifier, - int message_level, - const base::string16& message, - int line_number, - const GURL& source_url) override; + void OnWorkerStarted(ServiceWorkerVersion* version) override; + void OnWorkerStopped(ServiceWorkerVersion* version) override; + void OnVersionStateChanged(ServiceWorkerVersion* version) override; + void OnErrorReported(ServiceWorkerVersion* version, + const base::string16& error_message, + int line_number, + int column_number, + const GURL& source_url) override; + void OnReportConsoleMessage(ServiceWorkerVersion* version, + int source_identifier, + int message_level, + const base::string16& message, + int line_number, + const GURL& source_url) override; ServiceWorkerStorage* storage() { return storage_.get(); } ServiceWorkerCacheStorageManager* cache_manager() { diff --git a/content/browser/service_worker/service_worker_context_request_handler.h b/content/browser/service_worker/service_worker_context_request_handler.h index 5b9d45da..c8af8ed 100644 --- a/content/browser/service_worker/service_worker_context_request_handler.h +++ b/content/browser/service_worker/service_worker_context_request_handler.h @@ -21,15 +21,15 @@ class CONTENT_EXPORT ServiceWorkerContextRequestHandler base::WeakPtr<ServiceWorkerProviderHost> provider_host, base::WeakPtr<storage::BlobStorageContext> blob_storage_context, ResourceType resource_type); - virtual ~ServiceWorkerContextRequestHandler(); + ~ServiceWorkerContextRequestHandler() override; // Called via custom URLRequestJobFactory. - virtual net::URLRequestJob* MaybeCreateJob( + net::URLRequestJob* MaybeCreateJob( net::URLRequest* request, net::NetworkDelegate* network_delegate, ResourceContext* resource_context) override; - virtual void GetExtraResponseInfo( + void GetExtraResponseInfo( bool* was_fetched_via_service_worker, bool* was_fallback_required_by_service_worker, GURL* original_url_via_service_worker, diff --git a/content/browser/service_worker/service_worker_context_unittest.cc b/content/browser/service_worker/service_worker_context_unittest.cc index 4341917..f04e575 100644 --- a/content/browser/service_worker/service_worker_context_unittest.cc +++ b/content/browser/service_worker/service_worker_context_unittest.cc @@ -77,9 +77,9 @@ class RejectInstallTestHelper : public EmbeddedWorkerTestHelper { explicit RejectInstallTestHelper(int mock_render_process_id) : EmbeddedWorkerTestHelper(mock_render_process_id) {} - virtual void OnInstallEvent(int embedded_worker_id, - int request_id, - int active_version_id) override { + void OnInstallEvent(int embedded_worker_id, + int request_id, + int active_version_id) override { SimulateSend( new ServiceWorkerHostMsg_InstallEventFinished( embedded_worker_id, request_id, @@ -92,8 +92,7 @@ class RejectActivateTestHelper : public EmbeddedWorkerTestHelper { explicit RejectActivateTestHelper(int mock_render_process_id) : EmbeddedWorkerTestHelper(mock_render_process_id) {} - virtual void OnActivateEvent(int embedded_worker_id, - int request_id) override { + void OnActivateEvent(int embedded_worker_id, int request_id) override { SimulateSend( new ServiceWorkerHostMsg_ActivateEventFinished( embedded_worker_id, request_id, diff --git a/content/browser/service_worker/service_worker_context_wrapper.h b/content/browser/service_worker/service_worker_context_wrapper.h index 57a2b6a..0670c0c 100644 --- a/content/browser/service_worker/service_worker_context_wrapper.h +++ b/content/browser/service_worker/service_worker_context_wrapper.h @@ -67,16 +67,14 @@ class CONTENT_EXPORT ServiceWorkerContextWrapper } // ServiceWorkerContext implementation: - virtual void RegisterServiceWorker( - const GURL& pattern, - const GURL& script_url, - const ResultCallback& continuation) override; - virtual void UnregisterServiceWorker( - const GURL& pattern, - const ResultCallback& continuation) override; - virtual void Terminate() override; - virtual void GetAllOriginsInfo(const GetUsageInfoCallback& callback) override; - virtual void DeleteForOrigin(const GURL& origin_url) override; + void RegisterServiceWorker(const GURL& pattern, + const GURL& script_url, + const ResultCallback& continuation) override; + void UnregisterServiceWorker(const GURL& pattern, + const ResultCallback& continuation) override; + void Terminate() override; + void GetAllOriginsInfo(const GetUsageInfoCallback& callback) override; + void DeleteForOrigin(const GURL& origin_url) override; // DeleteForOrigin with completion callback. Does not exit early, and returns // false if one or more of the deletions fail. @@ -104,7 +102,7 @@ class CONTENT_EXPORT ServiceWorkerContextWrapper friend class ServiceWorkerProcessManager; friend class MockServiceWorkerContextWrapper; - virtual ~ServiceWorkerContextWrapper(); + ~ServiceWorkerContextWrapper() override; void InitInternal( const base::FilePath& user_data_directory, diff --git a/content/browser/service_worker/service_worker_controllee_request_handler.h b/content/browser/service_worker/service_worker_controllee_request_handler.h index ea04b58..9c2becc 100644 --- a/content/browser/service_worker/service_worker_controllee_request_handler.h +++ b/content/browser/service_worker/service_worker_controllee_request_handler.h @@ -40,15 +40,15 @@ class CONTENT_EXPORT ServiceWorkerControlleeRequestHandler RequestContextType request_context_type, RequestContextFrameType frame_type, scoped_refptr<ResourceRequestBody> body); - virtual ~ServiceWorkerControlleeRequestHandler(); + ~ServiceWorkerControlleeRequestHandler() override; // Called via custom URLRequestJobFactory. - virtual net::URLRequestJob* MaybeCreateJob( + net::URLRequestJob* MaybeCreateJob( net::URLRequest* request, net::NetworkDelegate* network_delegate, ResourceContext* resource_context) override; - virtual void GetExtraResponseInfo( + void GetExtraResponseInfo( bool* was_fetched_via_service_worker, bool* was_fallback_required_by_service_worker, GURL* original_url_via_service_worker, diff --git a/content/browser/service_worker/service_worker_controllee_request_handler_unittest.cc b/content/browser/service_worker/service_worker_controllee_request_handler_unittest.cc index 05f938d..fe3aff6 100644 --- a/content/browser/service_worker/service_worker_controllee_request_handler_unittest.cc +++ b/content/browser/service_worker/service_worker_controllee_request_handler_unittest.cc @@ -88,9 +88,9 @@ class ServiceWorkerControlleeRequestHandlerTest : public testing::Test { class ServiceWorkerTestContentBrowserClient : public TestContentBrowserClient { public: ServiceWorkerTestContentBrowserClient() {} - virtual bool AllowServiceWorker(const GURL& scope, - const GURL& first_party, - content::ResourceContext* context) override { + bool AllowServiceWorker(const GURL& scope, + const GURL& first_party, + content::ResourceContext* context) override { return false; } }; diff --git a/content/browser/service_worker/service_worker_database_task_manager.h b/content/browser/service_worker/service_worker_database_task_manager.h index 9b8c0e8..fdf13f9 100644 --- a/content/browser/service_worker/service_worker_database_task_manager.h +++ b/content/browser/service_worker/service_worker_database_task_manager.h @@ -32,12 +32,12 @@ class ServiceWorkerDatabaseTaskManagerImpl public: explicit ServiceWorkerDatabaseTaskManagerImpl( base::SequencedWorkerPool* pool); - virtual ~ServiceWorkerDatabaseTaskManagerImpl(); + ~ServiceWorkerDatabaseTaskManagerImpl() override; protected: - virtual scoped_ptr<ServiceWorkerDatabaseTaskManager> Clone() override; - virtual base::SequencedTaskRunner* GetTaskRunner() override; - virtual base::SequencedTaskRunner* GetShutdownBlockingTaskRunner() override; + scoped_ptr<ServiceWorkerDatabaseTaskManager> Clone() override; + base::SequencedTaskRunner* GetTaskRunner() override; + base::SequencedTaskRunner* GetShutdownBlockingTaskRunner() override; private: ServiceWorkerDatabaseTaskManagerImpl( @@ -57,12 +57,12 @@ class CONTENT_EXPORT MockServiceWorkerDatabaseTaskManager public: explicit MockServiceWorkerDatabaseTaskManager( const scoped_refptr<base::SequencedTaskRunner>& task_runner); - virtual ~MockServiceWorkerDatabaseTaskManager(); + ~MockServiceWorkerDatabaseTaskManager() override; protected: - virtual scoped_ptr<ServiceWorkerDatabaseTaskManager> Clone() override; - virtual base::SequencedTaskRunner* GetTaskRunner() override; - virtual base::SequencedTaskRunner* GetShutdownBlockingTaskRunner() override; + scoped_ptr<ServiceWorkerDatabaseTaskManager> Clone() override; + base::SequencedTaskRunner* GetTaskRunner() override; + base::SequencedTaskRunner* GetShutdownBlockingTaskRunner() override; private: scoped_refptr<base::SequencedTaskRunner> task_runner_; diff --git a/content/browser/service_worker/service_worker_dispatcher_host.h b/content/browser/service_worker/service_worker_dispatcher_host.h index 725cb28..c3140c4 100644 --- a/content/browser/service_worker/service_worker_dispatcher_host.h +++ b/content/browser/service_worker/service_worker_dispatcher_host.h @@ -39,9 +39,9 @@ class CONTENT_EXPORT ServiceWorkerDispatcherHost : public BrowserMessageFilter { void Init(ServiceWorkerContextWrapper* context_wrapper); // BrowserMessageFilter implementation - virtual void OnFilterAdded(IPC::Sender* sender) override; - virtual void OnDestruct() const override; - virtual bool OnMessageReceived(const IPC::Message& message) override; + void OnFilterAdded(IPC::Sender* sender) override; + void OnDestruct() const override; + bool OnMessageReceived(const IPC::Message& message) override; // IPC::Sender implementation @@ -49,7 +49,7 @@ class CONTENT_EXPORT ServiceWorkerDispatcherHost : public BrowserMessageFilter { // class assumes that Send() can only fail after that when the renderer // process has terminated, at which point the whole instance will eventually // be destroyed. - virtual bool Send(IPC::Message* message) override; + bool Send(IPC::Message* message) override; // Returns the existing registration handle whose reference count is // incremented or newly created one if it doesn't exist. @@ -66,7 +66,7 @@ class CONTENT_EXPORT ServiceWorkerDispatcherHost : public BrowserMessageFilter { } protected: - virtual ~ServiceWorkerDispatcherHost(); + ~ServiceWorkerDispatcherHost() override; private: friend class BrowserThread; diff --git a/content/browser/service_worker/service_worker_dispatcher_host_unittest.cc b/content/browser/service_worker/service_worker_dispatcher_host_unittest.cc index 969f232..6f7f25d 100644 --- a/content/browser/service_worker/service_worker_dispatcher_host_unittest.cc +++ b/content/browser/service_worker/service_worker_dispatcher_host_unittest.cc @@ -38,21 +38,17 @@ class TestingServiceWorkerDispatcherHost : public ServiceWorkerDispatcherHost { Init(context_wrapper); } - virtual bool Send(IPC::Message* message) override { - return helper_->Send(message); - } + bool Send(IPC::Message* message) override { return helper_->Send(message); } IPC::TestSink* ipc_sink() { return helper_->ipc_sink(); } - virtual void BadMessageReceived() override { - ++bad_messages_received_count_; - } + void BadMessageReceived() override { ++bad_messages_received_count_; } int bad_messages_received_count_; protected: EmbeddedWorkerTestHelper* helper_; - virtual ~TestingServiceWorkerDispatcherHost() {} + ~TestingServiceWorkerDispatcherHost() override {} }; class ServiceWorkerDispatcherHostTest : public testing::Test { @@ -131,9 +127,9 @@ class ServiceWorkerDispatcherHostTest : public testing::Test { class ServiceWorkerTestContentBrowserClient : public TestContentBrowserClient { public: ServiceWorkerTestContentBrowserClient() {} - virtual bool AllowServiceWorker(const GURL& scope, - const GURL& first_party, - content::ResourceContext* context) override { + bool AllowServiceWorker(const GURL& scope, + const GURL& first_party, + content::ResourceContext* context) override { return false; } }; diff --git a/content/browser/service_worker/service_worker_handle.h b/content/browser/service_worker/service_worker_handle.h index 0ab64a8..b769640 100644 --- a/content/browser/service_worker/service_worker_handle.h +++ b/content/browser/service_worker/service_worker_handle.h @@ -49,23 +49,23 @@ class CONTENT_EXPORT ServiceWorkerHandle int provider_id, ServiceWorkerRegistration* registration, ServiceWorkerVersion* version); - virtual ~ServiceWorkerHandle(); + ~ServiceWorkerHandle() override; // ServiceWorkerVersion::Listener overrides. - virtual void OnWorkerStarted(ServiceWorkerVersion* version) override; - virtual void OnWorkerStopped(ServiceWorkerVersion* version) override; - virtual void OnErrorReported(ServiceWorkerVersion* version, - const base::string16& error_message, - int line_number, - int column_number, - const GURL& source_url) override; - virtual void OnReportConsoleMessage(ServiceWorkerVersion* version, - int source_identifier, - int message_level, - const base::string16& message, - int line_number, - const GURL& source_url) override; - virtual void OnVersionStateChanged(ServiceWorkerVersion* version) override; + void OnWorkerStarted(ServiceWorkerVersion* version) override; + void OnWorkerStopped(ServiceWorkerVersion* version) override; + void OnErrorReported(ServiceWorkerVersion* version, + const base::string16& error_message, + int line_number, + int column_number, + const GURL& source_url) override; + void OnReportConsoleMessage(ServiceWorkerVersion* version, + int source_identifier, + int message_level, + const base::string16& message, + int line_number, + const GURL& source_url) override; + void OnVersionStateChanged(ServiceWorkerVersion* version) override; ServiceWorkerObjectInfo GetObjectInfo(); diff --git a/content/browser/service_worker/service_worker_internals_ui.cc b/content/browser/service_worker/service_worker_internals_ui.cc index b0e79a1..8265292 100644 --- a/content/browser/service_worker/service_worker_internals_ui.cc +++ b/content/browser/service_worker/service_worker_internals_ui.cc @@ -300,11 +300,11 @@ class ServiceWorkerInternalsUI::PartitionObserver public: PartitionObserver(int partition_id, WebUI* web_ui) : partition_id_(partition_id), web_ui_(web_ui) {} - virtual ~PartitionObserver() {} + ~PartitionObserver() override {} // ServiceWorkerContextObserver overrides: - virtual void OnWorkerStarted(int64 version_id, - int process_id, - int thread_id) override { + void OnWorkerStarted(int64 version_id, + int process_id, + int thread_id) override { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); web_ui_->CallJavascriptFunction( "serviceworker.onWorkerStarted", @@ -313,9 +313,9 @@ class ServiceWorkerInternalsUI::PartitionObserver FundamentalValue(process_id), FundamentalValue(thread_id)); } - virtual void OnWorkerStopped(int64 version_id, - int process_id, - int thread_id) override { + void OnWorkerStopped(int64 version_id, + int process_id, + int thread_id) override { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); web_ui_->CallJavascriptFunction( "serviceworker.onWorkerStopped", @@ -324,17 +324,17 @@ class ServiceWorkerInternalsUI::PartitionObserver FundamentalValue(process_id), FundamentalValue(thread_id)); } - virtual void OnVersionStateChanged(int64 version_id) override { + void OnVersionStateChanged(int64 version_id) override { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); web_ui_->CallJavascriptFunction( "serviceworker.onVersionStateChanged", FundamentalValue(partition_id_), StringValue(base::Int64ToString(version_id))); } - virtual void OnErrorReported(int64 version_id, - int process_id, - int thread_id, - const ErrorInfo& info) override { + void OnErrorReported(int64 version_id, + int process_id, + int thread_id, + const ErrorInfo& info) override { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); ScopedVector<const Value> args; args.push_back(new FundamentalValue(partition_id_)); @@ -350,10 +350,10 @@ class ServiceWorkerInternalsUI::PartitionObserver web_ui_->CallJavascriptFunction("serviceworker.onErrorReported", args.get()); } - virtual void OnReportConsoleMessage(int64 version_id, - int process_id, - int thread_id, - const ConsoleMessage& message) override { + void OnReportConsoleMessage(int64 version_id, + int process_id, + int thread_id, + const ConsoleMessage& message) override { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); ScopedVector<const Value> args; args.push_back(new FundamentalValue(partition_id_)); @@ -370,12 +370,12 @@ class ServiceWorkerInternalsUI::PartitionObserver web_ui_->CallJavascriptFunction("serviceworker.onConsoleMessageReported", args.get()); } - virtual void OnRegistrationStored(const GURL& pattern) override { + void OnRegistrationStored(const GURL& pattern) override { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); web_ui_->CallJavascriptFunction("serviceworker.onRegistrationStored", StringValue(pattern.spec())); } - virtual void OnRegistrationDeleted(const GURL& pattern) override { + void OnRegistrationDeleted(const GURL& pattern) override { web_ui_->CallJavascriptFunction("serviceworker.onRegistrationDeleted", StringValue(pattern.spec())); } diff --git a/content/browser/service_worker/service_worker_internals_ui.h b/content/browser/service_worker/service_worker_internals_ui.h index 84c1e19..f0c09d6 100644 --- a/content/browser/service_worker/service_worker_internals_ui.h +++ b/content/browser/service_worker/service_worker_internals_ui.h @@ -42,7 +42,7 @@ class ServiceWorkerInternalsUI class OperationProxy; class PartitionObserver; - virtual ~ServiceWorkerInternalsUI(); + ~ServiceWorkerInternalsUI() override; void AddContextFromStoragePartition(StoragePartition* partition); void RemoveObserverFromStoragePartition(StoragePartition* partition); diff --git a/content/browser/service_worker/service_worker_job_unittest.cc b/content/browser/service_worker/service_worker_job_unittest.cc index 144cb90..91d986f 100644 --- a/content/browser/service_worker/service_worker_job_unittest.cc +++ b/content/browser/service_worker/service_worker_job_unittest.cc @@ -404,11 +404,11 @@ class FailToStartWorkerTestHelper : public EmbeddedWorkerTestHelper { explicit FailToStartWorkerTestHelper(int mock_render_process_id) : EmbeddedWorkerTestHelper(mock_render_process_id) {} - virtual void OnStartWorker(int embedded_worker_id, - int64 service_worker_version_id, - const GURL& scope, - const GURL& script_url, - bool pause_after_download) override { + void OnStartWorker(int embedded_worker_id, + int64 service_worker_version_id, + const GURL& scope, + const GURL& script_url, + bool pause_after_download) override { EmbeddedWorkerInstance* worker = registry()->GetWorker(embedded_worker_id); registry()->OnWorkerStopped(worker->process_id(), embedded_worker_id); } @@ -897,7 +897,7 @@ class UpdateJobTestHelper UpdateJobTestHelper(int mock_render_process_id) : EmbeddedWorkerTestHelper(mock_render_process_id), update_found_(false) {} - virtual ~UpdateJobTestHelper() { + ~UpdateJobTestHelper() override { if (registration_.get()) registration_->RemoveListener(this); } @@ -927,11 +927,11 @@ class UpdateJobTestHelper } // EmbeddedWorkerTestHelper overrides - virtual void OnStartWorker(int embedded_worker_id, - int64 version_id, - const GURL& scope, - const GURL& script, - bool pause_after_download) override { + void OnStartWorker(int embedded_worker_id, + int64 version_id, + const GURL& scope, + const GURL& script, + bool pause_after_download) override { const std::string kMockScriptBody = "mock_script"; const uint64 kMockScriptSize = 19284; ServiceWorkerVersion* version = context()->GetLiveVersion(version_id); @@ -961,7 +961,7 @@ class UpdateJobTestHelper } // ServiceWorkerRegistration::Listener overrides - virtual void OnVersionAttributesChanged( + void OnVersionAttributesChanged( ServiceWorkerRegistration* registration, ChangedVersionAttributesMask changed_mask, const ServiceWorkerRegistrationInfo& info) override { @@ -972,24 +972,22 @@ class UpdateJobTestHelper attribute_change_log_.push_back(entry); } - virtual void OnRegistrationFailed( - ServiceWorkerRegistration* registration) override { + void OnRegistrationFailed(ServiceWorkerRegistration* registration) override { NOTREACHED(); } - virtual void OnRegistrationFinishedUninstalling( + void OnRegistrationFinishedUninstalling( ServiceWorkerRegistration* registration) override { NOTREACHED(); } - virtual void OnUpdateFound( - ServiceWorkerRegistration* registration) override { + void OnUpdateFound(ServiceWorkerRegistration* registration) override { ASSERT_FALSE(update_found_); update_found_ = true; } // ServiceWorkerVersion::Listener overrides - virtual void OnVersionStateChanged(ServiceWorkerVersion* version) override { + void OnVersionStateChanged(ServiceWorkerVersion* version) override { StateChangeLogEntry entry; entry.version_id = version->version_id(); entry.status = version->status(); diff --git a/content/browser/service_worker/service_worker_provider_host.h b/content/browser/service_worker/service_worker_provider_host.h index 9c33a3e..b442f01 100644 --- a/content/browser/service_worker/service_worker_provider_host.h +++ b/content/browser/service_worker/service_worker_provider_host.h @@ -139,8 +139,7 @@ class CONTENT_EXPORT ServiceWorkerProviderHost UpdateAfter24Hours); // ServiceWorkerRegistration::Listener overrides. - virtual void OnRegistrationFailed( - ServiceWorkerRegistration* registration) override; + void OnRegistrationFailed(ServiceWorkerRegistration* registration) override; // Sets the controller version field to |version| or if |version| is NULL, // clears the field. diff --git a/content/browser/service_worker/service_worker_quota_client.h b/content/browser/service_worker/service_worker_quota_client.h index b86ee96..a1cf91d 100644 --- a/content/browser/service_worker/service_worker_quota_client.h +++ b/content/browser/service_worker/service_worker_quota_client.h @@ -15,23 +15,23 @@ class ServiceWorkerContextWrapper; class ServiceWorkerQuotaClient : public storage::QuotaClient { public: - virtual ~ServiceWorkerQuotaClient(); + ~ServiceWorkerQuotaClient() override; // QuotaClient method overrides - virtual ID id() const override; - virtual void OnQuotaManagerDestroyed() override; - virtual void GetOriginUsage(const GURL& origin, - storage::StorageType type, - const GetUsageCallback& callback) override; - virtual void GetOriginsForType(storage::StorageType type, - const GetOriginsCallback& callback) override; - virtual void GetOriginsForHost(storage::StorageType type, - const std::string& host, - const GetOriginsCallback& callback) override; - virtual void DeleteOriginData(const GURL& origin, - storage::StorageType type, - const DeletionCallback& callback) override; - virtual bool DoesSupport(storage::StorageType type) const override; + ID id() const override; + void OnQuotaManagerDestroyed() override; + void GetOriginUsage(const GURL& origin, + storage::StorageType type, + const GetUsageCallback& callback) override; + void GetOriginsForType(storage::StorageType type, + const GetOriginsCallback& callback) override; + void GetOriginsForHost(storage::StorageType type, + const std::string& host, + const GetOriginsCallback& callback) override; + void DeleteOriginData(const GURL& origin, + storage::StorageType type, + const DeletionCallback& callback) override; + bool DoesSupport(storage::StorageType type) const override; private: friend class ServiceWorkerContextWrapper; diff --git a/content/browser/service_worker/service_worker_read_from_cache_job.h b/content/browser/service_worker/service_worker_read_from_cache_job.h index e919d25..2a290d3 100644 --- a/content/browser/service_worker/service_worker_read_from_cache_job.h +++ b/content/browser/service_worker/service_worker_read_from_cache_job.h @@ -32,21 +32,18 @@ class CONTENT_EXPORT ServiceWorkerReadFromCacheJob int64 response_id); private: - virtual ~ServiceWorkerReadFromCacheJob(); + ~ServiceWorkerReadFromCacheJob() override; // net::URLRequestJob overrides - virtual void Start() override; - virtual void Kill() override; - virtual net::LoadState GetLoadState() const override; - virtual bool GetCharset(std::string* charset) override; - virtual bool GetMimeType(std::string* mime_type) const override; - virtual void GetResponseInfo(net::HttpResponseInfo* info) override; - virtual int GetResponseCode() const override; - virtual void SetExtraRequestHeaders( - const net::HttpRequestHeaders& headers) override; - virtual bool ReadRawData(net::IOBuffer* buf, - int buf_size, - int *bytes_read) override; + void Start() override; + void Kill() override; + net::LoadState GetLoadState() const override; + bool GetCharset(std::string* charset) override; + bool GetMimeType(std::string* mime_type) const override; + void GetResponseInfo(net::HttpResponseInfo* info) override; + int GetResponseCode() const override; + void SetExtraRequestHeaders(const net::HttpRequestHeaders& headers) override; + bool ReadRawData(net::IOBuffer* buf, int buf_size, int* bytes_read) override; // Reader completion callbacks. void OnReadInfoComplete(int result); diff --git a/content/browser/service_worker/service_worker_register_job.h b/content/browser/service_worker/service_worker_register_job.h index a6e27c1..167501b 100644 --- a/content/browser/service_worker/service_worker_register_job.h +++ b/content/browser/service_worker/service_worker_register_job.h @@ -51,7 +51,7 @@ class ServiceWorkerRegisterJob : public ServiceWorkerRegisterJobBase, CONTENT_EXPORT ServiceWorkerRegisterJob( base::WeakPtr<ServiceWorkerContextCore> context, ServiceWorkerRegistration* registration); - virtual ~ServiceWorkerRegisterJob(); + ~ServiceWorkerRegisterJob() override; // Registers a callback to be called when the promise would resolve (whether // successfully or not). Multiple callbacks may be registered. @@ -61,10 +61,10 @@ class ServiceWorkerRegisterJob : public ServiceWorkerRegisterJobBase, ServiceWorkerProviderHost* provider_host); // ServiceWorkerRegisterJobBase implementation: - virtual void Start() override; - virtual void Abort() override; - virtual bool Equals(ServiceWorkerRegisterJobBase* job) override; - virtual RegistrationJobType GetType() override; + void Start() override; + void Abort() override; + bool Equals(ServiceWorkerRegisterJobBase* job) override; + RegistrationJobType GetType() override; private: FRIEND_TEST_ALL_PREFIXES(ServiceWorkerProviderHostWaitingVersionTest, @@ -134,11 +134,11 @@ class ServiceWorkerRegisterJob : public ServiceWorkerRegisterJobBase, ServiceWorkerRegistration* registration); // EmbeddedWorkerInstance::Listener override of OnPausedAfterDownload. - virtual void OnPausedAfterDownload() override; - virtual bool OnMessageReceived(const IPC::Message& message) override; + void OnPausedAfterDownload() override; + bool OnMessageReceived(const IPC::Message& message) override; // ServiceWorkerRegistration::Listener overrides - virtual void OnRegistrationFinishedUninstalling( + void OnRegistrationFinishedUninstalling( ServiceWorkerRegistration* registration) override; void OnCompareScriptResourcesComplete( diff --git a/content/browser/service_worker/service_worker_registration.h b/content/browser/service_worker/service_worker_registration.h index 520974d..cf9f5af 100644 --- a/content/browser/service_worker/service_worker_registration.h +++ b/content/browser/service_worker/service_worker_registration.h @@ -110,7 +110,7 @@ class CONTENT_EXPORT ServiceWorkerRegistration private: friend class base::RefCounted<ServiceWorkerRegistration>; - virtual ~ServiceWorkerRegistration(); + ~ServiceWorkerRegistration() override; void SetVersionInternal( ServiceWorkerVersion* version, @@ -121,7 +121,7 @@ class CONTENT_EXPORT ServiceWorkerRegistration ChangedVersionAttributesMask* mask); // ServiceWorkerVersion::Listener override. - virtual void OnNoControllees(ServiceWorkerVersion* version) override; + void OnNoControllees(ServiceWorkerVersion* version) override; // This method corresponds to the [[Activate]] algorithm. void ActivateWaitingVersion(); diff --git a/content/browser/service_worker/service_worker_registration_handle.h b/content/browser/service_worker/service_worker_registration_handle.h index d30a99c..9439027 100644 --- a/content/browser/service_worker/service_worker_registration_handle.h +++ b/content/browser/service_worker/service_worker_registration_handle.h @@ -48,14 +48,12 @@ class ServiceWorkerRegistrationHandle private: // ServiceWorkerRegistration::Listener overrides. - virtual void OnVersionAttributesChanged( + void OnVersionAttributesChanged( ServiceWorkerRegistration* registration, ChangedVersionAttributesMask changed_mask, const ServiceWorkerRegistrationInfo& info) override; - virtual void OnRegistrationFailed( - ServiceWorkerRegistration* registration) override; - virtual void OnUpdateFound( - ServiceWorkerRegistration* registration) override; + void OnRegistrationFailed(ServiceWorkerRegistration* registration) override; + void OnUpdateFound(ServiceWorkerRegistration* registration) override; // Sets the corresponding version field to the given version or if the given // version is NULL, clears the field. diff --git a/content/browser/service_worker/service_worker_registration_unittest.cc b/content/browser/service_worker/service_worker_registration_unittest.cc index 300c475..73d383e 100644 --- a/content/browser/service_worker/service_worker_registration_unittest.cc +++ b/content/browser/service_worker/service_worker_registration_unittest.cc @@ -51,7 +51,7 @@ class ServiceWorkerRegistrationTest : public testing::Test { observed_registration_->RemoveListener(this); } - virtual void OnVersionAttributesChanged( + void OnVersionAttributesChanged( ServiceWorkerRegistration* registration, ChangedVersionAttributesMask changed_mask, const ServiceWorkerRegistrationInfo& info) override { @@ -60,18 +60,17 @@ class ServiceWorkerRegistrationTest : public testing::Test { observed_info_ = info; } - virtual void OnRegistrationFailed( + void OnRegistrationFailed( ServiceWorkerRegistration* registration) override { NOTREACHED(); } - virtual void OnRegistrationFinishedUninstalling( + void OnRegistrationFinishedUninstalling( ServiceWorkerRegistration* registration) override { NOTREACHED(); } - virtual void OnUpdateFound( - ServiceWorkerRegistration* registration) override { + void OnUpdateFound(ServiceWorkerRegistration* registration) override { NOTREACHED(); } diff --git a/content/browser/service_worker/service_worker_request_handler.cc b/content/browser/service_worker/service_worker_request_handler.cc index 3698eb7..6c871e6 100644 --- a/content/browser/service_worker/service_worker_request_handler.cc +++ b/content/browser/service_worker/service_worker_request_handler.cc @@ -31,8 +31,8 @@ class ServiceWorkerRequestInterceptor public: explicit ServiceWorkerRequestInterceptor(ResourceContext* resource_context) : resource_context_(resource_context) {} - virtual ~ServiceWorkerRequestInterceptor() {} - virtual net::URLRequestJob* MaybeInterceptRequest( + ~ServiceWorkerRequestInterceptor() override {} + net::URLRequestJob* MaybeInterceptRequest( net::URLRequest* request, net::NetworkDelegate* network_delegate) const override { ServiceWorkerRequestHandler* handler = diff --git a/content/browser/service_worker/service_worker_request_handler.h b/content/browser/service_worker/service_worker_request_handler.h index ff2be2f..91afd26 100644 --- a/content/browser/service_worker/service_worker_request_handler.h +++ b/content/browser/service_worker/service_worker_request_handler.h @@ -76,7 +76,7 @@ class CONTENT_EXPORT ServiceWorkerRequestHandler // this to avoid colliding with ServiceWorkers. static bool IsControlledByServiceWorker(net::URLRequest* request); - virtual ~ServiceWorkerRequestHandler(); + ~ServiceWorkerRequestHandler() override; // Called via custom URLRequestJobFactory. virtual net::URLRequestJob* MaybeCreateJob( diff --git a/content/browser/service_worker/service_worker_storage.h b/content/browser/service_worker/service_worker_storage.h index 6c2853f..85e1a72 100644 --- a/content/browser/service_worker/service_worker_storage.h +++ b/content/browser/service_worker/service_worker_storage.h @@ -58,7 +58,7 @@ class CONTENT_EXPORT ServiceWorkerStorage void(ServiceWorkerStatusCode status, bool are_equal)> CompareCallback; - virtual ~ServiceWorkerStorage(); + ~ServiceWorkerStorage() override; static scoped_ptr<ServiceWorkerStorage> Create( const base::FilePath& path, diff --git a/content/browser/service_worker/service_worker_storage_unittest.cc b/content/browser/service_worker/service_worker_storage_unittest.cc index 94b5570..35e41ab 100644 --- a/content/browser/service_worker/service_worker_storage_unittest.cc +++ b/content/browser/service_worker/service_worker_storage_unittest.cc @@ -627,7 +627,7 @@ class ServiceWorkerResourceStorageDiskTest ServiceWorkerResourceStorageTest::SetUp(); } - virtual base::FilePath GetUserDataDirectory() override { + base::FilePath GetUserDataDirectory() override { return user_data_directory_.path(); } diff --git a/content/browser/service_worker/service_worker_unregister_job.h b/content/browser/service_worker/service_worker_unregister_job.h index 6a4899f..fef9c27 100644 --- a/content/browser/service_worker/service_worker_unregister_job.h +++ b/content/browser/service_worker/service_worker_unregister_job.h @@ -32,17 +32,17 @@ class ServiceWorkerUnregisterJob : public ServiceWorkerRegisterJobBase { ServiceWorkerUnregisterJob(base::WeakPtr<ServiceWorkerContextCore> context, const GURL& pattern); - virtual ~ServiceWorkerUnregisterJob(); + ~ServiceWorkerUnregisterJob() override; // Registers a callback to be called when the job completes (whether // successfully or not). Multiple callbacks may be registered. void AddCallback(const UnregistrationCallback& callback); // ServiceWorkerRegisterJobBase implementation: - virtual void Start() override; - virtual void Abort() override; - virtual bool Equals(ServiceWorkerRegisterJobBase* job) override; - virtual RegistrationJobType GetType() override; + void Start() override; + void Abort() override; + bool Equals(ServiceWorkerRegisterJobBase* job) override; + RegistrationJobType GetType() override; private: void OnRegistrationFound( diff --git a/content/browser/service_worker/service_worker_url_request_job.h b/content/browser/service_worker/service_worker_url_request_job.h index 2c94c19..e8f0f0b 100644 --- a/content/browser/service_worker/service_worker_url_request_job.h +++ b/content/browser/service_worker/service_worker_url_request_job.h @@ -60,39 +60,33 @@ class CONTENT_EXPORT ServiceWorkerURLRequestJob } // net::URLRequestJob overrides: - virtual void Start() override; - virtual void Kill() override; - virtual net::LoadState GetLoadState() const override; - virtual bool GetCharset(std::string* charset) override; - virtual bool GetMimeType(std::string* mime_type) const override; - virtual void GetResponseInfo(net::HttpResponseInfo* info) override; - virtual void GetLoadTimingInfo( - net::LoadTimingInfo* load_timing_info) const override; - virtual int GetResponseCode() const override; - virtual void SetExtraRequestHeaders( - const net::HttpRequestHeaders& headers) override; - virtual bool ReadRawData(net::IOBuffer* buf, - int buf_size, - int *bytes_read) override; + void Start() override; + void Kill() override; + net::LoadState GetLoadState() const override; + bool GetCharset(std::string* charset) override; + bool GetMimeType(std::string* mime_type) const override; + void GetResponseInfo(net::HttpResponseInfo* info) override; + void GetLoadTimingInfo(net::LoadTimingInfo* load_timing_info) const override; + int GetResponseCode() const override; + void SetExtraRequestHeaders(const net::HttpRequestHeaders& headers) override; + bool ReadRawData(net::IOBuffer* buf, int buf_size, int* bytes_read) override; // net::URLRequest::Delegate overrides that read the blob from the // ServiceWorkerFetchResponse. - virtual void OnReceivedRedirect(net::URLRequest* request, - const net::RedirectInfo& redirect_info, - bool* defer_redirect) override; - virtual void OnAuthRequired(net::URLRequest* request, - net::AuthChallengeInfo* auth_info) override; - virtual void OnCertificateRequested( + void OnReceivedRedirect(net::URLRequest* request, + const net::RedirectInfo& redirect_info, + bool* defer_redirect) override; + void OnAuthRequired(net::URLRequest* request, + net::AuthChallengeInfo* auth_info) override; + void OnCertificateRequested( net::URLRequest* request, net::SSLCertRequestInfo* cert_request_info) override; - virtual void OnSSLCertificateError(net::URLRequest* request, - const net::SSLInfo& ssl_info, - bool fatal) override; - virtual void OnBeforeNetworkStart(net::URLRequest* request, - bool* defer) override; - virtual void OnResponseStarted(net::URLRequest* request) override; - virtual void OnReadCompleted(net::URLRequest* request, - int bytes_read) override; + void OnSSLCertificateError(net::URLRequest* request, + const net::SSLInfo& ssl_info, + bool fatal) override; + void OnBeforeNetworkStart(net::URLRequest* request, bool* defer) override; + void OnResponseStarted(net::URLRequest* request) override; + void OnReadCompleted(net::URLRequest* request, int bytes_read) override; const net::HttpResponseInfo* http_info() const; @@ -106,7 +100,7 @@ class CONTENT_EXPORT ServiceWorkerURLRequestJob base::TimeTicks* fetch_end_time) const; protected: - virtual ~ServiceWorkerURLRequestJob(); + ~ServiceWorkerURLRequestJob() override; private: enum ResponseType { diff --git a/content/browser/service_worker/service_worker_url_request_job_unittest.cc b/content/browser/service_worker/service_worker_url_request_job_unittest.cc index 3126bd0..3668351 100644 --- a/content/browser/service_worker/service_worker_url_request_job_unittest.cc +++ b/content/browser/service_worker/service_worker_url_request_job_unittest.cc @@ -55,9 +55,9 @@ class MockHttpProtocolHandler base::WeakPtr<storage::BlobStorageContext> blob_storage_context) : provider_host_(provider_host), blob_storage_context_(blob_storage_context) {} - virtual ~MockHttpProtocolHandler() {} + ~MockHttpProtocolHandler() override {} - virtual net::URLRequestJob* MaybeCreateJob( + net::URLRequestJob* MaybeCreateJob( net::URLRequest* request, net::NetworkDelegate* network_delegate) const override { ServiceWorkerURLRequestJob* job = @@ -199,12 +199,12 @@ class BlobResponder : public EmbeddedWorkerTestHelper { : EmbeddedWorkerTestHelper(mock_render_process_id), blob_uuid_(blob_uuid), blob_size_(blob_size) {} - virtual ~BlobResponder() {} + ~BlobResponder() override {} protected: - virtual void OnFetchEvent(int embedded_worker_id, - int request_id, - const ServiceWorkerFetchRequest& request) override { + void OnFetchEvent(int embedded_worker_id, + int request_id, + const ServiceWorkerFetchRequest& request) override { SimulateSend(new ServiceWorkerHostMsg_FetchEventFinished( embedded_worker_id, request_id, diff --git a/content/browser/service_worker/service_worker_version.h b/content/browser/service_worker/service_worker_version.h index 7195bfb..24dd459 100644 --- a/content/browser/service_worker/service_worker_version.h +++ b/content/browser/service_worker/service_worker_version.h @@ -229,21 +229,21 @@ class CONTENT_EXPORT ServiceWorkerVersion typedef std::map<ServiceWorkerProviderHost*, int> ControlleeMap; typedef IDMap<ServiceWorkerProviderHost> ControlleeByIDMap; - virtual ~ServiceWorkerVersion(); + ~ServiceWorkerVersion() override; // EmbeddedWorkerInstance::Listener overrides: - virtual void OnStarted() override; - virtual void OnStopped() override; - virtual void OnReportException(const base::string16& error_message, - int line_number, - int column_number, - const GURL& source_url) override; - virtual void OnReportConsoleMessage(int source_identifier, - int message_level, - const base::string16& message, - int line_number, - const GURL& source_url) override; - virtual bool OnMessageReceived(const IPC::Message& message) override; + void OnStarted() override; + void OnStopped() override; + void OnReportException(const base::string16& error_message, + int line_number, + int column_number, + const GURL& source_url) override; + void OnReportConsoleMessage(int source_identifier, + int message_level, + const base::string16& message, + int line_number, + const GURL& source_url) override; + bool OnMessageReceived(const IPC::Message& message) override; void OnStartMessageSent(ServiceWorkerStatusCode status); diff --git a/content/browser/service_worker/service_worker_version_unittest.cc b/content/browser/service_worker/service_worker_version_unittest.cc index ff95ad2..19c4ff31 100644 --- a/content/browser/service_worker/service_worker_version_unittest.cc +++ b/content/browser/service_worker/service_worker_version_unittest.cc @@ -36,11 +36,11 @@ class MessageReceiver : public EmbeddedWorkerTestHelper { MessageReceiver() : EmbeddedWorkerTestHelper(kRenderProcessId), current_embedded_worker_id_(0) {} - virtual ~MessageReceiver() {} + ~MessageReceiver() override {} - virtual bool OnMessageToWorker(int thread_id, - int embedded_worker_id, - const IPC::Message& message) override { + bool OnMessageToWorker(int thread_id, + int embedded_worker_id, + const IPC::Message& message) override { if (EmbeddedWorkerTestHelper::OnMessageToWorker( thread_id, embedded_worker_id, message)) { return true; @@ -85,13 +85,11 @@ class MessageReceiverFromWorker : public EmbeddedWorkerInstance::Listener { : instance_(instance) { instance_->AddListener(this); } - virtual ~MessageReceiverFromWorker() { - instance_->RemoveListener(this); - } + ~MessageReceiverFromWorker() override { instance_->RemoveListener(this); } - virtual void OnStarted() override { NOTREACHED(); } - virtual void OnStopped() override { NOTREACHED(); } - virtual bool OnMessageReceived(const IPC::Message& message) override { + void OnStarted() override { NOTREACHED(); } + void OnStopped() override { NOTREACHED(); } + bool OnMessageReceived(const IPC::Message& message) override { bool handled = true; IPC_BEGIN_MESSAGE_MAP(MessageReceiverFromWorker, message) IPC_MESSAGE_HANDLER(TestMsg_MessageFromWorker, OnMessageFromWorker) diff --git a/content/browser/service_worker/service_worker_write_to_cache_job.h b/content/browser/service_worker/service_worker_write_to_cache_job.h index be4e4e9..ec3bfa7 100644 --- a/content/browser/service_worker/service_worker_write_to_cache_job.h +++ b/content/browser/service_worker/service_worker_write_to_cache_job.h @@ -49,21 +49,18 @@ class CONTENT_EXPORT ServiceWorkerWriteToCacheJob FRIEND_TEST_ALL_PREFIXES(ServiceWorkerContextRequestHandlerTest, UpdateAfter24Hours); - virtual ~ServiceWorkerWriteToCacheJob(); + ~ServiceWorkerWriteToCacheJob() override; // net::URLRequestJob overrides - virtual void Start() override; - virtual void Kill() override; - virtual net::LoadState GetLoadState() const override; - virtual bool GetCharset(std::string* charset) override; - virtual bool GetMimeType(std::string* mime_type) const override; - virtual void GetResponseInfo(net::HttpResponseInfo* info) override; - virtual int GetResponseCode() const override; - virtual void SetExtraRequestHeaders( - const net::HttpRequestHeaders& headers) override; - virtual bool ReadRawData(net::IOBuffer* buf, - int buf_size, - int *bytes_read) override; + void Start() override; + void Kill() override; + net::LoadState GetLoadState() const override; + bool GetCharset(std::string* charset) override; + bool GetMimeType(std::string* mime_type) const override; + void GetResponseInfo(net::HttpResponseInfo* info) override; + int GetResponseCode() const override; + void SetExtraRequestHeaders(const net::HttpRequestHeaders& headers) override; + bool ReadRawData(net::IOBuffer* buf, int buf_size, int* bytes_read) override; const net::HttpResponseInfo* http_info() const; @@ -81,27 +78,20 @@ class CONTENT_EXPORT ServiceWorkerWriteToCacheJob void OnWriteDataComplete(int result); // net::URLRequest::Delegate overrides that observe the net request. - virtual void OnReceivedRedirect( - net::URLRequest* request, - const net::RedirectInfo& redirect_info, - bool* defer_redirect) override; - virtual void OnAuthRequired( - net::URLRequest* request, - net::AuthChallengeInfo* auth_info) override; - virtual void OnCertificateRequested( + void OnReceivedRedirect(net::URLRequest* request, + const net::RedirectInfo& redirect_info, + bool* defer_redirect) override; + void OnAuthRequired(net::URLRequest* request, + net::AuthChallengeInfo* auth_info) override; + void OnCertificateRequested( net::URLRequest* request, net::SSLCertRequestInfo* cert_request_info) override; - virtual void OnSSLCertificateError( - net::URLRequest* request, - const net::SSLInfo& ssl_info, - bool fatal) override; - virtual void OnBeforeNetworkStart( - net::URLRequest* request, - bool* defer) override; - virtual void OnResponseStarted(net::URLRequest* request) override; - virtual void OnReadCompleted( - net::URLRequest* request, - int bytes_read) override; + void OnSSLCertificateError(net::URLRequest* request, + const net::SSLInfo& ssl_info, + bool fatal) override; + void OnBeforeNetworkStart(net::URLRequest* request, bool* defer) override; + void OnResponseStarted(net::URLRequest* request) override; + void OnReadCompleted(net::URLRequest* request, int bytes_read) override; void AsyncNotifyDoneHelper(const net::URLRequestStatus& status); diff --git a/content/browser/session_history_browsertest.cc b/content/browser/session_history_browsertest.cc index 9831759..2d81581 100644 --- a/content/browser/session_history_browsertest.cc +++ b/content/browser/session_history_browsertest.cc @@ -47,7 +47,7 @@ class SessionHistoryTest : public ContentBrowserTest { protected: SessionHistoryTest() {} - virtual void SetUpOnMainThread() override { + void SetUpOnMainThread() override { ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); embedded_test_server()->RegisterRequestHandler( base::Bind(&HandleEchoTitleRequest, "/echotitle")); diff --git a/content/browser/shared_worker/shared_worker_message_filter.h b/content/browser/shared_worker/shared_worker_message_filter.h index 4c8d28c..e283a22 100644 --- a/content/browser/shared_worker/shared_worker_message_filter.h +++ b/content/browser/shared_worker/shared_worker_message_filter.h @@ -26,8 +26,8 @@ class CONTENT_EXPORT SharedWorkerMessageFilter : public BrowserMessageFilter { MessagePortMessageFilter* message_port_filter); // BrowserMessageFilter implementation. - virtual void OnChannelClosing() override; - virtual bool OnMessageReceived(const IPC::Message& message) override; + void OnChannelClosing() override; + bool OnMessageReceived(const IPC::Message& message) override; int GetNextRoutingID(); int render_process_id() const { return render_process_id_; } @@ -38,7 +38,7 @@ class CONTENT_EXPORT SharedWorkerMessageFilter : public BrowserMessageFilter { protected: // This is protected, so we can define sub classes for testing. - virtual ~SharedWorkerMessageFilter(); + ~SharedWorkerMessageFilter() override; private: // Message handlers. diff --git a/content/browser/shared_worker/shared_worker_service_impl.h b/content/browser/shared_worker/shared_worker_service_impl.h index 04eb321..b09d583 100644 --- a/content/browser/shared_worker/shared_worker_service_impl.h +++ b/content/browser/shared_worker/shared_worker_service_impl.h @@ -41,10 +41,10 @@ class CONTENT_EXPORT SharedWorkerServiceImpl static SharedWorkerServiceImpl* GetInstance(); // WorkerService implementation: - virtual bool TerminateWorker(int process_id, int route_id) override; - virtual std::vector<WorkerInfo> GetWorkers() override; - virtual void AddObserver(WorkerServiceObserver* observer) override; - virtual void RemoveObserver(WorkerServiceObserver* observer) override; + bool TerminateWorker(int process_id, int route_id) override; + std::vector<WorkerInfo> GetWorkers() override; + void AddObserver(WorkerServiceObserver* observer) override; + void RemoveObserver(WorkerServiceObserver* observer) override; // These methods correspond to worker related IPCs. void CreateWorker(const ViewHostMsg_CreateWorker_Params& params, @@ -115,7 +115,7 @@ class CONTENT_EXPORT SharedWorkerServiceImpl PendingInstaneMap; SharedWorkerServiceImpl(); - virtual ~SharedWorkerServiceImpl(); + ~SharedWorkerServiceImpl() override; void ResetForTesting(); diff --git a/content/browser/shared_worker/shared_worker_service_impl_unittest.cc b/content/browser/shared_worker/shared_worker_service_impl_unittest.cc index 25ab152..88d8d5a 100644 --- a/content/browser/shared_worker/shared_worker_service_impl_unittest.cc +++ b/content/browser/shared_worker/shared_worker_service_impl_unittest.cc @@ -110,7 +110,7 @@ class MockMessagePortMessageFilter : public MessagePortMessageFilter { ScopedVector<IPC::Message>* message_queue) : MessagePortMessageFilter(callback), message_queue_(message_queue) {} - virtual bool Send(IPC::Message* message) override { + bool Send(IPC::Message* message) override { if (!message_queue_) { delete message; return false; @@ -125,7 +125,7 @@ class MockMessagePortMessageFilter : public MessagePortMessageFilter { } private: - virtual ~MockMessagePortMessageFilter() {} + ~MockMessagePortMessageFilter() override {} ScopedVector<IPC::Message>* message_queue_; }; @@ -142,7 +142,7 @@ class MockSharedWorkerMessageFilter : public SharedWorkerMessageFilter { message_port_filter), message_queue_(message_queue) {} - virtual bool Send(IPC::Message* message) override { + bool Send(IPC::Message* message) override { if (!message_queue_) { delete message; return false; @@ -157,7 +157,7 @@ class MockSharedWorkerMessageFilter : public SharedWorkerMessageFilter { } private: - virtual ~MockSharedWorkerMessageFilter() {} + ~MockSharedWorkerMessageFilter() override {} ScopedVector<IPC::Message>* message_queue_; }; diff --git a/content/browser/signed_certificate_timestamp_store_impl.h b/content/browser/signed_certificate_timestamp_store_impl.h index 5600775..b2f728a 100644 --- a/content/browser/signed_certificate_timestamp_store_impl.h +++ b/content/browser/signed_certificate_timestamp_store_impl.h @@ -20,10 +20,9 @@ class SignedCertificateTimestampStoreImpl static SignedCertificateTimestampStoreImpl* GetInstance(); // SignedCertificateTimestampStore implementation: - virtual int Store( - net::ct::SignedCertificateTimestamp* sct, - int render_process_host_id) override; - virtual bool Retrieve( + int Store(net::ct::SignedCertificateTimestamp* sct, + int render_process_host_id) override; + bool Retrieve( int sct_id, scoped_refptr<net::ct::SignedCertificateTimestamp>* sct) override; @@ -31,7 +30,7 @@ class SignedCertificateTimestampStoreImpl friend struct DefaultSingletonTraits<SignedCertificateTimestampStoreImpl>; SignedCertificateTimestampStoreImpl(); - virtual ~SignedCertificateTimestampStoreImpl(); + ~SignedCertificateTimestampStoreImpl() override; RendererDataMemoizingStore<net::ct::SignedCertificateTimestamp> store_; diff --git a/content/browser/site_instance_impl.h b/content/browser/site_instance_impl.h index 35d1a1e..2c55688 100644 --- a/content/browser/site_instance_impl.h +++ b/content/browser/site_instance_impl.h @@ -19,14 +19,14 @@ class CONTENT_EXPORT SiteInstanceImpl : public SiteInstance, public RenderProcessHostObserver { public: // SiteInstance interface overrides. - virtual int32 GetId() override; - virtual bool HasProcess() const override; - virtual RenderProcessHost* GetProcess() override; - virtual BrowserContext* GetBrowserContext() const override; - virtual const GURL& GetSiteURL() const override; - virtual SiteInstance* GetRelatedSiteInstance(const GURL& url) override; - virtual bool IsRelatedSiteInstance(const SiteInstance* instance) override; - virtual size_t GetRelatedActiveContentsCount() override; + int32 GetId() override; + bool HasProcess() const override; + RenderProcessHost* GetProcess() override; + BrowserContext* GetBrowserContext() const override; + const GURL& GetSiteURL() const override; + SiteInstance* GetRelatedSiteInstance(const GURL& url) override; + bool IsRelatedSiteInstance(const SiteInstance* instance) override; + size_t GetRelatedActiveContentsCount() override; // Set the web site that this SiteInstance is rendering pages for. // This includes the scheme and registered domain, but not the port. If the @@ -89,7 +89,7 @@ class CONTENT_EXPORT SiteInstanceImpl : public SiteInstance, friend class SiteInstance; // Virtual to allow tests to extend it. - virtual ~SiteInstanceImpl(); + ~SiteInstanceImpl() override; // Create a new SiteInstance. Protected to give access to BrowsingInstance // and tests; most callers should use Create or GetRelatedSiteInstance @@ -98,7 +98,7 @@ class CONTENT_EXPORT SiteInstanceImpl : public SiteInstance, private: // RenderProcessHostObserver implementation. - virtual void RenderProcessHostDestroyed(RenderProcessHost* host) override; + void RenderProcessHostDestroyed(RenderProcessHost* host) override; // Used to restrict a process' origin access rights. void LockToOrigin(); diff --git a/content/browser/site_instance_impl_unittest.cc b/content/browser/site_instance_impl_unittest.cc index 0eff9f9..70fd28a 100644 --- a/content/browser/site_instance_impl_unittest.cc +++ b/content/browser/site_instance_impl_unittest.cc @@ -36,20 +36,20 @@ const char kPrivilegedScheme[] = "privileged"; class SiteInstanceTestWebUIControllerFactory : public WebUIControllerFactory { public: - virtual WebUIController* CreateWebUIControllerForURL( - WebUI* web_ui, const GURL& url) const override { + WebUIController* CreateWebUIControllerForURL(WebUI* web_ui, + const GURL& url) const override { return NULL; } - virtual WebUI::TypeID GetWebUIType(BrowserContext* browser_context, - const GURL& url) const override { + WebUI::TypeID GetWebUIType(BrowserContext* browser_context, + const GURL& url) const override { return WebUI::kNoWebUI; } - virtual bool UseWebUIForURL(BrowserContext* browser_context, - const GURL& url) const override { + bool UseWebUIForURL(BrowserContext* browser_context, + const GURL& url) const override { return HasWebUIScheme(url); } - virtual bool UseWebUIBindingsForURL(BrowserContext* browser_context, - const GURL& url) const override { + bool UseWebUIBindingsForURL(BrowserContext* browser_context, + const GURL& url) const override { return HasWebUIScheme(url); } }; @@ -61,12 +61,12 @@ class SiteInstanceTestBrowserClient : public TestContentBrowserClient { WebUIControllerFactory::RegisterFactory(&factory_); } - virtual ~SiteInstanceTestBrowserClient() { + ~SiteInstanceTestBrowserClient() override { WebUIControllerFactory::UnregisterFactoryForTesting(&factory_); } - virtual bool IsSuitableHost(RenderProcessHost* process_host, - const GURL& site_url) override { + bool IsSuitableHost(RenderProcessHost* process_host, + const GURL& site_url) override { return (privileged_process_id_ == process_host->GetID()) == site_url.SchemeIs(kPrivilegedScheme); } @@ -157,9 +157,7 @@ class TestBrowsingInstance : public BrowsingInstance { using BrowsingInstance::UnregisterSiteInstance; private: - virtual ~TestBrowsingInstance() { - (*delete_counter_)++; - } + ~TestBrowsingInstance() override { (*delete_counter_)++; } int* delete_counter_; }; @@ -179,9 +177,7 @@ class TestSiteInstance : public SiteInstanceImpl { private: TestSiteInstance(BrowsingInstance* browsing_instance, int* delete_counter) : SiteInstanceImpl(browsing_instance), delete_counter_(delete_counter) {} - virtual ~TestSiteInstance() { - (*delete_counter_)++; - } + ~TestSiteInstance() override { (*delete_counter_)++; } int* delete_counter_; }; diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc index a0a459e..660b4c6 100644 --- a/content/browser/site_per_process_browsertest.cc +++ b/content/browser/site_per_process_browsertest.cc @@ -34,17 +34,16 @@ class SitePerProcessWebContentsObserver: public WebContentsObserver { explicit SitePerProcessWebContentsObserver(WebContents* web_contents) : WebContentsObserver(web_contents), navigation_succeeded_(false) {} - virtual ~SitePerProcessWebContentsObserver() {} + ~SitePerProcessWebContentsObserver() override {} - virtual void DidStartProvisionalLoadForFrame( - RenderFrameHost* render_frame_host, - const GURL& validated_url, - bool is_error_page, - bool is_iframe_srcdoc) override { + void DidStartProvisionalLoadForFrame(RenderFrameHost* render_frame_host, + const GURL& validated_url, + bool is_error_page, + bool is_iframe_srcdoc) override { navigation_succeeded_ = false; } - virtual void DidFailProvisionalLoad( + void DidFailProvisionalLoad( RenderFrameHost* render_frame_host, const GURL& validated_url, int error_code, @@ -53,7 +52,7 @@ class SitePerProcessWebContentsObserver: public WebContentsObserver { navigation_succeeded_ = false; } - virtual void DidCommitProvisionalLoadForFrame( + void DidCommitProvisionalLoadForFrame( RenderFrameHost* render_frame_host, const GURL& url, ui::PageTransition transition_type) override { @@ -81,7 +80,7 @@ class RedirectNotificationObserver : public NotificationObserver { // NotificationService::AllSources(). RedirectNotificationObserver(int notification_type, const NotificationSource& source); - virtual ~RedirectNotificationObserver(); + ~RedirectNotificationObserver() override; // Wait until the specified notification occurs. If the notification was // emitted between the construction of this object and this call then it @@ -99,9 +98,9 @@ class RedirectNotificationObserver : public NotificationObserver { } // NotificationObserver: - virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) override; + void Observe(int type, + const NotificationSource& source, + const NotificationDetails& details) override; private: bool seen_; diff --git a/content/browser/site_per_process_browsertest.h b/content/browser/site_per_process_browsertest.h index c059d01..19dfc01 100644 --- a/content/browser/site_per_process_browsertest.h +++ b/content/browser/site_per_process_browsertest.h @@ -23,8 +23,8 @@ class SitePerProcessBrowserTest : public ContentBrowserTest { const GURL& url, std::string iframe_id); - virtual void SetUpCommandLine(base::CommandLine* command_line) override; - virtual void SetUpOnMainThread() override; + void SetUpCommandLine(base::CommandLine* command_line) override; + void SetUpOnMainThread() override; }; } // namespace content diff --git a/content/browser/speech/audio_encoder.cc b/content/browser/speech/audio_encoder.cc index cf9f72d..09b5dca 100644 --- a/content/browser/speech/audio_encoder.cc +++ b/content/browser/speech/audio_encoder.cc @@ -24,9 +24,9 @@ const int kFLACCompressionLevel = 0; // 0 for speed class FLACEncoder : public AudioEncoder { public: FLACEncoder(int sampling_rate, int bits_per_sample); - virtual ~FLACEncoder(); - virtual void Encode(const AudioChunk& raw_audio) override; - virtual void Flush() override; + ~FLACEncoder() override; + void Encode(const AudioChunk& raw_audio) override; + void Flush() override; private: static FLAC__StreamEncoderWriteStatus WriteCallback( @@ -113,9 +113,9 @@ COMPILE_ASSERT(kMaxSpeexFrameLength <= 0xFF, invalidLength); class SpeexEncoder : public AudioEncoder { public: explicit SpeexEncoder(int sampling_rate, int bits_per_sample); - virtual ~SpeexEncoder(); - virtual void Encode(const AudioChunk& raw_audio) override; - virtual void Flush() override {} + ~SpeexEncoder() override; + void Encode(const AudioChunk& raw_audio) override; + void Flush() override {} private: void* encoder_state_; diff --git a/content/browser/speech/endpointer/endpointer_unittest.cc b/content/browser/speech/endpointer/endpointer_unittest.cc index ec0aac6..807b6f6 100644 --- a/content/browser/speech/endpointer/endpointer_unittest.cc +++ b/content/browser/speech/endpointer/endpointer_unittest.cc @@ -73,9 +73,7 @@ class EnergyEndpointerFrameProcessor : public FrameProcessor { explicit EnergyEndpointerFrameProcessor(EnergyEndpointer* endpointer) : endpointer_(endpointer) {} - virtual EpStatus ProcessFrame(int64 time, - int16* samples, - int frame_size) override { + EpStatus ProcessFrame(int64 time, int16* samples, int frame_size) override { endpointer_->ProcessAudioFrame(time, samples, kFrameSize, NULL); int64 ep_time; return endpointer_->Status(&ep_time); @@ -118,9 +116,7 @@ class EndpointerFrameProcessor : public FrameProcessor { explicit EndpointerFrameProcessor(Endpointer* endpointer) : endpointer_(endpointer) {} - virtual EpStatus ProcessFrame(int64 time, - int16* samples, - int frame_size) override { + EpStatus ProcessFrame(int64 time, int16* samples, int frame_size) override { scoped_refptr<AudioChunk> frame( new AudioChunk(reinterpret_cast<uint8*>(samples), kFrameSize * 2, 2)); endpointer_->ProcessAudio(*frame.get(), NULL); diff --git a/content/browser/speech/google_one_shot_remote_engine.h b/content/browser/speech/google_one_shot_remote_engine.h index 42aa40f..0e5b09f 100644 --- a/content/browser/speech/google_one_shot_remote_engine.h +++ b/content/browser/speech/google_one_shot_remote_engine.h @@ -33,19 +33,19 @@ class CONTENT_EXPORT GoogleOneShotRemoteEngine static int url_fetcher_id_for_tests; explicit GoogleOneShotRemoteEngine(net::URLRequestContextGetter* context); - virtual ~GoogleOneShotRemoteEngine(); + ~GoogleOneShotRemoteEngine() override; // SpeechRecognitionEngine methods. - virtual void SetConfig(const SpeechRecognitionEngineConfig& config) override; - virtual void StartRecognition() override; - virtual void EndRecognition() override; - virtual void TakeAudioChunk(const AudioChunk& data) override; - virtual void AudioChunksEnded() override; - virtual bool IsRecognitionPending() const override; - virtual int GetDesiredAudioChunkDurationMs() const override; + void SetConfig(const SpeechRecognitionEngineConfig& config) override; + void StartRecognition() override; + void EndRecognition() override; + void TakeAudioChunk(const AudioChunk& data) override; + void AudioChunksEnded() override; + bool IsRecognitionPending() const override; + int GetDesiredAudioChunkDurationMs() const override; // net::URLFetcherDelegate methods. - virtual void OnURLFetchComplete(const net::URLFetcher* source) override; + void OnURLFetchComplete(const net::URLFetcher* source) override; private: SpeechRecognitionEngineConfig config_; diff --git a/content/browser/speech/google_one_shot_remote_engine_unittest.cc b/content/browser/speech/google_one_shot_remote_engine_unittest.cc index a4360ce..1695010 100644 --- a/content/browser/speech/google_one_shot_remote_engine_unittest.cc +++ b/content/browser/speech/google_one_shot_remote_engine_unittest.cc @@ -26,12 +26,12 @@ class GoogleOneShotRemoteEngineTest : public SpeechRecognitionEngineDelegate, void CreateAndTestRequest(bool success, const std::string& http_response); // SpeechRecognitionRequestDelegate methods. - virtual void OnSpeechRecognitionEngineResults( + void OnSpeechRecognitionEngineResults( const SpeechRecognitionResults& results) override { results_ = results; } - virtual void OnSpeechRecognitionEngineError( + void OnSpeechRecognitionEngineError( const SpeechRecognitionError& error) override { error_ = error.code; } diff --git a/content/browser/speech/google_streaming_remote_engine.h b/content/browser/speech/google_streaming_remote_engine.h index cc5c177..961ef08 100644 --- a/content/browser/speech/google_streaming_remote_engine.h +++ b/content/browser/speech/google_streaming_remote_engine.h @@ -57,21 +57,22 @@ class CONTENT_EXPORT GoogleStreamingRemoteEngine static const int kDownstreamUrlFetcherIdForTesting; explicit GoogleStreamingRemoteEngine(net::URLRequestContextGetter* context); - virtual ~GoogleStreamingRemoteEngine(); + ~GoogleStreamingRemoteEngine() override; // SpeechRecognitionEngine methods. - virtual void SetConfig(const SpeechRecognitionEngineConfig& config) override; - virtual void StartRecognition() override; - virtual void EndRecognition() override; - virtual void TakeAudioChunk(const AudioChunk& data) override; - virtual void AudioChunksEnded() override; - virtual bool IsRecognitionPending() const override; - virtual int GetDesiredAudioChunkDurationMs() const override; + void SetConfig(const SpeechRecognitionEngineConfig& config) override; + void StartRecognition() override; + void EndRecognition() override; + void TakeAudioChunk(const AudioChunk& data) override; + void AudioChunksEnded() override; + bool IsRecognitionPending() const override; + int GetDesiredAudioChunkDurationMs() const override; // net::URLFetcherDelegate methods. - virtual void OnURLFetchComplete(const net::URLFetcher* source) override; - virtual void OnURLFetchDownloadProgress(const net::URLFetcher* source, - int64 current, int64 total) override; + void OnURLFetchComplete(const net::URLFetcher* source) override; + void OnURLFetchDownloadProgress(const net::URLFetcher* source, + int64 current, + int64 total) override; private: // Response status codes from the speech recognition webservice. diff --git a/content/browser/speech/google_streaming_remote_engine_unittest.cc b/content/browser/speech/google_streaming_remote_engine_unittest.cc index 3ae6c7f..670bf85 100644 --- a/content/browser/speech/google_streaming_remote_engine_unittest.cc +++ b/content/browser/speech/google_streaming_remote_engine_unittest.cc @@ -42,11 +42,11 @@ class GoogleStreamingRemoteEngineTest : public SpeechRecognitionEngineDelegate, void CreateAndTestRequest(bool success, const std::string& http_response); // SpeechRecognitionRequestDelegate methods. - virtual void OnSpeechRecognitionEngineResults( + void OnSpeechRecognitionEngineResults( const SpeechRecognitionResults& results) override { results_.push(results); } - virtual void OnSpeechRecognitionEngineError( + void OnSpeechRecognitionEngineError( const SpeechRecognitionError& error) override { error_ = error.code; } diff --git a/content/browser/speech/speech_recognition_browsertest.cc b/content/browser/speech/speech_recognition_browsertest.cc index af02d9f..02671a4 100644 --- a/content/browser/speech/speech_recognition_browsertest.cc +++ b/content/browser/speech/speech_recognition_browsertest.cc @@ -44,28 +44,28 @@ class SpeechRecognitionBrowserTest : }; // MockGoogleStreamingServerDelegate methods. - virtual void OnClientConnected() override { + void OnClientConnected() override { ASSERT_EQ(kTestAudioControllerOpened, streaming_server_state_); streaming_server_state_ = kClientConnected; } - virtual void OnClientAudioUpload() override { + void OnClientAudioUpload() override { if (streaming_server_state_ == kClientConnected) streaming_server_state_ = kClientAudioUpload; } - virtual void OnClientAudioUploadComplete() override { + void OnClientAudioUploadComplete() override { ASSERT_EQ(kTestAudioControllerClosed, streaming_server_state_); streaming_server_state_ = kClientAudioUploadComplete; } - virtual void OnClientDisconnected() override { + void OnClientDisconnected() override { ASSERT_EQ(kClientAudioUploadComplete, streaming_server_state_); streaming_server_state_ = kClientDisconnected; } // media::TestAudioInputControllerDelegate methods. - virtual void TestAudioControllerOpened( + void TestAudioControllerOpened( media::TestAudioInputController* controller) override { ASSERT_EQ(kIdle, streaming_server_state_); streaming_server_state_ = kTestAudioControllerOpened; @@ -79,7 +79,7 @@ class SpeechRecognitionBrowserTest : FeedAudioController(1000 /* ms */, /*noise=*/ false); } - virtual void TestAudioControllerClosed( + void TestAudioControllerClosed( media::TestAudioInputController* controller) override { ASSERT_EQ(kClientAudioUpload, streaming_server_state_); streaming_server_state_ = kTestAudioControllerClosed; @@ -103,7 +103,7 @@ class SpeechRecognitionBrowserTest : protected: // ContentBrowserTest methods. - virtual void SetUpInProcessBrowserTestFixture() override { + void SetUpInProcessBrowserTestFixture() override { test_audio_input_controller_factory_.set_delegate(this); media::AudioInputController::set_factory_for_testing( &test_audio_input_controller_factory_); @@ -111,18 +111,18 @@ class SpeechRecognitionBrowserTest : streaming_server_state_ = kIdle; } - virtual void SetUpOnMainThread() override { + void SetUpOnMainThread() override { ASSERT_TRUE(SpeechRecognitionManagerImpl::GetInstance()); SpeechRecognizerImpl::SetAudioManagerForTesting( new media::MockAudioManager(BrowserThread::GetMessageLoopProxyForThread( BrowserThread::IO))); } - virtual void TearDownOnMainThread() override { + void TearDownOnMainThread() override { SpeechRecognizerImpl::SetAudioManagerForTesting(NULL); } - virtual void TearDownInProcessBrowserTestFixture() override { + void TearDownInProcessBrowserTestFixture() override { test_audio_input_controller_factory_.set_delegate(NULL); mock_streaming_server_.reset(); } diff --git a/content/browser/speech/speech_recognition_dispatcher_host.h b/content/browser/speech/speech_recognition_dispatcher_host.h index ac6b0c2..c64904e 100644 --- a/content/browser/speech/speech_recognition_dispatcher_host.h +++ b/content/browser/speech/speech_recognition_dispatcher_host.h @@ -34,33 +34,30 @@ class CONTENT_EXPORT SpeechRecognitionDispatcherHost base::WeakPtr<SpeechRecognitionDispatcherHost> AsWeakPtr(); // SpeechRecognitionEventListener methods. - virtual void OnRecognitionStart(int session_id) override; - virtual void OnAudioStart(int session_id) override; - virtual void OnEnvironmentEstimationComplete(int session_id) override; - virtual void OnSoundStart(int session_id) override; - virtual void OnSoundEnd(int session_id) override; - virtual void OnAudioEnd(int session_id) override; - virtual void OnRecognitionEnd(int session_id) override; - virtual void OnRecognitionResults( - int session_id, - const SpeechRecognitionResults& results) override; - virtual void OnRecognitionError( - int session_id, - const SpeechRecognitionError& error) override; - virtual void OnAudioLevelsChange(int session_id, - float volume, - float noise_volume) override; + void OnRecognitionStart(int session_id) override; + void OnAudioStart(int session_id) override; + void OnEnvironmentEstimationComplete(int session_id) override; + void OnSoundStart(int session_id) override; + void OnSoundEnd(int session_id) override; + void OnAudioEnd(int session_id) override; + void OnRecognitionEnd(int session_id) override; + void OnRecognitionResults(int session_id, + const SpeechRecognitionResults& results) override; + void OnRecognitionError(int session_id, + const SpeechRecognitionError& error) override; + void OnAudioLevelsChange(int session_id, + float volume, + float noise_volume) override; // BrowserMessageFilter implementation. - virtual bool OnMessageReceived(const IPC::Message& message) override; - virtual void OverrideThreadForMessage( - const IPC::Message& message, - BrowserThread::ID* thread) override; + bool OnMessageReceived(const IPC::Message& message) override; + void OverrideThreadForMessage(const IPC::Message& message, + BrowserThread::ID* thread) override; - virtual void OnChannelClosing() override; + void OnChannelClosing() override; private: - virtual ~SpeechRecognitionDispatcherHost(); + ~SpeechRecognitionDispatcherHost() override; void OnStartRequest( const SpeechRecognitionHostMsg_StartRequest_Params& params); diff --git a/content/browser/speech/speech_recognition_manager_impl.h b/content/browser/speech/speech_recognition_manager_impl.h index e39e198..9b8da39 100644 --- a/content/browser/speech/speech_recognition_manager_impl.h +++ b/content/browser/speech/speech_recognition_manager_impl.h @@ -58,39 +58,39 @@ class CONTENT_EXPORT SpeechRecognitionManagerImpl : static SpeechRecognitionManagerImpl* GetInstance(); // SpeechRecognitionManager implementation. - virtual int CreateSession( - const SpeechRecognitionSessionConfig& config) override; - virtual void StartSession(int session_id) override; - virtual void AbortSession(int session_id) override; - virtual void AbortAllSessionsForRenderProcess(int render_process_id) override; - virtual void AbortAllSessionsForRenderView(int render_process_id, - int render_view_id) override; - virtual void StopAudioCaptureForSession(int session_id) override; - virtual const SpeechRecognitionSessionConfig& GetSessionConfig( + int CreateSession(const SpeechRecognitionSessionConfig& config) override; + void StartSession(int session_id) override; + void AbortSession(int session_id) override; + void AbortAllSessionsForRenderProcess(int render_process_id) override; + void AbortAllSessionsForRenderView(int render_process_id, + int render_view_id) override; + void StopAudioCaptureForSession(int session_id) override; + const SpeechRecognitionSessionConfig& GetSessionConfig( int session_id) const override; - virtual SpeechRecognitionSessionContext GetSessionContext( + SpeechRecognitionSessionContext GetSessionContext( int session_id) const override; - virtual int GetSession(int render_process_id, - int render_view_id, - int request_id) const override; - virtual bool HasAudioInputDevices() override; - virtual base::string16 GetAudioInputDeviceModel() override; - virtual void ShowAudioInputSettings() override; + int GetSession(int render_process_id, + int render_view_id, + int request_id) const override; + bool HasAudioInputDevices() override; + base::string16 GetAudioInputDeviceModel() override; + void ShowAudioInputSettings() override; // SpeechRecognitionEventListener methods. - virtual void OnRecognitionStart(int session_id) override; - virtual void OnAudioStart(int session_id) override; - virtual void OnEnvironmentEstimationComplete(int session_id) override; - virtual void OnSoundStart(int session_id) override; - virtual void OnSoundEnd(int session_id) override; - virtual void OnAudioEnd(int session_id) override; - virtual void OnRecognitionEnd(int session_id) override; - virtual void OnRecognitionResults( - int session_id, const SpeechRecognitionResults& result) override; - virtual void OnRecognitionError( - int session_id, const SpeechRecognitionError& error) override; - virtual void OnAudioLevelsChange(int session_id, float volume, - float noise_volume) override; + void OnRecognitionStart(int session_id) override; + void OnAudioStart(int session_id) override; + void OnEnvironmentEstimationComplete(int session_id) override; + void OnSoundStart(int session_id) override; + void OnSoundEnd(int session_id) override; + void OnAudioEnd(int session_id) override; + void OnRecognitionEnd(int session_id) override; + void OnRecognitionResults(int session_id, + const SpeechRecognitionResults& result) override; + void OnRecognitionError(int session_id, + const SpeechRecognitionError& error) override; + void OnAudioLevelsChange(int session_id, + float volume, + float noise_volume) override; SpeechRecognitionManagerDelegate* delegate() const { return delegate_.get(); } @@ -101,7 +101,7 @@ class CONTENT_EXPORT SpeechRecognitionManagerImpl : friend struct base::DefaultDeleter<SpeechRecognitionManagerImpl>; SpeechRecognitionManagerImpl(media::AudioManager* audio_manager, MediaStreamManager* media_stream_manager); - virtual ~SpeechRecognitionManagerImpl(); + ~SpeechRecognitionManagerImpl() override; private: // Data types for the internal Finite State Machine (FSM). diff --git a/content/browser/speech/speech_recognizer_impl.cc b/content/browser/speech/speech_recognizer_impl.cc index 9fe98be..f6fb390 100644 --- a/content/browser/speech/speech_recognizer_impl.cc +++ b/content/browser/speech/speech_recognizer_impl.cc @@ -36,7 +36,7 @@ class SpeechRecognizerImpl::OnDataConverter public: OnDataConverter(const AudioParameters& input_params, const AudioParameters& output_params); - virtual ~OnDataConverter(); + ~OnDataConverter() override; // Converts input audio |data| bus into an AudioChunk where the input format // is given by |input_parameters_| and the output format by @@ -45,8 +45,7 @@ class SpeechRecognizerImpl::OnDataConverter private: // media::AudioConverter::InputCallback implementation. - virtual double ProvideInput(AudioBus* dest, - base::TimeDelta buffer_delay) override; + double ProvideInput(AudioBus* dest, base::TimeDelta buffer_delay) override; // Handles resampling, buffering, and channel mixing between input and output // parameters. diff --git a/content/browser/speech/speech_recognizer_impl.h b/content/browser/speech/speech_recognizer_impl.h index b047174..3a26d33 100644 --- a/content/browser/speech/speech_recognizer_impl.h +++ b/content/browser/speech/speech_recognizer_impl.h @@ -47,11 +47,11 @@ class CONTENT_EXPORT SpeechRecognizerImpl bool provisional_results, SpeechRecognitionEngine* engine); - virtual void StartRecognition(const std::string& device_id) override; - virtual void AbortRecognition() override; - virtual void StopAudioCapture() override; - virtual bool IsActive() const override; - virtual bool IsCapturingAudio() const override; + void StartRecognition(const std::string& device_id) override; + void AbortRecognition() override; + void StopAudioCapture() override; + bool IsActive() const override; + bool IsCapturingAudio() const override; const SpeechRecognitionEngine& recognition_engine() const; private: @@ -89,7 +89,7 @@ class CONTENT_EXPORT SpeechRecognizerImpl SpeechRecognitionError engine_error; }; - virtual ~SpeechRecognizerImpl(); + ~SpeechRecognizerImpl() override; // Entry point for pushing any new external event into the recognizer FSM. void DispatchEvent(const FSMEventArgs& event_args); @@ -129,19 +129,19 @@ class CONTENT_EXPORT SpeechRecognizerImpl void OnAudioClosed(media::AudioInputController*); // AudioInputController::EventHandler methods. - virtual void OnCreated(media::AudioInputController* controller) override {} - virtual void OnRecording(media::AudioInputController* controller) override {} - virtual void OnError(media::AudioInputController* controller, - media::AudioInputController::ErrorCode error_code) override; - virtual void OnData(media::AudioInputController* controller, - const media::AudioBus* data) override; - virtual void OnLog(media::AudioInputController* controller, - const std::string& message) override {} + void OnCreated(media::AudioInputController* controller) override {} + void OnRecording(media::AudioInputController* controller) override {} + void OnError(media::AudioInputController* controller, + media::AudioInputController::ErrorCode error_code) override; + void OnData(media::AudioInputController* controller, + const media::AudioBus* data) override; + void OnLog(media::AudioInputController* controller, + const std::string& message) override {} // SpeechRecognitionEngineDelegate methods. - virtual void OnSpeechRecognitionEngineResults( + void OnSpeechRecognitionEngineResults( const SpeechRecognitionResults& results) override; - virtual void OnSpeechRecognitionEngineError( + void OnSpeechRecognitionEngineError( const SpeechRecognitionError& error) override; static media::AudioManager* audio_manager_for_tests_; diff --git a/content/browser/speech/speech_recognizer_impl_unittest.cc b/content/browser/speech/speech_recognizer_impl_unittest.cc index f85f58d..0cb4f0d 100644 --- a/content/browser/speech/speech_recognizer_impl_unittest.cc +++ b/content/browser/speech/speech_recognizer_impl_unittest.cc @@ -95,52 +95,53 @@ class SpeechRecognizerImplTest : public SpeechRecognitionEventListener, } // Overridden from SpeechRecognitionEventListener: - virtual void OnAudioStart(int session_id) override { + void OnAudioStart(int session_id) override { audio_started_ = true; CheckEventsConsistency(); } - virtual void OnAudioEnd(int session_id) override { + void OnAudioEnd(int session_id) override { audio_ended_ = true; CheckEventsConsistency(); } - virtual void OnRecognitionResults( - int session_id, const SpeechRecognitionResults& results) override { + void OnRecognitionResults(int session_id, + const SpeechRecognitionResults& results) override { result_received_ = true; } - virtual void OnRecognitionError( - int session_id, const SpeechRecognitionError& error) override { + void OnRecognitionError(int session_id, + const SpeechRecognitionError& error) override { EXPECT_TRUE(recognition_started_); EXPECT_FALSE(recognition_ended_); error_ = error.code; } - virtual void OnAudioLevelsChange(int session_id, float volume, - float noise_volume) override { + void OnAudioLevelsChange(int session_id, + float volume, + float noise_volume) override { volume_ = volume; noise_volume_ = noise_volume; } - virtual void OnRecognitionEnd(int session_id) override { + void OnRecognitionEnd(int session_id) override { recognition_ended_ = true; CheckEventsConsistency(); } - virtual void OnRecognitionStart(int session_id) override { + void OnRecognitionStart(int session_id) override { recognition_started_ = true; CheckEventsConsistency(); } - virtual void OnEnvironmentEstimationComplete(int session_id) override {} + void OnEnvironmentEstimationComplete(int session_id) override {} - virtual void OnSoundStart(int session_id) override { + void OnSoundStart(int session_id) override { sound_started_ = true; CheckEventsConsistency(); } - virtual void OnSoundEnd(int session_id) override { + void OnSoundEnd(int session_id) override { sound_ended_ = true; CheckEventsConsistency(); } diff --git a/content/browser/ssl/ssl_cert_error_handler.h b/content/browser/ssl/ssl_cert_error_handler.h index 69c6470..e3c4378 100644 --- a/content/browser/ssl/ssl_cert_error_handler.h +++ b/content/browser/ssl/ssl_cert_error_handler.h @@ -27,7 +27,7 @@ class SSLCertErrorHandler : public SSLErrorHandler { const net::SSLInfo& ssl_info, bool fatal); - virtual SSLCertErrorHandler* AsSSLCertErrorHandler() override; + SSLCertErrorHandler* AsSSLCertErrorHandler() override; // These accessors are available on either thread const net::SSLInfo& ssl_info() const { return ssl_info_; } @@ -36,11 +36,11 @@ class SSLCertErrorHandler : public SSLErrorHandler { protected: // SSLErrorHandler methods - virtual void OnDispatchFailed() override; - virtual void OnDispatched() override; + void OnDispatchFailed() override; + void OnDispatched() override; private: - virtual ~SSLCertErrorHandler(); + ~SSLCertErrorHandler() override; // These read-only members may be accessed on any thread. const net::SSLInfo ssl_info_; diff --git a/content/browser/startup_task_runner_unittest.cc b/content/browser/startup_task_runner_unittest.cc index 04b93ea..d8b6224 100644 --- a/content/browser/startup_task_runner_unittest.cc +++ b/content/browser/startup_task_runner_unittest.cc @@ -96,22 +96,21 @@ class MockTaskRunner { class TaskRunnerProxy : public base::SingleThreadTaskRunner { public: TaskRunnerProxy(MockTaskRunner* mock) : mock_(mock) {} - virtual bool RunsTasksOnCurrentThread() const override { return true; } - virtual bool PostDelayedTask(const tracked_objects::Location& location, - const Closure& closure, - base::TimeDelta delta) override { + bool RunsTasksOnCurrentThread() const override { return true; } + bool PostDelayedTask(const tracked_objects::Location& location, + const Closure& closure, + base::TimeDelta delta) override { return mock_->PostDelayedTask(location, closure, delta); } - virtual bool PostNonNestableDelayedTask( - const tracked_objects::Location& location, - const Closure& closure, - base::TimeDelta delta) override { + bool PostNonNestableDelayedTask(const tracked_objects::Location& location, + const Closure& closure, + base::TimeDelta delta) override { return mock_->PostNonNestableDelayedTask(location, closure, delta); } private: MockTaskRunner* mock_; - virtual ~TaskRunnerProxy() {} + ~TaskRunnerProxy() override {} }; TEST_F(StartupTaskRunnerTest, SynchronousExecution) { diff --git a/content/browser/storage_partition_impl.h b/content/browser/storage_partition_impl.h index f8fda1c..f0c12d4 100644 --- a/content/browser/storage_partition_impl.h +++ b/content/browser/storage_partition_impl.h @@ -21,7 +21,7 @@ namespace content { class StoragePartitionImpl : public StoragePartition { public: - CONTENT_EXPORT virtual ~StoragePartitionImpl(); + CONTENT_EXPORT ~StoragePartitionImpl() override; // Quota managed data uses a different bitmask for types than // StoragePartition uses. This method generates that mask. @@ -33,30 +33,29 @@ class StoragePartitionImpl : public StoragePartition { storage::SpecialStoragePolicy* special_storage_policy); // StoragePartition interface. - virtual base::FilePath GetPath() override; - virtual net::URLRequestContextGetter* GetURLRequestContext() override; - virtual net::URLRequestContextGetter* GetMediaURLRequestContext() override; - virtual storage::QuotaManager* GetQuotaManager() override; - virtual ChromeAppCacheService* GetAppCacheService() override; - virtual storage::FileSystemContext* GetFileSystemContext() override; - virtual storage::DatabaseTracker* GetDatabaseTracker() override; - virtual DOMStorageContextWrapper* GetDOMStorageContext() override; - virtual IndexedDBContextImpl* GetIndexedDBContext() override; - virtual ServiceWorkerContextWrapper* GetServiceWorkerContext() override; - - virtual void ClearDataForOrigin( - uint32 remove_mask, - uint32 quota_storage_remove_mask, - const GURL& storage_origin, - net::URLRequestContextGetter* request_context_getter, - const base::Closure& callback) override; - virtual void ClearData(uint32 remove_mask, - uint32 quota_storage_remove_mask, - const GURL& storage_origin, - const OriginMatcherFunction& origin_matcher, - const base::Time begin, - const base::Time end, - const base::Closure& callback) override; + base::FilePath GetPath() override; + net::URLRequestContextGetter* GetURLRequestContext() override; + net::URLRequestContextGetter* GetMediaURLRequestContext() override; + storage::QuotaManager* GetQuotaManager() override; + ChromeAppCacheService* GetAppCacheService() override; + storage::FileSystemContext* GetFileSystemContext() override; + storage::DatabaseTracker* GetDatabaseTracker() override; + DOMStorageContextWrapper* GetDOMStorageContext() override; + IndexedDBContextImpl* GetIndexedDBContext() override; + ServiceWorkerContextWrapper* GetServiceWorkerContext() override; + + void ClearDataForOrigin(uint32 remove_mask, + uint32 quota_storage_remove_mask, + const GURL& storage_origin, + net::URLRequestContextGetter* request_context_getter, + const base::Closure& callback) override; + void ClearData(uint32 remove_mask, + uint32 quota_storage_remove_mask, + const GURL& storage_origin, + const OriginMatcherFunction& origin_matcher, + const base::Time begin, + const base::Time end, + const base::Closure& callback) override; WebRTCIdentityStore* GetWebRTCIdentityStore(); diff --git a/content/browser/storage_partition_impl_map.cc b/content/browser/storage_partition_impl_map.cc index a5ba346..d36968b 100644 --- a/content/browser/storage_partition_impl_map.cc +++ b/content/browser/storage_partition_impl_map.cc @@ -58,10 +58,9 @@ class BlobProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler { stream_context_(stream_context), file_system_context_(file_system_context) {} - virtual ~BlobProtocolHandler() { - } + ~BlobProtocolHandler() override {} - virtual net::URLRequestJob* MaybeCreateJob( + net::URLRequestJob* MaybeCreateJob( net::URLRequest* request, net::NetworkDelegate* network_delegate) const override { scoped_refptr<Stream> stream = diff --git a/content/browser/storage_partition_impl_map.h b/content/browser/storage_partition_impl_map.h index c15fefc..6536621 100644 --- a/content/browser/storage_partition_impl_map.h +++ b/content/browser/storage_partition_impl_map.h @@ -30,7 +30,7 @@ class CONTENT_EXPORT StoragePartitionImplMap public: explicit StoragePartitionImplMap(BrowserContext* browser_context); - virtual ~StoragePartitionImplMap(); + ~StoragePartitionImplMap() override; // This map retains ownership of the returned StoragePartition objects. StoragePartitionImpl* Get(const std::string& partition_domain, diff --git a/content/browser/streams/stream_handle_impl.h b/content/browser/streams/stream_handle_impl.h index f642ad5..d2bd94d 100644 --- a/content/browser/streams/stream_handle_impl.h +++ b/content/browser/streams/stream_handle_impl.h @@ -21,12 +21,12 @@ class Stream; class StreamHandleImpl : public StreamHandle { public: StreamHandleImpl(const base::WeakPtr<Stream>& stream); - virtual ~StreamHandleImpl(); + ~StreamHandleImpl() override; private: // StreamHandle overrides - virtual const GURL& GetURL() override; - virtual void AddCloseListener(const base::Closure& callback) override; + const GURL& GetURL() override; + void AddCloseListener(const base::Closure& callback) override; base::WeakPtr<Stream> stream_; GURL url_; diff --git a/content/browser/streams/stream_unittest.cc b/content/browser/streams/stream_unittest.cc index 0b93ab0..3a92810 100644 --- a/content/browser/streams/stream_unittest.cc +++ b/content/browser/streams/stream_unittest.cc @@ -43,7 +43,7 @@ class TestStreamReader : public StreamReadObserver { public: TestStreamReader() : buffer_(new net::GrowableIOBuffer()), completed_(false) { } - virtual ~TestStreamReader() {} + ~TestStreamReader() override {} void Read(Stream* stream) { const size_t kBufferSize = 32768; @@ -76,9 +76,7 @@ class TestStreamReader : public StreamReadObserver { } } - virtual void OnDataAvailable(Stream* stream) override { - Read(stream); - } + void OnDataAvailable(Stream* stream) override { Read(stream); } scoped_refptr<net::GrowableIOBuffer> buffer() { return buffer_; } @@ -94,7 +92,7 @@ class TestStreamReader : public StreamReadObserver { class TestStreamWriter : public StreamWriteObserver { public: TestStreamWriter() {} - virtual ~TestStreamWriter() {} + ~TestStreamWriter() override {} void Write(Stream* stream, scoped_refptr<net::IOBuffer> buffer, @@ -102,11 +100,9 @@ class TestStreamWriter : public StreamWriteObserver { stream->AddData(buffer, buffer_size); } - virtual void OnSpaceAvailable(Stream* stream) override { - } + void OnSpaceAvailable(Stream* stream) override {} - virtual void OnClose(Stream* stream) override { - } + void OnClose(Stream* stream) override {} }; TEST_F(StreamTest, SetReadObserver) { diff --git a/content/browser/streams/stream_url_request_job.h b/content/browser/streams/stream_url_request_job.h index 84d7ad0..17e7eb2 100644 --- a/content/browser/streams/stream_url_request_job.h +++ b/content/browser/streams/stream_url_request_job.h @@ -24,22 +24,19 @@ class CONTENT_EXPORT StreamURLRequestJob scoped_refptr<Stream> stream); // StreamObserver methods. - virtual void OnDataAvailable(Stream* stream) override; + void OnDataAvailable(Stream* stream) override; // net::URLRequestJob methods. - virtual void Start() override; - virtual void Kill() override; - virtual bool ReadRawData(net::IOBuffer* buf, - int buf_size, - int* bytes_read) override; - virtual bool GetMimeType(std::string* mime_type) const override; - virtual void GetResponseInfo(net::HttpResponseInfo* info) override; - virtual int GetResponseCode() const override; - virtual void SetExtraRequestHeaders( - const net::HttpRequestHeaders& headers) override; + void Start() override; + void Kill() override; + bool ReadRawData(net::IOBuffer* buf, int buf_size, int* bytes_read) override; + bool GetMimeType(std::string* mime_type) const override; + void GetResponseInfo(net::HttpResponseInfo* info) override; + int GetResponseCode() const override; + void SetExtraRequestHeaders(const net::HttpRequestHeaders& headers) override; protected: - virtual ~StreamURLRequestJob(); + ~StreamURLRequestJob() override; private: void DidStart(); diff --git a/content/browser/streams/stream_url_request_job_unittest.cc b/content/browser/streams/stream_url_request_job_unittest.cc index 0929fc3..0b9c00a 100644 --- a/content/browser/streams/stream_url_request_job_unittest.cc +++ b/content/browser/streams/stream_url_request_job_unittest.cc @@ -38,7 +38,7 @@ class StreamURLRequestJobTest : public testing::Test { MockProtocolHandler(StreamRegistry* registry) : registry_(registry) {} // net::URLRequestJobFactory::ProtocolHandler override. - virtual net::URLRequestJob* MaybeCreateJob( + net::URLRequestJob* MaybeCreateJob( net::URLRequest* request, net::NetworkDelegate* network_delegate) const override { scoped_refptr<Stream> stream = registry_->GetStream(request->url()); diff --git a/content/browser/tcmalloc_internals_request_job.h b/content/browser/tcmalloc_internals_request_job.h index 22a3eb8..d6d7e00 100644 --- a/content/browser/tcmalloc_internals_request_job.h +++ b/content/browser/tcmalloc_internals_request_job.h @@ -50,13 +50,13 @@ class TcmallocInternalsRequestJob : public net::URLRequestSimpleJob { TcmallocInternalsRequestJob(net::URLRequest* request, net::NetworkDelegate* network_delegate); - virtual int GetData(std::string* mime_type, - std::string* charset, - std::string* data, - const net::CompletionCallback& callback) const override; + int GetData(std::string* mime_type, + std::string* charset, + std::string* data, + const net::CompletionCallback& callback) const override; protected: - virtual ~TcmallocInternalsRequestJob() {} + ~TcmallocInternalsRequestJob() override {} private: DISALLOW_IMPLICIT_CONSTRUCTORS(TcmallocInternalsRequestJob); diff --git a/content/browser/theme_helper_mac.h b/content/browser/theme_helper_mac.h index 3b0e144..935ab3f 100644 --- a/content/browser/theme_helper_mac.h +++ b/content/browser/theme_helper_mac.h @@ -33,12 +33,12 @@ class ThemeHelperMac : public NotificationObserver { friend struct DefaultSingletonTraits<ThemeHelperMac>; ThemeHelperMac(); - virtual ~ThemeHelperMac(); + ~ThemeHelperMac() override; // Overridden from NotificationObserver: - virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) override; + void Observe(int type, + const NotificationSource& source, + const NotificationDetails& details) override; NotificationRegistrar registrar_; diff --git a/content/browser/time_zone_monitor_mac.mm b/content/browser/time_zone_monitor_mac.mm index c435aae..700c17e 100644 --- a/content/browser/time_zone_monitor_mac.mm +++ b/content/browser/time_zone_monitor_mac.mm @@ -21,7 +21,7 @@ class TimeZoneMonitorMac : public TimeZoneMonitor { }]; } - virtual ~TimeZoneMonitorMac() { + ~TimeZoneMonitorMac() override { NSNotificationCenter* nc = [NSNotificationCenter defaultCenter]; [nc removeObserver:notification_observer_]; } diff --git a/content/browser/tracing/trace_message_filter.h b/content/browser/tracing/trace_message_filter.h index ac129c0..3d12d76 100644 --- a/content/browser/tracing/trace_message_filter.h +++ b/content/browser/tracing/trace_message_filter.h @@ -21,8 +21,8 @@ class TraceMessageFilter : public BrowserMessageFilter { TraceMessageFilter(); // BrowserMessageFilter implementation. - virtual void OnChannelClosing() override; - virtual bool OnMessageReceived(const IPC::Message& message) override; + void OnChannelClosing() override; + bool OnMessageReceived(const IPC::Message& message) override; void SendBeginTracing(const base::debug::CategoryFilter& category_filter_str, const base::debug::TraceOptions& options); @@ -37,7 +37,7 @@ class TraceMessageFilter : public BrowserMessageFilter { void SendCancelWatchEvent(); protected: - virtual ~TraceMessageFilter(); + ~TraceMessageFilter() override; private: // Message handlers. diff --git a/content/browser/tracing/trace_uploader.h b/content/browser/tracing/trace_uploader.h index bfc4385..323a4c5 100644 --- a/content/browser/tracing/trace_uploader.h +++ b/content/browser/tracing/trace_uploader.h @@ -43,12 +43,13 @@ class TraceUploader : public net::URLFetcherDelegate { const std::string& version, const std::string& upload_url, net::URLRequestContextGetter* request_context); - virtual ~TraceUploader(); + ~TraceUploader() override; // net::URLFetcherDelegate implementation. - virtual void OnURLFetchComplete(const net::URLFetcher* source) override; - virtual void OnURLFetchUploadProgress(const net::URLFetcher* source, - int64 current, int64 total) override; + void OnURLFetchComplete(const net::URLFetcher* source) override; + void OnURLFetchUploadProgress(const net::URLFetcher* source, + int64 current, + int64 total) override; // Compresses and uploads the given file contents. void DoUpload(const std::string& file_contents, diff --git a/content/browser/tracing/tracing_controller_impl.cc b/content/browser/tracing/tracing_controller_impl.cc index 06826c4..3e8e1ac 100644 --- a/content/browser/tracing/tracing_controller_impl.cc +++ b/content/browser/tracing/tracing_controller_impl.cc @@ -43,7 +43,7 @@ class FileTraceDataSink : public TracingController::TraceDataSink { completion_callback_(callback), file_(NULL) {} - virtual void AddTraceChunk(const std::string& chunk) override { + void AddTraceChunk(const std::string& chunk) override { std::string tmp = chunk; scoped_refptr<base::RefCountedString> chunk_ptr = base::RefCountedString::TakeString(&tmp); @@ -53,10 +53,10 @@ class FileTraceDataSink : public TracingController::TraceDataSink { base::Bind( &FileTraceDataSink::AddTraceChunkOnFileThread, this, chunk_ptr)); } - virtual void SetSystemTrace(const std::string& data) override { + void SetSystemTrace(const std::string& data) override { system_trace_ = data; } - virtual void Close() override { + void Close() override { BrowserThread::PostTask( BrowserThread::FILE, FROM_HERE, @@ -64,7 +64,7 @@ class FileTraceDataSink : public TracingController::TraceDataSink { } private: - virtual ~FileTraceDataSink() { DCHECK(file_ == NULL); } + ~FileTraceDataSink() override { DCHECK(file_ == NULL); } void AddTraceChunkOnFileThread( const scoped_refptr<base::RefCountedString> chunk) { @@ -127,15 +127,15 @@ class StringTraceDataSink : public TracingController::TraceDataSink { : completion_callback_(callback) {} // TracingController::TraceDataSink implementation - virtual void AddTraceChunk(const std::string& chunk) override { + void AddTraceChunk(const std::string& chunk) override { if (!trace_.empty()) trace_ += ","; trace_ += chunk; } - virtual void SetSystemTrace(const std::string& data) override { + void SetSystemTrace(const std::string& data) override { system_trace_ = data; } - virtual void Close() override { + void Close() override { std::string result = "{\"traceEvents\":[" + trace_ + "]"; if (!system_trace_.empty()) result += ",\"systemTraceEvents\": " + system_trace_; @@ -147,7 +147,7 @@ class StringTraceDataSink : public TracingController::TraceDataSink { } private: - virtual ~StringTraceDataSink() {} + ~StringTraceDataSink() override {} std::string trace_; std::string system_trace_; diff --git a/content/browser/tracing/tracing_controller_impl.h b/content/browser/tracing/tracing_controller_impl.h index 3f80b7a..9bd8420 100644 --- a/content/browser/tracing/tracing_controller_impl.h +++ b/content/browser/tracing/tracing_controller_impl.h @@ -27,32 +27,28 @@ class TracingControllerImpl : public TracingController { static TracingControllerImpl* GetInstance(); // TracingController implementation. - virtual bool GetCategories( - const GetCategoriesDoneCallback& callback) override; - virtual bool EnableRecording( - const base::debug::CategoryFilter& category_filter, - const base::debug::TraceOptions& trace_options, - const EnableRecordingDoneCallback& callback) override; - virtual bool DisableRecording( - const scoped_refptr<TraceDataSink>& sink) override; - virtual bool EnableMonitoring( - const base::debug::CategoryFilter& category_filter, - const base::debug::TraceOptions& trace_options, - const EnableMonitoringDoneCallback& callback) override; - virtual bool DisableMonitoring( + bool GetCategories(const GetCategoriesDoneCallback& callback) override; + bool EnableRecording(const base::debug::CategoryFilter& category_filter, + const base::debug::TraceOptions& trace_options, + const EnableRecordingDoneCallback& callback) override; + bool DisableRecording(const scoped_refptr<TraceDataSink>& sink) override; + bool EnableMonitoring(const base::debug::CategoryFilter& category_filter, + const base::debug::TraceOptions& trace_options, + const EnableMonitoringDoneCallback& callback) override; + bool DisableMonitoring( const DisableMonitoringDoneCallback& callback) override; - virtual void GetMonitoringStatus( + void GetMonitoringStatus( bool* out_enabled, base::debug::CategoryFilter* out_category_filter, base::debug::TraceOptions* out_trace_options) override; - virtual bool CaptureMonitoringSnapshot( + bool CaptureMonitoringSnapshot( const scoped_refptr<TraceDataSink>& sink) override; - virtual bool GetTraceBufferPercentFull( + bool GetTraceBufferPercentFull( const GetTraceBufferPercentFullCallback& callback) override; - virtual bool SetWatchEvent(const std::string& category_name, - const std::string& event_name, - const WatchEventCallback& callback) override; - virtual bool CancelWatchEvent() override; + bool SetWatchEvent(const std::string& category_name, + const std::string& event_name, + const WatchEventCallback& callback) override; + bool CancelWatchEvent() override; void RegisterTracingUI(TracingUI* tracing_ui); void UnregisterTracingUI(TracingUI* tracing_ui); @@ -64,7 +60,7 @@ class TracingControllerImpl : public TracingController { friend class TraceMessageFilter; TracingControllerImpl(); - virtual ~TracingControllerImpl(); + ~TracingControllerImpl() override; bool can_enable_recording() const { return !is_recording_; diff --git a/content/browser/tracing/tracing_ui.h b/content/browser/tracing/tracing_ui.h index b0afde0..7b69337 100644 --- a/content/browser/tracing/tracing_ui.h +++ b/content/browser/tracing/tracing_ui.h @@ -17,7 +17,7 @@ namespace content { class CONTENT_EXPORT TracingUI : public WebUIController { public: explicit TracingUI(WebUI* web_ui); - virtual ~TracingUI(); + ~TracingUI() override; void OnMonitoringStateChanged(bool is_monitoring); void DoUpload(const base::ListValue* args); void OnTraceUploadProgress(int64 current, int64 total); diff --git a/content/browser/transition_browsertest.cc b/content/browser/transition_browsertest.cc index 6d199a8..d3287f0 100644 --- a/content/browser/transition_browsertest.cc +++ b/content/browser/transition_browsertest.cc @@ -26,7 +26,7 @@ class TransitionBrowserTest : public ContentBrowserTest { public: TransitionBrowserTest() {} - virtual void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(CommandLine* command_line) override { command_line->AppendSwitch( switches::kEnableExperimentalWebPlatformFeatures); } @@ -46,12 +46,11 @@ class TransitionBrowserTestObserver is_transition_request_(false) { } - virtual void RequestBeginning( - net::URLRequest* request, - ResourceContext* resource_context, - AppCacheService* appcache_service, - ResourceType resource_type, - ScopedVector<ResourceThrottle>* throttles) override { + void RequestBeginning(net::URLRequest* request, + ResourceContext* resource_context, + AppCacheService* appcache_service, + ResourceType resource_type, + ScopedVector<ResourceThrottle>* throttles) override { CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); ShellResourceDispatcherHostDelegate::RequestBeginning(request, resource_context, @@ -70,11 +69,10 @@ class TransitionBrowserTestObserver } } - virtual void OnResponseStarted( - net::URLRequest* request, - ResourceContext* resource_context, - ResourceResponse* response, - IPC::Sender* sender) override { + void OnResponseStarted(net::URLRequest* request, + ResourceContext* resource_context, + ResourceResponse* response, + IPC::Sender* sender) override { ResourceRequestInfoImpl* info = ResourceRequestInfoImpl::ForRequest(request_); diff --git a/content/browser/utility_process_host_impl.cc b/content/browser/utility_process_host_impl.cc index 848d208..0d24e3a 100644 --- a/content/browser/utility_process_host_impl.cc +++ b/content/browser/utility_process_host_impl.cc @@ -47,7 +47,7 @@ class UtilitySandboxedProcessLauncherDelegate #endif // OS_WIN {} - virtual ~UtilitySandboxedProcessLauncherDelegate() {} + ~UtilitySandboxedProcessLauncherDelegate() override {} #if defined(OS_WIN) virtual bool ShouldLaunchElevated() override { @@ -59,15 +59,11 @@ class UtilitySandboxedProcessLauncherDelegate } #elif defined(OS_POSIX) - virtual bool ShouldUseZygote() override { + bool ShouldUseZygote() override { return !no_sandbox_ && exposed_dir_.empty(); } - virtual base::EnvironmentMap GetEnvironment() override { - return env_; - } - virtual base::ScopedFD TakeIpcFd() override { - return ipc_fd_.Pass(); - } + base::EnvironmentMap GetEnvironment() override { return env_; } + base::ScopedFD TakeIpcFd() override { return ipc_fd_.Pass(); } #endif // OS_WIN private: diff --git a/content/browser/utility_process_host_impl.h b/content/browser/utility_process_host_impl.h index b88f77d..c310e9b 100644 --- a/content/browser/utility_process_host_impl.h +++ b/content/browser/utility_process_host_impl.h @@ -38,21 +38,21 @@ class CONTENT_EXPORT UtilityProcessHostImpl UtilityProcessHostImpl( const scoped_refptr<UtilityProcessHostClient>& client, const scoped_refptr<base::SequencedTaskRunner>& client_task_runner); - virtual ~UtilityProcessHostImpl(); + ~UtilityProcessHostImpl() override; // UtilityProcessHost implementation: - virtual bool Send(IPC::Message* message) override; - virtual bool StartBatchMode() override; - virtual void EndBatchMode() override; - virtual void SetExposedDir(const base::FilePath& dir) override; - virtual void EnableMDns() override; - virtual void DisableSandbox() override; + bool Send(IPC::Message* message) override; + bool StartBatchMode() override; + void EndBatchMode() override; + void SetExposedDir(const base::FilePath& dir) override; + void EnableMDns() override; + void DisableSandbox() override; #if defined(OS_WIN) virtual void ElevatePrivileges() override; #endif - virtual const ChildProcessData& GetData() override; + const ChildProcessData& GetData() override; #if defined(OS_POSIX) - virtual void SetEnv(const base::EnvironmentMap& env) override; + void SetEnv(const base::EnvironmentMap& env) override; #endif void set_child_flags(int flags) { child_flags_ = flags; } @@ -63,9 +63,9 @@ class CONTENT_EXPORT UtilityProcessHostImpl bool StartProcess(); // BrowserChildProcessHost: - virtual bool OnMessageReceived(const IPC::Message& message) override; - virtual void OnProcessLaunchFailed() override; - virtual void OnProcessCrashed(int exit_code) override; + bool OnMessageReceived(const IPC::Message& message) override; + void OnProcessLaunchFailed() override; + void OnProcessCrashed(int exit_code) override; // A pointer to our client interface, who will be informed of progress. scoped_refptr<UtilityProcessHostClient> client_; diff --git a/content/browser/vibration/vibration_message_filter.h b/content/browser/vibration/vibration_message_filter.h index ecb6ae8..19e0e61 100644 --- a/content/browser/vibration/vibration_message_filter.h +++ b/content/browser/vibration/vibration_message_filter.h @@ -17,9 +17,9 @@ class VibrationMessageFilter : public BrowserMessageFilter { VibrationMessageFilter(); private: - virtual ~VibrationMessageFilter(); + ~VibrationMessageFilter() override; // BrowserMessageFilter implementation. - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; void OnVibrate(int64 milliseconds); void OnCancelVibration(); diff --git a/content/browser/web_contents/opened_by_dom_browsertest.cc b/content/browser/web_contents/opened_by_dom_browsertest.cc index 275095a..0a89f71 100644 --- a/content/browser/web_contents/opened_by_dom_browsertest.cc +++ b/content/browser/web_contents/opened_by_dom_browsertest.cc @@ -28,7 +28,7 @@ class CloseTrackingDelegate : public WebContentsDelegate { bool close_contents_called() const { return close_contents_called_; } - virtual void CloseContents(WebContents* source) override { + void CloseContents(WebContents* source) override { close_contents_called_ = true; } @@ -42,7 +42,7 @@ class CloseTrackingDelegate : public WebContentsDelegate { class OpenedByDOMTest : public ContentBrowserTest { protected: - virtual void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(CommandLine* command_line) override { // Use --site-per-process to force process swaps on cross-site navigations. command_line->AppendSwitch(switches::kSitePerProcess); } diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index 25d9f99..f697a09 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc @@ -259,7 +259,7 @@ class WebContentsImpl::DestructionObserver : public WebContentsObserver { } // WebContentsObserver: - virtual void WebContentsDestroyed() override { + void WebContentsDestroyed() override { owner_->OnWebContentsDestroyed( static_cast<WebContentsImpl*>(web_contents())); } diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h index fba5639..8201c9b 100644 --- a/content/browser/web_contents/web_contents_impl.h +++ b/content/browser/web_contents/web_contents_impl.h @@ -99,7 +99,7 @@ class CONTENT_EXPORT WebContentsImpl public NON_EXPORTED_BASE(NavigationControllerDelegate), public NON_EXPORTED_BASE(NavigatorDelegate) { public: - virtual ~WebContentsImpl(); + ~WebContentsImpl() override; static WebContentsImpl* CreateWithOpener( const WebContents::CreateParams& params, @@ -197,428 +197,400 @@ class CONTENT_EXPORT WebContentsImpl void RemoveAccessibilityMode(AccessibilityMode mode); // WebContents ------------------------------------------------------ - virtual WebContentsDelegate* GetDelegate() override; - virtual void SetDelegate(WebContentsDelegate* delegate) override; - virtual NavigationControllerImpl& GetController() override; - virtual const NavigationControllerImpl& GetController() const override; - virtual BrowserContext* GetBrowserContext() const override; - virtual const GURL& GetURL() const override; - virtual const GURL& GetVisibleURL() const override; - virtual const GURL& GetLastCommittedURL() const override; - virtual RenderProcessHost* GetRenderProcessHost() const override; - virtual RenderFrameHost* GetMainFrame() override; - virtual RenderFrameHost* GetFocusedFrame() override; - virtual void ForEachFrame( + WebContentsDelegate* GetDelegate() override; + void SetDelegate(WebContentsDelegate* delegate) override; + NavigationControllerImpl& GetController() override; + const NavigationControllerImpl& GetController() const override; + BrowserContext* GetBrowserContext() const override; + const GURL& GetURL() const override; + const GURL& GetVisibleURL() const override; + const GURL& GetLastCommittedURL() const override; + RenderProcessHost* GetRenderProcessHost() const override; + RenderFrameHost* GetMainFrame() override; + RenderFrameHost* GetFocusedFrame() override; + void ForEachFrame( const base::Callback<void(RenderFrameHost*)>& on_frame) override; - virtual void SendToAllFrames(IPC::Message* message) override; - virtual RenderViewHost* GetRenderViewHost() const override; - virtual int GetRoutingID() const override; - virtual RenderWidgetHostView* GetRenderWidgetHostView() const override; - virtual RenderWidgetHostView* GetFullscreenRenderWidgetHostView() const - override; - virtual WebUI* CreateWebUI(const GURL& url) override; - virtual WebUI* GetWebUI() const override; - virtual WebUI* GetCommittedWebUI() const override; - virtual void SetUserAgentOverride(const std::string& override) override; - virtual const std::string& GetUserAgentOverride() const override; - virtual void EnableTreeOnlyAccessibilityMode() override; - virtual bool IsTreeOnlyAccessibilityModeForTesting() const override; - virtual bool IsFullAccessibilityModeForTesting() const override; + void SendToAllFrames(IPC::Message* message) override; + RenderViewHost* GetRenderViewHost() const override; + int GetRoutingID() const override; + RenderWidgetHostView* GetRenderWidgetHostView() const override; + RenderWidgetHostView* GetFullscreenRenderWidgetHostView() const override; + WebUI* CreateWebUI(const GURL& url) override; + WebUI* GetWebUI() const override; + WebUI* GetCommittedWebUI() const override; + void SetUserAgentOverride(const std::string& override) override; + const std::string& GetUserAgentOverride() const override; + void EnableTreeOnlyAccessibilityMode() override; + bool IsTreeOnlyAccessibilityModeForTesting() const override; + bool IsFullAccessibilityModeForTesting() const override; #if defined(OS_WIN) virtual void SetParentNativeViewAccessible( gfx::NativeViewAccessible accessible_parent) override; #endif - virtual const base::string16& GetTitle() const override; - virtual int32 GetMaxPageID() override; - virtual int32 GetMaxPageIDForSiteInstance( - SiteInstance* site_instance) override; - virtual SiteInstanceImpl* GetSiteInstance() const override; - virtual SiteInstanceImpl* GetPendingSiteInstance() const override; - virtual bool IsLoading() const override; - virtual bool IsLoadingToDifferentDocument() const override; - virtual bool IsWaitingForResponse() const override; - virtual const net::LoadStateWithParam& GetLoadState() const override; - virtual const base::string16& GetLoadStateHost() const override; - virtual uint64 GetUploadSize() const override; - virtual uint64 GetUploadPosition() const override; - virtual std::set<GURL> GetSitesInTab() const override; - virtual const std::string& GetEncoding() const override; - virtual bool DisplayedInsecureContent() const override; - virtual void IncrementCapturerCount(const gfx::Size& capture_size) override; - virtual void DecrementCapturerCount() override; - virtual int GetCapturerCount() const override; - virtual bool IsAudioMuted() const override; - virtual void SetAudioMuted(bool mute) override; - virtual bool IsCrashed() const override; - virtual void SetIsCrashed(base::TerminationStatus status, - int error_code) override; - virtual base::TerminationStatus GetCrashedStatus() const override; - virtual bool IsBeingDestroyed() const override; - virtual void NotifyNavigationStateChanged( - InvalidateTypes changed_flags) override; - virtual base::TimeTicks GetLastActiveTime() const override; - virtual void WasShown() override; - virtual void WasHidden() override; - virtual bool NeedToFireBeforeUnload() override; - virtual void DispatchBeforeUnload(bool for_cross_site_transition) override; - virtual void Stop() override; - virtual WebContents* Clone() override; - virtual void ReloadFocusedFrame(bool ignore_cache) override; - virtual void Undo() override; - virtual void Redo() override; - virtual void Cut() override; - virtual void Copy() override; - virtual void CopyToFindPboard() override; - virtual void Paste() override; - virtual void PasteAndMatchStyle() override; - virtual void Delete() override; - virtual void SelectAll() override; - virtual void Unselect() override; - virtual void Replace(const base::string16& word) override; - virtual void ReplaceMisspelling(const base::string16& word) override; - virtual void NotifyContextMenuClosed( + const base::string16& GetTitle() const override; + int32 GetMaxPageID() override; + int32 GetMaxPageIDForSiteInstance(SiteInstance* site_instance) override; + SiteInstanceImpl* GetSiteInstance() const override; + SiteInstanceImpl* GetPendingSiteInstance() const override; + bool IsLoading() const override; + bool IsLoadingToDifferentDocument() const override; + bool IsWaitingForResponse() const override; + const net::LoadStateWithParam& GetLoadState() const override; + const base::string16& GetLoadStateHost() const override; + uint64 GetUploadSize() const override; + uint64 GetUploadPosition() const override; + std::set<GURL> GetSitesInTab() const override; + const std::string& GetEncoding() const override; + bool DisplayedInsecureContent() const override; + void IncrementCapturerCount(const gfx::Size& capture_size) override; + void DecrementCapturerCount() override; + int GetCapturerCount() const override; + bool IsAudioMuted() const override; + void SetAudioMuted(bool mute) override; + bool IsCrashed() const override; + void SetIsCrashed(base::TerminationStatus status, int error_code) override; + base::TerminationStatus GetCrashedStatus() const override; + bool IsBeingDestroyed() const override; + void NotifyNavigationStateChanged(InvalidateTypes changed_flags) override; + base::TimeTicks GetLastActiveTime() const override; + void WasShown() override; + void WasHidden() override; + bool NeedToFireBeforeUnload() override; + void DispatchBeforeUnload(bool for_cross_site_transition) override; + void Stop() override; + WebContents* Clone() override; + void ReloadFocusedFrame(bool ignore_cache) override; + void Undo() override; + void Redo() override; + void Cut() override; + void Copy() override; + void CopyToFindPboard() override; + void Paste() override; + void PasteAndMatchStyle() override; + void Delete() override; + void SelectAll() override; + void Unselect() override; + void Replace(const base::string16& word) override; + void ReplaceMisspelling(const base::string16& word) override; + void NotifyContextMenuClosed( + const CustomContextMenuContext& context) override; + void ExecuteCustomContextMenuCommand( + int action, const CustomContextMenuContext& context) override; - virtual void ExecuteCustomContextMenuCommand( - int action, const CustomContextMenuContext& context) override; - virtual gfx::NativeView GetNativeView() override; - virtual gfx::NativeView GetContentNativeView() override; - virtual gfx::NativeWindow GetTopLevelNativeWindow() override; - virtual gfx::Rect GetContainerBounds() override; - virtual gfx::Rect GetViewBounds() override; - virtual DropData* GetDropData() override; - virtual void Focus() override; - virtual void SetInitialFocus() override; - virtual void StoreFocus() override; - virtual void RestoreFocus() override; - virtual void FocusThroughTabTraversal(bool reverse) override; - virtual bool ShowingInterstitialPage() const override; - virtual InterstitialPage* GetInterstitialPage() const override; - virtual bool IsSavable() override; - virtual void OnSavePage() override; - virtual bool SavePage(const base::FilePath& main_file, - const base::FilePath& dir_path, - SavePageType save_type) override; - virtual void SaveFrame(const GURL& url, - const Referrer& referrer) override; - virtual void GenerateMHTML( - const base::FilePath& file, - const base::Callback<void(int64)>& callback) - override; - virtual const std::string& GetContentsMimeType() const override; - virtual bool WillNotifyDisconnection() const override; - virtual void SetOverrideEncoding(const std::string& encoding) override; - virtual void ResetOverrideEncoding() override; - virtual RendererPreferences* GetMutableRendererPrefs() override; - virtual void Close() override; - virtual void SystemDragEnded() override; - virtual void UserGestureDone() override; - virtual void SetClosedByUserGesture(bool value) override; - virtual bool GetClosedByUserGesture() const override; - virtual void ViewSource() override; - virtual void ViewFrameSource(const GURL& url, - const PageState& page_state) override; - virtual int GetMinimumZoomPercent() const override; - virtual int GetMaximumZoomPercent() const override; - virtual gfx::Size GetPreferredSize() const override; - virtual bool GotResponseToLockMouseRequest(bool allowed) override; - virtual bool HasOpener() const override; - virtual void DidChooseColorInColorChooser(SkColor color) override; - virtual void DidEndColorChooser() override; - virtual int DownloadImage(const GURL& url, - bool is_favicon, - uint32_t max_bitmap_size, - const ImageDownloadCallback& callback) override; - virtual bool IsSubframe() const override; - virtual void Find(int request_id, - const base::string16& search_text, - const blink::WebFindOptions& options) override; - virtual void StopFinding(StopFindAction action) override; - virtual void InsertCSS(const std::string& css) override; - virtual bool WasRecentlyAudible() override; - virtual void GetManifest(const GetManifestCallback&) override; + gfx::NativeView GetNativeView() override; + gfx::NativeView GetContentNativeView() override; + gfx::NativeWindow GetTopLevelNativeWindow() override; + gfx::Rect GetContainerBounds() override; + gfx::Rect GetViewBounds() override; + DropData* GetDropData() override; + void Focus() override; + void SetInitialFocus() override; + void StoreFocus() override; + void RestoreFocus() override; + void FocusThroughTabTraversal(bool reverse) override; + bool ShowingInterstitialPage() const override; + InterstitialPage* GetInterstitialPage() const override; + bool IsSavable() override; + void OnSavePage() override; + bool SavePage(const base::FilePath& main_file, + const base::FilePath& dir_path, + SavePageType save_type) override; + void SaveFrame(const GURL& url, const Referrer& referrer) override; + void GenerateMHTML(const base::FilePath& file, + const base::Callback<void(int64)>& callback) override; + const std::string& GetContentsMimeType() const override; + bool WillNotifyDisconnection() const override; + void SetOverrideEncoding(const std::string& encoding) override; + void ResetOverrideEncoding() override; + RendererPreferences* GetMutableRendererPrefs() override; + void Close() override; + void SystemDragEnded() override; + void UserGestureDone() override; + void SetClosedByUserGesture(bool value) override; + bool GetClosedByUserGesture() const override; + void ViewSource() override; + void ViewFrameSource(const GURL& url, const PageState& page_state) override; + int GetMinimumZoomPercent() const override; + int GetMaximumZoomPercent() const override; + gfx::Size GetPreferredSize() const override; + bool GotResponseToLockMouseRequest(bool allowed) override; + bool HasOpener() const override; + void DidChooseColorInColorChooser(SkColor color) override; + void DidEndColorChooser() override; + int DownloadImage(const GURL& url, + bool is_favicon, + uint32_t max_bitmap_size, + const ImageDownloadCallback& callback) override; + bool IsSubframe() const override; + void Find(int request_id, + const base::string16& search_text, + const blink::WebFindOptions& options) override; + void StopFinding(StopFindAction action) override; + void InsertCSS(const std::string& css) override; + bool WasRecentlyAudible() override; + void GetManifest(const GetManifestCallback&) override; #if defined(OS_ANDROID) virtual base::android::ScopedJavaLocalRef<jobject> GetJavaWebContents() override; virtual WebContentsAndroid* GetWebContentsAndroid(); #elif defined(OS_MACOSX) - virtual void SetAllowOtherViews(bool allow) override; - virtual bool GetAllowOtherViews() override; + void SetAllowOtherViews(bool allow) override; + bool GetAllowOtherViews() override; #endif // Implementation of PageNavigator. - virtual WebContents* OpenURL(const OpenURLParams& params) override; + WebContents* OpenURL(const OpenURLParams& params) override; // Implementation of IPC::Sender. - virtual bool Send(IPC::Message* message) override; + bool Send(IPC::Message* message) override; // RenderFrameHostDelegate --------------------------------------------------- - virtual bool OnMessageReceived(RenderFrameHost* render_frame_host, - const IPC::Message& message) override; - virtual const GURL& GetMainFrameLastCommittedURL() const override; - virtual void RenderFrameCreated(RenderFrameHost* render_frame_host) override; - virtual void RenderFrameDeleted(RenderFrameHost* render_frame_host) override; - virtual void DidStartLoading(RenderFrameHost* render_frame_host, - bool to_different_document) override; - virtual void SwappedOut(RenderFrameHost* render_frame_host) override; - virtual void DidDeferAfterResponseStarted( + bool OnMessageReceived(RenderFrameHost* render_frame_host, + const IPC::Message& message) override; + const GURL& GetMainFrameLastCommittedURL() const override; + void RenderFrameCreated(RenderFrameHost* render_frame_host) override; + void RenderFrameDeleted(RenderFrameHost* render_frame_host) override; + void DidStartLoading(RenderFrameHost* render_frame_host, + bool to_different_document) override; + void SwappedOut(RenderFrameHost* render_frame_host) override; + void DidDeferAfterResponseStarted( const TransitionLayerData& transition_data) override; - virtual bool WillHandleDeferAfterResponseStarted() override; - virtual void WorkerCrashed(RenderFrameHost* render_frame_host) override; - virtual void ShowContextMenu(RenderFrameHost* render_frame_host, - const ContextMenuParams& params) override; - virtual void RunJavaScriptMessage(RenderFrameHost* render_frame_host, - const base::string16& message, - const base::string16& default_prompt, - const GURL& frame_url, - JavaScriptMessageType type, - IPC::Message* reply_msg) override; - virtual void RunBeforeUnloadConfirm(RenderFrameHost* render_frame_host, - const base::string16& message, - bool is_reload, - IPC::Message* reply_msg) override; - virtual void DidAccessInitialDocument() override; - virtual void DidDisownOpener(RenderFrameHost* render_frame_host) override; - virtual void DocumentOnLoadCompleted( - RenderFrameHost* render_frame_host) override; - virtual void UpdateTitle(RenderFrameHost* render_frame_host, - int32 page_id, - const base::string16& title, - base::i18n::TextDirection title_direction) override; - virtual void UpdateEncoding(RenderFrameHost* render_frame_host, - const std::string& encoding) override; - virtual WebContents* GetAsWebContents() override; - virtual bool IsNeverVisible() override; - virtual AccessibilityMode GetAccessibilityMode() const override; - virtual void AccessibilityEventReceived( + bool WillHandleDeferAfterResponseStarted() override; + void WorkerCrashed(RenderFrameHost* render_frame_host) override; + void ShowContextMenu(RenderFrameHost* render_frame_host, + const ContextMenuParams& params) override; + void RunJavaScriptMessage(RenderFrameHost* render_frame_host, + const base::string16& message, + const base::string16& default_prompt, + const GURL& frame_url, + JavaScriptMessageType type, + IPC::Message* reply_msg) override; + void RunBeforeUnloadConfirm(RenderFrameHost* render_frame_host, + const base::string16& message, + bool is_reload, + IPC::Message* reply_msg) override; + void DidAccessInitialDocument() override; + void DidDisownOpener(RenderFrameHost* render_frame_host) override; + void DocumentOnLoadCompleted(RenderFrameHost* render_frame_host) override; + void UpdateTitle(RenderFrameHost* render_frame_host, + int32 page_id, + const base::string16& title, + base::i18n::TextDirection title_direction) override; + void UpdateEncoding(RenderFrameHost* render_frame_host, + const std::string& encoding) override; + WebContents* GetAsWebContents() override; + bool IsNeverVisible() override; + AccessibilityMode GetAccessibilityMode() const override; + void AccessibilityEventReceived( const std::vector<AXEventNotificationDetails>& details) override; - virtual RenderFrameHost* GetGuestByInstanceID(int browser_plugin_instance_id) - override; + RenderFrameHost* GetGuestByInstanceID( + int browser_plugin_instance_id) override; #if defined(OS_WIN) virtual gfx::NativeViewAccessible GetParentNativeViewAccessible() override; #endif // RenderViewHostDelegate ---------------------------------------------------- - virtual RenderViewHostDelegateView* GetDelegateView() override; - virtual bool OnMessageReceived(RenderViewHost* render_view_host, - const IPC::Message& message) override; + RenderViewHostDelegateView* GetDelegateView() override; + bool OnMessageReceived(RenderViewHost* render_view_host, + const IPC::Message& message) override; // RenderFrameHostDelegate has the same method, so list it there because this // interface is going away. // virtual WebContents* GetAsWebContents() override; - virtual gfx::Rect GetRootWindowResizerRect() const override; - virtual void RenderViewCreated(RenderViewHost* render_view_host) override; - virtual void RenderViewReady(RenderViewHost* render_view_host) override; - virtual void RenderViewTerminated(RenderViewHost* render_view_host, - base::TerminationStatus status, - int error_code) override; - virtual void RenderViewDeleted(RenderViewHost* render_view_host) override; - virtual void UpdateState(RenderViewHost* render_view_host, - int32 rvh_page_id, - int32 page_id, - const PageState& page_state) override; - virtual void UpdateTargetURL(const GURL& url) override; - virtual void Close(RenderViewHost* render_view_host) override; - virtual void RequestMove(const gfx::Rect& new_bounds) override; - virtual void DidCancelLoading() override; - virtual void DocumentAvailableInMainFrame( - RenderViewHost* render_view_host) override; - virtual void RouteCloseEvent(RenderViewHost* rvh) override; - virtual void RouteMessageEvent( - RenderViewHost* rvh, - const ViewMsg_PostMessage_Params& params) override; - virtual bool AddMessageToConsole(int32 level, - const base::string16& message, - int32 line_no, - const base::string16& source_id) override; - virtual RendererPreferences GetRendererPrefs( + gfx::Rect GetRootWindowResizerRect() const override; + void RenderViewCreated(RenderViewHost* render_view_host) override; + void RenderViewReady(RenderViewHost* render_view_host) override; + void RenderViewTerminated(RenderViewHost* render_view_host, + base::TerminationStatus status, + int error_code) override; + void RenderViewDeleted(RenderViewHost* render_view_host) override; + void UpdateState(RenderViewHost* render_view_host, + int32 rvh_page_id, + int32 page_id, + const PageState& page_state) override; + void UpdateTargetURL(const GURL& url) override; + void Close(RenderViewHost* render_view_host) override; + void RequestMove(const gfx::Rect& new_bounds) override; + void DidCancelLoading() override; + void DocumentAvailableInMainFrame(RenderViewHost* render_view_host) override; + void RouteCloseEvent(RenderViewHost* rvh) override; + void RouteMessageEvent(RenderViewHost* rvh, + const ViewMsg_PostMessage_Params& params) override; + bool AddMessageToConsole(int32 level, + const base::string16& message, + int32 line_no, + const base::string16& source_id) override; + RendererPreferences GetRendererPrefs( BrowserContext* browser_context) const override; - virtual WebPreferences ComputeWebkitPrefs() override; - virtual void OnUserGesture() override; - virtual void OnIgnoredUIEvent() override; - virtual void RendererUnresponsive(RenderViewHost* render_view_host) override; - virtual void RendererResponsive(RenderViewHost* render_view_host) override; - virtual void LoadStateChanged(const GURL& url, - const net::LoadStateWithParam& load_state, - uint64 upload_position, - uint64 upload_size) override; - virtual void Activate() override; - virtual void Deactivate() override; - virtual void LostCapture() override; - virtual void HandleMouseDown() override; - virtual void HandleMouseUp() override; - virtual void HandlePointerActivate() override; - virtual void HandleGestureBegin() override; - virtual void HandleGestureEnd() override; - virtual void RunFileChooser( - RenderViewHost* render_view_host, - const FileChooserParams& params) override; - virtual void ToggleFullscreenMode(bool enter_fullscreen) override; - virtual bool IsFullscreenForCurrentTab() const override; - virtual void UpdatePreferredSize(const gfx::Size& pref_size) override; - virtual void ResizeDueToAutoResize(const gfx::Size& new_size) override; - virtual void RequestToLockMouse(bool user_gesture, - bool last_unlocked_by_target) override; - virtual void LostMouseLock() override; - virtual void CreateNewWindow( + WebPreferences ComputeWebkitPrefs() override; + void OnUserGesture() override; + void OnIgnoredUIEvent() override; + void RendererUnresponsive(RenderViewHost* render_view_host) override; + void RendererResponsive(RenderViewHost* render_view_host) override; + void LoadStateChanged(const GURL& url, + const net::LoadStateWithParam& load_state, + uint64 upload_position, + uint64 upload_size) override; + void Activate() override; + void Deactivate() override; + void LostCapture() override; + void HandleMouseDown() override; + void HandleMouseUp() override; + void HandlePointerActivate() override; + void HandleGestureBegin() override; + void HandleGestureEnd() override; + void RunFileChooser(RenderViewHost* render_view_host, + const FileChooserParams& params) override; + void ToggleFullscreenMode(bool enter_fullscreen) override; + bool IsFullscreenForCurrentTab() const override; + void UpdatePreferredSize(const gfx::Size& pref_size) override; + void ResizeDueToAutoResize(const gfx::Size& new_size) override; + void RequestToLockMouse(bool user_gesture, + bool last_unlocked_by_target) override; + void LostMouseLock() override; + void CreateNewWindow( int render_process_id, int route_id, int main_frame_route_id, const ViewHostMsg_CreateWindow_Params& params, SessionStorageNamespace* session_storage_namespace) override; - virtual void CreateNewWidget(int render_process_id, - int route_id, - blink::WebPopupType popup_type) override; - virtual void CreateNewFullscreenWidget(int render_process_id, - int route_id) override; - virtual void ShowCreatedWindow(int route_id, - WindowOpenDisposition disposition, - const gfx::Rect& initial_pos, - bool user_gesture) override; - virtual void ShowCreatedWidget(int route_id, - const gfx::Rect& initial_pos) override; - virtual void ShowCreatedFullscreenWidget(int route_id) override; - virtual void RequestMediaAccessPermission( + void CreateNewWidget(int render_process_id, + int route_id, + blink::WebPopupType popup_type) override; + void CreateNewFullscreenWidget(int render_process_id, int route_id) override; + void ShowCreatedWindow(int route_id, + WindowOpenDisposition disposition, + const gfx::Rect& initial_pos, + bool user_gesture) override; + void ShowCreatedWidget(int route_id, const gfx::Rect& initial_pos) override; + void ShowCreatedFullscreenWidget(int route_id) override; + void RequestMediaAccessPermission( const MediaStreamRequest& request, const MediaResponseCallback& callback) override; - virtual bool CheckMediaAccessPermission(const GURL& security_origin, - MediaStreamType type) override; - virtual SessionStorageNamespace* GetSessionStorageNamespace( + bool CheckMediaAccessPermission(const GURL& security_origin, + MediaStreamType type) override; + SessionStorageNamespace* GetSessionStorageNamespace( SiteInstance* instance) override; - virtual SessionStorageNamespaceMap GetSessionStorageNamespaceMap() override; - virtual FrameTree* GetFrameTree() override; + SessionStorageNamespaceMap GetSessionStorageNamespaceMap() override; + FrameTree* GetFrameTree() override; // NavigatorDelegate --------------------------------------------------------- - virtual void DidStartProvisionalLoad( - RenderFrameHostImpl* render_frame_host, - const GURL& validated_url, - bool is_error_page, - bool is_iframe_srcdoc) override; - virtual void DidStartNavigationTransition( + void DidStartProvisionalLoad(RenderFrameHostImpl* render_frame_host, + const GURL& validated_url, + bool is_error_page, + bool is_iframe_srcdoc) override; + void DidStartNavigationTransition( RenderFrameHostImpl* render_frame_host) override; - virtual void DidFailProvisionalLoadWithError( + void DidFailProvisionalLoadWithError( RenderFrameHostImpl* render_frame_host, const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) override; - virtual void DidFailLoadWithError( - RenderFrameHostImpl* render_frame_host, - const GURL& url, - int error_code, - const base::string16& error_description) override; - virtual void DidCommitProvisionalLoad( - RenderFrameHostImpl* render_frame_host, - const GURL& url, - ui::PageTransition transition_type) override; - virtual void DidNavigateMainFramePreCommit( - bool navigation_is_within_page) override; - virtual void DidNavigateMainFramePostCommit( + void DidFailLoadWithError(RenderFrameHostImpl* render_frame_host, + const GURL& url, + int error_code, + const base::string16& error_description) override; + void DidCommitProvisionalLoad(RenderFrameHostImpl* render_frame_host, + const GURL& url, + ui::PageTransition transition_type) override; + void DidNavigateMainFramePreCommit(bool navigation_is_within_page) override; + void DidNavigateMainFramePostCommit( const LoadCommittedDetails& details, const FrameHostMsg_DidCommitProvisionalLoad_Params& params) override; - virtual void DidNavigateAnyFramePostCommit( + void DidNavigateAnyFramePostCommit( RenderFrameHostImpl* render_frame_host, const LoadCommittedDetails& details, const FrameHostMsg_DidCommitProvisionalLoad_Params& params) override; - virtual void SetMainFrameMimeType(const std::string& mime_type) override; - virtual bool CanOverscrollContent() const override; - virtual void NotifyChangedNavigationState( - InvalidateTypes changed_flags) override; - virtual void AboutToNavigateRenderFrame( + void SetMainFrameMimeType(const std::string& mime_type) override; + bool CanOverscrollContent() const override; + void NotifyChangedNavigationState(InvalidateTypes changed_flags) override; + void AboutToNavigateRenderFrame( RenderFrameHostImpl* render_frame_host) override; - virtual void DidStartNavigationToPendingEntry( + void DidStartNavigationToPendingEntry( RenderFrameHostImpl* render_frame_host, const GURL& url, NavigationController::ReloadType reload_type) override; - virtual void RequestOpenURL(RenderFrameHostImpl* render_frame_host, - const OpenURLParams& params) override; - virtual bool ShouldPreserveAbortedURLs() override; + void RequestOpenURL(RenderFrameHostImpl* render_frame_host, + const OpenURLParams& params) override; + bool ShouldPreserveAbortedURLs() override; // RenderWidgetHostDelegate -------------------------------------------------- - virtual void RenderWidgetDeleted( - RenderWidgetHostImpl* render_widget_host) override; - virtual bool PreHandleKeyboardEvent( - const NativeWebKeyboardEvent& event, - bool* is_keyboard_shortcut) override; - virtual void HandleKeyboardEvent( - const NativeWebKeyboardEvent& event) override; - virtual bool HandleWheelEvent( - const blink::WebMouseWheelEvent& event) override; - virtual bool PreHandleGestureEvent( - const blink::WebGestureEvent& event) override; - virtual bool HandleGestureEvent( - const blink::WebGestureEvent& event) override; - virtual void DidSendScreenRects(RenderWidgetHostImpl* rwh) override; - virtual BrowserAccessibilityManager* GetRootBrowserAccessibilityManager() + void RenderWidgetDeleted(RenderWidgetHostImpl* render_widget_host) override; + bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, + bool* is_keyboard_shortcut) override; + void HandleKeyboardEvent(const NativeWebKeyboardEvent& event) override; + bool HandleWheelEvent(const blink::WebMouseWheelEvent& event) override; + bool PreHandleGestureEvent(const blink::WebGestureEvent& event) override; + bool HandleGestureEvent(const blink::WebGestureEvent& event) override; + void DidSendScreenRects(RenderWidgetHostImpl* rwh) override; + BrowserAccessibilityManager* GetRootBrowserAccessibilityManager() override; + BrowserAccessibilityManager* GetOrCreateRootBrowserAccessibilityManager() override; - virtual BrowserAccessibilityManager* - GetOrCreateRootBrowserAccessibilityManager() override; // RenderFrameHostManager::Delegate ------------------------------------------ - virtual bool CreateRenderViewForRenderManager( + bool CreateRenderViewForRenderManager( RenderViewHost* render_view_host, int opener_route_id, int proxy_routing_id, bool for_main_frame_navigation) override; - virtual bool CreateRenderFrameForRenderManager( - RenderFrameHost* render_frame_host, - int parent_routing_id) override; - virtual void BeforeUnloadFiredFromRenderManager( - bool proceed, const base::TimeTicks& proceed_time, + bool CreateRenderFrameForRenderManager(RenderFrameHost* render_frame_host, + int parent_routing_id) override; + void BeforeUnloadFiredFromRenderManager( + bool proceed, + const base::TimeTicks& proceed_time, bool* proceed_to_fire_unload) override; - virtual void RenderProcessGoneFromRenderManager( + void RenderProcessGoneFromRenderManager( RenderViewHost* render_view_host) override; - virtual void UpdateRenderViewSizeForRenderManager() override; - virtual void CancelModalDialogsForRenderManager() override; - virtual void NotifySwappedFromRenderManager(RenderFrameHost* old_host, - RenderFrameHost* new_host, - bool is_main_frame) override; - virtual int CreateOpenerRenderViewsForRenderManager( - SiteInstance* instance) override; - virtual NavigationControllerImpl& - GetControllerForRenderManager() override; - virtual WebUIImpl* CreateWebUIForRenderManager(const GURL& url) override; - virtual NavigationEntry* - GetLastCommittedNavigationEntryForRenderManager() override; - virtual bool FocusLocationBarByDefault() override; - virtual void SetFocusToLocationBar(bool select_all) override; - virtual bool IsHidden() override; + void UpdateRenderViewSizeForRenderManager() override; + void CancelModalDialogsForRenderManager() override; + void NotifySwappedFromRenderManager(RenderFrameHost* old_host, + RenderFrameHost* new_host, + bool is_main_frame) override; + int CreateOpenerRenderViewsForRenderManager(SiteInstance* instance) override; + NavigationControllerImpl& GetControllerForRenderManager() override; + WebUIImpl* CreateWebUIForRenderManager(const GURL& url) override; + NavigationEntry* GetLastCommittedNavigationEntryForRenderManager() override; + bool FocusLocationBarByDefault() override; + void SetFocusToLocationBar(bool select_all) override; + bool IsHidden() override; // NotificationObserver ------------------------------------------------------ - virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) override; + void Observe(int type, + const NotificationSource& source, + const NotificationDetails& details) override; // NavigationControllerDelegate ---------------------------------------------- - virtual WebContents* GetWebContents() override; - virtual void NotifyNavigationEntryCommitted( + WebContents* GetWebContents() override; + void NotifyNavigationEntryCommitted( const LoadCommittedDetails& load_details) override; // Invoked before a form repost warning is shown. - virtual void NotifyBeforeFormRepostWarningShow() override; + void NotifyBeforeFormRepostWarningShow() override; // Activate this WebContents and show a form repost warning. - virtual void ActivateAndShowRepostFormWarningDialog() override; + void ActivateAndShowRepostFormWarningDialog() override; // Whether the initial empty page of this view has been accessed by another // page, making it unsafe to show the pending URL. Always false after the // first commit. - virtual bool HasAccessedInitialDocument() override; + bool HasAccessedInitialDocument() override; // Updates the max page ID for the current SiteInstance in this // WebContentsImpl to be at least |page_id|. - virtual void UpdateMaxPageID(int32 page_id) override; + void UpdateMaxPageID(int32 page_id) override; // Updates the max page ID for the given SiteInstance in this WebContentsImpl // to be at least |page_id|. - virtual void UpdateMaxPageIDForSiteInstance(SiteInstance* site_instance, - int32 page_id) override; + void UpdateMaxPageIDForSiteInstance(SiteInstance* site_instance, + int32 page_id) override; // Copy the current map of SiteInstance ID to max page ID from another tab. // This is necessary when this tab adopts the NavigationEntries from // |web_contents|. - virtual void CopyMaxPageIDsFrom(WebContents* web_contents) override; + void CopyMaxPageIDsFrom(WebContents* web_contents) override; // Called by the NavigationController to cause the WebContentsImpl to navigate // to the current pending entry. The NavigationController should be called @@ -630,37 +602,35 @@ class CONTENT_EXPORT WebContentsImpl // // If this method returns false, then the navigation is discarded (equivalent // to calling DiscardPendingEntry on the NavigationController). - virtual bool NavigateToPendingEntry( + bool NavigateToPendingEntry( NavigationController::ReloadType reload_type) override; // Sets the history for this WebContentsImpl to |history_length| entries, and // moves the current page_id to the last entry in the list if it's valid. // This is mainly used when a prerendered page is swapped into the current // tab. The method is virtual for testing. - virtual void SetHistoryLengthAndPrune( - const SiteInstance* site_instance, - int merge_history_length, - int32 minimum_page_id) override; + void SetHistoryLengthAndPrune(const SiteInstance* site_instance, + int merge_history_length, + int32 minimum_page_id) override; // Called by InterstitialPageImpl when it creates a RenderFrameHost. - virtual void RenderFrameForInterstitialPageCreated( + void RenderFrameForInterstitialPageCreated( RenderFrameHost* render_frame_host) override; // Sets the passed interstitial as the currently showing interstitial. // No interstitial page should already be attached. - virtual void AttachInterstitialPage( - InterstitialPageImpl* interstitial_page) override; + void AttachInterstitialPage(InterstitialPageImpl* interstitial_page) override; // Unsets the currently showing interstitial. - virtual void DetachInterstitialPage() override; + void DetachInterstitialPage() override; // Changes the IsLoading state and notifies the delegate as needed. // |details| is used to provide details on the load that just finished // (but can be null if not applicable). - virtual void SetIsLoading(RenderViewHost* render_view_host, - bool is_loading, - bool to_different_document, - LoadNotificationDetails* details) override; + void SetIsLoading(RenderViewHost* render_view_host, + bool is_loading, + bool to_different_document, + LoadNotificationDetails* details) override; typedef base::Callback<void(WebContents*)> CreatedCallback; diff --git a/content/browser/web_contents/web_contents_impl_browsertest.cc b/content/browser/web_contents/web_contents_impl_browsertest.cc index d2df9c1c..349af0e 100644 --- a/content/browser/web_contents/web_contents_impl_browsertest.cc +++ b/content/browser/web_contents/web_contents_impl_browsertest.cc @@ -63,9 +63,9 @@ class LoadStopNotificationObserver : public WindowedNotificationObserver { session_index_(-1), controller_(NULL) { } - virtual void Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) override { + void Observe(int type, + const NotificationSource& source, + const NotificationDetails& details) override { if (type == NOTIFICATION_LOAD_STOP) { const Details<LoadNotificationDetails> load_details(details); url_ = load_details->url; @@ -93,7 +93,7 @@ class NavigateOnCommitObserver : public WebContentsObserver { } // WebContentsObserver: - virtual void NavigationEntryCommitted( + void NavigationEntryCommitted( const LoadCommittedDetails& load_details) override { if (!done_) { done_ = true; @@ -114,8 +114,7 @@ class RenderViewSizeDelegate : public WebContentsDelegate { } // WebContentsDelegate: - virtual gfx::Size GetSizeForNewRenderView( - WebContents* web_contents) const override { + gfx::Size GetSizeForNewRenderView(WebContents* web_contents) const override { gfx::Size size(web_contents->GetContainerBounds().size()); size.Enlarge(size_insets_.width(), size_insets_.height()); return size; @@ -134,11 +133,11 @@ class RenderViewSizeObserver : public WebContentsObserver { } // WebContentsObserver: - virtual void RenderViewCreated(RenderViewHost* rvh) override { + void RenderViewCreated(RenderViewHost* rvh) override { rwhv_create_size_ = rvh->GetView()->GetViewBounds().size(); } - virtual void DidStartNavigationToPendingEntry( + void DidStartNavigationToPendingEntry( const GURL& url, NavigationController::ReloadType reload_type) override { ResizeWebContentsView(shell_, wcv_new_size_, false); @@ -160,8 +159,8 @@ class LoadingStateChangedDelegate : public WebContentsDelegate { } // WebContentsDelegate: - virtual void LoadingStateChanged(WebContents* contents, - bool to_different_document) override { + void LoadingStateChanged(WebContents* contents, + bool to_different_document) override { loadingStateChangedCount_++; if (to_different_document) loadingStateToDifferentDocumentCount_++; @@ -385,7 +384,7 @@ class RenderFrameCreatedObserver : public WebContentsObserver { last_rfh_(NULL) { } - virtual void RenderFrameCreated(RenderFrameHost* render_frame_host) override { + void RenderFrameCreated(RenderFrameHost* render_frame_host) override { last_rfh_ = render_frame_host; } @@ -489,22 +488,21 @@ struct LoadProgressDelegateAndObserver : public WebContentsDelegate, } // WebContentsDelegate: - virtual void LoadProgressChanged(WebContents* source, - double progress) override { + void LoadProgressChanged(WebContents* source, double progress) override { EXPECT_TRUE(did_start_loading); EXPECT_FALSE(did_stop_loading); progresses.push_back(progress); } // WebContentsObserver: - virtual void DidStartLoading(RenderViewHost* render_view_host) override { + void DidStartLoading(RenderViewHost* render_view_host) override { EXPECT_FALSE(did_start_loading); EXPECT_EQ(0U, progresses.size()); EXPECT_FALSE(did_stop_loading); did_start_loading = true; } - virtual void DidStopLoading(RenderViewHost* render_view_host) override { + void DidStopLoading(RenderViewHost* render_view_host) override { EXPECT_TRUE(did_start_loading); EXPECT_GE(progresses.size(), 1U); EXPECT_FALSE(did_stop_loading); @@ -543,7 +541,7 @@ struct FirstVisuallyNonEmptyPaintObserver : public WebContentsObserver { : WebContentsObserver(shell->web_contents()), did_fist_visually_non_empty_paint_(false) {} - virtual void DidFirstVisuallyNonEmptyPaint() override { + void DidFirstVisuallyNonEmptyPaint() override { did_fist_visually_non_empty_paint_ = true; on_did_first_visually_non_empty_paint_.Run(); } diff --git a/content/browser/web_contents/web_contents_impl_unittest.cc b/content/browser/web_contents/web_contents_impl_unittest.cc index 645c825..1a907b1 100644 --- a/content/browser/web_contents/web_contents_impl_unittest.cc +++ b/content/browser/web_contents/web_contents_impl_unittest.cc @@ -44,25 +44,25 @@ const char kTestWebUIUrl[] = "chrome://blah"; class WebContentsImplTestWebUIControllerFactory : public WebUIControllerFactory { public: - virtual WebUIController* CreateWebUIControllerForURL( - WebUI* web_ui, const GURL& url) const override { + WebUIController* CreateWebUIControllerForURL(WebUI* web_ui, + const GURL& url) const override { if (!UseWebUI(url)) return NULL; return new WebUIController(web_ui); } - virtual WebUI::TypeID GetWebUIType(BrowserContext* browser_context, - const GURL& url) const override { + WebUI::TypeID GetWebUIType(BrowserContext* browser_context, + const GURL& url) const override { return WebUI::kNoWebUI; } - virtual bool UseWebUIForURL(BrowserContext* browser_context, - const GURL& url) const override { + bool UseWebUIForURL(BrowserContext* browser_context, + const GURL& url) const override { return UseWebUI(url); } - virtual bool UseWebUIBindingsForURL(BrowserContext* browser_context, - const GURL& url) const override { + bool UseWebUIBindingsForURL(BrowserContext* browser_context, + const GURL& url) const override { return UseWebUI(url); } @@ -78,10 +78,11 @@ class TestInterstitialPageDelegate : public InterstitialPageDelegate { public: explicit TestInterstitialPageDelegate(TestInterstitialPage* interstitial_page) : interstitial_page_(interstitial_page) {} - virtual void CommandReceived(const std::string& command) override; - virtual std::string GetHTMLContents() override { return std::string(); } - virtual void OnDontProceed() override; - virtual void OnProceed() override; + void CommandReceived(const std::string& command) override; + std::string GetHTMLContents() override { return std::string(); } + void OnDontProceed() override; + void OnProceed() override; + private: TestInterstitialPage* interstitial_page_; }; @@ -130,7 +131,7 @@ class TestInterstitialPage : public InterstitialPageImpl { *deleted_ = false; } - virtual ~TestInterstitialPage() { + ~TestInterstitialPage() override { if (deleted_) *deleted_ = true; if (delegate_) @@ -186,9 +187,7 @@ class TestInterstitialPage : public InterstitialPageImpl { } protected: - virtual WebContentsView* CreateWebContentsView() override { - return NULL; - } + WebContentsView* CreateWebContentsView() override { return NULL; } private: InterstitialState* state_; @@ -217,12 +216,12 @@ class TestInterstitialPageStateGuard : public TestInterstitialPage::Delegate { DCHECK(interstitial_page_); interstitial_page_->set_delegate(this); } - virtual ~TestInterstitialPageStateGuard() { + ~TestInterstitialPageStateGuard() override { if (interstitial_page_) interstitial_page_->ClearStates(); } - virtual void TestInterstitialPageDeleted( + void TestInterstitialPageDeleted( TestInterstitialPage* interstitial) override { DCHECK(interstitial_page_ == interstitial); interstitial_page_ = NULL; @@ -237,9 +236,9 @@ class WebContentsImplTestBrowserClient : public TestContentBrowserClient { WebContentsImplTestBrowserClient() : assign_site_for_url_(false) {} - virtual ~WebContentsImplTestBrowserClient() {} + ~WebContentsImplTestBrowserClient() override {} - virtual bool ShouldAssignSiteForURL(const GURL& url) override { + bool ShouldAssignSiteForURL(const GURL& url) override { return assign_site_for_url_; } @@ -272,16 +271,16 @@ class TestWebContentsObserver : public WebContentsObserver { explicit TestWebContentsObserver(WebContents* contents) : WebContentsObserver(contents) { } - virtual ~TestWebContentsObserver() {} + ~TestWebContentsObserver() override {} - virtual void DidFinishLoad(RenderFrameHost* render_frame_host, - const GURL& validated_url) override { + void DidFinishLoad(RenderFrameHost* render_frame_host, + const GURL& validated_url) override { last_url_ = validated_url; } - virtual void DidFailLoad(RenderFrameHost* render_frame_host, - const GURL& validated_url, - int error_code, - const base::string16& error_description) override { + void DidFailLoad(RenderFrameHost* render_frame_host, + const GURL& validated_url, + int error_code, + const base::string16& error_description) override { last_url_ = validated_url; } @@ -298,15 +297,15 @@ class TestWebContentsObserver : public WebContentsObserver { class FakeFullscreenDelegate : public WebContentsDelegate { public: FakeFullscreenDelegate() : fullscreened_contents_(NULL) {} - virtual ~FakeFullscreenDelegate() {} + ~FakeFullscreenDelegate() override {} - virtual void ToggleFullscreenModeForTab(WebContents* web_contents, - bool enter_fullscreen) override { + void ToggleFullscreenModeForTab(WebContents* web_contents, + bool enter_fullscreen) override { fullscreened_contents_ = enter_fullscreen ? web_contents : NULL; } - virtual bool IsFullscreenForTabOrPending(const WebContents* web_contents) - const override { + bool IsFullscreenForTabOrPending( + const WebContents* web_contents) const override { return fullscreened_contents_ && web_contents == fullscreened_contents_; } @@ -320,9 +319,9 @@ class FakeValidationMessageDelegate : public WebContentsDelegate { public: FakeValidationMessageDelegate() : hide_validation_message_was_called_(false) {} - virtual ~FakeValidationMessageDelegate() {} + ~FakeValidationMessageDelegate() override {} - virtual void HideValidationMessage(WebContents* web_contents) override { + void HideValidationMessage(WebContents* web_contents) override { hide_validation_message_was_called_ = true; } @@ -2453,7 +2452,7 @@ class ContentsZoomChangedDelegate : public WebContentsDelegate { } // WebContentsDelegate: - virtual void ContentsZoomChange(bool zoom_in) override { + void ContentsZoomChange(bool zoom_in) override { contents_zoom_changed_call_count_++; last_zoom_in_ = zoom_in; } diff --git a/content/browser/web_contents/web_contents_user_data_unittest.cc b/content/browser/web_contents/web_contents_user_data_unittest.cc index acec01d..eeb2acb 100644 --- a/content/browser/web_contents/web_contents_user_data_unittest.cc +++ b/content/browser/web_contents/web_contents_user_data_unittest.cc @@ -15,7 +15,8 @@ namespace content { class WebContentsAttachedClass1 : public WebContentsUserData<WebContentsAttachedClass1> { public: - virtual ~WebContentsAttachedClass1() {} + ~WebContentsAttachedClass1() override {} + private: explicit WebContentsAttachedClass1(WebContents* contents) {} friend class WebContentsUserData<WebContentsAttachedClass1>; @@ -24,7 +25,8 @@ class WebContentsAttachedClass1 class WebContentsAttachedClass2 : public WebContentsUserData<WebContentsAttachedClass2> { public: - virtual ~WebContentsAttachedClass2() {} + ~WebContentsAttachedClass2() override {} + private: explicit WebContentsAttachedClass2(WebContents* contents) {} friend class WebContentsUserData<WebContentsAttachedClass2>; diff --git a/content/browser/web_contents/web_contents_view_guest.h b/content/browser/web_contents/web_contents_view_guest.h index dfb76e7..e21f19a 100644 --- a/content/browser/web_contents/web_contents_view_guest.h +++ b/content/browser/web_contents/web_contents_view_guest.h @@ -31,7 +31,7 @@ class WebContentsViewGuest : public WebContentsView, BrowserPluginGuest* guest, scoped_ptr<WebContentsView> platform_view, RenderViewHostDelegateView* platform_view_delegate_view); - virtual ~WebContentsViewGuest(); + ~WebContentsViewGuest() override; WebContents* web_contents(); @@ -45,45 +45,46 @@ class WebContentsViewGuest : public WebContentsView, const ContextMenuParams& params) const; // WebContentsView implementation -------------------------------------------- - virtual gfx::NativeView GetNativeView() const override; - virtual gfx::NativeView GetContentNativeView() const override; - virtual gfx::NativeWindow GetTopLevelNativeWindow() const override; - virtual void GetContainerBounds(gfx::Rect* out) const override; - virtual void SizeContents(const gfx::Size& size) override; - virtual void Focus() override; - virtual void SetInitialFocus() override; - virtual void StoreFocus() override; - virtual void RestoreFocus() override; - virtual DropData* GetDropData() const override; - virtual gfx::Rect GetViewBounds() const override; - virtual void CreateView(const gfx::Size& initial_size, - gfx::NativeView context) override; - virtual RenderWidgetHostViewBase* CreateViewForWidget( - RenderWidgetHost* render_widget_host, bool is_guest_view_hack) override; - virtual RenderWidgetHostViewBase* CreateViewForPopupWidget( + gfx::NativeView GetNativeView() const override; + gfx::NativeView GetContentNativeView() const override; + gfx::NativeWindow GetTopLevelNativeWindow() const override; + void GetContainerBounds(gfx::Rect* out) const override; + void SizeContents(const gfx::Size& size) override; + void Focus() override; + void SetInitialFocus() override; + void StoreFocus() override; + void RestoreFocus() override; + DropData* GetDropData() const override; + gfx::Rect GetViewBounds() const override; + void CreateView(const gfx::Size& initial_size, + gfx::NativeView context) override; + RenderWidgetHostViewBase* CreateViewForWidget( + RenderWidgetHost* render_widget_host, + bool is_guest_view_hack) override; + RenderWidgetHostViewBase* CreateViewForPopupWidget( RenderWidgetHost* render_widget_host) override; - virtual void SetPageTitle(const base::string16& title) override; - virtual void RenderViewCreated(RenderViewHost* host) override; - virtual void RenderViewSwappedIn(RenderViewHost* host) override; - virtual void SetOverscrollControllerEnabled(bool enabled) override; + void SetPageTitle(const base::string16& title) override; + void RenderViewCreated(RenderViewHost* host) override; + void RenderViewSwappedIn(RenderViewHost* host) override; + void SetOverscrollControllerEnabled(bool enabled) override; #if defined(OS_MACOSX) - virtual void SetAllowOtherViews(bool allow) override; - virtual bool GetAllowOtherViews() const override; - virtual bool IsEventTracking() const override; - virtual void CloseTabAfterEventTracking() override; + void SetAllowOtherViews(bool allow) override; + bool GetAllowOtherViews() const override; + bool IsEventTracking() const override; + void CloseTabAfterEventTracking() override; #endif // Backend implementation of RenderViewHostDelegateView. - virtual void ShowContextMenu(RenderFrameHost* render_frame_host, - const ContextMenuParams& params) override; - virtual void StartDragging(const DropData& drop_data, - blink::WebDragOperationsMask allowed_ops, - const gfx::ImageSkia& image, - const gfx::Vector2d& image_offset, - const DragEventSourceInfo& event_info) override; - virtual void UpdateDragCursor(blink::WebDragOperation operation) override; - virtual void GotFocus() override; - virtual void TakeFocus(bool reverse) override; + void ShowContextMenu(RenderFrameHost* render_frame_host, + const ContextMenuParams& params) override; + void StartDragging(const DropData& drop_data, + blink::WebDragOperationsMask allowed_ops, + const gfx::ImageSkia& image, + const gfx::Vector2d& image_offset, + const DragEventSourceInfo& event_info) override; + void UpdateDragCursor(blink::WebDragOperation operation) override; + void GotFocus() override; + void TakeFocus(bool reverse) override; private: // The WebContentsImpl whose contents we display. diff --git a/content/browser/web_contents/web_contents_view_mac.h b/content/browser/web_contents/web_contents_view_mac.h index 57cd35e..80292af 100644 --- a/content/browser/web_contents/web_contents_view_mac.h +++ b/content/browser/web_contents/web_contents_view_mac.h @@ -63,55 +63,56 @@ class WebContentsViewMac : public WebContentsView, // because that's what was easiest when they were split. WebContentsViewMac(WebContentsImpl* web_contents, WebContentsViewDelegate* delegate); - virtual ~WebContentsViewMac(); + ~WebContentsViewMac() override; // WebContentsView implementation -------------------------------------------- - virtual gfx::NativeView GetNativeView() const override; - virtual gfx::NativeView GetContentNativeView() const override; - virtual gfx::NativeWindow GetTopLevelNativeWindow() const override; - virtual void GetContainerBounds(gfx::Rect* out) const override; - virtual void SizeContents(const gfx::Size& size) override; - virtual void Focus() override; - virtual void SetInitialFocus() override; - virtual void StoreFocus() override; - virtual void RestoreFocus() override; - virtual DropData* GetDropData() const override; - virtual gfx::Rect GetViewBounds() const override; - virtual void SetAllowOtherViews(bool allow) override; - virtual bool GetAllowOtherViews() const override; - virtual void CreateView( - const gfx::Size& initial_size, gfx::NativeView context) override; - virtual RenderWidgetHostViewBase* CreateViewForWidget( - RenderWidgetHost* render_widget_host, bool is_guest_view_hack) override; - virtual RenderWidgetHostViewBase* CreateViewForPopupWidget( + gfx::NativeView GetNativeView() const override; + gfx::NativeView GetContentNativeView() const override; + gfx::NativeWindow GetTopLevelNativeWindow() const override; + void GetContainerBounds(gfx::Rect* out) const override; + void SizeContents(const gfx::Size& size) override; + void Focus() override; + void SetInitialFocus() override; + void StoreFocus() override; + void RestoreFocus() override; + DropData* GetDropData() const override; + gfx::Rect GetViewBounds() const override; + void SetAllowOtherViews(bool allow) override; + bool GetAllowOtherViews() const override; + void CreateView(const gfx::Size& initial_size, + gfx::NativeView context) override; + RenderWidgetHostViewBase* CreateViewForWidget( + RenderWidgetHost* render_widget_host, + bool is_guest_view_hack) override; + RenderWidgetHostViewBase* CreateViewForPopupWidget( RenderWidgetHost* render_widget_host) override; - virtual void SetPageTitle(const base::string16& title) override; - virtual void RenderViewCreated(RenderViewHost* host) override; - virtual void RenderViewSwappedIn(RenderViewHost* host) override; - virtual void SetOverscrollControllerEnabled(bool enabled) override; - virtual bool IsEventTracking() const override; - virtual void CloseTabAfterEventTracking() override; + void SetPageTitle(const base::string16& title) override; + void RenderViewCreated(RenderViewHost* host) override; + void RenderViewSwappedIn(RenderViewHost* host) override; + void SetOverscrollControllerEnabled(bool enabled) override; + bool IsEventTracking() const override; + void CloseTabAfterEventTracking() override; // Backend implementation of RenderViewHostDelegateView. - virtual void ShowContextMenu(RenderFrameHost* render_frame_host, - const ContextMenuParams& params) override; - virtual void ShowPopupMenu(RenderFrameHost* render_frame_host, - const gfx::Rect& bounds, - int item_height, - double item_font_size, - int selected_item, - const std::vector<MenuItem>& items, - bool right_aligned, - bool allow_multiple_selection) override; - virtual void HidePopupMenu() override; - virtual void StartDragging(const DropData& drop_data, - blink::WebDragOperationsMask allowed_operations, - const gfx::ImageSkia& image, - const gfx::Vector2d& image_offset, - const DragEventSourceInfo& event_info) override; - virtual void UpdateDragCursor(blink::WebDragOperation operation) override; - virtual void GotFocus() override; - virtual void TakeFocus(bool reverse) override; + void ShowContextMenu(RenderFrameHost* render_frame_host, + const ContextMenuParams& params) override; + void ShowPopupMenu(RenderFrameHost* render_frame_host, + const gfx::Rect& bounds, + int item_height, + double item_font_size, + int selected_item, + const std::vector<MenuItem>& items, + bool right_aligned, + bool allow_multiple_selection) override; + void HidePopupMenu() override; + void StartDragging(const DropData& drop_data, + blink::WebDragOperationsMask allowed_operations, + const gfx::ImageSkia& image, + const gfx::Vector2d& image_offset, + const DragEventSourceInfo& event_info) override; + void UpdateDragCursor(blink::WebDragOperation operation) override; + void GotFocus() override; + void TakeFocus(bool reverse) override; // A helper method for closing the tab in the // CloseTabAfterEventTracking() implementation. diff --git a/content/browser/webui/content_web_ui_controller_factory.h b/content/browser/webui/content_web_ui_controller_factory.h index 2d5ee35..f263811 100644 --- a/content/browser/webui/content_web_ui_controller_factory.h +++ b/content/browser/webui/content_web_ui_controller_factory.h @@ -14,21 +14,20 @@ namespace content { class ContentWebUIControllerFactory : public WebUIControllerFactory { public: - virtual WebUI::TypeID GetWebUIType(BrowserContext* browser_context, - const GURL& url) const override; - virtual bool UseWebUIForURL(BrowserContext* browser_context, + WebUI::TypeID GetWebUIType(BrowserContext* browser_context, + const GURL& url) const override; + bool UseWebUIForURL(BrowserContext* browser_context, + const GURL& url) const override; + bool UseWebUIBindingsForURL(BrowserContext* browser_context, const GURL& url) const override; - virtual bool UseWebUIBindingsForURL(BrowserContext* browser_context, - const GURL& url) const override; - virtual WebUIController* CreateWebUIControllerForURL( - WebUI* web_ui, - const GURL& url) const override; + WebUIController* CreateWebUIControllerForURL(WebUI* web_ui, + const GURL& url) const override; static ContentWebUIControllerFactory* GetInstance(); protected: ContentWebUIControllerFactory(); - virtual ~ContentWebUIControllerFactory(); + ~ContentWebUIControllerFactory() override; private: friend struct DefaultSingletonTraits<ContentWebUIControllerFactory>; diff --git a/content/browser/webui/generic_handler.h b/content/browser/webui/generic_handler.h index 99084a3..dd35255 100644 --- a/content/browser/webui/generic_handler.h +++ b/content/browser/webui/generic_handler.h @@ -18,10 +18,10 @@ namespace content { class GenericHandler : public WebUIMessageHandler { public: GenericHandler(); - virtual ~GenericHandler(); + ~GenericHandler() override; // WebUIMessageHandler implementation. - virtual void RegisterMessages() override; + void RegisterMessages() override; private: void HandleNavigateToUrl(const base::ListValue* args); diff --git a/content/browser/webui/shared_resources_data_source.h b/content/browser/webui/shared_resources_data_source.h index 045dd83..87b5121 100644 --- a/content/browser/webui/shared_resources_data_source.h +++ b/content/browser/webui/shared_resources_data_source.h @@ -15,18 +15,18 @@ class SharedResourcesDataSource : public content::URLDataSource { SharedResourcesDataSource(); // content::URLDataSource implementation. - virtual std::string GetSource() const override; - virtual void StartDataRequest( + std::string GetSource() const override; + void StartDataRequest( const std::string& path, int render_process_id, int render_frame_id, const content::URLDataSource::GotDataCallback& callback) override; - virtual std::string GetMimeType(const std::string&) const override; - virtual std::string GetAccessControlAllowOriginForOrigin( + std::string GetMimeType(const std::string&) const override; + std::string GetAccessControlAllowOriginForOrigin( const std::string& origin) const override; private: - virtual ~SharedResourcesDataSource(); + ~SharedResourcesDataSource() override; DISALLOW_COPY_AND_ASSIGN(SharedResourcesDataSource); }; diff --git a/content/browser/webui/url_data_manager.h b/content/browser/webui/url_data_manager.h index e94568d..8a318b7 100644 --- a/content/browser/webui/url_data_manager.h +++ b/content/browser/webui/url_data_manager.h @@ -26,7 +26,7 @@ class WebUIDataSource; class CONTENT_EXPORT URLDataManager : public base::SupportsUserData::Data { public: explicit URLDataManager(BrowserContext* browser_context); - virtual ~URLDataManager(); + ~URLDataManager() override; // Adds a DataSource to the collection of data sources. This *must* be invoked // on the UI thread. diff --git a/content/browser/webui/url_data_manager_backend.cc b/content/browser/webui/url_data_manager_backend.cc index 8c21673c..9e12864 100644 --- a/content/browser/webui/url_data_manager_backend.cc +++ b/content/browser/webui/url_data_manager_backend.cc @@ -119,14 +119,12 @@ class URLRequestChromeJob : public net::URLRequestJob, bool is_incognito); // net::URLRequestJob implementation. - virtual void Start() override; - virtual void Kill() override; - virtual bool ReadRawData(net::IOBuffer* buf, - int buf_size, - int* bytes_read) override; - virtual bool GetMimeType(std::string* mime_type) const override; - virtual int GetResponseCode() const override; - virtual void GetResponseInfo(net::HttpResponseInfo* info) override; + void Start() override; + void Kill() override; + bool ReadRawData(net::IOBuffer* buf, int buf_size, int* bytes_read) override; + bool GetMimeType(std::string* mime_type) const override; + int GetResponseCode() const override; + void GetResponseInfo(net::HttpResponseInfo* info) override; // Used to notify that the requested data's |mime_type| is ready. void MimeTypeAvailable(const std::string& mime_type); @@ -175,7 +173,7 @@ class URLRequestChromeJob : public net::URLRequestJob, } private: - virtual ~URLRequestChromeJob(); + ~URLRequestChromeJob() override; // Helper for Start(), to let us start asynchronously. // (This pattern is shared by most net::URLRequestJob implementations.) @@ -459,9 +457,9 @@ class ChromeProtocolHandler is_incognito_(is_incognito), appcache_service_(appcache_service), blob_storage_context_(blob_storage_context) {} - virtual ~ChromeProtocolHandler() {} + ~ChromeProtocolHandler() override {} - virtual net::URLRequestJob* MaybeCreateJob( + net::URLRequestJob* MaybeCreateJob( net::URLRequest* request, net::NetworkDelegate* network_delegate) const override { DCHECK(request); @@ -504,7 +502,7 @@ class ChromeProtocolHandler GetURLDataManagerForResourceContext(resource_context_), is_incognito_); } - virtual bool IsSafeRedirectTarget(const GURL& location) const override { + bool IsSafeRedirectTarget(const GURL& location) const override { return false; } @@ -729,9 +727,9 @@ class DevToolsJobFactory // |is_incognito| should be set for incognito profiles. DevToolsJobFactory(content::ResourceContext* resource_context, bool is_incognito); - virtual ~DevToolsJobFactory(); + ~DevToolsJobFactory() override; - virtual net::URLRequestJob* MaybeCreateJob( + net::URLRequestJob* MaybeCreateJob( net::URLRequest* request, net::NetworkDelegate* network_delegate) const override; diff --git a/content/browser/webui/url_data_manager_backend.h b/content/browser/webui/url_data_manager_backend.h index 4bdfc23..19d6bd2 100644 --- a/content/browser/webui/url_data_manager_backend.h +++ b/content/browser/webui/url_data_manager_backend.h @@ -39,7 +39,7 @@ class URLDataManagerBackend : public base::SupportsUserData::Data { typedef int RequestID; URLDataManagerBackend(); - virtual ~URLDataManagerBackend(); + ~URLDataManagerBackend() override; // Invoked to create the protocol handler for chrome://. |is_incognito| should // be set for incognito profiles. Called on the UI thread. diff --git a/content/browser/webui/web_ui_controller_factory_registry.h b/content/browser/webui/web_ui_controller_factory_registry.h index b435745..b59162f 100644 --- a/content/browser/webui/web_ui_controller_factory_registry.h +++ b/content/browser/webui/web_ui_controller_factory_registry.h @@ -19,14 +19,14 @@ class CONTENT_EXPORT WebUIControllerFactoryRegistry // WebUIControllerFactory implementation. Each method loops through the same // method on all the factories. - virtual WebUIController* CreateWebUIControllerForURL( - WebUI* web_ui, const GURL& url) const override; - virtual WebUI::TypeID GetWebUIType(BrowserContext* browser_context, - const GURL& url) const override; - virtual bool UseWebUIForURL(BrowserContext* browser_context, + WebUIController* CreateWebUIControllerForURL(WebUI* web_ui, + const GURL& url) const override; + WebUI::TypeID GetWebUIType(BrowserContext* browser_context, + const GURL& url) const override; + bool UseWebUIForURL(BrowserContext* browser_context, + const GURL& url) const override; + bool UseWebUIBindingsForURL(BrowserContext* browser_context, const GURL& url) const override; - virtual bool UseWebUIBindingsForURL(BrowserContext* browser_context, - const GURL& url) const override; // Returns true if the given URL can be loaded by Web UI system. This allows // URLs that UseWebUIForURL returns true for, and also URLs that can be loaded @@ -38,7 +38,7 @@ class CONTENT_EXPORT WebUIControllerFactoryRegistry friend struct DefaultSingletonTraits<WebUIControllerFactoryRegistry>; WebUIControllerFactoryRegistry(); - virtual ~WebUIControllerFactoryRegistry(); + ~WebUIControllerFactoryRegistry() override; DISALLOW_COPY_AND_ASSIGN(WebUIControllerFactoryRegistry); }; diff --git a/content/browser/webui/web_ui_data_source_impl.cc b/content/browser/webui/web_ui_data_source_impl.cc index 1ab38d1..6fbe577 100644 --- a/content/browser/webui/web_ui_data_source_impl.cc +++ b/content/browser/webui/web_ui_data_source_impl.cc @@ -59,17 +59,14 @@ class WebUIDataSourceImpl::InternalDataSource : public URLDataSource { InternalDataSource(WebUIDataSourceImpl* parent) : parent_(parent) { } - virtual ~InternalDataSource() { - } + ~InternalDataSource() override {} // URLDataSource implementation. - virtual std::string GetSource() const override { - return parent_->GetSource(); - } - virtual std::string GetMimeType(const std::string& path) const override { + std::string GetSource() const override { return parent_->GetSource(); } + std::string GetMimeType(const std::string& path) const override { return parent_->GetMimeType(path); } - virtual void StartDataRequest( + void StartDataRequest( const std::string& path, int render_process_id, int render_frame_id, @@ -77,26 +74,24 @@ class WebUIDataSourceImpl::InternalDataSource : public URLDataSource { return parent_->StartDataRequest(path, render_process_id, render_frame_id, callback); } - virtual bool ShouldReplaceExistingSource() const override { + bool ShouldReplaceExistingSource() const override { return parent_->replace_existing_source_; } - virtual bool AllowCaching() const override { - return false; - } - virtual bool ShouldAddContentSecurityPolicy() const override { + bool AllowCaching() const override { return false; } + bool ShouldAddContentSecurityPolicy() const override { return parent_->add_csp_; } - virtual std::string GetContentSecurityPolicyObjectSrc() const override { + std::string GetContentSecurityPolicyObjectSrc() const override { if (parent_->object_src_set_) return parent_->object_src_; return URLDataSource::GetContentSecurityPolicyObjectSrc(); } - virtual std::string GetContentSecurityPolicyFrameSrc() const override { + std::string GetContentSecurityPolicyFrameSrc() const override { if (parent_->frame_src_set_) return parent_->frame_src_; return URLDataSource::GetContentSecurityPolicyFrameSrc(); } - virtual bool ShouldDenyXFrameOptions() const override { + bool ShouldDenyXFrameOptions() const override { return parent_->deny_xframe_options_; } diff --git a/content/browser/webui/web_ui_data_source_impl.h b/content/browser/webui/web_ui_data_source_impl.h index 8518fd4..d9f4488 100644 --- a/content/browser/webui/web_ui_data_source_impl.h +++ b/content/browser/webui/web_ui_data_source_impl.h @@ -27,30 +27,25 @@ class CONTENT_EXPORT WebUIDataSourceImpl public NON_EXPORTED_BASE(WebUIDataSource) { public: // WebUIDataSource implementation: - virtual void AddString(const std::string& name, - const base::string16& value) override; - virtual void AddString(const std::string& name, - const std::string& value) override; - virtual void AddLocalizedString(const std::string& name, int ids) override; - virtual void AddLocalizedStrings( + void AddString(const std::string& name, const base::string16& value) override; + void AddString(const std::string& name, const std::string& value) override; + void AddLocalizedString(const std::string& name, int ids) override; + void AddLocalizedStrings( const base::DictionaryValue& localized_strings) override; - virtual void AddBoolean(const std::string& name, bool value) override; - virtual void SetJsonPath(const std::string& path) override; - virtual void AddResourcePath(const std::string &path, - int resource_id) override; - virtual void SetDefaultResource(int resource_id) override; - virtual void SetRequestFilter( + void AddBoolean(const std::string& name, bool value) override; + void SetJsonPath(const std::string& path) override; + void AddResourcePath(const std::string& path, int resource_id) override; + void SetDefaultResource(int resource_id) override; + void SetRequestFilter( const WebUIDataSource::HandleRequestCallback& callback) override; - virtual void DisableReplaceExistingSource() override; - virtual void DisableContentSecurityPolicy() override; - virtual void OverrideContentSecurityPolicyObjectSrc( - const std::string& data) override; - virtual void OverrideContentSecurityPolicyFrameSrc( - const std::string& data) override; - virtual void DisableDenyXFrameOptions() override; + void DisableReplaceExistingSource() override; + void DisableContentSecurityPolicy() override; + void OverrideContentSecurityPolicyObjectSrc(const std::string& data) override; + void OverrideContentSecurityPolicyFrameSrc(const std::string& data) override; + void DisableDenyXFrameOptions() override; protected: - virtual ~WebUIDataSourceImpl(); + ~WebUIDataSourceImpl() override; // Completes a request by sending our dictionary of localized strings. void SendLocalizedStringsAsJSON( diff --git a/content/browser/webui/web_ui_data_source_unittest.cc b/content/browser/webui/web_ui_data_source_unittest.cc index 07e271f..60dcb64 100644 --- a/content/browser/webui/web_ui_data_source_unittest.cc +++ b/content/browser/webui/web_ui_data_source_unittest.cc @@ -24,16 +24,16 @@ const char kDummytResource[] = "<html>blah</html>"; class TestClient : public TestContentClient { public: TestClient() {} - virtual ~TestClient() {} + ~TestClient() override {} - virtual base::string16 GetLocalizedString(int message_id) const override { + base::string16 GetLocalizedString(int message_id) const override { if (message_id == kDummyStringId) return base::UTF8ToUTF16(kDummyString); return base::string16(); } - virtual base::RefCountedStaticMemory* GetDataResourceBytes( + base::RefCountedStaticMemory* GetDataResourceBytes( int resource_id) const override { base::RefCountedStaticMemory* bytes = NULL; if (resource_id == kDummyDefaultResourceId) { diff --git a/content/browser/webui/web_ui_impl.h b/content/browser/webui/web_ui_impl.h index b399fce..c08db29 100644 --- a/content/browser/webui/web_ui_impl.h +++ b/content/browser/webui/web_ui_impl.h @@ -23,7 +23,7 @@ class CONTENT_EXPORT WebUIImpl : public WebUI, public base::SupportsWeakPtr<WebUIImpl> { public: explicit WebUIImpl(WebContents* contents); - virtual ~WebUIImpl(); + ~WebUIImpl() override; // Called by WebContentsImpl when the RenderView is first created. This is // *not* called for every page load because in some cases @@ -31,47 +31,45 @@ class CONTENT_EXPORT WebUIImpl : public WebUI, void RenderViewCreated(RenderViewHost* render_view_host); // WebUI implementation: - virtual WebContents* GetWebContents() const override; - virtual WebUIController* GetController() const override; - virtual void SetController(WebUIController* controller) override; - virtual float GetDeviceScaleFactor() const override; - virtual const base::string16& GetOverriddenTitle() const override; - virtual void OverrideTitle(const base::string16& title) override; - virtual ui::PageTransition GetLinkTransitionType() const override; - virtual void SetLinkTransitionType(ui::PageTransition type) override; - virtual int GetBindings() const override; - virtual void SetBindings(int bindings) override; - virtual void OverrideJavaScriptFrame(const std::string& frame_name) override; - virtual void AddMessageHandler(WebUIMessageHandler* handler) override; + WebContents* GetWebContents() const override; + WebUIController* GetController() const override; + void SetController(WebUIController* controller) override; + float GetDeviceScaleFactor() const override; + const base::string16& GetOverriddenTitle() const override; + void OverrideTitle(const base::string16& title) override; + ui::PageTransition GetLinkTransitionType() const override; + void SetLinkTransitionType(ui::PageTransition type) override; + int GetBindings() const override; + void SetBindings(int bindings) override; + void OverrideJavaScriptFrame(const std::string& frame_name) override; + void AddMessageHandler(WebUIMessageHandler* handler) override; typedef base::Callback<void(const base::ListValue*)> MessageCallback; - virtual void RegisterMessageCallback( - const std::string& message, - const MessageCallback& callback) override; - virtual void ProcessWebUIMessage(const GURL& source_url, - const std::string& message, - const base::ListValue& args) override; - virtual void CallJavascriptFunction( - const std::string& function_name) override; - virtual void CallJavascriptFunction(const std::string& function_name, - const base::Value& arg) override; - virtual void CallJavascriptFunction(const std::string& function_name, - const base::Value& arg1, - const base::Value& arg2) override; - virtual void CallJavascriptFunction(const std::string& function_name, - const base::Value& arg1, - const base::Value& arg2, - const base::Value& arg3) override; - virtual void CallJavascriptFunction(const std::string& function_name, - const base::Value& arg1, - const base::Value& arg2, - const base::Value& arg3, - const base::Value& arg4) override; - virtual void CallJavascriptFunction( + void RegisterMessageCallback(const std::string& message, + const MessageCallback& callback) override; + void ProcessWebUIMessage(const GURL& source_url, + const std::string& message, + const base::ListValue& args) override; + void CallJavascriptFunction(const std::string& function_name) override; + void CallJavascriptFunction(const std::string& function_name, + const base::Value& arg) override; + void CallJavascriptFunction(const std::string& function_name, + const base::Value& arg1, + const base::Value& arg2) override; + void CallJavascriptFunction(const std::string& function_name, + const base::Value& arg1, + const base::Value& arg2, + const base::Value& arg3) override; + void CallJavascriptFunction(const std::string& function_name, + const base::Value& arg1, + const base::Value& arg2, + const base::Value& arg3, + const base::Value& arg4) override; + void CallJavascriptFunction( const std::string& function_name, const std::vector<const base::Value*>& args) override; // IPC::Listener implementation: - virtual bool OnMessageReceived(const IPC::Message& message) override; + bool OnMessageReceived(const IPC::Message& message) override; private: // IPC message handling. diff --git a/content/browser/webui/web_ui_mojo_browsertest.cc b/content/browser/webui/web_ui_mojo_browsertest.cc index c4908ef..83880d9 100644 --- a/content/browser/webui/web_ui_mojo_browsertest.cc +++ b/content/browser/webui/web_ui_mojo_browsertest.cc @@ -64,12 +64,10 @@ class BrowserTargetImpl : public mojo::InterfaceImpl<BrowserTarget> { public: explicit BrowserTargetImpl(base::RunLoop* run_loop) : run_loop_(run_loop) {} - virtual ~BrowserTargetImpl() {} + ~BrowserTargetImpl() override {} // mojo::InterfaceImpl<BrowserTarget> overrides: - virtual void PingResponse() override { - NOTREACHED(); - } + void PingResponse() override { NOTREACHED(); } protected: base::RunLoop* run_loop_; @@ -83,15 +81,13 @@ class PingBrowserTargetImpl : public BrowserTargetImpl { explicit PingBrowserTargetImpl(base::RunLoop* run_loop) : BrowserTargetImpl(run_loop) {} - virtual ~PingBrowserTargetImpl() {} + ~PingBrowserTargetImpl() override {} // mojo::InterfaceImpl<BrowserTarget> overrides: - virtual void OnConnectionEstablished() override { - client()->Ping(); - } + void OnConnectionEstablished() override { client()->Ping(); } // Quit the RunLoop when called. - virtual void PingResponse() override { + void PingResponse() override { got_message = true; run_loop_->Quit(); } @@ -127,10 +123,10 @@ class PingTestWebUIController : public TestWebUIController { PingTestWebUIController(WebUI* web_ui, base::RunLoop* run_loop) : TestWebUIController(web_ui, run_loop) { } - virtual ~PingTestWebUIController() {} + ~PingTestWebUIController() override {} // WebUIController overrides: - virtual void RenderViewCreated(RenderViewHost* render_view_host) override { + void RenderViewCreated(RenderViewHost* render_view_host) override { render_view_host->GetMainFrame()->GetServiceRegistry()-> AddService<BrowserTarget>(base::Bind( &PingTestWebUIController::CreateHandler, base::Unretained(this))); @@ -152,22 +148,22 @@ class TestWebUIControllerFactory : public WebUIControllerFactory { void set_run_loop(base::RunLoop* run_loop) { run_loop_ = run_loop; } - virtual WebUIController* CreateWebUIControllerForURL( - WebUI* web_ui, const GURL& url) const override { + WebUIController* CreateWebUIControllerForURL(WebUI* web_ui, + const GURL& url) const override { if (url.query() == "ping") return new PingTestWebUIController(web_ui, run_loop_); return NULL; } - virtual WebUI::TypeID GetWebUIType(BrowserContext* browser_context, - const GURL& url) const override { + WebUI::TypeID GetWebUIType(BrowserContext* browser_context, + const GURL& url) const override { return reinterpret_cast<WebUI::TypeID>(1); } - virtual bool UseWebUIForURL(BrowserContext* browser_context, - const GURL& url) const override { + bool UseWebUIForURL(BrowserContext* browser_context, + const GURL& url) const override { return true; } - virtual bool UseWebUIBindingsForURL(BrowserContext* browser_context, - const GURL& url) const override { + bool UseWebUIBindingsForURL(BrowserContext* browser_context, + const GURL& url) const override { return true; } |