diff options
author | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-15 00:45:07 +0000 |
---|---|---|
committer | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-15 00:45:07 +0000 |
commit | 7d389e235c5afa2861d8503a5df517206818a4e5 (patch) | |
tree | e5a6838c0d377ffad90f726bb04758ed9c501d3f | |
parent | 97746f96aae458638e6a61200e1dd66ffad06e53 (diff) | |
download | chromium_src-7d389e235c5afa2861d8503a5df517206818a4e5.zip chromium_src-7d389e235c5afa2861d8503a5df517206818a4e5.tar.gz chromium_src-7d389e235c5afa2861d8503a5df517206818a4e5.tar.bz2 |
Enable Clang warnings for implementation files on all platforms.
This fixes a few remaining issues for Android builds
BUG=115047
Review URL: https://chromiumcodereview.appspot.com/14876034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@200125 0039d316-1c4b-4281-b951-d872f2087c98
12 files changed, 42 insertions, 73 deletions
diff --git a/android_webview/browser/net/android_stream_reader_url_request_job_unittest.cc b/android_webview/browser/net/android_stream_reader_url_request_job_unittest.cc index 0e83a40..33e826c 100644 --- a/android_webview/browser/net/android_stream_reader_url_request_job_unittest.cc +++ b/android_webview/browser/net/android_stream_reader_url_request_job_unittest.cc @@ -47,15 +47,15 @@ class NotImplInputStream : public InputStream { public: NotImplInputStream() {} virtual ~NotImplInputStream() {} - virtual bool BytesAvailable(int* bytes_available) const { + virtual bool BytesAvailable(int* bytes_available) const OVERRIDE { NOTIMPLEMENTED(); return false; } - virtual bool Skip(int64_t n, int64_t* bytes_skipped) { + virtual bool Skip(int64_t n, int64_t* bytes_skipped) OVERRIDE { NOTIMPLEMENTED(); return false; } - virtual bool Read(net::IOBuffer* dest, int length, int* bytes_read) { + virtual bool Read(net::IOBuffer* dest, int length, int* bytes_read) OVERRIDE { NOTIMPLEMENTED(); return false; } @@ -69,28 +69,26 @@ class StreamReaderDelegate : virtual scoped_ptr<InputStream> OpenInputStream( JNIEnv* env, - const GURL& url) { + const GURL& url) OVERRIDE { return make_scoped_ptr<InputStream>(new NotImplInputStream()); } virtual void OnInputStreamOpenFailed(net::URLRequest* request, - bool* restart) { + bool* restart) OVERRIDE { *restart = false; } - virtual bool GetMimeType( - JNIEnv* env, - net::URLRequest* request, - android_webview::InputStream* stream, - std::string* mime_type) { + virtual bool GetMimeType(JNIEnv* env, + net::URLRequest* request, + android_webview::InputStream* stream, + std::string* mime_type) OVERRIDE { return false; } - virtual bool GetCharset( - JNIEnv* env, - net::URLRequest* request, - android_webview::InputStream* stream, - std::string* charset) { + virtual bool GetCharset(JNIEnv* env, + net::URLRequest* request, + android_webview::InputStream* stream, + std::string* charset) OVERRIDE { return false; } }; @@ -101,7 +99,7 @@ class NullStreamReaderDelegate : public StreamReaderDelegate { virtual scoped_ptr<InputStream> OpenInputStream( JNIEnv* env, - const GURL& url) { + const GURL& url) OVERRIDE { return make_scoped_ptr<InputStream>(NULL); } }; @@ -131,13 +129,13 @@ class TestStreamReaderJob : public AndroidStreamReaderURLRequestJob { } virtual scoped_ptr<InputStreamReader> CreateStreamReader( - InputStream* stream) { + InputStream* stream) OVERRIDE { return stream_reader_.Pass(); } protected: virtual ~TestStreamReaderJob() {} - virtual base::TaskRunner* GetWorkerThreadRunner() { + virtual base::TaskRunner* GetWorkerThreadRunner() OVERRIDE { return message_loop_proxy_.get(); } diff --git a/android_webview/native/aw_contents_io_thread_client_impl.cc b/android_webview/native/aw_contents_io_thread_client_impl.cc index de8f1b1..226ba55 100644 --- a/android_webview/native/aw_contents_io_thread_client_impl.cc +++ b/android_webview/native/aw_contents_io_thread_client_impl.cc @@ -104,7 +104,7 @@ class ClientMapEntryUpdater : public content::WebContentsObserver { virtual void RenderViewForInterstitialPageCreated( RenderViewHost* render_view_host) OVERRIDE; virtual void RenderViewDeleted(RenderViewHost* render_view_host) OVERRIDE; - virtual void WebContentsDestroyed(WebContents* web_contents); + virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE; private: JavaObjectWeakGlobalRef jdelegate_; diff --git a/build/common.gypi b/build/common.gypi index 707c433..0334416 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -1542,27 +1542,8 @@ 'grit_defines': ['-D', 'use_concatenated_impulse_responses'], }], ['clang_use_chrome_plugins==1 and OS!="win"', { - 'variables': { - 'clang_chrome_plugins_flags': [ - '<!@(<(DEPTH)/tools/clang/scripts/plugin_flags.sh)' - ], - }, - 'conditions': [ - ['OS=="linux" or OS=="mac"', { - 'clang_chrome_plugins_flags': [ - '<@(clang_chrome_plugins_flags)' - ], - }, { - # TODO(rsleevi): http://crbug.com/115047 - This warning is only - # enabled for Linux for now. Disable everywhere else. - 'clang_chrome_plugins_flags': [ - '<@(clang_chrome_plugins_flags)', - '-Xclang', - '-plugin-arg-find-bad-constructs', - '-Xclang', - 'skip-virtuals-in-implementations', - ], - }] + 'clang_chrome_plugins_flags': [ + '<!@(<(DEPTH)/tools/clang/scripts/plugin_flags.sh)' ], }], diff --git a/chrome/browser/history/android/android_cache_database_unittest.cc b/chrome/browser/history/android/android_cache_database_unittest.cc index e05addf..6d1c5b1 100644 --- a/chrome/browser/history/android/android_cache_database_unittest.cc +++ b/chrome/browser/history/android/android_cache_database_unittest.cc @@ -20,8 +20,7 @@ class AndroidCacheDatabaseTest : public testing::Test { public: AndroidCacheDatabaseTest() { } - ~AndroidCacheDatabaseTest() { - } + virtual ~AndroidCacheDatabaseTest() {} protected: virtual void SetUp() { diff --git a/chrome/browser/history/android/android_provider_backend_unittest.cc b/chrome/browser/history/android/android_provider_backend_unittest.cc index 5bc1bf1..3c2e6e3 100644 --- a/chrome/browser/history/android/android_provider_backend_unittest.cc +++ b/chrome/browser/history/android/android_provider_backend_unittest.cc @@ -114,8 +114,7 @@ class AndroidProviderBackendTest : public testing::Test { ui_thread_(BrowserThread::UI, &message_loop_), file_thread_(BrowserThread::FILE, &message_loop_) { } - ~AndroidProviderBackendTest() { - } + virtual ~AndroidProviderBackendTest() {} protected: virtual void SetUp() OVERRIDE { diff --git a/chrome/browser/history/android/android_urls_database_unittest.cc b/chrome/browser/history/android/android_urls_database_unittest.cc index 087f0e4..e95f0ba 100644 --- a/chrome/browser/history/android/android_urls_database_unittest.cc +++ b/chrome/browser/history/android/android_urls_database_unittest.cc @@ -19,8 +19,7 @@ class AndroidURLsMigrationTest : public HistoryUnitTestBase { public: AndroidURLsMigrationTest() { } - ~AndroidURLsMigrationTest() { - } + virtual ~AndroidURLsMigrationTest() {} protected: virtual void SetUp() { diff --git a/chrome/browser/history/android/bookmark_model_sql_handler_unittest.cc b/chrome/browser/history/android/bookmark_model_sql_handler_unittest.cc index bbcc1e3..9f83555 100644 --- a/chrome/browser/history/android/bookmark_model_sql_handler_unittest.cc +++ b/chrome/browser/history/android/bookmark_model_sql_handler_unittest.cc @@ -32,8 +32,7 @@ class BookmarkModelSQLHandlerTest : public testing::Test { ui_thread_(BrowserThread::UI, &message_loop_), file_thread_(BrowserThread::FILE, &message_loop_) { } - ~BookmarkModelSQLHandlerTest() { - } + virtual ~BookmarkModelSQLHandlerTest() {} protected: virtual void SetUp() OVERRIDE { diff --git a/chrome/browser/history/android/urls_sql_handler_unittest.cc b/chrome/browser/history/android/urls_sql_handler_unittest.cc index 3a8ba97..998ab96 100644 --- a/chrome/browser/history/android/urls_sql_handler_unittest.cc +++ b/chrome/browser/history/android/urls_sql_handler_unittest.cc @@ -26,8 +26,7 @@ class UrlsSQLHandlerTest : public testing::Test { : urls_sql_handler_(&history_db_), visit_sql_handler_(&history_db_) { } - ~UrlsSQLHandlerTest() { - } + virtual ~UrlsSQLHandlerTest() {} protected: virtual void SetUp() { diff --git a/chrome/browser/history/android/visit_sql_handler_unittest.cc b/chrome/browser/history/android/visit_sql_handler_unittest.cc index 21bc839..020008b 100644 --- a/chrome/browser/history/android/visit_sql_handler_unittest.cc +++ b/chrome/browser/history/android/visit_sql_handler_unittest.cc @@ -26,8 +26,7 @@ class VisitSQLHandlerTest : public testing::Test { : urls_sql_handler_(&history_db_), visit_sql_handler_(&history_db_) { } - ~VisitSQLHandlerTest() { - } + virtual ~VisitSQLHandlerTest() {} protected: virtual void SetUp() { diff --git a/chrome/browser/ui/android/tab_model/tab_model_unittest.cc b/chrome/browser/ui/android/tab_model/tab_model_unittest.cc index b639558..439b2bc 100644 --- a/chrome/browser/ui/android/tab_model/tab_model_unittest.cc +++ b/chrome/browser/ui/android/tab_model/tab_model_unittest.cc @@ -28,15 +28,15 @@ class TestTabModel : public TabModel { explicit TestTabModel(Profile* profile) : TabModel(profile) {} - int GetTabCount() const OVERRIDE { return 0; } - int GetActiveIndex() const OVERRIDE { return 0; } - content::WebContents* GetWebContentsAt(int index) const OVERRIDE { + virtual int GetTabCount() const OVERRIDE { return 0; } + virtual int GetActiveIndex() const OVERRIDE { return 0; } + virtual content::WebContents* GetWebContentsAt(int index) const OVERRIDE { return NULL; } - SessionID::id_type GetTabIdAt(int index) const OVERRIDE { return 0; } - void CreateTab(content::WebContents* web_contents) OVERRIDE {} - bool IsSessionRestoreInProgress() const OVERRIDE { return false; } - void OpenClearBrowsingData() const OVERRIDE {} + virtual SessionID::id_type GetTabIdAt(int index) const OVERRIDE { return 0; } + virtual void CreateTab(content::WebContents* web_contents) OVERRIDE {} + virtual bool IsSessionRestoreInProgress() const OVERRIDE { return false; } + virtual void OpenClearBrowsingData() const OVERRIDE {} }; TEST_F(TabModelTest, TestProfileHandling) { diff --git a/content/app/android/child_process_service.cc b/content/app/android/child_process_service.cc index 99e801b..5c50ec8 100644 --- a/content/app/android/child_process_service.cc +++ b/content/app/android/child_process_service.cc @@ -47,7 +47,7 @@ class SurfaceTexturePeerChildImpl : public content::SurfaceTexturePeer, base::ProcessHandle pid, scoped_refptr<gfx::SurfaceTextureBridge> surface_texture_bridge, int primary_id, - int secondary_id) { + int secondary_id) OVERRIDE { JNIEnv* env = base::android::AttachCurrentThread(); content::Java_ChildProcessService_establishSurfaceTexturePeer( env, service_.obj(), pid, diff --git a/ui/gfx/screen_android.cc b/ui/gfx/screen_android.cc index 81d3bcf..99b5bee 100644 --- a/ui/gfx/screen_android.cc +++ b/ui/gfx/screen_android.cc @@ -15,20 +15,16 @@ class ScreenAndroid : public Screen { public: ScreenAndroid() {} - bool IsDIPEnabled() OVERRIDE { - return true; - } + virtual bool IsDIPEnabled() OVERRIDE { return true; } - gfx::Point GetCursorScreenPoint() OVERRIDE { - return gfx::Point(); - } + virtual gfx::Point GetCursorScreenPoint() OVERRIDE { return gfx::Point(); } - gfx::NativeWindow GetWindowAtCursorScreenPoint() OVERRIDE { + virtual gfx::NativeWindow GetWindowAtCursorScreenPoint() OVERRIDE { NOTIMPLEMENTED(); return NULL; } - gfx::Display GetPrimaryDisplay() const OVERRIDE { + virtual gfx::Display GetPrimaryDisplay() const OVERRIDE { gfx::DeviceDisplayInfo device_info; const float device_scale_factor = device_info.GetDIPScale(); const gfx::Rect bounds_in_pixels = @@ -43,17 +39,17 @@ class ScreenAndroid : public Screen { return display; } - gfx::Display GetDisplayNearestWindow(gfx::NativeView view) const OVERRIDE { + virtual gfx::Display GetDisplayNearestWindow( + gfx::NativeView view) const OVERRIDE { return GetPrimaryDisplay(); } - gfx::Display GetDisplayNearestPoint(const gfx::Point& point) const OVERRIDE { + virtual gfx::Display GetDisplayNearestPoint( + const gfx::Point& point) const OVERRIDE { return GetPrimaryDisplay(); } - int GetNumDisplays() OVERRIDE { - return 1; - } + virtual int GetNumDisplays() OVERRIDE { return 1; } virtual gfx::Display GetDisplayMatching( const gfx::Rect& match_rect) const OVERRIDE { |