Skip to content

Commit

Permalink
Start deinlining non-empty virtual methods. (This will be automatical…
Browse files Browse the repository at this point in the history
…ly checked

for in the future.)

BUG=none
TEST=compiles

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68746 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
erg@google.com committed Dec 9, 2010
1 parent 57005ec commit 7cf4091
Show file tree
Hide file tree
Showing 80 changed files with 417 additions and 163 deletions.
8 changes: 8 additions & 0 deletions app/animation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ bool Animation::ShouldRenderRichAnimation() {
return true;
}

bool Animation::ShouldSendCanceledFromStop() {
return false;
}

void Animation::SetStartTime(base::TimeTicks start_time) {
start_time_ = start_time;
}

base::TimeDelta Animation::GetTimerInterval() const {
return timer_interval_;
}
4 changes: 2 additions & 2 deletions app/animation.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Animation : public AnimationContainerElement {
// Invoked from stop to determine if cancel should be invoked. If this returns
// true the delegate is notified the animation was canceled, otherwise the
// delegate is notified the animation stopped.
virtual bool ShouldSendCanceledFromStop() { return false; }
virtual bool ShouldSendCanceledFromStop();

AnimationContainer* container() { return container_.get(); }
base::TimeTicks start_time() const { return start_time_; }
Expand All @@ -81,7 +81,7 @@ class Animation : public AnimationContainerElement {
// AnimationContainer::Element overrides
virtual void SetStartTime(base::TimeTicks start_time);
virtual void Step(base::TimeTicks time_now) = 0;
virtual base::TimeDelta GetTimerInterval() const { return timer_interval_; }
virtual base::TimeDelta GetTimerInterval() const;

private:
// Interval for the animation.
Expand Down
8 changes: 8 additions & 0 deletions app/menus/menu_model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

namespace menus {

int MenuModel::GetFirstItemIndex(gfx::NativeMenu native_menu) const {
return 0;
}

bool MenuModel::IsVisibleAt(int index) const {
return true;
}
Expand All @@ -29,6 +33,10 @@ bool MenuModel::GetModelAndIndexForCommandId(int command_id,
return false;
}

const gfx::Font* MenuModel::GetLabelFontAt(int index) const {
return NULL;
}

// Default implementation ignores the disposition.
void MenuModel::ActivatedAtWithDisposition(int index, int disposition) {
ActivatedAt(index);
Expand Down
4 changes: 2 additions & 2 deletions app/menus/menu_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class MenuModel {
// IMPORTANT: If the model implementation returns something _other_ than 0
// here, it must offset the values for |index| it passes to the
// methods below by this number - this is NOT done automatically!
virtual int GetFirstItemIndex(gfx::NativeMenu native_menu) const { return 0; }
virtual int GetFirstItemIndex(gfx::NativeMenu native_menu) const;

// Returns the number of items in the menu.
virtual int GetItemCount() const = 0;
Expand All @@ -70,7 +70,7 @@ class MenuModel {

// Returns the font use for the label at the specified index.
// If NULL, then use default font.
virtual const gfx::Font* GetLabelFontAt(int index) const { return NULL; }
virtual const gfx::Font* GetLabelFontAt(int index) const;

// Gets the acclerator information for the specified index, returning true if
// there is a shortcut accelerator for the item, false otherwise.
Expand Down
8 changes: 8 additions & 0 deletions app/slide_animation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ void SlideAnimation::Hide() {
Start();
}

void SlideAnimation::SetSlideDuration(int duration) {
slide_duration_ = duration;
}

double SlideAnimation::GetCurrentValue() const {
return value_current_;
}

void SlideAnimation::AnimateToState(double state) {
if (state > 1.0)
state = 1.0;
Expand Down
4 changes: 2 additions & 2 deletions app/slide_animation.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ class SlideAnimation : public LinearAnimation {
// Sets the time a slide will take. Note that this isn't actually
// the amount of time an animation will take as the current value of
// the slide is considered.
virtual void SetSlideDuration(int duration) { slide_duration_ = duration; }
virtual void SetSlideDuration(int duration);
int GetSlideDuration() const { return slide_duration_; }
void SetTweenType(Tween::Type tween_type) { tween_type_ = tween_type; }

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

Expand Down
4 changes: 4 additions & 0 deletions app/throb_animation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ void ThrobAnimation::Hide() {
SlideAnimation::Hide();
}

void ThrobAnimation::SetSlideDuration(int duration) {
slide_duration_ = duration;
}

void ThrobAnimation::Step(base::TimeTicks time_now) {
LinearAnimation::Step(time_now);

Expand Down
2 changes: 1 addition & 1 deletion app/throb_animation.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ThrobAnimation : public SlideAnimation {
virtual void Hide();

// Overridden to maintain the slide duration.
virtual void SetSlideDuration(int duration) { slide_duration_ = duration; }
virtual void SetSlideDuration(int duration);

// The number of cycles remaining until the animation stops.
void set_cycles_remaining(int value) { cycles_remaining_ = value; }
Expand Down
4 changes: 4 additions & 0 deletions base/message_pump_glib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,10 @@ void MessagePumpForUI::DidProcessEvent(GdkEvent* event) {
FOR_EACH_OBSERVER(Observer, observers_, DidProcessEvent(event));
}

void MessagePumpForUI::Run(Delegate* delegate) {
RunWithDispatcher(delegate, NULL);
}

void MessagePumpForUI::Quit() {
if (state_) {
state_->should_quit = true;
Expand Down
2 changes: 1 addition & 1 deletion base/message_pump_glib.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class MessagePumpForUI : public MessagePump {
// is ready for processing.
virtual bool RunOnce(GMainContext* context, bool block);

virtual void Run(Delegate* delegate) { RunWithDispatcher(delegate, NULL); }
virtual void Run(Delegate* delegate);
virtual void Quit();
virtual void ScheduleWork();
virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time);
Expand Down
12 changes: 12 additions & 0 deletions base/metrics/histogram.cc
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,18 @@ Histogram::Inconsistencies Histogram::FindCorruption(
return static_cast<Inconsistencies>(inconsistencies);
}

Histogram::ClassType Histogram::histogram_type() const {
return HISTOGRAM;
}

Histogram::Sample Histogram::ranges(size_t i) const {
return ranges_[i];
}

size_t Histogram::bucket_count() const {
return bucket_count_;
}

//------------------------------------------------------------------------------
// Methods for the Histogram::SampleSet class
//------------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions base/metrics/histogram.h
Original file line number Diff line number Diff line change
Expand Up @@ -403,13 +403,13 @@ class Histogram : public base::RefCountedThreadSafe<Histogram> {
//----------------------------------------------------------------------------
// Accessors for factory constuction, serialization and testing.
//----------------------------------------------------------------------------
virtual ClassType histogram_type() const { return HISTOGRAM; }
virtual ClassType histogram_type() const;
const std::string& histogram_name() const { return histogram_name_; }
Sample declared_min() const { return declared_min_; }
Sample declared_max() const { return declared_max_; }
virtual Sample ranges(size_t i) const { return ranges_[i];}
virtual Sample ranges(size_t i) const;
Sample range_checksum() const { return range_checksum_; }
virtual size_t bucket_count() const { return bucket_count_; }
virtual size_t bucket_count() const;
// Snapshot the current complete set of sample data.
// Override with atomic/locked snapshot if needed.
virtual void SnapshotSample(SampleSet* sample) const;
Expand Down
4 changes: 4 additions & 0 deletions base/values_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ RefCountedList::~RefCountedList() {
if (list_)
delete list_;
}

ListValue* RefCountedList::Get() {
return list_;
}
4 changes: 1 addition & 3 deletions base/values_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ class RefCountedList : public base::RefCountedThreadSafe<RefCountedList> {
explicit RefCountedList(ListValue* list);
virtual ~RefCountedList();

virtual ListValue* Get() {
return list_;
}
virtual ListValue* Get();

private:
ListValue* list_;
Expand Down
2 changes: 2 additions & 0 deletions chrome/browser/importer/importer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ using webkit_glue::PasswordForm;

// Importer.

void Importer::Cancel() { cancelled_ = true; }

Importer::Importer()
: cancelled_(false),
import_to_bookmark_bar_(false),
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/importer/importer.h
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ class Importer : public base::RefCountedThreadSafe<Importer> {
ImporterBridge* bridge) = 0;

// Cancels the import process.
virtual void Cancel() { cancelled_ = true; }
virtual void Cancel();

void set_import_to_bookmark_bar(bool import_to_bookmark_bar) {
import_to_bookmark_bar_ = import_to_bookmark_bar;
Expand Down
12 changes: 12 additions & 0 deletions chrome/common/net/gaia/gaia_authenticator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,13 @@ bool GaiaAuthenticator::PerformGaiaRequest(const AuthParams& params,
}
}

bool GaiaAuthenticator::Post(const GURL& url,
const std::string& post_body,
unsigned long* response_code,
std::string* response_body) {
return false;
}

bool GaiaAuthenticator::LookupEmail(AuthResults* results) {
DCHECK_EQ(MessageLoop::current(), message_loop_);
// Use the provided Gaia server, but change the path to what V1 expects.
Expand Down Expand Up @@ -238,6 +245,11 @@ bool GaiaAuthenticator::LookupEmail(AuthResults* results) {
return false;
}

int GaiaAuthenticator::GetBackoffDelaySeconds(int current_backoff_delay) {
NOTREACHED();
return current_backoff_delay;
}

// We need to call this explicitly when we need to obtain a long-lived session
// token.
bool GaiaAuthenticator::IssueAuthToken(AuthResults* results,
Expand Down
9 changes: 2 additions & 7 deletions chrome/common/net/gaia/gaia_authenticator.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,7 @@ class GaiaAuthenticator {
virtual bool PerformGaiaRequest(const AuthParams& params,
AuthResults* results);
virtual bool Post(const GURL& url, const std::string& post_body,
unsigned long* response_code, std::string* response_body) {
return false;
}
unsigned long* response_code, std::string* response_body);

// Caller should fill in results->LSID before calling. Result in
// results->primary_email.
Expand All @@ -193,10 +191,7 @@ class GaiaAuthenticator {
// TODO(sanjeevr): This should be made pure virtual. But this class is
// currently directly being used in sync/engine/authenticator.cc, which is
// wrong.
virtual int GetBackoffDelaySeconds(int current_backoff_delay) {
NOTREACHED();
return current_backoff_delay;
}
virtual int GetBackoffDelaySeconds(int current_backoff_delay);

public:
// Retrieve email.
Expand Down
8 changes: 8 additions & 0 deletions chrome/service/net/service_url_request_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@ ServiceURLRequestContext::ServiceURLRequestContext(
accept_charset_ = "iso-8859-1,*,utf-8";
}

const std::string& ServiceURLRequestContext::GetUserAgent(
const GURL& url) const {
// If the user agent is set explicitly return that, otherwise call the
// base class method to return default value.
return user_agent_.empty() ?
URLRequestContext::GetUserAgent(url) : user_agent_;
}

ServiceURLRequestContext::~ServiceURLRequestContext() {
delete ftp_transaction_factory_;
delete http_transaction_factory_;
Expand Down
7 changes: 1 addition & 6 deletions chrome/service/net/service_url_request_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,7 @@ class ServiceURLRequestContext : public URLRequestContext {
}

// URLRequestContext overrides
virtual const std::string& GetUserAgent(const GURL& url) const {
// If the user agent is set explicitly return that, otherwise call the
// base class method to return default value.
return user_agent_.empty() ?
URLRequestContext::GetUserAgent(url) : user_agent_;
}
virtual const std::string& GetUserAgent(const GURL& url) const;

protected:
virtual ~ServiceURLRequestContext();
Expand Down
4 changes: 4 additions & 0 deletions chrome/worker/websharedworker_stub.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ void WebSharedWorkerStub::OnChannelError() {
OnTerminateWorkerContext();
}

const GURL& WebSharedWorkerStub::url() const {
return url_;
}

void WebSharedWorkerStub::OnStartWorkerContext(
const GURL& url, const string16& user_agent, const string16& source_code) {
// Ignore multiple attempts to start this worker (can happen if two pages
Expand Down
2 changes: 1 addition & 1 deletion chrome/worker/websharedworker_stub.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class WebSharedWorkerStub : public WebWorkerStubBase {
virtual void OnMessageReceived(const IPC::Message& message);
virtual void OnChannelError();

virtual const GURL& url() const { return url_; }
virtual const GURL& url() const;

private:
virtual ~WebSharedWorkerStub();
Expand Down
4 changes: 4 additions & 0 deletions chrome/worker/webworker_stub.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ void WebWorkerStub::OnChannelError() {
OnTerminateWorkerContext();
}

const GURL& WebWorkerStub::url() const {
return url_;
}

void WebWorkerStub::OnMessageReceived(const IPC::Message& message) {
if (!impl_)
return;
Expand Down
2 changes: 1 addition & 1 deletion chrome/worker/webworker_stub.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class WebWorkerStub : public WebWorkerStubBase {
virtual void OnMessageReceived(const IPC::Message& message);
virtual void OnChannelError();

virtual const GURL& url() const { return url_; }
virtual const GURL& url() const;

private:
virtual ~WebWorkerStub();
Expand Down
8 changes: 8 additions & 0 deletions chrome/worker/webworkerclient_proxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,14 @@ WebKit::WebWorker* WebWorkerClientProxy::createWorker(
0, appcache_host_id_);
}

WebKit::WebNotificationPresenter*
WebWorkerClientProxy::notificationPresenter() {
// TODO(johnnyg): Notifications are not yet hooked up to workers.
// Coming soon.
NOTREACHED();
return NULL;
}

WebApplicationCacheHost* WebWorkerClientProxy::createApplicationCacheHost(
WebKit::WebApplicationCacheHostClient* client) {
WorkerWebApplicationCacheHostImpl* host =
Expand Down
7 changes: 1 addition & 6 deletions chrome/worker/webworkerclient_proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,7 @@ class WebWorkerClientProxy : public WebKit::WebWorkerClient {
virtual void workerContextDestroyed();
virtual WebKit::WebWorker* createWorker(WebKit::WebWorkerClient* client);

virtual WebKit::WebNotificationPresenter* notificationPresenter() {
// TODO(johnnyg): Notifications are not yet hooked up to workers.
// Coming soon.
NOTREACHED();
return NULL;
}
virtual WebKit::WebNotificationPresenter* notificationPresenter();

virtual WebKit::WebApplicationCacheHost* createApplicationCacheHost(
WebKit::WebApplicationCacheHostClient* client);
Expand Down
5 changes: 5 additions & 0 deletions chrome/worker/worker_webapplicationcachehost_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@ WorkerWebApplicationCacheHostImpl::WorkerWebApplicationCacheHostImpl(
init_info.parent_process_id,
init_info.parent_appcache_host_id);
}

bool WorkerWebApplicationCacheHostImpl::selectCacheWithManifest(
const WebKit::WebURL& manifestURL) {
return true;
}
4 changes: 1 addition & 3 deletions chrome/worker/worker_webapplicationcachehost_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ class WorkerWebApplicationCacheHostImpl
// Cache selection is also different for workers. We know at construction
// time what cache to select and do so then.
virtual void selectCacheWithoutManifest() {}
virtual bool selectCacheWithManifest(const WebKit::WebURL& manifestURL) {
return true;
}
virtual bool selectCacheWithManifest(const WebKit::WebURL& manifestURL);
};

#endif // CHROME_WORKER_WORKER_WEBAPPLICATIONCACHEHOST_IMPL_H_
4 changes: 4 additions & 0 deletions media/base/buffers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@ StreamSample::StreamSample() {}

StreamSample::~StreamSample() {}

bool Buffer::IsEndOfStream() const {
return GetData() == NULL;
}

} // namespace media
2 changes: 1 addition & 1 deletion media/base/buffers.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class Buffer : public StreamSample {
virtual size_t GetDataSize() const = 0;

// If there's no data in this buffer, it represents end of stream.
virtual bool IsEndOfStream() const { return GetData() == NULL; }
virtual bool IsEndOfStream() const;

protected:
virtual ~Buffer() {}
Expand Down
Loading

0 comments on commit 7cf4091

Please sign in to comment.