diff options
80 files changed, 417 insertions, 163 deletions
diff --git a/app/animation.cc b/app/animation.cc index 28932c9..ff20117 100644 --- a/app/animation.cc +++ b/app/animation.cc @@ -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_; +} diff --git a/app/animation.h b/app/animation.h index 87dc43f..5affe61 100644 --- a/app/animation.h +++ b/app/animation.h @@ -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_; } @@ -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. diff --git a/app/menus/menu_model.cc b/app/menus/menu_model.cc index cd554f2..3df2bcc9 100644 --- a/app/menus/menu_model.cc +++ b/app/menus/menu_model.cc @@ -6,6 +6,10 @@ namespace menus { +int MenuModel::GetFirstItemIndex(gfx::NativeMenu native_menu) const { + return 0; +} + bool MenuModel::IsVisibleAt(int index) const { return true; } @@ -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); diff --git a/app/menus/menu_model.h b/app/menus/menu_model.h index 8247f60..62732cd 100644 --- a/app/menus/menu_model.h +++ b/app/menus/menu_model.h @@ -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; @@ -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. diff --git a/app/slide_animation.cc b/app/slide_animation.cc index c79e3ec..9029fd8 100644 --- a/app/slide_animation.cc +++ b/app/slide_animation.cc @@ -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; diff --git a/app/slide_animation.h b/app/slide_animation.h index d073db1..7c77445 100644 --- a/app/slide_animation.h +++ b/app/slide_animation.h @@ -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_; } diff --git a/app/throb_animation.cc b/app/throb_animation.cc index 65596b3..9ce8f5b 100644 --- a/app/throb_animation.cc +++ b/app/throb_animation.cc @@ -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); diff --git a/app/throb_animation.h b/app/throb_animation.h index e7baced..d3ac39e 100644 --- a/app/throb_animation.h +++ b/app/throb_animation.h @@ -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; } diff --git a/base/message_pump_glib.cc b/base/message_pump_glib.cc index fa5b726..fd24285 100644 --- a/base/message_pump_glib.cc +++ b/base/message_pump_glib.cc @@ -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; diff --git a/base/message_pump_glib.h b/base/message_pump_glib.h index 06635de..c118155 100644 --- a/base/message_pump_glib.h +++ b/base/message_pump_glib.h @@ -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); diff --git a/base/metrics/histogram.cc b/base/metrics/histogram.cc index 729e3b9..d87640f 100644 --- a/base/metrics/histogram.cc +++ b/base/metrics/histogram.cc @@ -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 //------------------------------------------------------------------------------ diff --git a/base/metrics/histogram.h b/base/metrics/histogram.h index b87c891..562f252 100644 --- a/base/metrics/histogram.h +++ b/base/metrics/histogram.h @@ -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; diff --git a/base/values_util.cc b/base/values_util.cc index 31d8e8c..fbc616b 100644 --- a/base/values_util.cc +++ b/base/values_util.cc @@ -12,3 +12,7 @@ RefCountedList::~RefCountedList() { if (list_) delete list_; } + +ListValue* RefCountedList::Get() { + return list_; +} diff --git a/base/values_util.h b/base/values_util.h index 57b35c1..1626bb5 100644 --- a/base/values_util.h +++ b/base/values_util.h @@ -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_; diff --git a/chrome/browser/importer/importer.cc b/chrome/browser/importer/importer.cc index 4286f4e..861db31 100644 --- a/chrome/browser/importer/importer.cc +++ b/chrome/browser/importer/importer.cc @@ -42,6 +42,8 @@ using webkit_glue::PasswordForm; // Importer. +void Importer::Cancel() { cancelled_ = true; } + Importer::Importer() : cancelled_(false), import_to_bookmark_bar_(false), diff --git a/chrome/browser/importer/importer.h b/chrome/browser/importer/importer.h index 7c527fa..515c58c 100644 --- a/chrome/browser/importer/importer.h +++ b/chrome/browser/importer/importer.h @@ -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; diff --git a/chrome/common/net/gaia/gaia_authenticator.cc b/chrome/common/net/gaia/gaia_authenticator.cc index 563ee3a..36d060e 100644 --- a/chrome/common/net/gaia/gaia_authenticator.cc +++ b/chrome/common/net/gaia/gaia_authenticator.cc @@ -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. @@ -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, diff --git a/chrome/common/net/gaia/gaia_authenticator.h b/chrome/common/net/gaia/gaia_authenticator.h index 789863e..be1b2d9 100644 --- a/chrome/common/net/gaia/gaia_authenticator.h +++ b/chrome/common/net/gaia/gaia_authenticator.h @@ -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. @@ -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. diff --git a/chrome/service/net/service_url_request_context.cc b/chrome/service/net/service_url_request_context.cc index ce32f67..59cea2b 100644 --- a/chrome/service/net/service_url_request_context.cc +++ b/chrome/service/net/service_url_request_context.cc @@ -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_; diff --git a/chrome/service/net/service_url_request_context.h b/chrome/service/net/service_url_request_context.h index a19e9f2..d1bb2bf 100644 --- a/chrome/service/net/service_url_request_context.h +++ b/chrome/service/net/service_url_request_context.h @@ -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(); diff --git a/chrome/worker/websharedworker_stub.cc b/chrome/worker/websharedworker_stub.cc index 61ffb31..8cb167a 100644 --- a/chrome/worker/websharedworker_stub.cc +++ b/chrome/worker/websharedworker_stub.cc @@ -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 diff --git a/chrome/worker/websharedworker_stub.h b/chrome/worker/websharedworker_stub.h index 157dadb..b9cb60c 100644 --- a/chrome/worker/websharedworker_stub.h +++ b/chrome/worker/websharedworker_stub.h @@ -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(); diff --git a/chrome/worker/webworker_stub.cc b/chrome/worker/webworker_stub.cc index 78d980e..cd58cab 100644 --- a/chrome/worker/webworker_stub.cc +++ b/chrome/worker/webworker_stub.cc @@ -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; diff --git a/chrome/worker/webworker_stub.h b/chrome/worker/webworker_stub.h index 584abce..76e1058 100644 --- a/chrome/worker/webworker_stub.h +++ b/chrome/worker/webworker_stub.h @@ -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(); diff --git a/chrome/worker/webworkerclient_proxy.cc b/chrome/worker/webworkerclient_proxy.cc index 6df7341..adb9b9b8 100644 --- a/chrome/worker/webworkerclient_proxy.cc +++ b/chrome/worker/webworkerclient_proxy.cc @@ -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 = diff --git a/chrome/worker/webworkerclient_proxy.h b/chrome/worker/webworkerclient_proxy.h index 53f8c67..555742e 100644 --- a/chrome/worker/webworkerclient_proxy.h +++ b/chrome/worker/webworkerclient_proxy.h @@ -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); diff --git a/chrome/worker/worker_webapplicationcachehost_impl.cc b/chrome/worker/worker_webapplicationcachehost_impl.cc index 2bf718a..fc0d282 100644 --- a/chrome/worker/worker_webapplicationcachehost_impl.cc +++ b/chrome/worker/worker_webapplicationcachehost_impl.cc @@ -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; +} diff --git a/chrome/worker/worker_webapplicationcachehost_impl.h b/chrome/worker/worker_webapplicationcachehost_impl.h index 3508fc4..db6dc8a 100644 --- a/chrome/worker/worker_webapplicationcachehost_impl.h +++ b/chrome/worker/worker_webapplicationcachehost_impl.h @@ -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_ diff --git a/media/base/buffers.cc b/media/base/buffers.cc index 4708726..ab66b9a 100644 --- a/media/base/buffers.cc +++ b/media/base/buffers.cc @@ -13,4 +13,8 @@ StreamSample::StreamSample() {} StreamSample::~StreamSample() {} +bool Buffer::IsEndOfStream() const { + return GetData() == NULL; +} + } // namespace media diff --git a/media/base/buffers.h b/media/base/buffers.h index 525450d..c87cdf3 100644 --- a/media/base/buffers.h +++ b/media/base/buffers.h @@ -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() {} diff --git a/media/base/filters.cc b/media/base/filters.cc index 923329b..d3d3bcb 100644 --- a/media/base/filters.cc +++ b/media/base/filters.cc @@ -133,6 +133,10 @@ const char* VideoRenderer::major_mime_type() const { return mime_type::kMajorTypeVideo; } +void* DemuxerStream::QueryInterface(const char* interface_id) { + return NULL; +} + DemuxerStream::~DemuxerStream() {} VideoDecoder::VideoDecoder() {} diff --git a/media/base/filters.h b/media/base/filters.h index 4fd52e2..49fa347 100644 --- a/media/base/filters.h +++ b/media/base/filters.h @@ -201,7 +201,7 @@ class DemuxerStream : public base::RefCountedThreadSafe<DemuxerStream> { // return NULL to indicate the interface is unknown. The derived filter // should NOT AddRef() the interface. The DemuxerStream::QueryInterface() // public template function will assign the interface to a scoped_refptr<>. - virtual void* QueryInterface(const char* interface_id) { return NULL; } + virtual void* QueryInterface(const char* interface_id); friend class base::RefCountedThreadSafe<DemuxerStream>; virtual ~DemuxerStream(); diff --git a/media/base/video_frame.h b/media/base/video_frame.h index ecb3f8a..b1be562 100644 --- a/media/base/video_frame.h +++ b/media/base/video_frame.h @@ -94,7 +94,7 @@ class VideoFrame : public StreamSample { static void CreateBlackFrame(int width, int height, scoped_refptr<VideoFrame>* frame_out); - virtual SurfaceType type() const { return type_; } + SurfaceType type() const { return type_; } Format format() const { return format_; } diff --git a/net/base/capturing_net_log.cc b/net/base/capturing_net_log.cc index e785990..fccd5ae 100644 --- a/net/base/capturing_net_log.cc +++ b/net/base/capturing_net_log.cc @@ -38,6 +38,10 @@ uint32 CapturingNetLog::NextID() { return base::subtle::NoBarrier_AtomicIncrement(&last_id_, 1); } +NetLog::LogLevel CapturingNetLog::GetLogLevel() const { + return LOG_ALL_BUT_BYTES; +} + void CapturingNetLog::GetEntries(EntryList* entry_list) const { AutoLock lock(lock_); *entry_list = entries_; diff --git a/net/base/capturing_net_log.h b/net/base/capturing_net_log.h index 3b6a39e..9254725 100644 --- a/net/base/capturing_net_log.h +++ b/net/base/capturing_net_log.h @@ -54,7 +54,7 @@ class CapturingNetLog : public NetLog { EventPhase phase, EventParameters* extra_parameters); virtual uint32 NextID(); - virtual LogLevel GetLogLevel() const { return LOG_ALL_BUT_BYTES; } + virtual LogLevel GetLogLevel() const; // Returns the list of all entries in the log. void GetEntries(EntryList* entry_list) const; diff --git a/net/base/cookie_monster.cc b/net/base/cookie_monster.cc index 04de3ca..8eb3a49 100644 --- a/net/base/cookie_monster.cc +++ b/net/base/cookie_monster.cc @@ -1323,6 +1323,10 @@ void CookieMonster::DeleteCookie(const GURL& url, } } +CookieMonster* CookieMonster::GetCookieMonster() { + return this; +} + CookieList CookieMonster::GetAllCookies() { AutoLock autolock(lock_); InitIfNecessary(); diff --git a/net/base/cookie_monster.h b/net/base/cookie_monster.h index 2e9614e..a985176 100644 --- a/net/base/cookie_monster.h +++ b/net/base/cookie_monster.h @@ -146,7 +146,7 @@ class CookieMonster : public CookieStore { // Deletes all cookies with that might apply to |url| that has |cookie_name|. virtual void DeleteCookie(const GURL& url, const std::string& cookie_name); - virtual CookieMonster* GetCookieMonster() { return this; } + virtual CookieMonster* GetCookieMonster(); // Sets a cookie given explicit user-provided cookie attributes. The cookie // name, value, domain, etc. are each provided as separate strings. This diff --git a/net/base/host_resolver.cc b/net/base/host_resolver.cc index fbd63bd..a8b642a 100644 --- a/net/base/host_resolver.cc +++ b/net/base/host_resolver.cc @@ -25,6 +25,14 @@ HostResolver::HostResolver() { HostResolver::~HostResolver() { } +AddressFamily HostResolver::GetDefaultAddressFamily() const { + return net::ADDRESS_FAMILY_UNSPECIFIED; +} + +HostResolverImpl* HostResolver::GetAsHostResolverImpl() { + return NULL; +} + SingleRequestHostResolver::SingleRequestHostResolver(HostResolver* resolver) : resolver_(resolver), cur_request_(NULL), diff --git a/net/base/host_resolver.h b/net/base/host_resolver.h index 471ad8a..4fc5c89 100644 --- a/net/base/host_resolver.h +++ b/net/base/host_resolver.h @@ -170,14 +170,12 @@ class HostResolver { // results to AF_INET by passing in ADDRESS_FAMILY_IPV4, or to // AF_INET6 by passing in ADDRESS_FAMILY_IPV6. virtual void SetDefaultAddressFamily(AddressFamily address_family) {} - virtual AddressFamily GetDefaultAddressFamily() const { - return net::ADDRESS_FAMILY_UNSPECIFIED; - } + virtual AddressFamily GetDefaultAddressFamily() const; // Returns |this| cast to a HostResolverImpl*, or NULL if the subclass // is not compatible with HostResolverImpl. Used primarily to expose // additional functionality on the about:net-internals page. - virtual HostResolverImpl* GetAsHostResolverImpl() { return NULL; } + virtual HostResolverImpl* GetAsHostResolverImpl(); // Does additional cleanup prior to destruction. virtual void Shutdown() {} diff --git a/net/ftp/ftp_directory_listing_parser_ls.cc b/net/ftp/ftp_directory_listing_parser_ls.cc index 40546c8..9660eab 100644 --- a/net/ftp/ftp_directory_listing_parser_ls.cc +++ b/net/ftp/ftp_directory_listing_parser_ls.cc @@ -91,6 +91,10 @@ FtpDirectoryListingParserLs::FtpDirectoryListingParserLs( FtpDirectoryListingParserLs::~FtpDirectoryListingParserLs() {} +FtpServerType FtpDirectoryListingParserLs::GetServerType() const { + return SERVER_LS; +} + bool FtpDirectoryListingParserLs::ConsumeLine(const string16& line) { if (line.empty() && !received_nonempty_line_) { // Allow empty lines only at the beginning of the listing. For example VMS diff --git a/net/ftp/ftp_directory_listing_parser_ls.h b/net/ftp/ftp_directory_listing_parser_ls.h index 6cb3655..3004f70 100644 --- a/net/ftp/ftp_directory_listing_parser_ls.h +++ b/net/ftp/ftp_directory_listing_parser_ls.h @@ -23,7 +23,7 @@ class FtpDirectoryListingParserLs : public FtpDirectoryListingParser { virtual ~FtpDirectoryListingParserLs(); // FtpDirectoryListingParser methods: - virtual FtpServerType GetServerType() const { return SERVER_LS; } + virtual FtpServerType GetServerType() const; virtual bool ConsumeLine(const string16& line); virtual bool OnEndOfInput(); virtual bool EntryAvailable() const; diff --git a/net/ftp/ftp_directory_listing_parser_mlsd.cc b/net/ftp/ftp_directory_listing_parser_mlsd.cc index d8ae618..f2558415 100644 --- a/net/ftp/ftp_directory_listing_parser_mlsd.cc +++ b/net/ftp/ftp_directory_listing_parser_mlsd.cc @@ -60,6 +60,10 @@ FtpDirectoryListingParserMlsd::FtpDirectoryListingParserMlsd() {} FtpDirectoryListingParserMlsd::~FtpDirectoryListingParserMlsd() {} +FtpServerType FtpDirectoryListingParserMlsd::GetServerType() const { + return SERVER_MLSD; +} + bool FtpDirectoryListingParserMlsd::ConsumeLine(const string16& line) { // The first space indicates where the filename begins. string16::size_type first_space_pos = line.find(' '); diff --git a/net/ftp/ftp_directory_listing_parser_mlsd.h b/net/ftp/ftp_directory_listing_parser_mlsd.h index c3e3acf..5c11fa0 100644 --- a/net/ftp/ftp_directory_listing_parser_mlsd.h +++ b/net/ftp/ftp_directory_listing_parser_mlsd.h @@ -20,7 +20,7 @@ class FtpDirectoryListingParserMlsd : public FtpDirectoryListingParser { virtual ~FtpDirectoryListingParserMlsd(); // FtpDirectoryListingParser methods: - virtual FtpServerType GetServerType() const { return SERVER_MLSD; } + virtual FtpServerType GetServerType() const; virtual bool ConsumeLine(const string16& line); virtual bool OnEndOfInput(); virtual bool EntryAvailable() const; diff --git a/net/ftp/ftp_directory_listing_parser_netware.cc b/net/ftp/ftp_directory_listing_parser_netware.cc index ab7fb6d..1801a4a 100644 --- a/net/ftp/ftp_directory_listing_parser_netware.cc +++ b/net/ftp/ftp_directory_listing_parser_netware.cc @@ -42,6 +42,10 @@ FtpDirectoryListingParserNetware::FtpDirectoryListingParserNetware( FtpDirectoryListingParserNetware::~FtpDirectoryListingParserNetware() {} +FtpServerType FtpDirectoryListingParserNetware::GetServerType() const { + return SERVER_NETWARE; +} + bool FtpDirectoryListingParserNetware::ConsumeLine(const string16& line) { if (!received_first_line_) { received_first_line_ = true; diff --git a/net/ftp/ftp_directory_listing_parser_netware.h b/net/ftp/ftp_directory_listing_parser_netware.h index 5fdcd84..48aebfc 100644 --- a/net/ftp/ftp_directory_listing_parser_netware.h +++ b/net/ftp/ftp_directory_listing_parser_netware.h @@ -23,7 +23,7 @@ class FtpDirectoryListingParserNetware : public FtpDirectoryListingParser { virtual ~FtpDirectoryListingParserNetware(); // FtpDirectoryListingParser methods: - virtual FtpServerType GetServerType() const { return SERVER_NETWARE; } + virtual FtpServerType GetServerType() const; virtual bool ConsumeLine(const string16& line); virtual bool OnEndOfInput(); virtual bool EntryAvailable() const; diff --git a/net/ftp/ftp_directory_listing_parser_vms.cc b/net/ftp/ftp_directory_listing_parser_vms.cc index ed12665..c74dad0 100644 --- a/net/ftp/ftp_directory_listing_parser_vms.cc +++ b/net/ftp/ftp_directory_listing_parser_vms.cc @@ -170,6 +170,10 @@ FtpDirectoryListingParserVms::FtpDirectoryListingParserVms() FtpDirectoryListingParserVms::~FtpDirectoryListingParserVms() {} +FtpServerType FtpDirectoryListingParserVms::GetServerType() const { + return SERVER_VMS; +} + bool FtpDirectoryListingParserVms::ConsumeLine(const string16& line) { switch (state_) { case STATE_INITIAL: diff --git a/net/ftp/ftp_directory_listing_parser_vms.h b/net/ftp/ftp_directory_listing_parser_vms.h index 12f8dc7..118365d 100644 --- a/net/ftp/ftp_directory_listing_parser_vms.h +++ b/net/ftp/ftp_directory_listing_parser_vms.h @@ -19,7 +19,7 @@ class FtpDirectoryListingParserVms : public FtpDirectoryListingParser { virtual ~FtpDirectoryListingParserVms(); // FtpDirectoryListingParser methods: - virtual FtpServerType GetServerType() const { return SERVER_VMS; } + virtual FtpServerType GetServerType() const; virtual bool ConsumeLine(const string16& line); virtual bool OnEndOfInput(); virtual bool EntryAvailable() const; diff --git a/net/ftp/ftp_directory_listing_parser_windows.cc b/net/ftp/ftp_directory_listing_parser_windows.cc index e3211739..7bce556 100644 --- a/net/ftp/ftp_directory_listing_parser_windows.cc +++ b/net/ftp/ftp_directory_listing_parser_windows.cc @@ -76,6 +76,10 @@ FtpDirectoryListingParserWindows::FtpDirectoryListingParserWindows() {} FtpDirectoryListingParserWindows::~FtpDirectoryListingParserWindows() {} +FtpServerType FtpDirectoryListingParserWindows::GetServerType() const { + return SERVER_WINDOWS; +} + bool FtpDirectoryListingParserWindows::ConsumeLine(const string16& line) { std::vector<string16> columns; base::SplitString(CollapseWhitespace(line, false), ' ', &columns); diff --git a/net/ftp/ftp_directory_listing_parser_windows.h b/net/ftp/ftp_directory_listing_parser_windows.h index 91ffe36..1f029af 100644 --- a/net/ftp/ftp_directory_listing_parser_windows.h +++ b/net/ftp/ftp_directory_listing_parser_windows.h @@ -18,7 +18,7 @@ class FtpDirectoryListingParserWindows : public FtpDirectoryListingParser { virtual ~FtpDirectoryListingParserWindows(); // FtpDirectoryListingParser methods: - virtual FtpServerType GetServerType() const { return SERVER_WINDOWS; } + virtual FtpServerType GetServerType() const; virtual bool ConsumeLine(const string16& line); virtual bool OnEndOfInput(); virtual bool EntryAvailable() const; diff --git a/net/http/http_auth_handler.cc b/net/http/http_auth_handler.cc index d6e6a62..e653e99 100644 --- a/net/http/http_auth_handler.cc +++ b/net/http/http_auth_handler.cc @@ -99,6 +99,14 @@ int HttpAuthHandler::GenerateAuthToken(const string16* username, return rv; } +bool HttpAuthHandler::NeedsIdentity() { + return true; +} + +bool HttpAuthHandler::AllowsDefaultCredentials() { + return false; +} + void HttpAuthHandler::OnGenerateAuthTokenComplete(int rv) { CompletionCallback* callback = original_callback_; FinishGenerateAuthToken(); diff --git a/net/http/http_auth_handler.h b/net/http/http_auth_handler.h index 908b065..f5ce1be 100644 --- a/net/http/http_auth_handler.h +++ b/net/http/http_auth_handler.h @@ -123,14 +123,14 @@ class HttpAuthHandler { // requires an identity. // TODO(wtc): Find a better way to handle a multi-round challenge-response // sequence used by a connection-based authentication scheme. - virtual bool NeedsIdentity() { return true; } + virtual bool NeedsIdentity(); // Returns whether the default credentials may be used for the |origin| passed // into |InitFromChallenge|. If true, the user does not need to be prompted // for username and password to establish credentials. // NOTE: SSO is a potential security risk. // TODO(cbentzel): Add a pointer to Firefox documentation about risk. - virtual bool AllowsDefaultCredentials() { return false; } + virtual bool AllowsDefaultCredentials(); protected: enum Property { diff --git a/net/http/http_stream_request.cc b/net/http/http_stream_request.cc index 62cb3d7..3f6b419 100644 --- a/net/http/http_stream_request.cc +++ b/net/http/http_stream_request.cc @@ -148,6 +148,18 @@ LoadState HttpStreamRequest::GetLoadState() const { } } +bool HttpStreamRequest::was_alternate_protocol_available() const { + return was_alternate_protocol_available_; +} + +bool HttpStreamRequest::was_npn_negotiated() const { + return was_npn_negotiated_; +} + +bool HttpStreamRequest::using_spdy() const { + return using_spdy_; +} + void HttpStreamRequest::GetSSLInfo() { DCHECK(using_ssl_); DCHECK(!establishing_tunnel_); diff --git a/net/http/http_stream_request.h b/net/http/http_stream_request.h index d0decb4..51559a7 100644 --- a/net/http/http_stream_request.h +++ b/net/http/http_stream_request.h @@ -69,11 +69,9 @@ class HttpStreamRequest : public StreamRequest { const string16& password); virtual LoadState GetLoadState() const; - virtual bool was_alternate_protocol_available() const { - return was_alternate_protocol_available_; - } - virtual bool was_npn_negotiated() const { return was_npn_negotiated_; } - virtual bool using_spdy() const { return using_spdy_; } + virtual bool was_alternate_protocol_available() const; + virtual bool was_npn_negotiated() const; + virtual bool using_spdy() const; private: enum AlternateProtocolMode { diff --git a/net/net.gyp b/net/net.gyp index 8004873..065a39d 100644 --- a/net/net.gyp +++ b/net/net.gyp @@ -591,6 +591,7 @@ 'socket/socks_client_socket.h', 'socket/socks_client_socket_pool.cc', 'socket/socks_client_socket_pool.h', + 'socket/ssl_client_socket.cc', 'socket/ssl_client_socket.h', 'socket/ssl_client_socket_mac.cc', 'socket/ssl_client_socket_mac.h', diff --git a/net/server/http_listen_socket.cc b/net/server/http_listen_socket.cc index f35582b..161b6f6 100644 --- a/net/server/http_listen_socket.cc +++ b/net/server/http_listen_socket.cc @@ -310,6 +310,14 @@ bool HttpListenSocket::ParseHeaders(HttpServerRequestInfo* info) { return false; } +void HttpListenSocket::Close() { + ListenSocket::Close(); +} + +void HttpListenSocket::Listen() { + ListenSocket::Listen(); +} + void HttpListenSocket::DidAccept(ListenSocket* server, ListenSocket* connection) { connection->AddRef(); diff --git a/net/server/http_listen_socket.h b/net/server/http_listen_socket.h index c917eaf..8b0bbc2 100644 --- a/net/server/http_listen_socket.h +++ b/net/server/http_listen_socket.h @@ -44,8 +44,8 @@ class HttpListenSocket : public ListenSocket, void Send404(); void Send500(const std::string& message); - virtual void Close() { ListenSocket::Close(); } - virtual void Listen() { ListenSocket::Listen(); } + virtual void Close(); + virtual void Listen(); // ListenSocketDelegate virtual void DidAccept(ListenSocket* server, ListenSocket* connection); diff --git a/net/socket/socks_client_socket_pool.cc b/net/socket/socks_client_socket_pool.cc index 6d9e814c..4db8c5b 100644 --- a/net/socket/socks_client_socket_pool.cc +++ b/net/socket/socks_client_socket_pool.cc @@ -236,6 +236,10 @@ void SOCKSClientSocketPool::CloseIdleSockets() { base_.CloseIdleSockets(); } +int SOCKSClientSocketPool::IdleSocketCount() const { + return base_.idle_socket_count(); +} + int SOCKSClientSocketPool::IdleSocketCountInGroup( const std::string& group_name) const { return base_.IdleSocketCountInGroup(group_name); @@ -261,4 +265,12 @@ DictionaryValue* SOCKSClientSocketPool::GetInfoAsValue( return dict; } +base::TimeDelta SOCKSClientSocketPool::ConnectionTimeout() const { + return base_.ConnectionTimeout(); +} + +ClientSocketPoolHistograms* SOCKSClientSocketPool::histograms() const { + return base_.histograms(); +}; + } // namespace net diff --git a/net/socket/socks_client_socket_pool.h b/net/socket/socks_client_socket_pool.h index 96eb4cf..3ba71546 100644 --- a/net/socket/socks_client_socket_pool.h +++ b/net/socket/socks_client_socket_pool.h @@ -138,9 +138,7 @@ class SOCKSClientSocketPool : public ClientSocketPool { virtual void CloseIdleSockets(); - virtual int IdleSocketCount() const { - return base_.idle_socket_count(); - } + virtual int IdleSocketCount() const; virtual int IdleSocketCountInGroup(const std::string& group_name) const; @@ -151,13 +149,9 @@ class SOCKSClientSocketPool : public ClientSocketPool { const std::string& type, bool include_nested_pools) const; - virtual base::TimeDelta ConnectionTimeout() const { - return base_.ConnectionTimeout(); - } + virtual base::TimeDelta ConnectionTimeout() const; - virtual ClientSocketPoolHistograms* histograms() const { - return base_.histograms(); - }; + virtual ClientSocketPoolHistograms* histograms() const; private: typedef ClientSocketPoolBase<SOCKSSocketParams> PoolBase; diff --git a/net/socket/ssl_client_socket.cc b/net/socket/ssl_client_socket.cc new file mode 100644 index 0000000..5635ad5 --- /dev/null +++ b/net/socket/ssl_client_socket.cc @@ -0,0 +1,62 @@ +// Copyright (c) 2010 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. + +#include "net/socket/ssl_client_socket.h" + +namespace net { + +SSLClientSocket::SSLClientSocket() + : was_npn_negotiated_(false), + was_spdy_negotiated_(false) { +} + +SSLClientSocket::NextProto SSLClientSocket::NextProtoFromString( + const std::string& proto_string) { + if (proto_string == "http1.1" || proto_string == "http/1.1") { + return kProtoHTTP11; + } else if (proto_string == "spdy/1") { + return kProtoSPDY1; + } else if (proto_string == "spdy/2") { + return kProtoSPDY2; + } else { + return kProtoUnknown; + } +} + +bool SSLClientSocket::IgnoreCertError(int error, int load_flags) { + if (error == OK || load_flags & LOAD_IGNORE_ALL_CERT_ERRORS) + return true; + + if (error == ERR_CERT_COMMON_NAME_INVALID && + (load_flags & LOAD_IGNORE_CERT_COMMON_NAME_INVALID)) + return true; + + if (error == ERR_CERT_DATE_INVALID && + (load_flags & LOAD_IGNORE_CERT_DATE_INVALID)) + return true; + + if (error == ERR_CERT_AUTHORITY_INVALID && + (load_flags & LOAD_IGNORE_CERT_AUTHORITY_INVALID)) + return true; + + return false; +} + +bool SSLClientSocket::was_npn_negotiated() const { + return was_npn_negotiated_; +} + +bool SSLClientSocket::set_was_npn_negotiated(bool negotiated) { + return was_npn_negotiated_ = negotiated; +} + +bool SSLClientSocket::was_spdy_negotiated() const { + return was_spdy_negotiated_; +} + +bool SSLClientSocket::set_was_spdy_negotiated(bool negotiated) { + return was_spdy_negotiated_ = negotiated; +} + +} // namespace net diff --git a/net/socket/ssl_client_socket.h b/net/socket/ssl_client_socket.h index c3eb0da..1b424fb 100644 --- a/net/socket/ssl_client_socket.h +++ b/net/socket/ssl_client_socket.h @@ -44,8 +44,8 @@ class DNSSECProvider { // class SSLClientSocket : public ClientSocket { public: - SSLClientSocket() : was_npn_negotiated_(false), was_spdy_negotiated_(false) { - } + SSLClientSocket(); + // Next Protocol Negotiation (NPN) allows a TLS client and server to come to // an agreement about the application level protocol to speak over a // connection. @@ -84,52 +84,19 @@ class SSLClientSocket : public ClientSocket { // supported list. virtual NextProtoStatus GetNextProto(std::string* proto) = 0; - static NextProto NextProtoFromString(const std::string& proto_string) { - if (proto_string == "http1.1" || proto_string == "http/1.1") { - return kProtoHTTP11; - } else if (proto_string == "spdy/1") { - return kProtoSPDY1; - } else if (proto_string == "spdy/2") { - return kProtoSPDY2; - } else { - return kProtoUnknown; - } - } - - static bool IgnoreCertError(int error, int load_flags) { - if (error == OK || load_flags & LOAD_IGNORE_ALL_CERT_ERRORS) - return true; - - if (error == ERR_CERT_COMMON_NAME_INVALID && - (load_flags & LOAD_IGNORE_CERT_COMMON_NAME_INVALID)) - return true; - if(error == ERR_CERT_DATE_INVALID && - (load_flags & LOAD_IGNORE_CERT_DATE_INVALID)) - return true; - if(error == ERR_CERT_AUTHORITY_INVALID && - (load_flags & LOAD_IGNORE_CERT_AUTHORITY_INVALID)) - return true; - - return false; - } - - virtual bool was_npn_negotiated() const { - return was_npn_negotiated_; - } - - virtual bool set_was_npn_negotiated(bool negotiated) { - return was_npn_negotiated_ = negotiated; - } + static NextProto NextProtoFromString(const std::string& proto_string); + + static bool IgnoreCertError(int error, int load_flags); + + virtual bool was_npn_negotiated() const; + + virtual bool set_was_npn_negotiated(bool negotiated); virtual void UseDNSSEC(DNSSECProvider*) { } - virtual bool was_spdy_negotiated() const { - return was_spdy_negotiated_; - } + virtual bool was_spdy_negotiated() const; - virtual bool set_was_spdy_negotiated(bool negotiated) { - return was_spdy_negotiated_ = negotiated; - } + virtual bool set_was_spdy_negotiated(bool negotiated); private: // True if NPN was responded to, independent of selecting SPDY or HTTP. diff --git a/net/socket/tcp_client_socket_libevent.cc b/net/socket/tcp_client_socket_libevent.cc index a3fb281..bf6d3af 100644 --- a/net/socket/tcp_client_socket_libevent.cc +++ b/net/socket/tcp_client_socket_libevent.cc @@ -609,6 +609,10 @@ int TCPClientSocketLibevent::GetPeerAddress(AddressList* address) const { return OK; } +const BoundNetLog& TCPClientSocketLibevent::NetLog() const { + return net_log_; +} + void TCPClientSocketLibevent::SetSubresourceSpeculation() { use_history_.set_subresource_speculation(); } diff --git a/net/socket/tcp_client_socket_libevent.h b/net/socket/tcp_client_socket_libevent.h index a89c5b3..e0e6e31 100644 --- a/net/socket/tcp_client_socket_libevent.h +++ b/net/socket/tcp_client_socket_libevent.h @@ -45,7 +45,7 @@ class TCPClientSocketLibevent : public ClientSocket, NonThreadSafe { virtual bool IsConnected() const; virtual bool IsConnectedAndIdle() const; virtual int GetPeerAddress(AddressList* address) const; - virtual const BoundNetLog& NetLog() const { return net_log_; } + virtual const BoundNetLog& NetLog() const; virtual void SetSubresourceSpeculation(); virtual void SetOmniboxSpeculation(); virtual bool WasEverUsed() const; diff --git a/net/socket/tcp_client_socket_pool.cc b/net/socket/tcp_client_socket_pool.cc index 8ec9cac..5f017ea 100644 --- a/net/socket/tcp_client_socket_pool.cc +++ b/net/socket/tcp_client_socket_pool.cc @@ -38,6 +38,18 @@ TCPSocketParams::TCPSocketParams(const std::string& host, int port, TCPSocketParams::~TCPSocketParams() {} +void TCPSocketParams::Initialize(RequestPriority priority, + const GURL& referrer, + bool disable_resolver_cache) { + // The referrer is used by the DNS prefetch system to correlate resolutions + // with the page that triggered them. It doesn't impact the actual addresses + // that we resolve to. + destination_.set_referrer(referrer); + destination_.set_priority(priority); + if (disable_resolver_cache) + destination_.set_allow_cached_response(false); +} + // TCPConnectJobs will time out after this many seconds. Note this is the total // time, including both host resolution and TCP connect() times. // @@ -272,6 +284,10 @@ void TCPClientSocketPool::CloseIdleSockets() { base_.CloseIdleSockets(); } +int TCPClientSocketPool::IdleSocketCount() const { + return base_.idle_socket_count(); +} + int TCPClientSocketPool::IdleSocketCountInGroup( const std::string& group_name) const { return base_.IdleSocketCountInGroup(group_name); @@ -282,4 +298,19 @@ LoadState TCPClientSocketPool::GetLoadState( return base_.GetLoadState(group_name, handle); } +DictionaryValue* TCPClientSocketPool::GetInfoAsValue( + const std::string& name, + const std::string& type, + bool include_nested_pools) const { + return base_.GetInfoAsValue(name, type); +} + +base::TimeDelta TCPClientSocketPool::ConnectionTimeout() const { + return base_.ConnectionTimeout(); +} + +ClientSocketPoolHistograms* TCPClientSocketPool::histograms() const { + return base_.histograms(); +} + } // namespace net diff --git a/net/socket/tcp_client_socket_pool.h b/net/socket/tcp_client_socket_pool.h index 08f0634f..e3986e5 100644 --- a/net/socket/tcp_client_socket_pool.h +++ b/net/socket/tcp_client_socket_pool.h @@ -39,15 +39,7 @@ class TCPSocketParams : public base::RefCounted<TCPSocketParams> { ~TCPSocketParams(); void Initialize(RequestPriority priority, const GURL& referrer, - bool disable_resolver_cache) { - // The referrer is used by the DNS prefetch system to correlate resolutions - // with the page that triggered them. It doesn't impact the actual addresses - // that we resolve to. - destination_.set_referrer(referrer); - destination_.set_priority(priority); - if (disable_resolver_cache) - destination_.set_allow_cached_response(false); - } + bool disable_resolver_cache); HostResolver::RequestInfo destination_; @@ -147,9 +139,7 @@ class TCPClientSocketPool : public ClientSocketPool { virtual void CloseIdleSockets(); - virtual int IdleSocketCount() const { - return base_.idle_socket_count(); - } + virtual int IdleSocketCount() const; virtual int IdleSocketCountInGroup(const std::string& group_name) const; @@ -158,17 +148,11 @@ class TCPClientSocketPool : public ClientSocketPool { virtual DictionaryValue* GetInfoAsValue(const std::string& name, const std::string& type, - bool include_nested_pools) const { - return base_.GetInfoAsValue(name, type); - } + bool include_nested_pools) const; - virtual base::TimeDelta ConnectionTimeout() const { - return base_.ConnectionTimeout(); - } + virtual base::TimeDelta ConnectionTimeout() const; - virtual ClientSocketPoolHistograms* histograms() const { - return base_.histograms(); - } + virtual ClientSocketPoolHistograms* histograms() const; private: typedef ClientSocketPoolBase<TCPSocketParams> PoolBase; diff --git a/net/spdy/spdy_http_stream.cc b/net/spdy/spdy_http_stream.cc index 5d27ee1..75f8039 100644 --- a/net/spdy/spdy_http_stream.cc +++ b/net/spdy/spdy_http_stream.cc @@ -141,6 +141,32 @@ void SpdyHttpStream::Close(bool not_reusable) { Cancel(); } +HttpStream* SpdyHttpStream::RenewStreamForAuth() { + return NULL; +} + +bool SpdyHttpStream::IsResponseBodyComplete() const { + if (!stream_) + return false; + return stream_->closed(); +} + +bool SpdyHttpStream::CanFindEndOfResponse() const { + return true; +} + +bool SpdyHttpStream::IsMoreDataBuffered() const { + return false; +} + +bool SpdyHttpStream::IsConnectionReused() const { + return spdy_session_->IsReused(); +} + +void SpdyHttpStream::SetConnectionReused() { + // SPDY doesn't need an indicator here. +} + int SpdyHttpStream::SendRequest(const HttpRequestHeaders& request_headers, UploadDataStream* request_body, HttpResponseInfo* response, diff --git a/net/spdy/spdy_http_stream.h b/net/spdy/spdy_http_stream.h index cd351cd..76649b2 100644 --- a/net/spdy/spdy_http_stream.h +++ b/net/spdy/spdy_http_stream.h @@ -55,20 +55,12 @@ class SpdyHttpStream : public SpdyStream::Delegate, public HttpStream { int buf_len, CompletionCallback* callback); virtual void Close(bool not_reusable); - virtual HttpStream* RenewStreamForAuth() { return NULL; } - virtual bool IsResponseBodyComplete() const { - if (!stream_) - return false; - return stream_->closed(); - } - virtual bool CanFindEndOfResponse() const { return true; } - virtual bool IsMoreDataBuffered() const { return false; } - virtual bool IsConnectionReused() const { - return spdy_session_->IsReused(); - } - virtual void SetConnectionReused() { - // SPDY doesn't need an indicator here. - } + virtual HttpStream* RenewStreamForAuth(); + virtual bool IsResponseBodyComplete() const; + virtual bool CanFindEndOfResponse() const; + virtual bool IsMoreDataBuffered() const; + virtual bool IsConnectionReused() const; + virtual void SetConnectionReused(); virtual void GetSSLInfo(SSLInfo* ssl_info); virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); diff --git a/ppapi/cpp/module.cc b/ppapi/cpp/module.cc index d6adddc..220609d 100644 --- a/ppapi/cpp/module.cc +++ b/ppapi/cpp/module.cc @@ -144,6 +144,10 @@ Module::~Module() { core_ = NULL; } +bool Module::Init() { + return true; +} + const void* Module::GetPluginInterface(const char* interface_name) { if (strcmp(interface_name, PPP_INSTANCE_INTERFACE) == 0) return &instance_interface; diff --git a/ppapi/cpp/module.h b/ppapi/cpp/module.h index 308d3ce..f3e8af7 100644 --- a/ppapi/cpp/module.h +++ b/ppapi/cpp/module.h @@ -35,7 +35,7 @@ class Module { // This function will be automatically called after the object is created. // This is where you can put functions that rely on other parts of the API, // now that the module has been created. - virtual bool Init() { return true; } + virtual bool Init(); // Returns the internal module handle. PP_Module pp_module() const { return pp_module_; } diff --git a/ppapi/proxy/host_dispatcher.cc b/ppapi/proxy/host_dispatcher.cc index 6e7a1f4..c196c14 100644 --- a/ppapi/proxy/host_dispatcher.cc +++ b/ppapi/proxy/host_dispatcher.cc @@ -72,6 +72,10 @@ void HostDispatcher::RemoveForInstance(PP_Instance instance) { g_instance_to_dispatcher->erase(found); } +bool HostDispatcher::IsPlugin() const { + return false; +} + } // namespace proxy } // namespace pp diff --git a/ppapi/proxy/host_dispatcher.h b/ppapi/proxy/host_dispatcher.h index f5b91b4..44d133a 100644 --- a/ppapi/proxy/host_dispatcher.h +++ b/ppapi/proxy/host_dispatcher.h @@ -54,7 +54,7 @@ class HostDispatcher : public Dispatcher { static void RemoveForInstance(PP_Instance instance); // Dispatcher overrides. - virtual bool IsPlugin() const { return false; } + virtual bool IsPlugin() const; private: DISALLOW_COPY_AND_ASSIGN(HostDispatcher); diff --git a/ppapi/proxy/plugin_dispatcher.cc b/ppapi/proxy/plugin_dispatcher.cc index 037b470..a6c97a0 100644 --- a/ppapi/proxy/plugin_dispatcher.cc +++ b/ppapi/proxy/plugin_dispatcher.cc @@ -66,6 +66,10 @@ void PluginDispatcher::SetGlobal(PluginDispatcher* dispatcher) { g_dispatcher = dispatcher; } +bool PluginDispatcher::IsPlugin() const { + return true; +} + void PluginDispatcher::OnMessageReceived(const IPC::Message& msg) { if (msg.routing_id() == MSG_ROUTING_CONTROL) { // Handle some plugin-specific control messages. diff --git a/ppapi/proxy/plugin_dispatcher.h b/ppapi/proxy/plugin_dispatcher.h index 8c75d33..5b8ffb7 100644 --- a/ppapi/proxy/plugin_dispatcher.h +++ b/ppapi/proxy/plugin_dispatcher.h @@ -43,7 +43,7 @@ class PluginDispatcher : public Dispatcher { static void SetGlobal(PluginDispatcher* dispatcher); // Dispatcher overrides. - virtual bool IsPlugin() const { return true; } + virtual bool IsPlugin() const; // IPC::Channel::Listener implementation. virtual void OnMessageReceived(const IPC::Message& msg); diff --git a/ppapi/proxy/plugin_resource.cc b/ppapi/proxy/plugin_resource.cc index b1a579e..d535cc7 100644 --- a/ppapi/proxy/plugin_resource.cc +++ b/ppapi/proxy/plugin_resource.cc @@ -13,5 +13,11 @@ PluginResource::PluginResource() { PluginResource::~PluginResource() { } +#define DEFINE_TYPE_GETTER(RESOURCE) \ + RESOURCE* PluginResource::As##RESOURCE() { return NULL; } +FOR_ALL_RESOURCES(DEFINE_TYPE_GETTER) +#undef DEFINE_TYPE_GETTER + + } // namespace proxy } // namespace pp diff --git a/ppapi/proxy/plugin_resource.h b/ppapi/proxy/plugin_resource.h index 52a8609..2c195bc 100644 --- a/ppapi/proxy/plugin_resource.h +++ b/ppapi/proxy/plugin_resource.h @@ -50,7 +50,7 @@ class PluginResource { // NULL if the resource does not match the specified type. Used by the Cast() // function. #define DEFINE_TYPE_GETTER(RESOURCE) \ - virtual RESOURCE* As##RESOURCE() { return NULL; } + virtual RESOURCE* As##RESOURCE(); FOR_ALL_RESOURCES(DEFINE_TYPE_GETTER) #undef DEFINE_TYPE_GETTER diff --git a/remoting/jingle_glue/xmpp_socket_adapter.cc b/remoting/jingle_glue/xmpp_socket_adapter.cc index c4a669a..8fdcd0f 100644 --- a/remoting/jingle_glue/xmpp_socket_adapter.cc +++ b/remoting/jingle_glue/xmpp_socket_adapter.cc @@ -50,6 +50,18 @@ XmppSocketAdapter::~XmppSocketAdapter() { } } +buzz::AsyncSocket::State XmppSocketAdapter::state() { + return state_; +} + +buzz::AsyncSocket::Error XmppSocketAdapter::error() { + return error_; +} + +int XmppSocketAdapter::GetError() { + return wsa_error_; +} + bool XmppSocketAdapter::FreeState() { int code = 0; diff --git a/remoting/jingle_glue/xmpp_socket_adapter.h b/remoting/jingle_glue/xmpp_socket_adapter.h index 42493f9a..90627cf 100644 --- a/remoting/jingle_glue/xmpp_socket_adapter.h +++ b/remoting/jingle_glue/xmpp_socket_adapter.h @@ -27,9 +27,9 @@ class XmppSocketAdapter : public buzz::AsyncSocket, bool allow_unverified_certs); virtual ~XmppSocketAdapter(); - virtual State state() { return state_; } - virtual Error error() { return error_; } - virtual int GetError() { return wsa_error_; } + virtual State state(); + virtual Error error(); + virtual int GetError(); void set_firewall(bool firewall) { firewall_ = firewall; } diff --git a/skia/ext/bitmap_platform_device_linux.cc b/skia/ext/bitmap_platform_device_linux.cc index 69f8058..60feb45 100644 --- a/skia/ext/bitmap_platform_device_linux.cc +++ b/skia/ext/bitmap_platform_device_linux.cc @@ -142,6 +142,14 @@ BitmapPlatformDevice::BitmapPlatformDevice( BitmapPlatformDevice::~BitmapPlatformDevice() { } +SkDeviceFactory* BitmapPlatformDevice::getDeviceFactory() { + return SkNEW(BitmapPlatformDeviceFactory); +} + +bool BitmapPlatformDevice::IsVectorial() { + return false; +} + cairo_t* BitmapPlatformDevice::beginPlatformPaint() { data_->LoadConfig(); cairo_t* cairo = data_->bitmap_context(); diff --git a/skia/ext/bitmap_platform_device_linux.h b/skia/ext/bitmap_platform_device_linux.h index b093414..27109e3 100644 --- a/skia/ext/bitmap_platform_device_linux.h +++ b/skia/ext/bitmap_platform_device_linux.h @@ -85,14 +85,12 @@ class BitmapPlatformDevice : public PlatformDevice { // A stub copy constructor. Needs to be properly implemented. BitmapPlatformDevice(const BitmapPlatformDevice& other); - virtual SkDeviceFactory* getDeviceFactory() { - return SkNEW(BitmapPlatformDeviceFactory); - } + virtual SkDeviceFactory* getDeviceFactory(); virtual void makeOpaque(int x, int y, int width, int height); // Bitmaps aren't vector graphics. - virtual bool IsVectorial() { return false; } + virtual bool IsVectorial(); // If someone wants to paint on a Cairo surface version of our // buffer, then give them the surface we're already using. diff --git a/webkit/glue/plugins/webplugin.cc b/webkit/glue/plugins/webplugin.cc index 18f722b..f780e18f 100644 --- a/webkit/glue/plugins/webplugin.cc +++ b/webkit/glue/plugins/webplugin.cc @@ -23,4 +23,9 @@ bool WebPluginGeometry::Equals(const WebPluginGeometry& rhs) const { rects_valid == rhs.rects_valid && visible == rhs.visible; } + +WebPluginDelegate* WebPlugin::delegate() { + return NULL; +} + } // namespace webkit_glue diff --git a/webkit/glue/plugins/webplugin.h b/webkit/glue/plugins/webplugin.h index 5fbef1f..8a61027 100644 --- a/webkit/glue/plugins/webplugin.h +++ b/webkit/glue/plugins/webplugin.h @@ -168,7 +168,7 @@ class WebPlugin { // Gets the WebPluginDelegate that implements the interface. // This API is only for use with Pepper, and is only overridden // by in-renderer implementations. - virtual WebPluginDelegate* delegate() { return NULL; } + virtual WebPluginDelegate* delegate(); // Handles NPN_URLRedirectResponse calls issued by plugins in response to // HTTP URL redirect notifications. |