diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-28 20:41:10 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-28 20:41:10 +0000 |
commit | be952c3ca6d93968409b246c9439a7d8c2a06bba (patch) | |
tree | 501d38ada79c1fddf10f65fe6c88b27a3df4cb1d | |
parent | 86c008e8a7da9c00c5a676eb201ba5d0c976748e (diff) | |
download | chromium_src-be952c3ca6d93968409b246c9439a7d8c2a06bba.zip chromium_src-be952c3ca6d93968409b246c9439a7d8c2a06bba.tar.gz chromium_src-be952c3ca6d93968409b246c9439a7d8c2a06bba.tar.bz2 |
Fix a ton of compiler warnings.
Most of these are classes with virtual methods lacking virtual destructors
or NULL used in non-pointer context.
BUG=none
TEST=app_unittests && base_unittests
--gtest_filter=-ConditionVariableTest.LargeFastTaskTest
patch by Jacob Mandelson <jlmjlm [at] gmail>
http://codereview.chromium.org/171028/show
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24792 0039d316-1c4b-4281-b951-d872f2087c98
141 files changed, 529 insertions, 277 deletions
diff --git a/app/animation.h b/app/animation.h index 811c038..c37adde 100644 --- a/app/animation.h +++ b/app/animation.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Inspired by NSAnimation @@ -32,6 +32,9 @@ class AnimationDelegate { // Called when an animation has been canceled. virtual void AnimationCanceled(const Animation* animation) { } + + protected: + ~AnimationDelegate() {} }; // Animation diff --git a/app/table_model.h b/app/table_model.h index c1e61b1..5d4377a 100644 --- a/app/table_model.h +++ b/app/table_model.h @@ -94,6 +94,8 @@ class TableModel { void ClearCollator(); protected: + ~TableModel() {} + // Returns the collator used by CompareValues. icu::Collator* GetCollator(); }; diff --git a/app/table_model_observer.h b/app/table_model_observer.h index fcd50f4..087ce28 100644 --- a/app/table_model_observer.h +++ b/app/table_model_observer.h @@ -20,6 +20,9 @@ class TableModelObserver { // Invoked when a range of items has been removed. virtual void OnItemsRemoved(int start, int length) = 0; + + protected: + ~TableModelObserver() {} }; #endif // APP_TABLE_MODEL_OBSERVER_H_ diff --git a/app/tree_model.h b/app/tree_model.h index f6d8da3..f6e2c14 100644 --- a/app/tree_model.h +++ b/app/tree_model.h @@ -1,4 +1,4 @@ -// Copyright (c) 2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -21,6 +21,9 @@ class TreeModelNode { public: // Returns the title for the node. virtual const std::wstring& GetTitle() const = 0; + + protected: + ~TreeModelNode() {} }; // Observer for the TreeModel. Notified of significant events to the model. @@ -45,6 +48,9 @@ class TreeModelObserver { // Notification that the contents of a node has changed. virtual void TreeNodeChanged(TreeModel* model, TreeModelNode* node) = 0; + + protected: + ~TreeModelObserver() {} }; // TreeModel ------------------------------------------------------------------ @@ -83,6 +89,9 @@ class TreeModel { // default icon. The index is relative to the list of icons returned from // GetIcons. virtual int GetIconIndex(TreeModelNode* node) { return -1; } + + protected: + ~TreeModel() {} }; #endif // APP_TREE_TREE_MODEL_H_ diff --git a/base/field_trial_unittest.cc b/base/field_trial_unittest.cc index 430fd67..1ab5669 100644 --- a/base/field_trial_unittest.cc +++ b/base/field_trial_unittest.cc @@ -160,8 +160,8 @@ TEST_F(FieldTrialTest, Save) { } TEST_F(FieldTrialTest, Restore) { - EXPECT_EQ(NULL, FieldTrialList::Find("Some_name")); - EXPECT_EQ(NULL, FieldTrialList::Find("xxx")); + EXPECT_TRUE(NULL == FieldTrialList::Find("Some_name")); + EXPECT_TRUE(NULL == FieldTrialList::Find("xxx")); FieldTrialList::StringAugmentsState("Some_name/Winner/xxx/yyyy/"); diff --git a/base/file_descriptor_shuffle.h b/base/file_descriptor_shuffle.h index 8ee77409..108a874 100644 --- a/base/file_descriptor_shuffle.h +++ b/base/file_descriptor_shuffle.h @@ -37,6 +37,9 @@ class InjectionDelegate { virtual bool Move(int src, int dest) = 0; // Delete an element of the domain. virtual void Close(int fd) = 0; + + protected: + ~InjectionDelegate() {} }; // An implementation of the InjectionDelegate interface using the file diff --git a/base/multiprocess_test.h b/base/multiprocess_test.h index 99c2c79..75a8a3e 100644 --- a/base/multiprocess_test.h +++ b/base/multiprocess_test.h @@ -1,9 +1,9 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef BASE_MULTIPROCESS_TEST_H__ -#define BASE_MULTIPROCESS_TEST_H__ +#ifndef BASE_MULTIPROCESS_TEST_H_ +#define BASE_MULTIPROCESS_TEST_H_ #include "base/base_switches.h" #include "base/command_line.h" @@ -106,7 +106,7 @@ class MultiProcessTest : public PlatformTest { const base::file_handle_mapping_vector& fds_to_map, bool debug_on_start) { CommandLine cl(*CommandLine::ForCurrentProcess()); - base::ProcessHandle handle = static_cast<base::ProcessHandle>(NULL); + base::ProcessHandle handle = 0; cl.AppendSwitchWithValue(kRunClientProcess, procname); if (debug_on_start) @@ -118,4 +118,4 @@ class MultiProcessTest : public PlatformTest { #endif }; -#endif // BASE_MULTIPROCESS_TEST_H__ +#endif // BASE_MULTIPROCESS_TEST_H_ diff --git a/base/process_util_linux.cc b/base/process_util_linux.cc index a05e9bb..f93b359 100644 --- a/base/process_util_linux.cc +++ b/base/process_util_linux.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -259,7 +259,6 @@ bool ProcessMetrics::GetWorkingSetKBytes(WorkingSetKBytes* ws_usage) const { int private_kb = 0; int pss_kb = 0; bool have_pss = false; - const int kPssAdjust = 0.5; if (!file_util::ReadFileToString(stat_file, &smaps)) return false; @@ -278,12 +277,12 @@ bool ProcessMetrics::GetWorkingSetKBytes(WorkingSetKBytes* ws_usage) const { return false; } if (StartsWithASCII(last_key_name, "Shared_", 1)) { - shared_kb += StringToInt(tokenizer.token()); + shared_kb += StringToInt(tokenizer.token()); } else if (StartsWithASCII(last_key_name, "Private_", 1)) { - private_kb += StringToInt(tokenizer.token()); + private_kb += StringToInt(tokenizer.token()); } else if (StartsWithASCII(last_key_name, "Pss", 1)) { - have_pss = true; - pss_kb += StringToInt(tokenizer.token()) + kPssAdjust; + have_pss = true; + pss_kb += StringToInt(tokenizer.token()); } state = KEY_NAME; break; diff --git a/base/process_util_unittest.cc b/base/process_util_unittest.cc index b75bdb8..6f74daf 100644 --- a/base/process_util_unittest.cc +++ b/base/process_util_unittest.cc @@ -41,7 +41,7 @@ MULTIPROCESS_TEST_MAIN(SimpleChildProcess) { TEST_F(ProcessUtilTest, SpawnChild) { ProcessHandle handle = this->SpawnChild(L"SimpleChildProcess"); - ASSERT_NE(static_cast<ProcessHandle>(NULL), handle); + ASSERT_NE(0, handle); EXPECT_TRUE(WaitForSingleProcess(handle, 5000)); base::CloseProcessHandle(handle); } @@ -62,7 +62,7 @@ MULTIPROCESS_TEST_MAIN(SlowChildProcess) { TEST_F(ProcessUtilTest, KillSlowChild) { remove("SlowChildProcess.die"); ProcessHandle handle = this->SpawnChild(L"SlowChildProcess"); - ASSERT_NE(static_cast<ProcessHandle>(NULL), handle); + ASSERT_NE(0, handle); FILE *fp = fopen("SlowChildProcess.die", "w"); fclose(fp); EXPECT_TRUE(base::WaitForSingleProcess(handle, 5000)); diff --git a/base/stats_table_unittest.cc b/base/stats_table_unittest.cc index d8535cb..f022b9b 100644 --- a/base/stats_table_unittest.cc +++ b/base/stats_table_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -208,7 +208,7 @@ TEST_F(StatsTableTest, MultipleProcesses) { // Spawn the processes. for (int16 index = 0; index < kMaxProcs; index++) { procs[index] = this->SpawnChild(L"StatsTableMultipleProcessMain"); - EXPECT_NE(static_cast<ProcessHandle>(NULL), procs[index]); + EXPECT_NE(0, procs[index]); } // Wait for the processes to finish. diff --git a/base/system_monitor.h b/base/system_monitor.h index aeec42b..6322be9 100644 --- a/base/system_monitor.h +++ b/base/system_monitor.h @@ -1,4 +1,4 @@ -// Copyright (c) 2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -72,6 +72,9 @@ class SystemMonitor { // Notification that the system is resuming. virtual void OnResume(SystemMonitor*) = 0; + + protected: + ~PowerObserver() {} }; // Add a new observer. diff --git a/base/task.h b/base/task.h index 447bfab..2b3b51c 100644 --- a/base/task.h +++ b/base/task.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -678,6 +678,7 @@ template <typename ReturnValue> struct CallbackWithReturnValue { class Type { public: + virtual ~Type() {} virtual ReturnValue Run() = 0; }; }; @@ -693,6 +694,9 @@ class CallbackWithReturnValueImpl virtual ReturnValue Run() { return (this->obj_->*(this->meth_))(); } + + protected: + ~CallbackWithReturnValueImpl() {} }; template <class T, typename ReturnValue> diff --git a/base/third_party/dmg_fp/README.chromium b/base/third_party/dmg_fp/README.chromium index 046f273..b857044 100644 --- a/base/third_party/dmg_fp/README.chromium +++ b/base/third_party/dmg_fp/README.chromium @@ -14,3 +14,4 @@ List of changes made to original code: - made some minor changes to allow clean compilation under g++ -Wall, see gcc_warnings.patch. - made some minor changes to build on 64-bit, see gcc_64_bit.patch. + - made some implicit type converisons explicit, see type_conversion.patch. diff --git a/base/third_party/dmg_fp/dtoa.cc b/base/third_party/dmg_fp/dtoa.cc index c1bc476..ffbc088 100644 --- a/base/third_party/dmg_fp/dtoa.cc +++ b/base/third_party/dmg_fp/dtoa.cc @@ -1559,7 +1559,7 @@ hexnan CONST char *s; int c1, havedig, udx0, xshift; - if (!hexdig['0']) + if (!hexdig[static_cast<int>('0')]) hexdig_init(); x[0] = x[1] = 0; havedig = xshift = 0; @@ -3283,7 +3283,7 @@ strtod #ifdef Avoid_Underflow if (bc.scale && y <= 2*P*Exp_msk1) { if (aadj <= 0x7fffffff) { - if ((z = aadj) <= 0) + if ((z = static_cast<ULong>(aadj)) <= 0) z = 1; aadj = z; aadj1 = bc.dsign ? aadj : -aadj; @@ -3837,7 +3837,7 @@ dtoa */ dval(&eps) = 0.5/tens[ilim-1] - dval(&eps); for(i = 0;;) { - L = dval(&u); + L = static_cast<long>(dval(&u)); dval(&u) -= L; *s++ = '0' + (int)L; if (dval(&u) < dval(&eps)) diff --git a/base/time.cc b/base/time.cc index 992e256..93b3311 100644 --- a/base/time.cc +++ b/base/time.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -51,7 +51,7 @@ int64 TimeDelta::InMicroseconds() const { Time Time::FromTimeT(time_t tt) { if (tt == 0) return Time(); // Preserve 0 so we can tell it doesn't exist. - return (tt * kMicrosecondsPerSecond) + kTimeTToMicrosecondsOffset; + return Time((tt * kMicrosecondsPerSecond) + kTimeTToMicrosecondsOffset); } time_t Time::ToTimeT() const { @@ -62,8 +62,9 @@ time_t Time::ToTimeT() const { // static Time Time::FromDoubleT(double dt) { - return (dt * static_cast<double>(kMicrosecondsPerSecond)) + - kTimeTToMicrosecondsOffset; + return Time(static_cast<int64>((dt * + static_cast<double>(kMicrosecondsPerSecond)) + + kTimeTToMicrosecondsOffset)); } double Time::ToDoubleT() const { diff --git a/base/time.h b/base/time.h index a57c04f..6a181af 100644 --- a/base/time.h +++ b/base/time.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -313,10 +313,10 @@ class Time { // Return a new time modified by some delta. Time operator+(TimeDelta delta) const { - return us_ + delta.delta_; + return Time(us_ + delta.delta_); } Time operator-(TimeDelta delta) const { - return us_ - delta.delta_; + return Time(us_ - delta.delta_); } // Comparison operators @@ -350,7 +350,7 @@ class Time { // |is_local = true| or UTC |is_local = false|. static Time FromExploded(bool is_local, const Exploded& exploded); - Time(int64 us) : us_(us) { + explicit Time(int64 us) : us_(us) { } // The representation of Jan 1, 1970 UTC in microseconds since the diff --git a/base/time_posix.cc b/base/time_posix.cc index 66f41d3..66e0345 100644 --- a/base/time_posix.cc +++ b/base/time_posix.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. diff --git a/base/waitable_event.h b/base/waitable_event.h index 31aa085..2b498497 100644 --- a/base/waitable_event.h +++ b/base/waitable_event.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -121,6 +121,9 @@ class WaitableEvent { // pointers match then this function is called as a final check. See the // comments in ~Handle for why. virtual bool Compare(void* tag) = 0; + + protected: + ~Waiter() {} }; private: diff --git a/base/waitable_event_watcher_unittest.cc b/base/waitable_event_watcher_unittest.cc index 049de38..80e64b5 100644 --- a/base/waitable_event_watcher_unittest.cc +++ b/base/waitable_event_watcher_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -38,7 +38,7 @@ void RunTest_BasicSignal(MessageLoop::Type message_loop_type) { WaitableEvent event(true, false); WaitableEventWatcher watcher; - EXPECT_EQ(NULL, watcher.GetWatchedEvent()); + EXPECT_TRUE(NULL == watcher.GetWatchedEvent()); QuitDelegate delegate; watcher.StartWatching(&event, &delegate); @@ -48,7 +48,7 @@ void RunTest_BasicSignal(MessageLoop::Type message_loop_type) { MessageLoop::current()->Run(); - EXPECT_EQ(NULL, watcher.GetWatchedEvent()); + EXPECT_TRUE(NULL == watcher.GetWatchedEvent()); } void RunTest_BasicCancel(MessageLoop::Type message_loop_type) { diff --git a/chrome/browser/autocomplete/autocomplete.h b/chrome/browser/autocomplete/autocomplete.h index b3ed20b..4e96102 100644 --- a/chrome/browser/autocomplete/autocomplete.h +++ b/chrome/browser/autocomplete/autocomplete.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -466,6 +466,8 @@ class AutocompleteProvider // them all again when this is called anyway, so such a parameter wouldn't // actually be useful. virtual void OnProviderUpdate(bool updated_matches) = 0; + protected: + ~ACProviderListener() {} }; AutocompleteProvider(ACProviderListener* listener, diff --git a/chrome/browser/autocomplete/autocomplete_edit.h b/chrome/browser/autocomplete/autocomplete_edit.h index efe5c9a..8567c62 100644 --- a/chrome/browser/autocomplete/autocomplete_edit.h +++ b/chrome/browser/autocomplete/autocomplete_edit.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -51,6 +51,8 @@ class AutocompleteEditController { // Returns the title of the current page. virtual std::wstring GetTitle() const = 0; + protected: + ~AutocompleteEditController() {} }; class AutocompleteEditModel { diff --git a/chrome/browser/autocomplete/autocomplete_edit_view.h b/chrome/browser/autocomplete/autocomplete_edit_view.h index 928d7e4..ea3988a 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view.h +++ b/chrome/browser/autocomplete/autocomplete_edit_view.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -125,6 +125,8 @@ class AutocompleteEditView { // Returns the gfx::NativeView of the edit view. virtual gfx::NativeView GetNativeView() const = 0; + protected: + ~AutocompleteEditView() {} }; #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_H_ diff --git a/chrome/browser/autocomplete/autocomplete_popup_view.h b/chrome/browser/autocomplete/autocomplete_popup_view.h index 344ab9c..d1977ae 100644 --- a/chrome/browser/autocomplete/autocomplete_popup_view.h +++ b/chrome/browser/autocomplete/autocomplete_popup_view.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -29,17 +29,17 @@ class Profile; // bounds for the autocomplete popup view. class AutocompletePopupPositioner { public: - virtual ~AutocompletePopupPositioner() { } - // Returns the bounds at which the popup should be shown, in screen // coordinates. The height is ignored, since the popup is sized to its // contents automatically. virtual gfx::Rect GetPopupBounds() const = 0; + protected: + ~AutocompletePopupPositioner() {} }; class AutocompletePopupView { public: - virtual ~AutocompletePopupView() { } + virtual ~AutocompletePopupView() {} // Returns true if the popup is currently open. virtual bool IsOpen() const = 0; diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc index dffc91a..d657a62 100644 --- a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc +++ b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc @@ -364,7 +364,7 @@ void AutocompletePopupViewGtk::AcceptLine(size_t line, gboolean AutocompletePopupViewGtk::HandleMotion(GtkWidget* widget, GdkEventMotion* event) { // TODO(deanm): Windows has a bunch of complicated logic here. - size_t line = LineFromY(event->y); + size_t line = LineFromY(static_cast<int>(event->y)); // There is both a hovered and selected line, hovered just means your mouse // is over it, but selected is what's showing in the location edit. model_->SetHoveredLine(line); @@ -377,7 +377,7 @@ gboolean AutocompletePopupViewGtk::HandleMotion(GtkWidget* widget, gboolean AutocompletePopupViewGtk::HandleButtonPress(GtkWidget* widget, GdkEventButton* event) { // Very similar to HandleMotion. - size_t line = LineFromY(event->y); + size_t line = LineFromY(static_cast<int>(event->y)); model_->SetHoveredLine(line); if (event->button == 1) model_->SetSelectedLine(line, false); @@ -386,7 +386,7 @@ gboolean AutocompletePopupViewGtk::HandleButtonPress(GtkWidget* widget, gboolean AutocompletePopupViewGtk::HandleButtonRelease(GtkWidget* widget, GdkEventButton* event) { - size_t line = LineFromY(event->y); + size_t line = LineFromY(static_cast<int>(event->y)); switch (event->button) { case 1: // Left click. AcceptLine(line, CURRENT_TAB); @@ -465,7 +465,7 @@ gboolean AutocompletePopupViewGtk::HandleExpose(GtkWidget* widget, bool has_description = !match.description.empty(); int text_width = window_rect.width() - (kIconAreaWidth + kRightPadding); int allocated_content_width = has_description ? - text_width * kContentWidthPercentage : text_width; + static_cast<int>(text_width * kContentWidthPercentage) : text_width; pango_layout_set_width(layout_, allocated_content_width * PANGO_SCALE); // Note: We force to URL to LTR for all text directions. diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index 93aad4d..3b10911 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -940,7 +940,7 @@ void AutomationProvider::OnRedirectQueryComplete( IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); Send(reply_message_); - redirect_query_ = NULL; + redirect_query_ = 0; reply_message_ = NULL; } diff --git a/chrome/browser/blocked_popup_container.h b/chrome/browser/blocked_popup_container.h index d7e5d0e..4d89a3f 100644 --- a/chrome/browser/blocked_popup_container.h +++ b/chrome/browser/blocked_popup_container.h @@ -52,6 +52,8 @@ class BlockedPopupContainerView { // Called by the BlockedPopupContainer that owns us. Destroys the view or // starts a delayed Task to destroy the View at some later time. virtual void Destroy() = 0; + protected: + ~BlockedPopupContainerView() {} }; // Takes ownership of TabContents that are unrequested popup windows and @@ -146,7 +148,7 @@ class BlockedPopupContainer : public TabContentsDelegate, // Ignored; BlockedPopupContainer doesn't display a throbber. virtual void NavigationStateChanged(const TabContents* source, - unsigned changed_flags) { } + unsigned changed_flags) {} // Forwards AddNewContents to our |owner_|. virtual void AddNewContents(TabContents* source, @@ -156,10 +158,10 @@ class BlockedPopupContainer : public TabContentsDelegate, bool user_gesture); // Ignore activation requests from the TabContents we're blocking. - virtual void ActivateContents(TabContents* contents) { } + virtual void ActivateContents(TabContents* contents) {} // Ignored; BlockedPopupContainer doesn't display a throbber. - virtual void LoadingStateChanged(TabContents* source) { } + virtual void LoadingStateChanged(TabContents* source) {} // Removes |source| from our internal list of blocked popups. virtual void CloseContents(TabContents* source); @@ -174,13 +176,13 @@ class BlockedPopupContainer : public TabContentsDelegate, virtual TabContents* GetConstrainingContents(TabContents* source); // Ignored; BlockedPopupContainer doesn't display a toolbar. - virtual void ToolbarSizeChanged(TabContents* source, bool is_animating) { } + virtual void ToolbarSizeChanged(TabContents* source, bool is_animating) {} // Ignored; BlockedPopupContainer doesn't display a bookmarking star. - virtual void URLStarredChanged(TabContents* source, bool starred) { } + virtual void URLStarredChanged(TabContents* source, bool starred) {} // Ignored; BlockedPopupContainer doesn't display a URL bar. - virtual void UpdateTargetURL(TabContents* source, const GURL& url) { } + virtual void UpdateTargetURL(TabContents* source, const GURL& url) {} // A number larger than the internal popup count on the Renderer; meant for // preventing a compromised renderer from exhausting GDI memory by spawning diff --git a/chrome/browser/bookmarks/bookmark_model_observer.h b/chrome/browser/bookmarks/bookmark_model_observer.h index 1b85fe3..738fc09 100644 --- a/chrome/browser/bookmarks/bookmark_model_observer.h +++ b/chrome/browser/bookmarks/bookmark_model_observer.h @@ -15,7 +15,7 @@ class BookmarkModelObserver { virtual void Loaded(BookmarkModel* model) = 0; // Invoked from the destructor of the BookmarkModel. - virtual void BookmarkModelBeingDeleted(BookmarkModel* model) { } + virtual void BookmarkModelBeingDeleted(BookmarkModel* model) {} // Invoked when a node has moved. virtual void BookmarkNodeMoved(BookmarkModel* model, @@ -51,6 +51,9 @@ class BookmarkModelObserver { // |node| have been reordered in some way, such as sorted. virtual void BookmarkNodeChildrenReordered(BookmarkModel* model, const BookmarkNode* node) = 0; + + protected: + ~BookmarkModelObserver() {} }; #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_OBSERVER_H_ diff --git a/chrome/browser/bookmarks/bookmark_service.h b/chrome/browser/bookmarks/bookmark_service.h index 2de91cf..1816057 100644 --- a/chrome/browser/bookmarks/bookmark_service.h +++ b/chrome/browser/bookmarks/bookmark_service.h @@ -1,4 +1,4 @@ -// Copyright 2008, Google Inc. +// Copyright 2009, The Chromium Authors // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -56,6 +56,9 @@ class BookmarkService { // Blocks until loaded. This is intended for usage on a thread other than // the main thread. virtual void BlockTillLoaded() = 0; + + protected: + ~BookmarkService() {} }; #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_SERVICE_H_ diff --git a/chrome/browser/browser_list.h b/chrome/browser/browser_list.h index fda1aa4..20c360d 100644 --- a/chrome/browser/browser_list.h +++ b/chrome/browser/browser_list.h @@ -1,9 +1,9 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_BROWSER_LIST_H__ -#define CHROME_BROWSER_BROWSER_LIST_H__ +#ifndef CHROME_BROWSER_BROWSER_LIST_H_ +#define CHROME_BROWSER_BROWSER_LIST_H_ #include <vector> @@ -28,7 +28,10 @@ class BrowserList { virtual void OnBrowserRemoving(const Browser* browser) = 0; // Called immediately after a browser is set active (SetLastActive) - virtual void OnBrowserSetLastActive(const Browser* browser) { }; + virtual void OnBrowserSetLastActive(const Browser* browser) {}; + + protected: + ~Observer() {}; }; // Adds and removes browsers from the global list. The browser object should @@ -191,4 +194,4 @@ class TabContentsIterator { TabContents* cur_; }; -#endif // CHROME_BROWSER_BROWSER_LIST_H__ +#endif // CHROME_BROWSER_BROWSER_LIST_H_ diff --git a/chrome/browser/browser_theme_provider.cc b/chrome/browser/browser_theme_provider.cc index ec4054b..ee361e9 100644 --- a/chrome/browser/browser_theme_provider.cc +++ b/chrome/browser/browser_theme_provider.cc @@ -117,8 +117,8 @@ const SkColor BrowserThemeProvider::kDefaultColorNTPSectionText = SkColorSetRGB(0, 0, 0); const SkColor BrowserThemeProvider::kDefaultColorNTPSectionLink = SkColorSetRGB(0, 0, 204); -const SkColor BrowserThemeProvider::kDefaultColorControlBackground = NULL; -const SkColor BrowserThemeProvider::kDefaultColorButtonBackground = NULL; +const SkColor BrowserThemeProvider::kDefaultColorControlBackground = 0u; +const SkColor BrowserThemeProvider::kDefaultColorButtonBackground = 0u; // Default tints. const skia::HSL BrowserThemeProvider::kDefaultTintButtons = { -1, -1, -1 }; diff --git a/chrome/browser/browser_window.h b/chrome/browser/browser_window.h index a1dbe76..fd41fc0 100644 --- a/chrome/browser/browser_window.h +++ b/chrome/browser/browser_window.h @@ -244,6 +244,7 @@ class BrowserWindow { protected: friend class BrowserList; friend class BrowserView; + ~BrowserWindow() {} virtual void DestroyBrowser() = 0; }; diff --git a/chrome/browser/browsing_data_remover.h b/chrome/browser/browsing_data_remover.h index 0425c6f..3f2bbbb 100644 --- a/chrome/browser/browsing_data_remover.h +++ b/chrome/browser/browsing_data_remover.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -41,6 +41,8 @@ class BrowsingDataRemover : public NotificationObserver { class Observer { public: virtual void OnBrowsingDataRemoverDone() = 0; + protected: + ~Observer() {} }; // Creates a BrowsingDataRemover to remove browser data from the specified diff --git a/chrome/browser/cancelable_request.h b/chrome/browser/cancelable_request.h index 713440e..3840936 100644 --- a/chrome/browser/cancelable_request.h +++ b/chrome/browser/cancelable_request.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -80,8 +80,8 @@ // } // }; -#ifndef CHROME_BROWSER_CANCELABLE_REQUEST_H__ -#define CHROME_BROWSER_CANCELABLE_REQUEST_H__ +#ifndef CHROME_BROWSER_CANCELABLE_REQUEST_H_ +#define CHROME_BROWSER_CANCELABLE_REQUEST_H_ #include <map> #include <vector> @@ -274,7 +274,7 @@ class CancelableRequestConsumerTSimple : public CancelableRequestConsumerBase { typedef std::map<PendingRequest, T> PendingRequestList; virtual T get_initial_t() const { - return NULL; + return 0; } virtual void OnRequestAdded(CancelableRequestProvider* provider, @@ -543,4 +543,4 @@ class CancelableRequest1 : public CancelableRequest<CB> { Type value; }; -#endif // CHROME_BROWSER_CANCELABLE_REQUEST_H__ +#endif // CHROME_BROWSER_CANCELABLE_REQUEST_H_ diff --git a/chrome/browser/command_updater.h b/chrome/browser/command_updater.h index 3a6b7ca..9e2afcb 100644 --- a/chrome/browser/command_updater.h +++ b/chrome/browser/command_updater.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -24,6 +24,8 @@ class CommandUpdater { public: // Perform the action associated with the command with the specified ID. virtual void ExecuteCommand(int id) = 0; + protected: + ~CommandUpdaterDelegate() {} }; // Create a CommandUpdater with a CommandUpdaterDelegate to handle execution @@ -50,6 +52,8 @@ class CommandUpdater { // Notifies the observer that the enabled state has changed for the // specified command id. virtual void EnabledStateChangedForCommand(int id, bool enabled) = 0; + protected: + ~CommandObserver() {} }; // Adds an observer to the state of a particular command. If the command does diff --git a/chrome/browser/dock_info.h b/chrome/browser/dock_info.h index 4f6d476..76c900e 100644 --- a/chrome/browser/dock_info.h +++ b/chrome/browser/dock_info.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -32,6 +32,9 @@ class DockInfo { virtual gfx::NativeWindow GetLocalProcessWindowAtPoint( const gfx::Point& screen_point, const std::set<gfx::NativeView>& ignore) = 0; + + protected: + ~Factory() {} }; // Possible dock positions. diff --git a/chrome/browser/download/download_manager.h b/chrome/browser/download/download_manager.h index fec86ad..b7d87c7 100644 --- a/chrome/browser/download/download_manager.h +++ b/chrome/browser/download/download_manager.h @@ -98,6 +98,9 @@ class DownloadItem { // Called when a downloaded file has been opened. virtual void OnDownloadOpened(DownloadItem* download) = 0; + + protected: + ~Observer() {} }; // Constructing from persistent store: @@ -323,6 +326,9 @@ class DownloadManager : public base::RefCountedThreadSafe<DownloadManager>, // downloads. The DownloadManagerObserver must copy the vector, but does not // own the individual DownloadItems, when this call is made. virtual void SetDownloads(std::vector<DownloadItem*>& downloads) = 0; + + protected: + ~Observer() {} }; // Public API diff --git a/chrome/browser/download/download_request_manager.h b/chrome/browser/download/download_request_manager.h index f9351c8..62c3caa 100644 --- a/chrome/browser/download/download_request_manager.h +++ b/chrome/browser/download/download_request_manager.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -57,6 +57,8 @@ class DownloadRequestManager : public: virtual void ContinueDownload() = 0; virtual void CancelDownload() = 0; + protected: + ~Callback() {} }; // TabDownloadState maintains the download state for a particular tab. @@ -169,6 +171,8 @@ class DownloadRequestManager : class TestingDelegate { public: virtual bool ShouldAllowDownload() = 0; + protected: + ~TestingDelegate() {} }; static void SetTestingDelegate(TestingDelegate* delegate); diff --git a/chrome/browser/extensions/extension_function_dispatcher.h b/chrome/browser/extensions/extension_function_dispatcher.h index 7a47b3f..a967c8f 100644 --- a/chrome/browser/extensions/extension_function_dispatcher.h +++ b/chrome/browser/extensions/extension_function_dispatcher.h @@ -31,6 +31,8 @@ class ExtensionFunctionDispatcher { public: virtual Browser* GetBrowser() = 0; virtual ExtensionHost* GetExtensionHost() { return NULL; } + protected: + ~Delegate() {} }; // The peer object allows us to notify ExtensionFunctions when we are diff --git a/chrome/browser/extensions/extension_shelf_model.h b/chrome/browser/extensions/extension_shelf_model.h index 29f6592..ba8b8b1d 100644 --- a/chrome/browser/extensions/extension_shelf_model.h +++ b/chrome/browser/extensions/extension_shelf_model.h @@ -158,6 +158,9 @@ class ExtensionShelfModelObserver { // The model is being destroyed. virtual void ShelfModelDeleting() {} + + protected: + ~ExtensionShelfModelObserver() {} }; diff --git a/chrome/browser/extensions/external_extension_provider.h b/chrome/browser/extensions/external_extension_provider.h index f431bfc..6c664c8 100644 --- a/chrome/browser/extensions/external_extension_provider.h +++ b/chrome/browser/extensions/external_extension_provider.h @@ -27,6 +27,8 @@ class ExternalExtensionProvider { const Version* version, const FilePath& path, Extension::Location location) = 0; + protected: + ~Visitor() {} }; virtual ~ExternalExtensionProvider() {} diff --git a/chrome/browser/gears_integration.cc b/chrome/browser/gears_integration.cc index 6805175..a2a0e4f 100644 --- a/chrome/browser/gears_integration.cc +++ b/chrome/browser/gears_integration.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -254,7 +254,7 @@ void GearsCreateShortcut( new CreateShortcutCommand(name_utf8, orig_name_utf8, url.spec(), description_utf8, app_info.icons, fallback_icon, callback); - CPHandleCommand(GEARSPLUGINCOMMAND_CREATE_SHORTCUT, command, NULL); + CPHandleCommand(GEARSPLUGINCOMMAND_CREATE_SHORTCUT, command, 0u); } // This class holds and manages the data passed to the @@ -311,5 +311,5 @@ void RunnableMethodTraits<QueryShortcutsCommand>::ReleaseCallee( void GearsQueryShortcuts(GearsQueryShortcutsCallback* callback) { CPHandleCommand(GEARSPLUGINCOMMAND_GET_SHORTCUT_LIST, new QueryShortcutsCommand(callback), - NULL); + 0u); } diff --git a/chrome/browser/gtk/back_forward_button_gtk.cc b/chrome/browser/gtk/back_forward_button_gtk.cc index 7f4bd69..e5f6125 100644 --- a/chrome/browser/gtk/back_forward_button_gtk.cc +++ b/chrome/browser/gtk/back_forward_button_gtk.cc @@ -110,7 +110,7 @@ gboolean BackForwardButtonGtk::OnButtonPress(GtkWidget* widget, if (event->button != 1) return FALSE; - button->y_position_of_last_press_ = event->y; + button->y_position_of_last_press_ = static_cast<int>(event->y); MessageLoop::current()->PostDelayedTask(FROM_HERE, button->show_menu_factory_.NewRunnableMethod( &BackForwardButtonGtk::ShowBackForwardMenu), diff --git a/chrome/browser/gtk/bookmark_bar_gtk.cc b/chrome/browser/gtk/bookmark_bar_gtk.cc index 373ce0f..909243d 100644 --- a/chrome/browser/gtk/bookmark_bar_gtk.cc +++ b/chrome/browser/gtk/bookmark_bar_gtk.cc @@ -399,8 +399,8 @@ void BookmarkBarGtk::AnimationProgressed(const Animation* animation) { DCHECK_EQ(animation, slide_animation_.get()); gtk_widget_set_size_request(event_box_.get(), -1, - animation->GetCurrentValue() * - kBookmarkBarHeight); + static_cast<gint>(animation->GetCurrentValue() * + kBookmarkBarHeight)); } void BookmarkBarGtk::AnimationEnded(const Animation* animation) { diff --git a/chrome/browser/gtk/bookmark_manager_gtk.cc b/chrome/browser/gtk/bookmark_manager_gtk.cc index f38512c..0d005e9 100644 --- a/chrome/browser/gtk/bookmark_manager_gtk.cc +++ b/chrome/browser/gtk/bookmark_manager_gtk.cc @@ -1183,7 +1183,9 @@ gboolean BookmarkManagerGtk::OnRightTreeViewButtonPress( GtkTreePath* path; gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(tree_view), - event->x, event->y, &path, NULL, NULL, NULL); + static_cast<gint>(event->x), + static_cast<gint>(event->y), &path, + NULL, NULL, NULL); if (path == NULL) return TRUE; @@ -1207,10 +1209,10 @@ gboolean BookmarkManagerGtk::OnRightTreeViewMotion( return FALSE; if (gtk_drag_check_threshold(tree_view, - bm->mousedown_event_.x, - bm->mousedown_event_.y, - event->x, - event->y)) { + static_cast<gint>(bm->mousedown_event_.x), + static_cast<gint>(bm->mousedown_event_.y), + static_cast<gint>(event->x), + static_cast<gint>(event->y))) { bm->delaying_mousedown_ = false; GtkTargetList* targets = GtkDndUtil::GetTargetListFromCodeMask( GtkDndUtil::CHROME_BOOKMARK_ITEM | diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc index 9c295ac..278f973 100644 --- a/chrome/browser/gtk/browser_window_gtk.cc +++ b/chrome/browser/gtk/browser_window_gtk.cc @@ -603,7 +603,7 @@ gboolean BrowserWindowGtk::OnCustomFrameExpose(GtkWidget* widget, IDR_WINDOW_TOP_CENTER, IDR_WINDOW_TOP_RIGHT_CORNER, IDR_WINDOW_LEFT_SIDE, - NULL, + 0, IDR_WINDOW_RIGHT_SIDE, IDR_WINDOW_BOTTOM_LEFT_CORNER, IDR_WINDOW_BOTTOM_CENTER, @@ -1825,7 +1825,8 @@ gboolean BrowserWindowGtk::OnButtonPressEvent(GtkWidget* widget, gdk_window_get_origin(GTK_WIDGET(browser->window_)->window, &win_x, &win_y); GdkWindowEdge edge; - gfx::Point point(event->x_root - win_x, event->y_root - win_y); + gfx::Point point(static_cast<int>(event->x_root - win_x), + static_cast<int>( event->y_root - win_y)); bool has_hit_edge = browser->GetWindowEdge(point.x(), point.y(), &edge); // Ignore clicks that are in/below the browser toolbar. @@ -1844,7 +1845,8 @@ gboolean BrowserWindowGtk::OnButtonPressEvent(GtkWidget* widget, guint32 last_click_time = browser->last_click_time_; gfx::Point last_click_position = browser->last_click_position_; browser->last_click_time_ = event->time; - browser->last_click_position_ = gfx::Point(event->x, event->y); + browser->last_click_position_ = gfx::Point(static_cast<int>(event->x), + static_cast<int>(event->y)); if (has_hit_titlebar) { // We want to start a move when the user single clicks, but not start a @@ -1864,19 +1866,23 @@ gboolean BrowserWindowGtk::OnButtonPressEvent(GtkWidget* widget, NULL); guint32 click_time = event->time - last_click_time; - int click_move_x = event->x - last_click_position.x(); - int click_move_y = event->y - last_click_position.y(); + int click_move_x = static_cast<int>(event->x - last_click_position.x()); + int click_move_y = static_cast<int>(event->y - last_click_position.y()); if (click_time > static_cast<guint32>(double_click_time) || click_move_x > double_click_distance || click_move_y > double_click_distance) { gtk_window_begin_move_drag(browser->window_, event->button, - event->x_root, event->y_root, event->time); + static_cast<gint>(event->x_root), + static_cast<gint>(event->y_root), + event->time); return TRUE; } } else if (has_hit_edge) { gtk_window_begin_resize_drag(browser->window_, edge, event->button, - event->x_root, event->y_root, event->time); + static_cast<gint>(event->x_root), + static_cast<gint>(event->y_root), + event->time); return TRUE; } } else if (GDK_2BUTTON_PRESS == event->type) { diff --git a/chrome/browser/gtk/constrained_window_gtk.h b/chrome/browser/gtk/constrained_window_gtk.h index 91fa9ac..d2003a9 100644 --- a/chrome/browser/gtk/constrained_window_gtk.h +++ b/chrome/browser/gtk/constrained_window_gtk.h @@ -22,6 +22,9 @@ class ConstrainedWindowGtkDelegate { // Tells the delegate to either delete itself or set up a task to delete // itself later. virtual void DeleteDelegate() = 0; + + protected: + ~ConstrainedWindowGtkDelegate() {} }; // Constrained window implementation for the GTK port. Unlike the Win32 system, diff --git a/chrome/browser/gtk/download_item_gtk.cc b/chrome/browser/gtk/download_item_gtk.cc index 815459a..90bb019 100644 --- a/chrome/browser/gtk/download_item_gtk.cc +++ b/chrome/browser/gtk/download_item_gtk.cc @@ -428,9 +428,9 @@ void DownloadItemGtk::AnimationProgressed(const Animation* animation) { gtk_widget_queue_draw(progress_area_.get()); } else { if (IsDangerous()) { - int progress = (dangerous_hbox_full_width_ - - dangerous_hbox_start_width_) * - new_item_animation_->GetCurrentValue(); + int progress = static_cast<int>((dangerous_hbox_full_width_ - + dangerous_hbox_start_width_) * + new_item_animation_->GetCurrentValue()); int showing_width = dangerous_hbox_start_width_ + progress; gtk_widget_set_size_request(dangerous_hbox_, showing_width, -1); } else { diff --git a/chrome/browser/gtk/download_request_dialog_delegate_gtk.cc b/chrome/browser/gtk/download_request_dialog_delegate_gtk.cc index 8903ee2..7e499b1 100644 --- a/chrome/browser/gtk/download_request_dialog_delegate_gtk.cc +++ b/chrome/browser/gtk/download_request_dialog_delegate_gtk.cc @@ -29,7 +29,7 @@ DownloadRequestDialogDelegateGtk::DownloadRequestDialogDelegateGtk( : DownloadRequestDialogDelegate(host), responded_(false) { // Create dialog. - root_.Own(gtk_vbox_new(NULL, gtk_util::kContentAreaBorder)); + root_.Own(gtk_vbox_new(false, gtk_util::kContentAreaBorder)); GtkWidget* label = gtk_label_new( l10n_util::GetStringUTF8(IDS_MULTI_DOWNLOAD_WARNING).c_str()); gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); diff --git a/chrome/browser/gtk/find_bar_gtk.cc b/chrome/browser/gtk/find_bar_gtk.cc index 0bf856a..231aa00 100644 --- a/chrome/browser/gtk/find_bar_gtk.cc +++ b/chrome/browser/gtk/find_bar_gtk.cc @@ -116,7 +116,7 @@ void SetDialogShape(GtkWidget* widget) { IDR_FIND_DLG_LEFT_BACKGROUND, IDR_FIND_DLG_MIDDLE_BACKGROUND, IDR_FIND_DLG_RIGHT_BACKGROUND, - NULL, NULL, NULL, NULL, NULL, NULL); + 0, 0, 0, 0, 0, 0); dialog_shape->ChangeWhiteToTransparent(); } @@ -132,7 +132,7 @@ const NineBox* GetDialogBorder() { IDR_FIND_DIALOG_LEFT, IDR_FIND_DIALOG_MIDDLE, IDR_FIND_DIALOG_RIGHT, - NULL, NULL, NULL, NULL, NULL, NULL); + 0, 0, 0, 0, 0, 0); } return dialog_border; @@ -512,7 +512,7 @@ void FindBarGtk::Observe(NotificationType type, &kEntryBackgroundColor); gtk_alignment_set_padding(GTK_ALIGNMENT(content_alignment_), - 0.0, 0.0, 0.0, 0.0); + 0, 0, 0, 0); gtk_widget_modify_bg(border_bin_, GTK_STATE_NORMAL, &kTextBorderColor); gtk_widget_modify_bg(border_bin_aa_, GTK_STATE_NORMAL, &kTextBorderColorAA); diff --git a/chrome/browser/gtk/gtk_floating_container.cc b/chrome/browser/gtk/gtk_floating_container.cc index b9d0e46..51f9632 100644 --- a/chrome/browser/gtk/gtk_floating_container.cc +++ b/chrome/browser/gtk/gtk_floating_container.cc @@ -115,7 +115,7 @@ static void gtk_floating_container_class_init( G_OBJECT_CLASS_TYPE(object_class), static_cast<GSignalFlags>(G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION), - NULL, + 0u, NULL, NULL, gtk_marshal_VOID__BOXED, G_TYPE_NONE, 1, diff --git a/chrome/browser/gtk/info_bubble_gtk.h b/chrome/browser/gtk/info_bubble_gtk.h index 137b395..eb88724 100644 --- a/chrome/browser/gtk/info_bubble_gtk.h +++ b/chrome/browser/gtk/info_bubble_gtk.h @@ -34,6 +34,9 @@ class InfoBubbleGtkDelegate { // NOTE: The Views interface has CloseOnEscape, except I can't find a place // where it ever returns false, so we always allow you to close via escape. + + protected: + ~InfoBubbleGtkDelegate() {} }; class InfoBubbleGtk : public NotificationObserver { diff --git a/chrome/browser/gtk/slide_animator_gtk.cc b/chrome/browser/gtk/slide_animator_gtk.cc index 866aca5..519a58f 100644 --- a/chrome/browser/gtk/slide_animator_gtk.cc +++ b/chrome/browser/gtk/slide_animator_gtk.cc @@ -107,8 +107,8 @@ bool SlideAnimatorGtk::IsClosing() { } void SlideAnimatorGtk::AnimationProgressed(const Animation* animation) { - int showing_height = child_->allocation.height * - animation_->GetCurrentValue(); + int showing_height = static_cast<int>(child_->allocation.height * + animation_->GetCurrentValue()); if (direction_ == DOWN) { gtk_fixed_move(GTK_FIXED(widget_.get()), child_, 0, showing_height - child_->allocation.height); diff --git a/chrome/browser/gtk/slide_animator_gtk.h b/chrome/browser/gtk/slide_animator_gtk.h index a4cf657..547ae83 100644 --- a/chrome/browser/gtk/slide_animator_gtk.h +++ b/chrome/browser/gtk/slide_animator_gtk.h @@ -28,6 +28,9 @@ class SlideAnimatorGtk : public AnimationDelegate { public: // Called when a call to Close() finishes animating. virtual void Closed() = 0; + + protected: + ~Delegate() {} }; enum Direction { diff --git a/chrome/browser/gtk/tab_contents_drag_source.cc b/chrome/browser/gtk/tab_contents_drag_source.cc index b27ef57..7953ba8 100644 --- a/chrome/browser/gtk/tab_contents_drag_source.cc +++ b/chrome/browser/gtk/tab_contents_drag_source.cc @@ -112,7 +112,9 @@ void TabContentsDragSource::DidProcessEvent(GdkEvent* event) { if (tab_contents()->render_view_host()) { tab_contents()->render_view_host()->DragSourceMovedTo( - client.x(), client.y(), event_motion->x_root, event_motion->y_root); + client.x(), client.y(), + static_cast<int>(event_motion->x_root), + static_cast<int>(event_motion->y_root)); } } diff --git a/chrome/browser/gtk/tabs/dragged_tab_gtk.cc b/chrome/browser/gtk/tabs/dragged_tab_gtk.cc index 2ddb607..5809cd1 100644 --- a/chrome/browser/gtk/tabs/dragged_tab_gtk.cc +++ b/chrome/browser/gtk/tabs/dragged_tab_gtk.cc @@ -263,8 +263,9 @@ void DraggedTabGtk::SetContainerShapeMask(GdkPixbuf* pixbuf) { // border). cairo_identity_matrix(cairo_context); cairo_set_source_rgba(cairo_context, 1.0f, 1.0f, 1.0f, 1.0f); - int tab_height = kScalingFactor * gdk_pixbuf_get_height(pixbuf) - - kDragFrameBorderSize; + int tab_height = static_cast<int>(kScalingFactor * + gdk_pixbuf_get_height(pixbuf) - + kDragFrameBorderSize); cairo_rectangle(cairo_context, 0, tab_height, size.width(), size.height() - tab_height); @@ -295,8 +296,10 @@ gboolean DraggedTabGtk::OnExposeEvent(GtkWidget* widget, } // Only used when not attached. - int tab_height = kScalingFactor * gdk_pixbuf_get_height(pixbuf); - int tab_width = kScalingFactor * gdk_pixbuf_get_width(pixbuf); + int tab_height = static_cast<int>(kScalingFactor * + gdk_pixbuf_get_height(pixbuf)); + int tab_width = static_cast<int>(kScalingFactor * + gdk_pixbuf_get_width(pixbuf)); // Draw the render area. if (dragged_tab->backing_store_ && !dragged_tab->attached_) { diff --git a/chrome/browser/gtk/tabs/tab_gtk.h b/chrome/browser/gtk/tabs/tab_gtk.h index dd8547b..2667b42 100644 --- a/chrome/browser/gtk/tabs/tab_gtk.h +++ b/chrome/browser/gtk/tabs/tab_gtk.h @@ -73,6 +73,9 @@ class TabGtk : public TabRendererGtk, // Returns the theme provider for icons and colors. virtual ThemeProvider* GetThemeProvider() = 0; + + protected: + ~TabDelegate() {} }; explicit TabGtk(TabDelegate* delegate); diff --git a/chrome/browser/gtk/tabs/tab_renderer_gtk.cc b/chrome/browser/gtk/tabs/tab_renderer_gtk.cc index 6a60e2b..867d9245 100644 --- a/chrome/browser/gtk/tabs/tab_renderer_gtk.cc +++ b/chrome/browser/gtk/tabs/tab_renderer_gtk.cc @@ -236,7 +236,9 @@ TabRendererGtk::TabRendererGtk(ThemeProvider* theme_provider) fav_icon_hiding_offset_(0), should_display_crashed_favicon_(false), loading_animation_(theme_provider), - close_button_color_(NULL) { + // Zero is not a valid SkColor. It'll be replaced by the + // theme tab_text_color. + close_button_color_(0u) { InitResources(); data_.pinned = false; @@ -590,7 +592,7 @@ void TabRendererGtk::Layout() { if (theme_provider_) { SkColor tab_text_color = theme_provider_->GetColor(BrowserThemeProvider::COLOR_TAB_TEXT); - if (!close_button_color_ || tab_text_color != close_button_color_) { + if (close_button_color_ == 0u || tab_text_color != close_button_color_) { close_button_color_ = tab_text_color; ResourceBundle& rb = ResourceBundle::GetSharedInstance(); close_button_->SetBackground(close_button_color_, diff --git a/chrome/browser/gtk/view_id_util.h b/chrome/browser/gtk/view_id_util.h index 1ec65e8..6c6f328 100644 --- a/chrome/browser/gtk/view_id_util.h +++ b/chrome/browser/gtk/view_id_util.h @@ -15,6 +15,8 @@ class ViewIDUtil { class Delegate { public: virtual GtkWidget* GetWidgetForViewID(ViewID id) = 0; + protected: + ~Delegate() {} }; static void SetID(GtkWidget* widget, ViewID id); diff --git a/chrome/browser/history/expire_history_backend.h b/chrome/browser/history/expire_history_backend.h index dc37044..4c64acb 100644 --- a/chrome/browser/history/expire_history_backend.h +++ b/chrome/browser/history/expire_history_backend.h @@ -1,9 +1,9 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_HISTORY_EXPIRE_HISTORY_BACKEND_H__ -#define CHROME_BROWSER_HISTORY_EXPIRE_HISTORY_BACKEND_H__ +#ifndef CHROME_BROWSER_HISTORY_EXPIRE_HISTORY_BACKEND_H_ +#define CHROME_BROWSER_HISTORY_EXPIRE_HISTORY_BACKEND_H_ #include <queue> #include <set> @@ -36,6 +36,9 @@ class BroadcastNotificationDelegate { // thread. The details argument will have ownership taken by this function. virtual void BroadcastNotifications(NotificationType type, HistoryDetails* details_deleted) = 0; + + protected: + ~BroadcastNotificationDelegate() {} }; // Encapsulates visit expiration criteria and type of visits to expire. @@ -277,4 +280,4 @@ class ExpireHistoryBackend { } // namespace history -#endif // CHROME_BROWSER_HISTORY_EXPIRE_HISTORY_BACKEND_H__ +#endif // CHROME_BROWSER_HISTORY_EXPIRE_HISTORY_BACKEND_H_ diff --git a/chrome/browser/history/history_backend.h b/chrome/browser/history/history_backend.h index 36b5193..846da67 100644 --- a/chrome/browser/history/history_backend.h +++ b/chrome/browser/history/history_backend.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -95,7 +95,7 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>, Delegate* delegate, BookmarkService* bookmark_service); - ~HistoryBackend(); + virtual ~HistoryBackend(); // Must be called after creation but before any objects are created. If this // fails, all other functions will fail as well. (Since this runs on another diff --git a/chrome/browser/history/history_types.h b/chrome/browser/history/history_types.h index c967374..9a7f36d 100644 --- a/chrome/browser/history/history_types.h +++ b/chrome/browser/history/history_types.h @@ -1,9 +1,9 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_HISTORY_HISTORY_TYPES_H__ -#define CHROME_BROWSER_HISTORY_HISTORY_TYPES_H__ +#ifndef CHROME_BROWSER_HISTORY_HISTORY_TYPES_H_ +#define CHROME_BROWSER_HISTORY_HISTORY_TYPES_H_ #include <map> #include <set> @@ -73,6 +73,7 @@ class URLRow { // Initialize will not set the URL, so our initialization above will stay. Initialize(); } + virtual ~URLRow() {} URLID id() const { return id_; } const GURL& url() const { return url_; } @@ -520,4 +521,4 @@ struct KeywordSearchTermVisit { } // history -#endif // CHROME_BROWSER_HISTORY_HISTORY_TYPES_H__ +#endif // CHROME_BROWSER_HISTORY_HISTORY_TYPES_H_ diff --git a/chrome/browser/history/starred_url_database.cc b/chrome/browser/history/starred_url_database.cc index b56bcd9..38124aa2 100644 --- a/chrome/browser/history/starred_url_database.cc +++ b/chrome/browser/history/starred_url_database.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -545,10 +545,10 @@ bool StarredURLDatabase::MigrateBookmarksToFileImpl(const FilePath& path) { // Create the bookmark bar and other folder nodes. history::StarredEntry entry; entry.type = history::StarredEntry::BOOKMARK_BAR; - BookmarkNode bookmark_bar_node(NULL, GURL()); + BookmarkNode bookmark_bar_node(0, GURL()); bookmark_bar_node.Reset(entry); entry.type = history::StarredEntry::OTHER; - BookmarkNode other_node(NULL, GURL()); + BookmarkNode other_node(0, GURL()); other_node.Reset(entry); std::map<history::UIStarID, history::StarID> group_id_to_id_map; @@ -597,7 +597,7 @@ bool StarredURLDatabase::MigrateBookmarksToFileImpl(const FilePath& path) { // encountering the details. // The created nodes are owned by the root node. - node = new BookmarkNode(NULL, i->url); + node = new BookmarkNode(0, i->url); id_to_node_map[i->id] = node; } node->Reset(*i); @@ -608,7 +608,7 @@ bool StarredURLDatabase::MigrateBookmarksToFileImpl(const FilePath& path) { BookmarkNode* parent = id_to_node_map[parent_id]; if (!parent) { // Haven't encountered the parent yet, create it now. - parent = new BookmarkNode(NULL, GURL()); + parent = new BookmarkNode(0, GURL()); id_to_node_map[parent_id] = parent; } diff --git a/chrome/browser/icon_loader.h b/chrome/browser/icon_loader.h index af4a10a..30788ad 100644 --- a/chrome/browser/icon_loader.h +++ b/chrome/browser/icon_loader.h @@ -43,6 +43,8 @@ class IconLoader : public base::RefCountedThreadSafe<IconLoader> { // icon has been successfully loaded, result is non-null. This method must // return true if it is taking ownership of the returned bitmap. virtual bool OnBitmapLoaded(IconLoader* source, SkBitmap* result) = 0; + protected: + ~Delegate() {} }; IconLoader(const IconGroupID& group, IconSize size, Delegate* delegate); diff --git a/chrome/browser/importer/firefox_importer_utils.cc b/chrome/browser/importer/firefox_importer_utils.cc index 28a9365..624a4e9 100644 --- a/chrome/browser/importer/firefox_importer_utils.cc +++ b/chrome/browser/importer/firefox_importer_utils.cc @@ -21,8 +21,8 @@ namespace { // the search URL when importing search engines. class FirefoxURLParameterFilter : public TemplateURLParser::ParameterFilter { public: - FirefoxURLParameterFilter() { } - ~FirefoxURLParameterFilter() { } + FirefoxURLParameterFilter() {} + virtual ~FirefoxURLParameterFilter() {} // TemplateURLParser::ParameterFilter method. virtual bool KeepParameter(const std::string& key, diff --git a/chrome/browser/input_window_dialog.h b/chrome/browser/input_window_dialog.h index 56bdfb9..0a93bcea 100644 --- a/chrome/browser/input_window_dialog.h +++ b/chrome/browser/input_window_dialog.h @@ -15,7 +15,7 @@ class InputWindowDialog { public: class Delegate { public: - virtual ~Delegate() { } + virtual ~Delegate() {} // Checks whether |text| is a valid input string. virtual bool IsValid(const std::wstring& text) = 0; @@ -42,7 +42,8 @@ class InputWindowDialog { virtual void Close() = 0; protected: - InputWindowDialog() { } + InputWindowDialog() {} + ~InputWindowDialog() {} private: DISALLOW_COPY_AND_ASSIGN(InputWindowDialog); diff --git a/chrome/browser/location_bar.h b/chrome/browser/location_bar.h index c8e9293..f9d178f 100644 --- a/chrome/browser/location_bar.h +++ b/chrome/browser/location_bar.h @@ -64,12 +64,17 @@ class LocationBar { // Returns a pointer to the testing interface. virtual LocationBarTesting* GetLocationBarForTesting() = 0; + + protected: + ~LocationBar() {} }; class LocationBarTesting { public: // Returns the number of visible page actions in the Omnibox. virtual int PageActionVisibleCount() = 0; + protected: + ~LocationBarTesting() {} }; #endif // CHROME_BROWSER_LOCATION_BAR_H_ diff --git a/chrome/browser/login_model.h b/chrome/browser/login_model.h index cbd2fef..6d764be 100644 --- a/chrome/browser/login_model.h +++ b/chrome/browser/login_model.h @@ -15,6 +15,8 @@ class LoginModelObserver { // as a match for the pending login prompt. virtual void OnAutofillDataAvailable(const std::wstring& username, const std::wstring& password) = 0; + protected: + ~LoginModelObserver() {} }; class LoginModel { @@ -23,6 +25,8 @@ class LoginModel { // observer can be null, signifying there is no longer any observer // interested in the data. virtual void SetObserver(LoginModelObserver* observer) = 0; + protected: + ~LoginModel() {} }; #endif // CHROME_BROWSER_LOGIN_MODEL_H_ diff --git a/chrome/browser/login_prompt.h b/chrome/browser/login_prompt.h index 6279c7a..3ba1aad 100644 --- a/chrome/browser/login_prompt.h +++ b/chrome/browser/login_prompt.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -64,6 +64,9 @@ class LoginHandler { // Notify the handler that the request was cancelled. // This function can only be called from the IO thread. virtual void OnRequestCancelled() = 0; + + protected: + ~LoginHandler() {} }; // Details to provide the NotificationObserver. Used by the automation proxy diff --git a/chrome/browser/login_prompt_gtk.cc b/chrome/browser/login_prompt_gtk.cc index dda0e15..a8f4316 100644 --- a/chrome/browser/login_prompt_gtk.cc +++ b/chrome/browser/login_prompt_gtk.cc @@ -83,7 +83,7 @@ class LoginHandlerGtk : public LoginHandler, std::wstring explanation) { DCHECK(MessageLoop::current() == ui_loop_); - root_.Own(gtk_vbox_new(NULL, gtk_util::kContentAreaBorder)); + root_.Own(gtk_vbox_new(false, gtk_util::kContentAreaBorder)); GtkWidget* label = gtk_label_new(WideToUTF8(explanation).c_str()); gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); gtk_box_pack_start(GTK_BOX(root_.get()), label, FALSE, FALSE, 0); diff --git a/chrome/browser/net/resolve_proxy_msg_helper_unittest.cc b/chrome/browser/net/resolve_proxy_msg_helper_unittest.cc index 9e79623..492ddf8 100644 --- a/chrome/browser/net/resolve_proxy_msg_helper_unittest.cc +++ b/chrome/browser/net/resolve_proxy_msg_helper_unittest.cc @@ -225,7 +225,7 @@ TEST(ResolveProxyMsgHelperTest, CancelPendingRequests) { EXPECT_EQ(0u, resolver->pending_requests().size()); - EXPECT_EQ(NULL, delegate.pending_result()); + EXPECT_TRUE(NULL == delegate.pending_result()); // It should also be the case that msg1, msg2, msg3 were deleted by the // cancellation. (Else will show up as a leak in Purify/Valgrind). diff --git a/chrome/browser/net/url_fetcher.h b/chrome/browser/net/url_fetcher.h index 6b1c87c..28ec2c5 100644 --- a/chrome/browser/net/url_fetcher.h +++ b/chrome/browser/net/url_fetcher.h @@ -75,6 +75,8 @@ class URLFetcher { int response_code, const ResponseCookies& cookies, const std::string& data) = 0; + protected: + ~Delegate() {} }; // URLFetcher::Create uses the currently registered Factory to create the @@ -85,6 +87,8 @@ class URLFetcher { const GURL& url, RequestType request_type, Delegate* d) = 0; + protected: + ~Factory() {} }; // |url| is the URL to send the request to. diff --git a/chrome/browser/page_info_model.h b/chrome/browser/page_info_model.h index 526372e..994549e 100644 --- a/chrome/browser/page_info_model.h +++ b/chrome/browser/page_info_model.h @@ -23,6 +23,8 @@ class PageInfoModel { class PageInfoModelObserver { public: virtual void ModelChanged() = 0; + protected: + ~PageInfoModelObserver() {} }; // Because the UI on the Mac is statically laid-out, this enum provides the diff --git a/chrome/browser/parsers/metadata_parser.h b/chrome/browser/parsers/metadata_parser.h index 97a4e85..9a8d80d 100644 --- a/chrome/browser/parsers/metadata_parser.h +++ b/chrome/browser/parsers/metadata_parser.h @@ -13,6 +13,7 @@ class MetadataPropertyIterator { public: MetadataPropertyIterator() {} + virtual ~MetadataPropertyIterator() {} // Gets the next Property in the iterator. Returns false if at the end // of the list. @@ -29,6 +30,7 @@ class MetadataPropertyIterator { class MetadataParser { public: MetadataParser(const FilePath& path) {} + virtual ~MetadataParser() {} static const char* kPropertyType; static const char* kPropertyFilesize; diff --git a/chrome/browser/parsers/metadata_parser_factory.h b/chrome/browser/parsers/metadata_parser_factory.h index c42e01d..9c291c4 100644 --- a/chrome/browser/parsers/metadata_parser_factory.h +++ b/chrome/browser/parsers/metadata_parser_factory.h @@ -12,6 +12,7 @@ class MetadataParserFactory { public: MetadataParserFactory() {} + virtual ~MetadataParserFactory() {} // Used to check to see if the parser can parse the given file. This // should not do any additional reading of the file. diff --git a/chrome/browser/parsers/metadata_parser_jpeg_factory.cc b/chrome/browser/parsers/metadata_parser_jpeg_factory.cc index e49cbcb..e79d969 100644 --- a/chrome/browser/parsers/metadata_parser_jpeg_factory.cc +++ b/chrome/browser/parsers/metadata_parser_jpeg_factory.cc @@ -11,6 +11,8 @@ MetadataParserJpegFactory::MetadataParserJpegFactory() : MetadataParserFactory(){} +MetadataParserJpegFactory::~MetadataParserJpegFactory() {} + bool MetadataParserJpegFactory::CanParse(const FilePath& path, char* bytes, int bytes_size) { diff --git a/chrome/browser/parsers/metadata_parser_jpeg_factory.h b/chrome/browser/parsers/metadata_parser_jpeg_factory.h index 48c059b..68399fe 100644 --- a/chrome/browser/parsers/metadata_parser_jpeg_factory.h +++ b/chrome/browser/parsers/metadata_parser_jpeg_factory.h @@ -15,6 +15,9 @@ class MetadataParserJpegFactory : public MetadataParserFactory { virtual bool CanParse(const FilePath& path, char* bytes, int bytes_size); virtual MetadataParser* CreateParser(const FilePath& path); + protected: + ~MetadataParserJpegFactory(); + private: DISALLOW_COPY_AND_ASSIGN(MetadataParserJpegFactory); }; diff --git a/chrome/browser/possible_url_model.h b/chrome/browser/possible_url_model.h index 4a688fe..45403a9 100644 --- a/chrome/browser/possible_url_model.h +++ b/chrome/browser/possible_url_model.h @@ -78,7 +78,7 @@ class PossibleURLModel : public TableModel { TableModelObserver* observer_; // Our consumer for favicon requests. - CancelableRequestConsumerT<size_t, NULL> consumer_; + CancelableRequestConsumerT<size_t, 0> consumer_; // The results we're showing. std::vector<Result> results_; diff --git a/chrome/browser/renderer_host/render_view_host_delegate.h b/chrome/browser/renderer_host/render_view_host_delegate.h index 2727879..916ff9db 100644 --- a/chrome/browser/renderer_host/render_view_host_delegate.h +++ b/chrome/browser/renderer_host/render_view_host_delegate.h @@ -136,6 +136,9 @@ class RenderViewHostDelegate { // The content's intrinsic width (prefWidth) changed. virtual void UpdatePreferredWidth(int pref_width) = 0; + + protected: + ~View() {} }; // RendererManagerment ------------------------------------------------------- @@ -161,6 +164,9 @@ class RenderViewHostDelegate { // Called the ResourceDispatcherHost's associate CrossSiteRequestHandler // when a cross-site navigation has been canceled. virtual void OnCrossSiteNavigationCanceled() = 0; + + protected: + ~RendererManagement() {} }; // BrowserIntegration -------------------------------------------------------- @@ -207,6 +213,9 @@ class RenderViewHostDelegate { virtual void OnDidGetApplicationInfo( int32 page_id, const webkit_glue::WebApplicationInfo& app_info) = 0; + + protected: + ~BrowserIntegration() {} }; // Resource ------------------------------------------------------------------ @@ -263,6 +272,9 @@ class RenderViewHostDelegate { // Notification that a document has been loaded in a frame. virtual void DocumentLoadedInFrame() = 0; + + protected: + ~Resource() {} }; // Save ---------------------------------------------------------------------- @@ -288,6 +300,9 @@ class RenderViewHostDelegate { virtual void OnReceivedSerializedHtmlData(const GURL& frame_url, const std::string& data, int32 status) = 0; + + protected: + ~Save() {} }; // Printing ------------------------------------------------------------------ @@ -303,6 +318,9 @@ class RenderViewHostDelegate { // EMF memory mapped data. virtual void DidPrintPage( const ViewHostMsg_DidPrintPage_Params& params) = 0; + + protected: + ~Printing() {} }; // FavIcon ------------------------------------------------------------------- @@ -326,6 +344,9 @@ class RenderViewHostDelegate { virtual void UpdateFavIconURL(RenderViewHost* render_view_host, int32 page_id, const GURL& icon_url) = 0; + + protected: + ~FavIcon() {} }; // AutoFill ------------------------------------------------------------------ @@ -352,6 +373,9 @@ class RenderViewHostDelegate { // autofill suggestion from the database. virtual void RemoveAutofillEntry(const std::wstring& field_name, const std::wstring& value) = 0; + + protected: + ~Autofill() {} }; // --------------------------------------------------------------------------- @@ -397,7 +421,7 @@ class RenderViewHostDelegate { // The RenderView is going to be deleted. This is called when each // RenderView is going to be destroyed - virtual void RenderViewDeleted(RenderViewHost* render_view_host) { } + virtual void RenderViewDeleted(RenderViewHost* render_view_host) {} // The RenderView was navigated to a different page. virtual void DidNavigate(RenderViewHost* render_view_host, @@ -542,6 +566,9 @@ class RenderViewHostDelegate { // The RenderView has inserted one css file into page. virtual void DidInsertCSS() {} + + protected: + ~RenderViewHostDelegate() {} }; #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ diff --git a/chrome/browser/renderer_host/render_widget_host.cc b/chrome/browser/renderer_host/render_widget_host.cc index 40fba47..2397c79 100644 --- a/chrome/browser/renderer_host/render_widget_host.cc +++ b/chrome/browser/renderer_host/render_widget_host.cc @@ -96,7 +96,7 @@ RenderWidgetHost::~RenderWidgetHost() { gfx::NativeViewId RenderWidgetHost::GetNativeViewId() { if (view_) return gfx::IdFromNativeView(view_->GetNativeView()); - return NULL; + return 0; } void RenderWidgetHost::Init() { diff --git a/chrome/browser/renderer_host/render_widget_host_painting_observer.h b/chrome/browser/renderer_host/render_widget_host_painting_observer.h index d24b61a..652ec47 100644 --- a/chrome/browser/renderer_host/render_widget_host_painting_observer.h +++ b/chrome/browser/renderer_host/render_widget_host_painting_observer.h @@ -19,6 +19,9 @@ class RenderWidgetHostPaintingObserver { // Indicates that the RenderWidgetHost just updated the backing store. virtual void WidgetDidUpdateBackingStore(RenderWidgetHost* widget) = 0; + + protected: + ~RenderWidgetHostPaintingObserver() {} }; #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_PAINTING_OBSERVER_H_ diff --git a/chrome/browser/renderer_host/resource_message_filter.cc b/chrome/browser/renderer_host/resource_message_filter.cc index c8183bb..8df6c4c 100644 --- a/chrome/browser/renderer_host/resource_message_filter.cc +++ b/chrome/browser/renderer_host/resource_message_filter.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -735,7 +735,7 @@ void ResourceMessageFilter::OnGetDefaultPrintSettings(IPC::Message* reply_msg) { // Loads default settings. This is asynchronous, only the IPC message sender // will hang until the settings are retrieved. printer_query->GetSettings(printing::PrinterQuery::DEFAULTS, - NULL, + 0, 0, false, task); diff --git a/chrome/browser/safe_browsing/database_perftest.cc b/chrome/browser/safe_browsing/database_perftest.cc index bbf4839..b25f419 100644 --- a/chrome/browser/safe_browsing/database_perftest.cc +++ b/chrome/browser/safe_browsing/database_perftest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -33,7 +33,7 @@ class Database { Database() : db_(NULL) { } - ~Database() { + virtual ~Database() { if (db_) { sqlite3_close(db_); db_ = NULL; diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.h b/chrome/browser/safe_browsing/safe_browsing_blocking_page.h index 280ffbb..c3c6ec7 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.h +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // @@ -136,12 +136,12 @@ class SafeBrowsingBlockingPage : public InterstitialPage { // Factory for creating SafeBrowsingBlockingPage. Useful for tests. class SafeBrowsingBlockingPageFactory { public: - ~SafeBrowsingBlockingPageFactory() { } - virtual SafeBrowsingBlockingPage* CreateSafeBrowsingPage( SafeBrowsingService* service, TabContents* tab_contents, const SafeBrowsingBlockingPage::UnsafeResourceList& unsafe_resources) = 0; + protected: + ~SafeBrowsingBlockingPageFactory() {} }; #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_BLOCKING_PAGE_H_ diff --git a/chrome/browser/search_engines/edit_search_engine_controller.h b/chrome/browser/search_engines/edit_search_engine_controller.h index 6333dbf..40bba57 100644 --- a/chrome/browser/search_engines/edit_search_engine_controller.h +++ b/chrome/browser/search_engines/edit_search_engine_controller.h @@ -23,6 +23,8 @@ class EditSearchEngineControllerDelegate { const std::wstring& title, const std::wstring& keyword, const std::wstring& url) = 0; + protected: + ~EditSearchEngineControllerDelegate() {} }; // EditSearchEngineController provides the core platform independent logic diff --git a/chrome/browser/search_engines/template_url_model.h b/chrome/browser/search_engines/template_url_model.h index c0e169b..f584580 100644 --- a/chrome/browser/search_engines/template_url_model.h +++ b/chrome/browser/search_engines/template_url_model.h @@ -1,9 +1,9 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_TEMPLATE_URL_MODEL_H__ -#define CHROME_BROWSER_TEMPLATE_URL_MODEL_H__ +#ifndef CHROME_BROWSER_TEMPLATE_URL_MODEL_H_ +#define CHROME_BROWSER_TEMPLATE_URL_MODEL_H_ #include <map> #include <string> @@ -48,6 +48,8 @@ class TemplateURLModelObserver { public: // Notification that the template url model has changed in some way. virtual void OnTemplateURLModelChanged() = 0; + protected: + ~TemplateURLModelObserver() {} }; class TemplateURLModel : public WebDataServiceConsumer, @@ -351,4 +353,4 @@ class TemplateURLModel : public WebDataServiceConsumer, DISALLOW_EVIL_CONSTRUCTORS(TemplateURLModel); }; -#endif // CHROME_BROWSER_TEMPLATE_URL_MODEL_H__ +#endif // CHROME_BROWSER_TEMPLATE_URL_MODEL_H_ diff --git a/chrome/browser/search_engines/template_url_parser.h b/chrome/browser/search_engines/template_url_parser.h index 65a4881..dfb139c 100644 --- a/chrome/browser/search_engines/template_url_parser.h +++ b/chrome/browser/search_engines/template_url_parser.h @@ -1,9 +1,9 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_TEMPLATE_URL_PARSER_H__ -#define CHROME_BROWSER_TEMPLATE_URL_PARSER_H__ +#ifndef CHROME_BROWSER_TEMPLATE_URL_PARSER_H_ +#define CHROME_BROWSER_TEMPLATE_URL_PARSER_H_ #include <string> @@ -21,6 +21,8 @@ class TemplateURLParser { // methods returns false, the parameter is not included. virtual bool KeepParameter(const std::string& key, const std::string& value) = 0; + protected: + ~ParameterFilter() {} }; // Decodes the chunk of data representing a TemplateURL. If data does // not describe a valid TemplateURL false is returned. Additionally, if the @@ -44,4 +46,4 @@ class TemplateURLParser { DISALLOW_EVIL_CONSTRUCTORS(TemplateURLParser); }; -#endif // CHROME_BROWSER_TEMPLATE_URL_PARSER_H__ +#endif // CHROME_BROWSER_TEMPLATE_URL_PARSER_H_ diff --git a/chrome/browser/sessions/tab_restore_service.h b/chrome/browser/sessions/tab_restore_service.h index a3e611c..5e980e4 100644 --- a/chrome/browser/sessions/tab_restore_service.h +++ b/chrome/browser/sessions/tab_restore_service.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -41,6 +41,9 @@ class TabRestoreService : public BaseSessionService { // Sent to all remaining Observers when TabRestoreService's // destructor is run. virtual void TabRestoreServiceDestroyed(TabRestoreService* service) = 0; + + protected: + ~Observer() {} }; // Interface used to allow the test to provide a custom time. diff --git a/chrome/browser/shell_dialogs.h b/chrome/browser/shell_dialogs.h index f9a3baa..5098fb4 100644 --- a/chrome/browser/shell_dialogs.h +++ b/chrome/browser/shell_dialogs.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -27,6 +27,9 @@ class BaseShellDialog { // Notifies the dialog box that the listener has been destroyed and it should // no longer be sent notifications. virtual void ListenerDestroyed() = 0; + + protected: + ~BaseShellDialog() {} }; // Shows a dialog box for selecting a file or a folder. @@ -64,6 +67,9 @@ class SelectFileDialog // the user canceling or closing the selection dialog box, for example). // |params| is contextual passed to SelectFile. virtual void FileSelectionCanceled(void* params) {}; + + protected: + ~Listener() {}; }; // Creates a dialog box helper. This object is ref-counted, but the returned @@ -140,6 +146,8 @@ class SelectFontDialog // canceling or closing the selection dialog box, for example). |params| is // contextual passed to SelectFile. virtual void FontSelectionCanceled(void* params) {}; + protected: + ~Listener() {}; }; // Creates a dialog box helper. This object is ref-counted, but the returned diff --git a/chrome/browser/spellchecker.cc b/chrome/browser/spellchecker.cc index b8bcc7f..b6a990b 100644 --- a/chrome/browser/spellchecker.cc +++ b/chrome/browser/spellchecker.cc @@ -547,7 +547,7 @@ void SpellChecker::GetAutoCorrectionWord(const std::wstring& word, const wchar_t* word_char = word.c_str(); for (int i = 0; i <= kMaxAutoCorrectWordSize; i++) { if (i >= word_length) - misspelled_word[i] = NULL; + misspelled_word[i] = 0; else misspelled_word[i] = word_char[i]; } diff --git a/chrome/browser/ssl/ssl_blocking_page.h b/chrome/browser/ssl/ssl_blocking_page.h index b83e16a..3156bfc 100644 --- a/chrome/browser/ssl/ssl_blocking_page.h +++ b/chrome/browser/ssl/ssl_blocking_page.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -31,6 +31,9 @@ class SSLBlockingPage : public InterstitialPage { // Notification that the user chose to accept the certificate. virtual void OnAllowCertificate(SSLCertErrorHandler* handler) = 0; + + protected: + ~Delegate() {} }; SSLBlockingPage(SSLCertErrorHandler* handler, Delegate* delegate); diff --git a/chrome/browser/ssl/ssl_policy.h b/chrome/browser/ssl/ssl_policy.h index 48a5f0d..ebabd3b 100644 --- a/chrome/browser/ssl/ssl_policy.h +++ b/chrome/browser/ssl/ssl_policy.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -26,6 +26,7 @@ class SSLRequestInfo; class SSLPolicy : public SSLBlockingPage::Delegate { public: explicit SSLPolicy(SSLPolicyBackend* backend); + virtual ~SSLPolicy() {} // An error occurred with the certificate in an SSL connection. void OnCertError(SSLCertErrorHandler* handler); diff --git a/chrome/browser/tab_contents/constrained_window.h b/chrome/browser/tab_contents/constrained_window.h index a1b8c2a..8719e65 100644 --- a/chrome/browser/tab_contents/constrained_window.h +++ b/chrome/browser/tab_contents/constrained_window.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -42,6 +42,8 @@ class ConstrainedWindow { // Closes the Constrained Window. virtual void CloseConstrainedWindow() = 0; + protected: + ~ConstrainedWindow() {} }; #endif // CHROME_BROWSER_TAB_CONTENTS_CONSTRAINED_WINDOW_H_ diff --git a/chrome/browser/tab_contents/page_navigator.h b/chrome/browser/tab_contents/page_navigator.h index 7d203e3..328971a 100644 --- a/chrome/browser/tab_contents/page_navigator.h +++ b/chrome/browser/tab_contents/page_navigator.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -21,6 +21,8 @@ class PageNavigator { virtual void OpenURL(const GURL& url, const GURL& referrer, WindowOpenDisposition disposition, PageTransition::Type transition) = 0; + protected: + ~PageNavigator() {} }; #endif // CHROME_BROWSER_TAB_CONTENTS_PAGE_NAVIGATOR_H_ diff --git a/chrome/browser/tab_contents/render_view_host_delegate_helper.h b/chrome/browser/tab_contents/render_view_host_delegate_helper.h index 4f9e600..641ca5e 100644 --- a/chrome/browser/tab_contents/render_view_host_delegate_helper.h +++ b/chrome/browser/tab_contents/render_view_host_delegate_helper.h @@ -28,6 +28,7 @@ class TabContents; class RenderViewHostDelegateViewHelper { public: RenderViewHostDelegateViewHelper() {} + virtual ~RenderViewHostDelegateViewHelper() {} virtual void CreateNewWindow(int route_id, base::WaitableEvent* modal_dialog_event, diff --git a/chrome/browser/tab_contents/render_view_host_manager.h b/chrome/browser/tab_contents/render_view_host_manager.h index 8c8dde2..874febd 100644 --- a/chrome/browser/tab_contents/render_view_host_manager.h +++ b/chrome/browser/tab_contents/render_view_host_manager.h @@ -59,6 +59,9 @@ class RenderViewHostManager // is none. virtual NavigationEntry* GetLastCommittedNavigationEntryForRenderManager() = 0; + + protected: + ~Delegate() {} }; // Both delegate pointers must be non-NULL and are not owned by this class. diff --git a/chrome/browser/tab_contents/web_contents_unittest.cc b/chrome/browser/tab_contents/web_contents_unittest.cc index 47426c4..fac89e0 100644 --- a/chrome/browser/tab_contents/web_contents_unittest.cc +++ b/chrome/browser/tab_contents/web_contents_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -41,7 +41,7 @@ static void InitNavigateParams(ViewHostMsg_FrameNavigate_Params* params, // Subclass the TestingProfile so that it can return certain services we need. class TabContentsTestingProfile : public TestingProfile { public: - TabContentsTestingProfile() : TestingProfile() { } + TabContentsTestingProfile() : TestingProfile() {} virtual PrefService* GetPrefs() { if (!prefs_.get()) { @@ -70,6 +70,8 @@ class TestInterstitialPage : public InterstitialPage { public: virtual void TestInterstitialPageDeleted( TestInterstitialPage* interstitial) = 0; + protected: + ~Delegate() {} }; // IMPORTANT NOTE: if you pass stack allocated values for |state| and diff --git a/chrome/browser/tabs/tab_strip_model.h b/chrome/browser/tabs/tab_strip_model.h index 4f1d44b..e776d6c 100644 --- a/chrome/browser/tabs/tab_strip_model.h +++ b/chrome/browser/tabs/tab_strip_model.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -47,21 +47,21 @@ class TabStripModelObserver { // (selected). virtual void TabInsertedAt(TabContents* contents, int index, - bool foreground) { } + bool foreground) {} // The specified TabContents at |index| is being closed (and eventually // destroyed). - virtual void TabClosingAt(TabContents* contents, int index) { } + virtual void TabClosingAt(TabContents* contents, int index) {} // The specified TabContents at |index| is being detached, perhaps to be // inserted in another TabStripModel. The implementer should take whatever // action is necessary to deal with the TabContents no longer being present. - virtual void TabDetachedAt(TabContents* contents, int index) { } + virtual void TabDetachedAt(TabContents* contents, int index) {} // The selected TabContents is about to change from |old_contents| at |index|. // This gives observers a chance to prepare for an impending switch before it // happens. - virtual void TabDeselectedAt(TabContents* contents, int index) { } + virtual void TabDeselectedAt(TabContents* contents, int index) {} // The selected TabContents changed from |old_contents| to |new_contents| at // |index|. |user_gesture| specifies whether or not this was done by a user @@ -70,14 +70,14 @@ class TabStripModelObserver { virtual void TabSelectedAt(TabContents* old_contents, TabContents* new_contents, int index, - bool user_gesture) { } + bool user_gesture) {} // The specified TabContents at |from_index| was moved to |to_index|. If // the pinned state of the tab is changing |pinned_state_changed| is true. virtual void TabMoved(TabContents* contents, int from_index, int to_index, - bool pinned_state_changed) { } + bool pinned_state_changed) {} // The specified TabContents at |index| changed in some way. |contents| may // be an entirely different object and the old value is no longer available @@ -92,18 +92,21 @@ class TabStripModelObserver { // without updating the title (which may be an ugly URL if the real title // hasn't come in yet). virtual void TabChangedAt(TabContents* contents, int index, - bool loading_only) { } + bool loading_only) {} // Invoked when the pinned state of a tab changes. // NOTE: this is only invoked if the tab doesn't move as a result of its // pinned state changing. If the tab moves as a result, the observer is // notified by way of the TabMoved method with |pinned_state_changed| true. - virtual void TabPinnedStateChanged(TabContents* contents, int index) { } + virtual void TabPinnedStateChanged(TabContents* contents, int index) {} // The TabStripModel now no longer has any "significant" (user created or // user manipulated) tabs. The implementer may use this as a trigger to try // and close the window containing the TabStripModel, for example... - virtual void TabStripEmpty() { } + virtual void TabStripEmpty() {} + + protected: + ~TabStripModelObserver() {} }; /////////////////////////////////////////////////////////////////////////////// @@ -199,6 +202,9 @@ class TabStripModelDelegate { // Returns whether some contents can be closed. virtual bool CanCloseContentsAt(int index) = 0; + + protected: + ~TabStripModelDelegate() {} }; //////////////////////////////////////////////////////////////////////////////// diff --git a/chrome/browser/webdata/web_data_service.h b/chrome/browser/webdata/web_data_service.h index f15911b..2c008c3 100644 --- a/chrome/browser/webdata/web_data_service.h +++ b/chrome/browser/webdata/web_data_service.h @@ -1,9 +1,9 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__ -#define CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__ +#ifndef CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H_ +#define CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H_ #include <map> #include <vector> @@ -240,7 +240,7 @@ class WebDataService : public base::RefCountedThreadSafe<WebDataService> { arg2_(arg2) { } - virtual ~GenericRequest2() { } + virtual ~GenericRequest2() {} T GetArgument1() { return arg1_; @@ -539,6 +539,9 @@ class WebDataServiceConsumer { // not be opened. The result object is destroyed after this call. virtual void OnWebDataServiceRequestDone(WebDataService::Handle h, const WDTypedResult* result) = 0; + + protected: + ~WebDataServiceConsumer() {} }; -#endif // CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__ +#endif // CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H_ diff --git a/chrome/common/child_process_host.cc b/chrome/common/child_process_host.cc index cf67d15..0cc76fa 100644 --- a/chrome/common/child_process_host.cc +++ b/chrome/common/child_process_host.cc @@ -206,7 +206,7 @@ void ChildProcessHost::OnChildDied() { // On POSIX, once we've called DidProcessCrash, handle() is no longer // valid. Ensure the destructor doesn't try to use it. - set_handle(NULL); + set_handle(0); delete this; } diff --git a/chrome/common/extensions/extension_unittest.cc b/chrome/common/extensions/extension_unittest.cc index fb40330..09b320b 100644 --- a/chrome/common/extensions/extension_unittest.cc +++ b/chrome/common/extensions/extension_unittest.cc @@ -293,7 +293,7 @@ TEST(ExtensionTest, LoadPageActionHelper) { DictionaryValue input; // First try with an empty dictionary. We should get nothing back. - ASSERT_EQ(NULL, extension.LoadPageActionHelper(&input, 0, &error_msg)); + ASSERT_TRUE(NULL == extension.LoadPageActionHelper(&input, 0, &error_msg)); ASSERT_STRNE("", error_msg.c_str()); error_msg = ""; diff --git a/chrome/common/gtk_tree.h b/chrome/common/gtk_tree.h index 8caa64c..4e74efa 100644 --- a/chrome/common/gtk_tree.h +++ b/chrome/common/gtk_tree.h @@ -43,6 +43,9 @@ class ModelAdapter : public TableModelObserver { // after clearing the list store. Can be overriden by the delegate if it // needs to do extra initialization before the list store is populated. virtual void OnModelChanged() {} + + protected: + ~Delegate() {} }; // |table_model| may be NULL. diff --git a/chrome/common/property_bag_unittest.cc b/chrome/common/property_bag_unittest.cc index 51db07c..6dca90c 100644 --- a/chrome/common/property_bag_unittest.cc +++ b/chrome/common/property_bag_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -10,7 +10,7 @@ TEST(PropertyBagTest, AddQueryRemove) { PropertyAccessor<int> adaptor; // Should be no match initially. - EXPECT_EQ(NULL, adaptor.GetProperty(&bag)); + EXPECT_TRUE(NULL == adaptor.GetProperty(&bag)); // Add the value and make sure we get it back. const int kFirstValue = 1; @@ -26,7 +26,7 @@ TEST(PropertyBagTest, AddQueryRemove) { // Remove the value and make sure it's gone. adaptor.DeleteProperty(&bag); - EXPECT_EQ(NULL, adaptor.GetProperty(&bag)); + EXPECT_TRUE(NULL == adaptor.GetProperty(&bag)); } TEST(PropertyBagTest, Copy) { @@ -57,6 +57,6 @@ TEST(PropertyBagTest, Copy) { // Clear it out, neither property should be left. copy = PropertyBag(); - EXPECT_EQ(NULL, adaptor1.GetProperty(©)); - EXPECT_EQ(NULL, adaptor2.GetProperty(©)); + EXPECT_TRUE(NULL == adaptor1.GetProperty(©)); + EXPECT_TRUE(NULL == adaptor2.GetProperty(©)); } diff --git a/chrome/common/temp_scaffolding_stubs.h b/chrome/common/temp_scaffolding_stubs.h index 47e0e86..0506afc 100644 --- a/chrome/common/temp_scaffolding_stubs.h +++ b/chrome/common/temp_scaffolding_stubs.h @@ -64,9 +64,9 @@ namespace printing { class PrintViewManager : public RenderViewHostDelegate::Printing { public: - PrintViewManager(TabContents&) { } + PrintViewManager(TabContents&) {} void Stop() { NOTIMPLEMENTED(); } - void Destroy() { } + void Destroy() {} bool OnRenderViewGone(RenderViewHost*) { NOTIMPLEMENTED(); return true; // Assume for now that all renderer crashes are important. @@ -115,7 +115,7 @@ class PrinterQuery : public base::RefCountedThreadSafe<PrinterQuery> { class PrintJobManager { public: - void OnQuit() { } + void OnQuit() {} void PopPrinterQuery(int document_cookie, scoped_refptr<PrinterQuery>* job) { NOTIMPLEMENTED(); } @@ -150,8 +150,9 @@ class DockInfo { class RepostFormWarningDialog { public: - static void RunRepostFormWarningDialog(NavigationController*) { } - virtual ~RepostFormWarningDialog() { } + static void RunRepostFormWarningDialog(NavigationController*) {} + protected: + ~RepostFormWarningDialog() {} }; class BaseDragSource { diff --git a/chrome/common/worker_thread_ticker.h b/chrome/common/worker_thread_ticker.h index bbc5380..ceb2903 100644 --- a/chrome/common/worker_thread_ticker.h +++ b/chrome/common/worker_thread_ticker.h @@ -1,9 +1,9 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_COMMON_WORKER_THREAD_TICKER_H__ -#define CHROME_COMMON_WORKER_THREAD_TICKER_H__ +#ifndef CHROME_COMMON_WORKER_THREAD_TICKER_H_ +#define CHROME_COMMON_WORKER_THREAD_TICKER_H_ #include <vector> @@ -24,6 +24,9 @@ class WorkerThreadTicker { public: // Gets invoked when the timer period is up virtual void OnTick() = 0; + + protected: + ~Callback() {} }; // tick_interval is the periodic interval in which to invoke the @@ -84,4 +87,4 @@ class WorkerThreadTicker { DISALLOW_COPY_AND_ASSIGN(WorkerThreadTicker); }; -#endif // CHROME_COMMON_WORKER_THREAD_TICKER_H__ +#endif // CHROME_COMMON_WORKER_THREAD_TICKER_H_ diff --git a/chrome/common/x11_util.h b/chrome/common/x11_util.h index 09b1c2b..abe9f32e 100644 --- a/chrome/common/x11_util.h +++ b/chrome/common/x11_util.h @@ -74,6 +74,9 @@ class EnumerateWindowsDelegate { // |xid| is the X Window ID of the enumerated window. Return true to stop // further iteration. virtual bool ShouldStopIterating(XID xid) = 0; + + protected: + ~EnumerateWindowsDelegate() {} }; // Enumerates all windows in the current display. Will recurse into child diff --git a/chrome/plugin/webplugin_delegate_stub.cc b/chrome/plugin/webplugin_delegate_stub.cc index 9b33329..b659a5c 100644 --- a/chrome/plugin/webplugin_delegate_stub.cc +++ b/chrome/plugin/webplugin_delegate_stub.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -141,7 +141,7 @@ void WebPluginDelegateStub::OnInit(const PluginMsg_Init_Params& params, command_line.GetSwitchValue(switches::kPluginPath)); - gfx::PluginWindowHandle parent = NULL; + gfx::PluginWindowHandle parent = 0; #if defined(OS_WIN) parent = gfx::NativeViewFromId(params.containing_window); #elif defined(OS_LINUX) diff --git a/chrome/renderer/audio_message_filter.h b/chrome/renderer/audio_message_filter.h index 04ff699..3052330 100644 --- a/chrome/renderer/audio_message_filter.h +++ b/chrome/renderer/audio_message_filter.h @@ -32,6 +32,9 @@ class AudioMessageFilter : public IPC::ChannelProxy::MessageFilter { // Called when notification of stream volume is received from the browser // process. virtual void OnVolume(double left, double right) = 0; + + protected: + ~Delegate() {} }; AudioMessageFilter(int32 route_id); diff --git a/chrome/renderer/print_web_view_helper_linux.cc b/chrome/renderer/print_web_view_helper_linux.cc index 0fb7ffc..fef1eb6 100644 --- a/chrome/renderer/print_web_view_helper_linux.cc +++ b/chrome/renderer/print_web_view_helper_linux.cc @@ -26,15 +26,15 @@ void PrintWebViewHelper::Print(WebFrame* frame, bool script_initiated) { // Top = 0.25 in. // Bottom = 0.56 in. const int kDPI = 72; - const int kWidth = (8.5-0.25-0.25) * kDPI; - const int kHeight = (11-0.25-0.56) * kDPI; + const int kWidth = static_cast<int>((8.5-0.25-0.25) * kDPI); + const int kHeight = static_cast<int>((11-0.25-0.56) * kDPI); ViewMsg_Print_Params default_settings; default_settings.printable_size = gfx::Size(kWidth, kHeight); default_settings.dpi = kDPI; default_settings.min_shrink = 1.25; default_settings.max_shrink = 2.0; default_settings.desired_dpi = kDPI; - default_settings.document_cookie = NULL; + default_settings.document_cookie = 0; default_settings.selection_only = false; // Calculate the estimated page count. diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 48caa47..b7e17b6 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -1884,7 +1884,7 @@ WebView* RenderView::CreateWebView(WebView* webview, (true, false); #endif RenderView* view = RenderView::Create(render_thread_, - NULL, waitable_event, routing_id_, + 0, waitable_event, routing_id_, renderer_preferences_, webkit_preferences_, shared_popup_counter_, routing_id); diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc index 6a6c0a4..1212e07 100644 --- a/chrome/renderer/render_widget.cc +++ b/chrome/renderer/render_widget.cc @@ -46,7 +46,7 @@ RenderWidget::RenderWidget(RenderThreadBase* render_thread, bool activatable) webwidget_(NULL), opener_id_(MSG_ROUTING_NONE), render_thread_(render_thread), - host_window_(NULL), + host_window_(0), current_paint_buf_(NULL), current_scroll_buf_(NULL), next_paint_flags_(0), diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc index c72c654..e180328 100644 --- a/chrome/renderer/webplugin_delegate_proxy.cc +++ b/chrome/renderer/webplugin_delegate_proxy.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -63,7 +63,7 @@ class ResourceClientProxy : public WebPluginResourceClient { public: ResourceClientProxy(PluginChannelHost* channel, int instance_id) : channel_(channel), instance_id_(instance_id), resource_id_(0), - notify_needed_(false), notify_data_(NULL), + notify_needed_(false), notify_data_(0), multibyte_response_expected_(false) { } @@ -172,7 +172,7 @@ WebPluginDelegateProxy::WebPluginDelegateProxy(const std::string& mime_type, : render_view_(render_view), plugin_(NULL), windowless_(false), - window_(NULL), + window_(0), mime_type_(mime_type), clsid_(clsid), npobject_(NULL), @@ -666,8 +666,8 @@ bool WebPluginDelegateProxy::BackgroundChanged( #else const unsigned char* page_bytes = cairo_image_surface_get_data(page_surface); int page_stride = cairo_image_surface_get_stride(page_surface); - int page_start_x = page_x_double; - int page_start_y = page_y_double; + int page_start_x = static_cast<int>(page_x_double); + int page_start_y = static_cast<int>(page_y_double); skia::PlatformDevice& device = background_store_canvas_->getTopPlatformDevice(); @@ -797,7 +797,7 @@ void WebPluginDelegateProxy::OnSetWindow(gfx::PluginWindowHandle window) { void WebPluginDelegateProxy::WillDestroyWindow() { DCHECK(window_); plugin_->WillDestroyWindow(window_); - window_ = NULL; + window_ = 0; } #if defined(OS_WIN) diff --git a/chrome/test/automation/tab_proxy.h b/chrome/test/automation/tab_proxy.h index c8bb83e..b3beee3 100644 --- a/chrome/test/automation/tab_proxy.h +++ b/chrome/test/automation/tab_proxy.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -35,6 +35,8 @@ class TabProxy : public AutomationResourceProxy { class TabProxyDelegate { public: virtual void OnMessageReceived(TabProxy* tab, const IPC::Message& msg) {} + protected: + ~TabProxyDelegate() {} }; TabProxy(AutomationMessageSender* sender, diff --git a/chrome/test/browser/browser_test_runner.h b/chrome/test/browser/browser_test_runner.h index cbc0ddf..0127f99 100644 --- a/chrome/test/browser/browser_test_runner.h +++ b/chrome/test/browser/browser_test_runner.h @@ -44,6 +44,8 @@ class BrowserTestRunner { class BrowserTestRunnerFactory { public: virtual BrowserTestRunner* CreateBrowserTestRunner() const = 0; + protected: + ~BrowserTestRunnerFactory() {} }; } // namespace diff --git a/chrome/test/render_view_test.cc b/chrome/test/render_view_test.cc index cf3a90b..11de14c3 100644 --- a/chrome/test/render_view_test.cc +++ b/chrome/test/render_view_test.cc @@ -91,7 +91,7 @@ void RenderViewTest::SetUp() { render_thread_.set_routing_id(kRouteId); // This needs to pass the mock render thread to the view. - view_ = RenderView::Create(&render_thread_, NULL, NULL, kOpenerId, + view_ = RenderView::Create(&render_thread_, 0, NULL, kOpenerId, RendererPreferences(), WebPreferences(), new SharedRenderViewCounter(0), kRouteId); diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc index 51eb703..b5e66c6 100644 --- a/chrome/test/ui/ui_test.cc +++ b/chrome/test/ui/ui_test.cc @@ -523,7 +523,7 @@ void UITest::QuitBrowser() { // Don't forget to close the handle base::CloseProcessHandle(process_); - process_ = NULL; + process_ = 0; } void UITest::AssertAppNotRunning(const std::wstring& error_message) { diff --git a/ipc/ipc_logging.h b/ipc/ipc_logging.h index 364ad79..7bbf18c 100644 --- a/ipc/ipc_logging.h +++ b/ipc/ipc_logging.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -30,6 +30,8 @@ class Logging : public base::WaitableEventWatcher::Delegate, class Consumer { public: virtual void Log(const LogData& data) = 0; + protected: + ~Consumer() {} }; void SetConsumer(Consumer* consumer); diff --git a/ipc/ipc_sync_channel.h b/ipc/ipc_sync_channel.h index bfc9eac..741959f 100644 --- a/ipc/ipc_sync_channel.h +++ b/ipc/ipc_sync_channel.h @@ -1,9 +1,9 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef IPC_IPC_SYNC_SENDER_H__ -#define IPC_IPC_SYNC_SENDER_H__ +#ifndef IPC_IPC_SYNC_SENDER_H_ +#define IPC_IPC_SYNC_SENDER_H_ #include <string> #include <deque> @@ -154,9 +154,9 @@ class SyncChannel : public ChannelProxy, base::WaitableEventWatcher send_done_watcher_; base::WaitableEventWatcher dispatch_watcher_; - DISALLOW_EVIL_CONSTRUCTORS(SyncChannel); + DISALLOW_COPY_AND_ASSIGN(SyncChannel); }; } // namespace IPC -#endif // IPC_IPC_SYNC_SENDER_H__ +#endif // IPC_IPC_SYNC_SENDER_H_ diff --git a/ipc/ipc_sync_message.h b/ipc/ipc_sync_message.h index 5d072a7..092fda2 100644 --- a/ipc/ipc_sync_message.h +++ b/ipc/ipc_sync_message.h @@ -1,9 +1,9 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef IPC_IPC_SYNC_MESSAGE_H__ -#define IPC_IPC_SYNC_MESSAGE_H__ +#ifndef IPC_IPC_SYNC_MESSAGE_H_ +#define IPC_IPC_SYNC_MESSAGE_H_ #if defined(OS_WIN) #include <windows.h> @@ -84,6 +84,7 @@ class SyncMessage : public Message { // Used to deserialize parameters from a reply to a synchronous message class MessageReplyDeserializer { public: + virtual ~MessageReplyDeserializer() {} bool SerializeOutputParameters(const Message& msg); private: // Derived classes need to implement this, using the given iterator (which @@ -93,4 +94,4 @@ class MessageReplyDeserializer { } // namespace IPC -#endif // IPC_IPC_SYNC_MESSAGE_H__ +#endif // IPC_IPC_SYNC_MESSAGE_H_ diff --git a/media/audio/linux/alsa_output_unittest.cc b/media/audio/linux/alsa_output_unittest.cc index d13da89..343344b 100644 --- a/media/audio/linux/alsa_output_unittest.cc +++ b/media/audio/linux/alsa_output_unittest.cc @@ -215,7 +215,7 @@ TEST_F(AlsaPcmOutputStreamTest, OpenClose) { test_stream_->Close(); message_loop_.RunAllPending(); - EXPECT_EQ(NULL, test_stream_->playback_handle_); + EXPECT_TRUE(NULL == test_stream_->playback_handle_); EXPECT_FALSE(test_stream_->packet_.get()); EXPECT_TRUE(test_stream_->stop_stream_); } diff --git a/media/base/clock.h b/media/base/clock.h index 93af4a9..40b0b81 100644 --- a/media/base/clock.h +++ b/media/base/clock.h @@ -40,6 +40,9 @@ class Clock { // Returns the current elapsed media time. virtual base::TimeDelta Elapsed() const = 0; + + protected: + ~Clock() {} }; } // namespace media diff --git a/media/filters/ffmpeg_demuxer_unittest.cc b/media/filters/ffmpeg_demuxer_unittest.cc index 078f54b..a31f9ab 100644 --- a/media/filters/ffmpeg_demuxer_unittest.cc +++ b/media/filters/ffmpeg_demuxer_unittest.cc @@ -396,7 +396,7 @@ TEST_F(FFmpegDemuxerTest, Read) { EXPECT_TRUE(reader->called()); ASSERT_TRUE(reader->buffer()); EXPECT_TRUE(reader->buffer()->IsEndOfStream()); - EXPECT_EQ(NULL, reader->buffer()->GetData()); + EXPECT_TRUE(NULL == reader->buffer()->GetData()); EXPECT_EQ(0u, reader->buffer()->GetDataSize()); // Manually release buffer, which should release any remaining AVPackets. @@ -410,7 +410,7 @@ TEST_F(FFmpegDemuxerTest, Read) { EXPECT_TRUE(reader->called()); ASSERT_TRUE(reader->buffer()); EXPECT_TRUE(reader->buffer()->IsEndOfStream()); - EXPECT_EQ(NULL, reader->buffer()->GetData()); + EXPECT_TRUE(NULL == reader->buffer()->GetData()); EXPECT_EQ(0u, reader->buffer()->GetDataSize()); // Manually release buffer, which should release any remaining AVPackets. diff --git a/media/filters/null_audio_renderer.cc b/media/filters/null_audio_renderer.cc index d977b08..43d5b29 100644 --- a/media/filters/null_audio_renderer.cc +++ b/media/filters/null_audio_renderer.cc @@ -18,7 +18,7 @@ NullAudioRenderer::NullAudioRenderer() : AudioRendererBase(), bytes_per_millisecond_(0), buffer_size_(0), - thread_(NULL), + thread_(0), shutdown_(false) { } @@ -89,7 +89,7 @@ void NullAudioRenderer::OnStop() { shutdown_ = true; if (thread_) { PlatformThread::Join(thread_); - thread_ = NULL; + thread_ = 0; } } diff --git a/media/filters/video_renderer_base.cc b/media/filters/video_renderer_base.cc index 5a320c9..1539490 100644 --- a/media/filters/video_renderer_base.cc +++ b/media/filters/video_renderer_base.cc @@ -39,7 +39,7 @@ VideoRendererBase::VideoRendererBase() height_(0), frame_available_(&lock_), state_(kUninitialized), - thread_(NULL), + thread_(0), pending_reads_(0), playback_rate_(0) { } @@ -105,7 +105,7 @@ void VideoRendererBase::Stop() { AutoUnlock auto_unlock(lock_); PlatformThread::Join(thread_); } - thread_ = NULL; + thread_ = 0; } } diff --git a/net/base/directory_lister.cc b/net/base/directory_lister.cc index 616fc82..69e301e 100644 --- a/net/base/directory_lister.cc +++ b/net/base/directory_lister.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -37,7 +37,7 @@ DirectoryLister::DirectoryLister(const FilePath& dir, : dir_(dir), delegate_(delegate), message_loop_(NULL), - thread_(NULL), + thread_(0), canceled_(false) { DCHECK(!dir.value().empty()); } @@ -70,7 +70,7 @@ void DirectoryLister::Cancel() { if (thread_) { PlatformThread::Join(thread_); - thread_ = NULL; + thread_ = 0; } } diff --git a/net/base/directory_lister.h b/net/base/directory_lister.h index cb98da6..58c2cd3 100644 --- a/net/base/directory_lister.h +++ b/net/base/directory_lister.h @@ -1,9 +1,9 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef NET_BASE_DIRECTORY_LISTER_H__ -#define NET_BASE_DIRECTORY_LISTER_H__ +#ifndef NET_BASE_DIRECTORY_LISTER_H_ +#define NET_BASE_DIRECTORY_LISTER_H_ #include <string> @@ -32,6 +32,9 @@ class DirectoryLister : public base::RefCountedThreadSafe<DirectoryLister>, virtual void OnListFile( const file_util::FileEnumerator::FindInfo& data) = 0; virtual void OnListDone(int error) = 0; + + protected: + ~DirectoryListerDelegate() {} }; DirectoryLister(const FilePath& dir, DirectoryListerDelegate* delegate); @@ -68,4 +71,4 @@ class DirectoryLister : public base::RefCountedThreadSafe<DirectoryLister>, } // namespace net -#endif // NET_BASE_DIRECTORY_LISTER_H__ +#endif // NET_BASE_DIRECTORY_LISTER_H_ diff --git a/net/base/host_cache_unittest.cc b/net/base/host_cache_unittest.cc index fe01e20..bfb1860 100644 --- a/net/base/host_cache_unittest.cc +++ b/net/base/host_cache_unittest.cc @@ -28,7 +28,7 @@ TEST(HostCacheTest, Basic) { EXPECT_EQ(0U, cache.size()); // Add an entry for "foobar.com" at t=0. - EXPECT_EQ(NULL, cache.Lookup("foobar.com", base::TimeTicks())); + EXPECT_TRUE(NULL == cache.Lookup("foobar.com", base::TimeTicks())); cache.Set("foobar.com", OK, AddressList(), now); entry1 = cache.Lookup("foobar.com", base::TimeTicks()); EXPECT_FALSE(NULL == entry1); @@ -38,7 +38,7 @@ TEST(HostCacheTest, Basic) { now += base::TimeDelta::FromSeconds(5); // Add an entry for "foobar2.com" at t=5. - EXPECT_EQ(NULL, cache.Lookup("foobar2.com", base::TimeTicks())); + EXPECT_TRUE(NULL == cache.Lookup("foobar2.com", base::TimeTicks())); cache.Set("foobar2.com", OK, AddressList(), now); entry2 = cache.Lookup("foobar2.com", base::TimeTicks()); EXPECT_FALSE(NULL == entry1); @@ -54,7 +54,7 @@ TEST(HostCacheTest, Basic) { // Advance to t=10; entry1 is now expired. now += base::TimeDelta::FromSeconds(1); - EXPECT_EQ(NULL, cache.Lookup("foobar.com", now)); + EXPECT_TRUE(NULL == cache.Lookup("foobar.com", now)); EXPECT_EQ(entry2, cache.Lookup("foobar2.com", now)); // Update entry1, so it is no longer expired. @@ -70,8 +70,8 @@ TEST(HostCacheTest, Basic) { // Advance to t=20; both entries are now expired. now += base::TimeDelta::FromSeconds(10); - EXPECT_EQ(NULL, cache.Lookup("foobar.com", now)); - EXPECT_EQ(NULL, cache.Lookup("foobar2.com", now)); + EXPECT_TRUE(NULL == cache.Lookup("foobar.com", now)); + EXPECT_TRUE(NULL == cache.Lookup("foobar2.com", now)); } // Try caching entries for a failed resolve attempt. @@ -81,19 +81,19 @@ TEST(HostCacheTest, NegativeEntry) { // Set t=0. base::TimeTicks now; - EXPECT_EQ(NULL, cache.Lookup("foobar.com", base::TimeTicks())); + EXPECT_TRUE(NULL == cache.Lookup("foobar.com", base::TimeTicks())); cache.Set("foobar.com", ERR_NAME_NOT_RESOLVED, AddressList(), now); EXPECT_EQ(1U, cache.size()); // We disallow use of negative entries. - EXPECT_EQ(NULL, cache.Lookup("foobar.com", now)); + EXPECT_TRUE(NULL == cache.Lookup("foobar.com", now)); // Now overwrite with a valid entry, and then overwrite with negative entry // again -- the valid entry should be kicked out. cache.Set("foobar.com", OK, AddressList(), now); EXPECT_FALSE(NULL == cache.Lookup("foobar.com", now)); cache.Set("foobar.com", ERR_NAME_NOT_RESOLVED, AddressList(), now); - EXPECT_EQ(NULL, cache.Lookup("foobar.com", now)); + EXPECT_TRUE(NULL == cache.Lookup("foobar.com", now)); } TEST(HostCacheTest, Compact) { @@ -185,7 +185,7 @@ TEST(HostCacheTest, SetWithCompact) { // Adding the fourth entry will cause "expired" to be evicted. cache.Set("host3", OK, AddressList(), now); EXPECT_EQ(3U, cache.size()); - EXPECT_EQ(NULL, cache.Lookup("expired", now)); + EXPECT_TRUE(NULL == cache.Lookup("expired", now)); EXPECT_FALSE(NULL == cache.Lookup("host1", now)); EXPECT_FALSE(NULL == cache.Lookup("host2", now)); EXPECT_FALSE(NULL == cache.Lookup("host3", now)); @@ -208,9 +208,9 @@ TEST(HostCacheTest, NoCache) { base::TimeTicks now; // Lookup and Set should have no effect. - EXPECT_EQ(NULL, cache.Lookup("foobar.com", base::TimeTicks())); + EXPECT_TRUE(NULL == cache.Lookup("foobar.com", base::TimeTicks())); cache.Set("foobar.com", OK, AddressList(), now); - EXPECT_EQ(NULL, cache.Lookup("foobar.com", base::TimeTicks())); + EXPECT_TRUE(NULL == cache.Lookup("foobar.com", base::TimeTicks())); EXPECT_EQ(0U, cache.size()); } diff --git a/net/base/ssl_client_auth_cache_unittest.cc b/net/base/ssl_client_auth_cache_unittest.cc index 33eb25f..c0697fc 100644 --- a/net/base/ssl_client_auth_cache_unittest.cc +++ b/net/base/ssl_client_auth_cache_unittest.cc @@ -28,7 +28,7 @@ TEST(SSLClientAuthCacheTest, LookupAddRemove) { new X509Certificate("foo3", "CA", start_date, expiration_date)); // Lookup non-existent client certificate. - EXPECT_EQ(NULL, cache.Lookup(server1)); + EXPECT_TRUE(NULL == cache.Lookup(server1)); // Add client certificate for server1. cache.Add(server1, cert1.get()); @@ -46,12 +46,12 @@ TEST(SSLClientAuthCacheTest, LookupAddRemove) { // Remove client certificate of server1. cache.Remove(server1); - EXPECT_EQ(NULL, cache.Lookup(server1)); + EXPECT_TRUE(NULL == cache.Lookup(server1)); EXPECT_EQ(cert2.get(), cache.Lookup(server2)); // Remove non-existent client certificate. cache.Remove(server1); - EXPECT_EQ(NULL, cache.Lookup(server1)); + EXPECT_TRUE(NULL == cache.Lookup(server1)); EXPECT_EQ(cert2.get(), cache.Lookup(server2)); } diff --git a/net/ftp/ftp_auth_cache_unittest.cc b/net/ftp/ftp_auth_cache_unittest.cc index f74762b..a4d8ef4 100644 --- a/net/ftp/ftp_auth_cache_unittest.cc +++ b/net/ftp/ftp_auth_cache_unittest.cc @@ -24,7 +24,7 @@ TEST(FtpAuthCacheTest, LookupAddRemove) { scoped_refptr<AuthData> data3(new AuthData()); // Lookup non-existent entry. - EXPECT_EQ(NULL, cache.Lookup(origin1)); + EXPECT_TRUE(NULL == cache.Lookup(origin1)); // Add entry for origin1. cache.Add(origin1, data1.get()); @@ -42,12 +42,12 @@ TEST(FtpAuthCacheTest, LookupAddRemove) { // Remove entry of origin1. cache.Remove(origin1); - EXPECT_EQ(NULL, cache.Lookup(origin1)); + EXPECT_TRUE(NULL == cache.Lookup(origin1)); EXPECT_EQ(data2.get(), cache.Lookup(origin2)); // Remove non-existent entry cache.Remove(origin1); - EXPECT_EQ(NULL, cache.Lookup(origin1)); + EXPECT_TRUE(NULL == cache.Lookup(origin1)); EXPECT_EQ(data2.get(), cache.Lookup(origin2)); } @@ -93,7 +93,7 @@ TEST(FtpAuthCacheTest, NormalizedKey) { // Remove cache.Remove(GURL("ftp://HOsT")); - EXPECT_EQ(NULL, cache.Lookup(GURL("ftp://host"))); + EXPECT_TRUE(NULL == cache.Lookup(GURL("ftp://host"))); } TEST(FtpAuthCacheTest, EvictOldEntries) { @@ -112,7 +112,7 @@ TEST(FtpAuthCacheTest, EvictOldEntries) { // Adding one entry should cause eviction of the first entry. cache.Add(GURL("ftp://last_host"), auth_data.get()); - EXPECT_EQ(NULL, cache.Lookup(GURL("ftp://host0"))); + EXPECT_TRUE(NULL == cache.Lookup(GURL("ftp://host0"))); // Remaining entries should not get evicted. for (size_t i = 1; i < FtpAuthCache::kMaxEntries; i++) { diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc index d63546d..b4d99d6 100644 --- a/net/http/http_network_transaction_unittest.cc +++ b/net/http/http_network_transaction_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -2639,19 +2639,19 @@ TEST_F(HttpNetworkTransactionTest, ResetStateForRestart) { trans->ResetStateForRestart(); // Verify that the state that needed to be reset, has been reset. - EXPECT_EQ(NULL, trans->header_buf_->headers()); + EXPECT_TRUE(NULL == trans->header_buf_->headers()); EXPECT_EQ(0, trans->header_buf_capacity_); EXPECT_EQ(0, trans->header_buf_len_); EXPECT_EQ(-1, trans->header_buf_body_offset_); EXPECT_EQ(-1, trans->header_buf_http_offset_); EXPECT_EQ(-1, trans->response_body_length_); EXPECT_EQ(0, trans->response_body_read_); - EXPECT_EQ(NULL, trans->read_buf_.get()); + EXPECT_TRUE(NULL == trans->read_buf_.get()); EXPECT_EQ(0, trans->read_buf_len_); EXPECT_EQ("", trans->request_headers_->headers_); EXPECT_EQ(0U, trans->request_headers_bytes_sent_); - EXPECT_EQ(NULL, trans->response_.auth_challenge.get()); - EXPECT_EQ(NULL, trans->response_.headers.get()); + EXPECT_TRUE(NULL == trans->response_.auth_challenge.get()); + EXPECT_TRUE(NULL == trans->response_.headers.get()); EXPECT_EQ(false, trans->response_.was_cached); EXPECT_EQ(0, trans->response_.ssl_info.cert_status); EXPECT_FALSE(trans->response_.vary_data.is_valid()); diff --git a/net/proxy/single_threaded_proxy_resolver_unittest.cc b/net/proxy/single_threaded_proxy_resolver_unittest.cc index da21ff1..0503a01 100644 --- a/net/proxy/single_threaded_proxy_resolver_unittest.cc +++ b/net/proxy/single_threaded_proxy_resolver_unittest.cc @@ -34,8 +34,8 @@ class MockProxyResolver : public ProxyResolver { CheckIsOnWorkerThread(); - EXPECT_EQ(NULL, callback); - EXPECT_EQ(NULL, request); + EXPECT_TRUE(NULL == callback); + EXPECT_TRUE(NULL == request); results->UseNamedProxy(query_url.host()); diff --git a/net/socket/client_socket_pool_base.h b/net/socket/client_socket_pool_base.h index e6368ca..9beac0a 100644 --- a/net/socket/client_socket_pool_base.h +++ b/net/socket/client_socket_pool_base.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // @@ -426,7 +426,7 @@ class ClientSocketPoolBase { max_sockets, max_sockets_per_group, new ConnectJobFactoryAdaptor(connect_job_factory))) {} - ~ClientSocketPoolBase() {} + virtual ~ClientSocketPoolBase() {} // These member functions simply forward to ClientSocketPoolBaseHelper. diff --git a/net/socket/client_socket_pool_base_unittest.cc b/net/socket/client_socket_pool_base_unittest.cc index fff6869..5f33197 100644 --- a/net/socket/client_socket_pool_base_unittest.cc +++ b/net/socket/client_socket_pool_base_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -327,9 +327,9 @@ class TestConnectJobDelegate : public ConnectJob::Delegate { result_ = result; scoped_ptr<ClientSocket> socket(job->ReleaseSocket()); if (result == OK) { - EXPECT_TRUE(socket.get() != NULL); + EXPECT_FALSE(socket.get() == NULL); } else { - EXPECT_EQ(NULL, socket.get()); + EXPECT_TRUE(socket.get() == NULL); } delete job; have_result_ = true; diff --git a/net/socket/ssl_test_util.cc b/net/socket/ssl_test_util.cc index 7e73f1e..e60cab9 100644 --- a/net/socket/ssl_test_util.cc +++ b/net/socket/ssl_test_util.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -136,7 +136,7 @@ const int TestServerLauncher::kBadHTTPSPort = 9666; // The issuer name of the cert that should be trusted for the test to work. const wchar_t TestServerLauncher::kCertIssuerName[] = L"Test CA"; -TestServerLauncher::TestServerLauncher() : process_handle_(NULL), +TestServerLauncher::TestServerLauncher() : process_handle_(0), forking_(false), connection_attempts_(10), connection_timeout_(1000) @@ -149,7 +149,7 @@ TestServerLauncher::TestServerLauncher() : process_handle_(NULL), TestServerLauncher::TestServerLauncher(int connection_attempts, int connection_timeout) - : process_handle_(NULL), + : process_handle_(0), forking_(false), connection_attempts_(connection_attempts), connection_timeout_(connection_timeout) @@ -331,7 +331,7 @@ bool TestServerLauncher::WaitToFinish(int timeout_ms) { bool ret = base::WaitForSingleProcess(process_handle_, timeout_ms); if (ret) { base::CloseProcessHandle(process_handle_); - process_handle_ = NULL; + process_handle_ = 0; LOG(INFO) << "Finished."; } else { LOG(INFO) << "Timed out."; @@ -346,7 +346,7 @@ bool TestServerLauncher::Stop() { bool ret = base::KillProcess(process_handle_, 1, true); if (ret) { base::CloseProcessHandle(process_handle_); - process_handle_ = NULL; + process_handle_ = 0; LOG(INFO) << "Stopped."; } else { LOG(INFO) << "Kill failed?"; diff --git a/net/tools/fetch/http_listen_socket.h b/net/tools/fetch/http_listen_socket.h index f31df20..81f0de0 100644 --- a/net/tools/fetch/http_listen_socket.h +++ b/net/tools/fetch/http_listen_socket.h @@ -17,8 +17,11 @@ class HttpListenSocket : public ListenSocket, public: class Delegate { public: - virtual void OnRequest(HttpListenSocket* connection, + virtual void OnRequest(HttpListenSocket* connection, HttpServerRequestInfo* info) = 0; + + protected: + ~Delegate() {} }; static HttpListenSocket* Listen(const std::string& ip, int port, diff --git a/net/url_request/url_request_unittest.h b/net/url_request/url_request_unittest.h index e058957..3c51571 100644 --- a/net/url_request/url_request_unittest.h +++ b/net/url_request/url_request_unittest.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -239,11 +239,13 @@ class TestDelegate : public URLRequest::Delegate { // that can provide various responses useful for testing. class BaseTestServer : public base::RefCounted<BaseTestServer> { protected: - BaseTestServer() { } + BaseTestServer() {} BaseTestServer(int connection_attempts, int connection_timeout) - : launcher_(connection_attempts, connection_timeout) { } + : launcher_(connection_attempts, connection_timeout) {} public: + virtual ~BaseTestServer() {} + void set_forking(bool forking) { launcher_.set_forking(forking); } diff --git a/views/accelerator.h b/views/accelerator.h index bb8f91f..2b62193 100644 --- a/views/accelerator.h +++ b/views/accelerator.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -36,7 +36,7 @@ class Accelerator { modifiers_ = accelerator.modifiers_; } - ~Accelerator() { }; + ~Accelerator() {}; Accelerator& operator=(const Accelerator& accelerator) { if (this != &accelerator) { @@ -95,6 +95,8 @@ class AcceleratorTarget { public: // This method should return true if the accelerator was processed. virtual bool AcceleratorPressed(const Accelerator& accelerator) = 0; + protected: + ~AcceleratorTarget() {} }; } diff --git a/views/controls/menu/simple_menu_model.h b/views/controls/menu/simple_menu_model.h index 2be2cbc..4671f3e 100644 --- a/views/controls/menu/simple_menu_model.h +++ b/views/controls/menu/simple_menu_model.h @@ -44,6 +44,9 @@ class SimpleMenuModel : public Menu2Model { // Performs the action associated with the specified command id. virtual void ExecuteCommand(int command_id) = 0; + + protected: + ~Delegate() {} }; // The Delegate can be NULL, though if it is items can't be checked or diff --git a/views/view.h b/views/view.h index 66ef76f..7742d03 100644 --- a/views/view.h +++ b/views/view.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -68,6 +68,9 @@ class ContextMenuController { int x, int y, bool is_mouse_gesture) = 0; + + protected: + ~ContextMenuController() {} }; // DragController is responsible for writing drag data for a view, as well as @@ -85,6 +88,9 @@ class DragController { // Returns the supported drag operations (see DragDropTypes for possible // values). A drag is only started if this returns a non-zero value. virtual int GetDragOperations(View* sender, int x, int y) = 0; + + protected: + ~DragController() {} }; diff --git a/webkit/api/public/linux/WebSandboxSupport.h b/webkit/api/public/linux/WebSandboxSupport.h index 4e20387..a8a5eaf 100644 --- a/webkit/api/public/linux/WebSandboxSupport.h +++ b/webkit/api/public/linux/WebSandboxSupport.h @@ -49,6 +49,9 @@ namespace WebKit { // Returns a string with the font family on an empty string if the // request cannot be satisfied. virtual WebString getFontFamilyForCharacters(const WebUChar* characters, size_t numCharacters) = 0; + + protected: + ~WebSandboxSupport() { } }; } // namespace WebKit diff --git a/webkit/glue/devtools/devtools_rpc.h b/webkit/glue/devtools/devtools_rpc.h index 072116e..84a2a7e 100644 --- a/webkit/glue/devtools/devtools_rpc.h +++ b/webkit/glue/devtools/devtools_rpc.h @@ -225,7 +225,7 @@ class Class {\ Class() { \ class_name = #Class; \ } \ - ~Class() {} \ + virtual ~Class() {} \ \ STRUCT( \ TOOLS_RPC_API_METHOD0, \ diff --git a/webkit/glue/webcursor_unittest.cc b/webkit/glue/webcursor_unittest.cc index 1a15bf8..51fd433 100644 --- a/webkit/glue/webcursor_unittest.cc +++ b/webkit/glue/webcursor_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -22,7 +22,7 @@ TEST(WebCursorTest, CursorSerialization) { ok_custom_pickle.WriteInt(4); ok_custom_pickle.WriteUInt32(0); // Custom Windows message. - ok_custom_pickle.WriteIntPtr(NULL); + ok_custom_pickle.WriteIntPtr(0); void* iter = NULL; EXPECT_TRUE(custom_cursor.Deserialize(&ok_custom_pickle, &iter)); @@ -39,7 +39,7 @@ TEST(WebCursorTest, CursorSerialization) { short_custom_pickle.WriteInt(3); short_custom_pickle.WriteUInt32(0); // Custom Windows message. - ok_custom_pickle.WriteIntPtr(NULL); + ok_custom_pickle.WriteIntPtr(0); iter = NULL; EXPECT_FALSE(custom_cursor.Deserialize(&short_custom_pickle, &iter)); @@ -58,7 +58,7 @@ TEST(WebCursorTest, CursorSerialization) { for (int i = 0; i < kTooBigSize; ++i) large_custom_pickle.WriteUInt32(0); // Custom Windows message. - ok_custom_pickle.WriteIntPtr(NULL); + ok_custom_pickle.WriteIntPtr(0); iter = NULL; EXPECT_FALSE(custom_cursor.Deserialize(&large_custom_pickle, &iter)); @@ -75,7 +75,7 @@ TEST(WebCursorTest, CursorSerialization) { neg_custom_pickle.WriteInt(4); neg_custom_pickle.WriteUInt32(0); // Custom Windows message. - neg_custom_pickle.WriteIntPtr(NULL); + neg_custom_pickle.WriteIntPtr(0); iter = NULL; EXPECT_FALSE(custom_cursor.Deserialize(&neg_custom_pickle, &iter)); } |