Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Clean-up inline members of nested classes (chrome/)

Due to a bug, the Clang-plugin style checker failed to warn about
inline constructors, destructors, non-empty virtual methods, etc.
for nested classes.

The plugin has been fixed, and this patch is part of a clean-up of all
the code that now causes the plugin to issue errors.

BUG=139346


Review URL: https://chromiumcodereview.appspot.com/10855075

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@151135 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
  • Loading branch information...
commit 2bf063aa666c6bcbffe878f1db5ef42737b051eb 1 parent e4095cf
hans@chromium.org authored
Showing with 172 additions and 74 deletions.
  1. +4 −0 custom_handlers/protocol_handler_registry.cc
  2. +2 −1  custom_handlers/protocol_handler_registry.h
  3. +7 −0 download/download_request_limiter.cc
  4. +1 −6 download/download_request_limiter.h
  5. +11 −0 extensions/api/socket/socket.cc
  6. +2 −6 extensions/api/socket/socket.h
  7. +2 −0  extensions/user_script_master.cc
  8. +1 −1  extensions/user_script_master.h
  9. +9 −0 file_select_helper.cc
  10. +2 −6 file_select_helper.h
  11. +2 −0  gpu_blacklist.cc
  12. +1 −1  gpu_blacklist.h
  13. +1 −10 process_info_snapshot.h
  14. +11 −0 process_info_snapshot_mac.cc
  15. +5 −0 profiles/profile_manager.cc
  16. +1 −3 profiles/profile_manager.h
  17. +5 −0 sessions/base_session_service.cc
  18. +1 −3 sessions/base_session_service.h
  19. +14 −0 speech/chrome_speech_recognition_preferences.cc
  20. +3 −3 speech/chrome_speech_recognition_preferences.h
  21. +35 −0 task_manager/task_manager.cc
  22. +14 −16 task_manager/task_manager.h
  23. +6 −0 ui/gtk/menu_gtk.cc
  24. +2 −2 ui/gtk/menu_gtk.h
  25. +11 −0 ui/panels/base_panel_browser_test.cc
  26. +1 −7 ui/panels/base_panel_browser_test.h
  27. +11 −0 ui/panels/old_base_panel_browser_test.cc
  28. +1 −7 ui/panels/old_base_panel_browser_test.h
  29. +2 −0  ui/webui/chrome_url_data_manager.cc
  30. +1 −1  ui/webui/chrome_url_data_manager.h
  31. +2 −0  ui/webui/ntp/new_tab_ui.cc
  32. +1 −1  ui/webui/ntp/new_tab_ui.h
View
4 custom_handlers/protocol_handler_registry.cc
@@ -242,6 +242,10 @@ void ProtocolHandlerRegistry::DefaultClientObserver::SetWorker(
worker_ = worker;
}
+bool ProtocolHandlerRegistry::DefaultClientObserver::IsOwnedByWorker() {
+ return true;
+}
+
// Delegate --------------------------------------------------------------------
ProtocolHandlerRegistry::Delegate::~Delegate() {}
View
3  custom_handlers/protocol_handler_registry.h
@@ -51,7 +51,8 @@ class ProtocolHandlerRegistry : public ProfileKeyedService {
ShellIntegration::DefaultProtocolClientWorker* worker_;
private:
- virtual bool IsOwnedByWorker() OVERRIDE { return true; }
+ virtual bool IsOwnedByWorker() OVERRIDE;
+
// This is a raw pointer, not reference counted, intentionally. In general
// subclasses of DefaultWebClientObserver are not able to be refcounted
// e.g. the browser options page
View
7 download/download_request_limiter.cc
@@ -117,6 +117,13 @@ void DownloadRequestLimiter::TabDownloadState::Accept() {
NotifyCallbacks(true);
}
+DownloadRequestLimiter::TabDownloadState::TabDownloadState()
+ : host_(NULL),
+ status_(DownloadRequestLimiter::ALLOW_ONE_DOWNLOAD),
+ download_count_(0),
+ infobar_(NULL) {
+}
+
void DownloadRequestLimiter::TabDownloadState::Observe(
int type,
const content::NotificationSource& source,
View
7 download/download_request_limiter.h
@@ -125,12 +125,7 @@ class DownloadRequestLimiter
protected:
// Used for testing.
- TabDownloadState()
- : host_(NULL),
- status_(DownloadRequestLimiter::ALLOW_ONE_DOWNLOAD),
- download_count_(0),
- infobar_(NULL) {
- }
+ TabDownloadState();
private:
// content::NotificationObserver method.
View
11 extensions/api/socket/socket.cc
@@ -124,4 +124,15 @@ void Socket::IPEndPointToStringAndPort(const net::IPEndPoint& address,
}
}
+Socket::WriteRequest::WriteRequest(scoped_refptr<net::IOBuffer> io_buffer,
+ int byte_count,
+ const CompletionCallback& callback)
+ : io_buffer(io_buffer),
+ byte_count(byte_count),
+ callback(callback),
+ bytes_written(0) {
+}
+
+Socket::WriteRequest::~WriteRequest() { }
+
} // namespace extensions
View
8 extensions/api/socket/socket.h
@@ -97,12 +97,8 @@ class Socket : public ApiResource {
struct WriteRequest {
WriteRequest(scoped_refptr<net::IOBuffer> io_buffer,
int byte_count,
- const CompletionCallback& callback)
- : io_buffer(io_buffer),
- byte_count(byte_count),
- callback(callback),
- bytes_written(0) { }
- ~WriteRequest() { }
+ const CompletionCallback& callback);
+ ~WriteRequest();
scoped_refptr<net::IOBuffer> io_buffer;
int byte_count;
CompletionCallback callback;
View
2  extensions/user_script_master.cc
@@ -163,6 +163,8 @@ void UserScriptMaster::ScriptReloader::StartLoad(
&UserScriptMaster::ScriptReloader::RunLoad, this, user_scripts));
}
+UserScriptMaster::ScriptReloader::~ScriptReloader() {}
+
void UserScriptMaster::ScriptReloader::NotifyMaster(
base::SharedMemory* memory) {
// The master went away, so these new scripts aren't useful anymore.
View
2  extensions/user_script_master.h
@@ -91,7 +91,7 @@ class UserScriptMaster : public base::RefCountedThreadSafe<UserScriptMaster>,
FRIEND_TEST_ALL_PREFIXES(UserScriptMasterTest, LeaveBOMNotAtTheBeginning);
friend class base::RefCountedThreadSafe<UserScriptMaster::ScriptReloader>;
- ~ScriptReloader() {}
+ ~ScriptReloader();
// Where functions are run:
// master file
View
9 file_select_helper.cc
@@ -115,6 +115,15 @@ FileSelectHelper::~FileSelectHelper() {
}
}
+void FileSelectHelper::DirectoryListerDispatchDelegate::OnListFile(
+ const net::DirectoryLister::DirectoryListerData& data) {
+ parent_->OnListFile(id_, data);
+}
+
+void FileSelectHelper::DirectoryListerDispatchDelegate::OnListDone(int error) {
+ parent_->OnListDone(id_, error);
+}
+
void FileSelectHelper::FileSelected(const FilePath& path,
int index, void* params) {
FileSelectedWithExtraInfo(ui::SelectedFileInfo(path, path), index, params);
View
8 file_select_helper.h
@@ -61,12 +61,8 @@ class FileSelectHelper
id_(id) {}
virtual ~DirectoryListerDispatchDelegate() {}
virtual void OnListFile(
- const net::DirectoryLister::DirectoryListerData& data) OVERRIDE {
- parent_->OnListFile(id_, data);
- }
- virtual void OnListDone(int error) OVERRIDE {
- parent_->OnListDone(id_, error);
- }
+ const net::DirectoryLister::DirectoryListerData& data) OVERRIDE;
+ virtual void OnListDone(int error) OVERRIDE;
private:
// This FileSelectHelper owns this object.
FileSelectHelper* parent_;
View
2  gpu_blacklist.cc
@@ -626,6 +626,8 @@ GpuBlacklist::GpuBlacklistEntry::GpuBlacklistEntry()
contains_unknown_features_(false) {
}
+GpuBlacklist::GpuBlacklistEntry::~GpuBlacklistEntry() { }
+
bool GpuBlacklist::GpuBlacklistEntry::SetId(uint32 id) {
if (id != 0) {
id_ = id;
View
2  gpu_blacklist.h
@@ -280,7 +280,7 @@ class GpuBlacklist : public content::GpuDataManagerObserver {
};
GpuBlacklistEntry();
- ~GpuBlacklistEntry() { }
+ ~GpuBlacklistEntry();
bool SetId(uint32 id);
View
11 process_info_snapshot.h
@@ -57,16 +57,7 @@ class ProcessInfoSnapshot {
uint64_t vsize;
std::string command;
- ProcInfoEntry()
- : pid(0),
- ppid(0),
- uid(0),
- euid(0),
- rss(0),
- rshrd(0),
- rprvt(0),
- vsize(0) {
- }
+ ProcInfoEntry();
};
// Get process information for a given PID.
View
11 process_info_snapshot_mac.cc
@@ -325,6 +325,17 @@ void ProcessInfoSnapshot::Reset() {
proc_info_entries_.clear();
}
+ProcessInfoSnapshot::ProcInfoEntry::ProcInfoEntry()
+ : pid(0),
+ ppid(0),
+ uid(0),
+ euid(0),
+ rss(0),
+ rshrd(0),
+ rprvt(0),
+ vsize(0) {
+}
+
bool ProcessInfoSnapshot::GetProcInfo(int pid,
ProcInfoEntry* proc_info) const {
std::map<int,ProcInfoEntry>::const_iterator it = proc_info_entries_.find(pid);
View
5 profiles/profile_manager.cc
@@ -1041,6 +1041,11 @@ void ProfileManager::RunCallbacks(const std::vector<CreateCallback>& callbacks,
callbacks[i].Run(profile, status);
}
+ProfileManager::ProfileInfo::ProfileInfo(Profile* profile, bool created)
+ : profile(profile),
+ created(created) {
+}
+
ProfileManager::ProfileInfo::~ProfileInfo() {
ProfileDestroyer::DestroyProfileWhenAppropriate(profile.release());
}
View
4 profiles/profile_manager.h
@@ -222,9 +222,7 @@ class ProfileManager : public base::NonThreadSafe,
// This struct contains information about profiles which are being loaded or
// were loaded.
struct ProfileInfo {
- ProfileInfo(Profile* profile, bool created)
- : profile(profile), created(created) {
- }
+ ProfileInfo(Profile* profile, bool created);
~ProfileInfo();
View
5 sessions/base_session_service.cc
@@ -26,6 +26,11 @@ using content::NavigationEntry;
// InternalGetCommandsRequest -------------------------------------------------
+BaseSessionService::InternalGetCommandsRequest::InternalGetCommandsRequest(
+ const CallbackType& callback)
+ : CancelableRequest<InternalGetCommandsCallback>(callback) {
+}
+
BaseSessionService::InternalGetCommandsRequest::~InternalGetCommandsRequest() {
STLDeleteElements(&commands);
}
View
4 sessions/base_session_service.h
@@ -65,9 +65,7 @@ class BaseSessionService : public CancelableRequestProvider,
class InternalGetCommandsRequest :
public CancelableRequest<InternalGetCommandsCallback> {
public:
- explicit InternalGetCommandsRequest(const CallbackType& callback)
- : CancelableRequest<InternalGetCommandsCallback>(callback) {
- }
+ explicit InternalGetCommandsRequest(const CallbackType& callback);
// The commands. The backend fills this in for us.
std::vector<SessionCommand*> commands;
View
14 speech/chrome_speech_recognition_preferences.cc
@@ -68,6 +68,20 @@ void ChromeSpeechRecognitionPreferences::Factory::RegisterUserPrefs(
PrefService::UNSYNCABLE_PREF);
}
+bool
+ChromeSpeechRecognitionPreferences::Factory::ServiceRedirectedInIncognito() {
+ return false;
+}
+
+bool ChromeSpeechRecognitionPreferences::Factory::ServiceIsNULLWhileTesting() {
+ return true;
+}
+
+bool
+ChromeSpeechRecognitionPreferences::Factory::ServiceIsCreatedWithProfile() {
+ return false;
+}
+
ChromeSpeechRecognitionPreferences::Service::Service(
Profile* profile)
: preferences_(new ChromeSpeechRecognitionPreferences(profile)) {
View
6 speech/chrome_speech_recognition_preferences.h
@@ -79,9 +79,9 @@ class ChromeSpeechRecognitionPreferences
virtual ProfileKeyedService* BuildServiceInstanceFor(Profile* profile)
const OVERRIDE;
virtual void RegisterUserPrefs(PrefService* prefs) OVERRIDE;
- virtual bool ServiceRedirectedInIncognito() OVERRIDE { return false; }
- virtual bool ServiceIsNULLWhileTesting() OVERRIDE { return true; }
- virtual bool ServiceIsCreatedWithProfile() OVERRIDE { return false; }
+ virtual bool ServiceRedirectedInIncognito() OVERRIDE;
+ virtual bool ServiceIsNULLWhileTesting() OVERRIDE;
+ virtual bool ServiceIsCreatedWithProfile() OVERRIDE;
DISALLOW_COPY_AND_ASSIGN(Factory);
};
View
35 task_manager/task_manager.cc
@@ -1068,6 +1068,41 @@ bool TaskManagerModel::GetProcessMetricsForRow(
// TaskManager class
////////////////////////////////////////////////////////////////////////////////
+int TaskManager::Resource::GetRoutingID() const { return 0; }
+
+bool TaskManager::Resource::ReportsCacheStats() const { return false; }
+
+WebKit::WebCache::ResourceTypeStats
+TaskManager::Resource::GetWebCoreCacheStats() const {
+ return WebKit::WebCache::ResourceTypeStats();
+}
+
+bool TaskManager::Resource::ReportsFPS() const { return false; }
+
+float TaskManager::Resource::GetFPS() const { return 0.0f; }
+
+bool TaskManager::Resource::ReportsSqliteMemoryUsed() const { return false; }
+
+size_t TaskManager::Resource::SqliteMemoryUsedBytes() const { return 0; }
+
+const extensions::Extension* TaskManager::Resource::GetExtension() const {
+ return NULL;
+}
+
+bool TaskManager::Resource::ReportsV8MemoryStats() const { return false; }
+
+size_t TaskManager::Resource::GetV8MemoryAllocated() const { return 0; }
+
+size_t TaskManager::Resource::GetV8MemoryUsed() const { return 0; }
+
+bool TaskManager::Resource::CanInspect() const { return false; }
+
+content::WebContents* TaskManager::Resource::GetWebContents() const {
+ return NULL;
+}
+
+bool TaskManager::Resource::IsBackground() const { return false; }
+
// static
void TaskManager::RegisterPrefs(PrefService* prefs) {
prefs->RegisterDictionaryPref(prefs::kTaskManagerWindowPlacement);
View
30 task_manager/task_manager.h
@@ -79,29 +79,27 @@ class TaskManager {
virtual base::ProcessHandle GetProcess() const = 0;
virtual int GetUniqueChildProcessId() const = 0;
virtual Type GetType() const = 0;
- virtual int GetRoutingID() const { return 0; }
+ virtual int GetRoutingID() const;
- virtual bool ReportsCacheStats() const { return false; }
- virtual WebKit::WebCache::ResourceTypeStats GetWebCoreCacheStats() const {
- return WebKit::WebCache::ResourceTypeStats();
- }
+ virtual bool ReportsCacheStats() const;
+ virtual WebKit::WebCache::ResourceTypeStats GetWebCoreCacheStats() const;
- virtual bool ReportsFPS() const { return false; }
- virtual float GetFPS() const { return 0.0f; }
+ virtual bool ReportsFPS() const;
+ virtual float GetFPS() const;
- virtual bool ReportsSqliteMemoryUsed() const { return false; }
- virtual size_t SqliteMemoryUsedBytes() const { return 0; }
+ virtual bool ReportsSqliteMemoryUsed() const;
+ virtual size_t SqliteMemoryUsedBytes() const;
// Return extension associated with the resource, or NULL
// if not applicable.
- virtual const extensions::Extension* GetExtension() const { return NULL; }
+ virtual const extensions::Extension* GetExtension() const;
- virtual bool ReportsV8MemoryStats() const { return false; }
- virtual size_t GetV8MemoryAllocated() const { return 0; }
- virtual size_t GetV8MemoryUsed() const { return 0; }
+ virtual bool ReportsV8MemoryStats() const;
+ virtual size_t GetV8MemoryAllocated() const;
+ virtual size_t GetV8MemoryUsed() const;
// Returns true if this resource can be inspected using developer tools.
- virtual bool CanInspect() const { return false; }
+ virtual bool CanInspect() const;
// Invokes or reveals developer tools window for this resource.
virtual void Inspect() const {}
@@ -109,7 +107,7 @@ class TaskManager {
// A helper function for ActivateProcess when selected resource refers
// to a Tab or other window containing web contents. Returns NULL by
// default because not all resources have an associated web contents.
- virtual content::WebContents* GetWebContents() const { return NULL; }
+ virtual content::WebContents* GetWebContents() const;
// Whether this resource does report the network usage accurately.
// This controls whether 0 or N/A is displayed when no bytes have been
@@ -134,7 +132,7 @@ class TaskManager {
// Returns true if this resource is not visible to the user because it lives
// in the background (e.g. extension background page, background contents).
- virtual bool IsBackground() const { return false; }
+ virtual bool IsBackground() const;
static const char* GetResourceTypeAsString(const Type type) {
switch (type) {
View
6 ui/gtk/menu_gtk.cc
@@ -120,6 +120,12 @@ int CalculateMenuYPosition(const GdkRectangle* screen_rect,
} // namespace
+bool MenuGtk::Delegate::AlwaysShowIconForCmd(int command_id) const {
+ return false;
+}
+
+GtkIconSet* MenuGtk::Delegate::GetIconSetForId(int idr) { return NULL; }
+
GtkWidget* MenuGtk::Delegate::GetDefaultImageForCommandId(int command_id) {
const char* stock;
switch (command_id) {
View
4 ui/gtk/menu_gtk.h
@@ -43,10 +43,10 @@ class MenuGtk {
// Return true if we should override the "gtk-menu-images" system setting
// when showing image menu items for this menu.
- virtual bool AlwaysShowIconForCmd(int command_id) const { return false; }
+ virtual bool AlwaysShowIconForCmd(int command_id) const;
// Returns a tinted image used in button in a menu.
- virtual GtkIconSet* GetIconSetForId(int idr) { return NULL; }
+ virtual GtkIconSet* GetIconSetForId(int idr);
// Returns an icon for the menu item, if available.
virtual GtkWidget* GetImageForCommandId(int command_id) const;
View
11 ui/panels/base_panel_browser_test.cc
@@ -291,6 +291,17 @@ void BasePanelBrowserTest::WaitForExpansionStateChanged(
EXPECT_EQ(expansion_state, panel->expansion_state());
}
+BasePanelBrowserTest::CreatePanelParams::CreatePanelParams(
+ const std::string& name,
+ const gfx::Rect& bounds,
+ ActiveState show_flag)
+ : name(name),
+ bounds(bounds),
+ show_flag(show_flag),
+ wait_for_fully_created(true),
+ expected_active_state(show_flag) {
+}
+
Panel* BasePanelBrowserTest::CreatePanelWithParams(
const CreatePanelParams& params) {
#if defined(OS_MACOSX)
View
8 ui/panels/base_panel_browser_test.h
@@ -66,13 +66,7 @@ class BasePanelBrowserTest : public InProcessBrowserTest {
CreatePanelParams(const std::string& name,
const gfx::Rect& bounds,
- ActiveState show_flag)
- : name(name),
- bounds(bounds),
- show_flag(show_flag),
- wait_for_fully_created(true),
- expected_active_state(show_flag) {
- }
+ ActiveState show_flag);
};
Panel* CreatePanelWithParams(const CreatePanelParams& params);
View
11 ui/panels/old_base_panel_browser_test.cc
@@ -293,6 +293,17 @@ void OldBasePanelBrowserTest::WaitForExpansionStateChanged(
EXPECT_EQ(expansion_state, panel->expansion_state());
}
+OldBasePanelBrowserTest::CreatePanelParams::CreatePanelParams(
+ const std::string& name,
+ const gfx::Rect& bounds,
+ ActiveState show_flag)
+ : name(name),
+ bounds(bounds),
+ show_flag(show_flag),
+ wait_for_fully_created(true),
+ expected_active_state(show_flag) {
+}
+
Panel* OldBasePanelBrowserTest::CreatePanelWithParams(
const CreatePanelParams& params) {
#if defined(OS_MACOSX)
View
8 ui/panels/old_base_panel_browser_test.h
@@ -66,13 +66,7 @@ class OldBasePanelBrowserTest : public InProcessBrowserTest {
CreatePanelParams(const std::string& name,
const gfx::Rect& bounds,
- ActiveState show_flag)
- : name(name),
- bounds(bounds),
- show_flag(show_flag),
- wait_for_fully_created(true),
- expected_active_state(show_flag) {
- }
+ ActiveState show_flag);
};
Panel* CreatePanelWithParams(const CreatePanelParams& params);
View
2  ui/webui/chrome_url_data_manager.cc
@@ -164,6 +164,8 @@ bool ChromeURLDataManager::DataSource::ShouldReplaceExistingSource() const {
return true;
}
+bool ChromeURLDataManager::DataSource::AllowCaching() const { return true; }
+
// static
void ChromeURLDataManager::DataSource::SetFontAndTextDirection(
DictionaryValue* localized_strings) {
View
2  ui/webui/chrome_url_data_manager.h
@@ -107,7 +107,7 @@ class ChromeURLDataManager : public ProfileKeyedService {
virtual bool ShouldReplaceExistingSource() const;
// Returns true if responses from this DataSource can be cached.
- virtual bool AllowCaching() const { return true; }
+ virtual bool AllowCaching() const;
static void SetFontAndTextDirection(
base::DictionaryValue* localized_strings);
View
2  ui/webui/ntp/new_tab_ui.cc
@@ -400,3 +400,5 @@ void NewTabUI::NewTabHTMLSource::AddResource(const char* resource,
resource_map_[std::string(resource)] =
std::make_pair(std::string(mime_type), resource_id);
}
+
+NewTabUI::NewTabHTMLSource::~NewTabHTMLSource() {}
View
2  ui/webui/ntp/new_tab_ui.h
@@ -85,7 +85,7 @@ class NewTabUI : public content::WebUIController,
int resource_id);
private:
- virtual ~NewTabHTMLSource() {}
+ virtual ~NewTabHTMLSource();
// Pointer back to the original profile.
Profile* profile_;
Please sign in to comment.
Something went wrong with that request. Please try again.