diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-13 20:10:45 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-13 20:10:45 +0000 |
commit | ddb1e5ae096bd91da721887fd55e68c603bf7067 (patch) | |
tree | 401d9a379ff03bb8b69a1ce9c23fe182f673f587 /webkit | |
parent | 1c9526e0650a91e412d815417634c9f193b1a4d5 (diff) | |
download | chromium_src-ddb1e5ae096bd91da721887fd55e68c603bf7067.zip chromium_src-ddb1e5ae096bd91da721887fd55e68c603bf7067.tar.gz chromium_src-ddb1e5ae096bd91da721887fd55e68c603bf7067.tar.bz2 |
Even more virtual method deinlining.
BUG=none
TEST=compiles
Review URL: http://codereview.chromium.org/5741001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69041 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
20 files changed, 86 insertions, 30 deletions
diff --git a/webkit/appcache/appcache_url_request_job.cc b/webkit/appcache/appcache_url_request_job.cc index 9dc19ea..10245f7 100644 --- a/webkit/appcache/appcache_url_request_job.cc +++ b/webkit/appcache/appcache_url_request_job.cc @@ -256,6 +256,10 @@ int AppCacheURLRequestJob::GetResponseCode() const { return http_info()->headers->response_code(); } +bool AppCacheURLRequestJob::IsCachedContent() const { + return is_delivering_appcache_response(); +} + bool AppCacheURLRequestJob::ReadRawData(net::IOBuffer* buf, int buf_size, int *bytes_read) { DCHECK(is_delivering_appcache_response()); diff --git a/webkit/appcache/appcache_url_request_job.h b/webkit/appcache/appcache_url_request_job.h index 2b97291..f66ed54 100644 --- a/webkit/appcache/appcache_url_request_job.h +++ b/webkit/appcache/appcache_url_request_job.h @@ -125,9 +125,7 @@ class AppCacheURLRequestJob : public net::URLRequestJob, // FilterContext methods virtual bool GetMimeType(std::string* mime_type) const; virtual int GetResponseCode() const; - virtual bool IsCachedContent() const { - return is_delivering_appcache_response(); - } + virtual bool IsCachedContent() const; AppCacheStorage* storage_; bool has_been_started_; diff --git a/webkit/glue/media/buffered_data_source.cc b/webkit/glue/media/buffered_data_source.cc index 2e91bcc..c5e39b7 100644 --- a/webkit/glue/media/buffered_data_source.cc +++ b/webkit/glue/media/buffered_data_source.cc @@ -253,6 +253,26 @@ void BufferedResourceLoader::SetAllowDefer(bool is_allowed) { DisableDeferIfNeeded(); } +int64 BufferedResourceLoader::content_length() { + return content_length_; +} + +int64 BufferedResourceLoader::instance_size() { + return instance_size_; +} + +bool BufferedResourceLoader::partial_response() { + return partial_response_; +} + +bool BufferedResourceLoader::network_activity() { + return !completed_ && !deferred_; +} + +const GURL& BufferedResourceLoader::url() { + return url_; +} + void BufferedResourceLoader::SetURLLoaderForTest(WebURLLoader* mock_loader) { url_loader_.reset(mock_loader); keep_test_loader_ = true; diff --git a/webkit/glue/media/buffered_data_source.h b/webkit/glue/media/buffered_data_source.h index 12e8280..6ea6f1c 100644 --- a/webkit/glue/media/buffered_data_source.h +++ b/webkit/glue/media/buffered_data_source.h @@ -99,21 +99,21 @@ class BufferedResourceLoader : // Gets the content length in bytes of the instance after this loader has been // started. If this value is -1, then content length is unknown. - virtual int64 content_length() { return content_length_; } + virtual int64 content_length(); // Gets the original size of the file requested. If this value is -1, then // the size is unknown. - virtual int64 instance_size() { return instance_size_; } + virtual int64 instance_size(); // Returns true if the response for this loader is a partial response. // It means a 206 response in HTTP/HTTPS protocol. - virtual bool partial_response() { return partial_response_; } + virtual bool partial_response(); // Returns true if network is currently active. - virtual bool network_activity() { return !completed_ && !deferred_; } + virtual bool network_activity(); // Returns resulting URL. - virtual const GURL& url() { return url_; } + virtual const GURL& url(); // Used to inject a mock used for unittests. virtual void SetURLLoaderForTest(WebKit::WebURLLoader* mock_loader); diff --git a/webkit/glue/plugins/pepper_graphics_2d.cc b/webkit/glue/plugins/pepper_graphics_2d.cc index 7ccfae5..f051b89 100644 --- a/webkit/glue/plugins/pepper_graphics_2d.cc +++ b/webkit/glue/plugins/pepper_graphics_2d.cc @@ -243,6 +243,10 @@ bool Graphics2D::Init(int width, int height, bool is_always_opaque) { return true; } +Graphics2D* Graphics2D::AsGraphics2D() { + return this; +} + PP_Bool Graphics2D::Describe(PP_Size* size, PP_Bool* is_always_opaque) { size->width = image_data_->width(); size->height = image_data_->height(); diff --git a/webkit/glue/plugins/pepper_graphics_2d.h b/webkit/glue/plugins/pepper_graphics_2d.h index 78170ab..320209a 100644 --- a/webkit/glue/plugins/pepper_graphics_2d.h +++ b/webkit/glue/plugins/pepper_graphics_2d.h @@ -39,7 +39,7 @@ class Graphics2D : public Resource { bool is_always_opaque() const { return is_always_opaque_; } // Resource override. - virtual Graphics2D* AsGraphics2D() { return this; } + virtual Graphics2D* AsGraphics2D(); // PPB_Graphics2D functions. PP_Bool Describe(PP_Size* size, PP_Bool* is_always_opaque); diff --git a/webkit/glue/plugins/pepper_graphics_3d.cc b/webkit/glue/plugins/pepper_graphics_3d.cc index 2dc4def..34551da 100644 --- a/webkit/glue/plugins/pepper_graphics_3d.cc +++ b/webkit/glue/plugins/pepper_graphics_3d.cc @@ -145,6 +145,10 @@ void Graphics3D::ResetCurrent() { CurrentContextKey::get()->Set(NULL); } +Graphics3D* Graphics3D::AsGraphics3D() { + return this; +} + Graphics3D::~Graphics3D() { Destroy(); } diff --git a/webkit/glue/plugins/pepper_graphics_3d.h b/webkit/glue/plugins/pepper_graphics_3d.h index 5c00068..420a364 100644 --- a/webkit/glue/plugins/pepper_graphics_3d.h +++ b/webkit/glue/plugins/pepper_graphics_3d.h @@ -41,9 +41,7 @@ class Graphics3D : public Resource { static void ResetCurrent(); // Resource override. - virtual Graphics3D* AsGraphics3D() { - return this; - } + virtual Graphics3D* AsGraphics3D(); bool Init(PP_Instance instance_id, int32_t config, const int32_t* attrib_list); diff --git a/webkit/glue/plugins/pepper_image_data.cc b/webkit/glue/plugins/pepper_image_data.cc index 7a0ecb1..13fb4ef 100644 --- a/webkit/glue/plugins/pepper_image_data.cc +++ b/webkit/glue/plugins/pepper_image_data.cc @@ -142,6 +142,10 @@ bool ImageData::IsImageDataFormatSupported(PP_ImageDataFormat format) { format == PP_IMAGEDATAFORMAT_RGBA_PREMUL; } +ImageData* ImageData::AsImageData() { + return this; +} + bool ImageData::Init(PP_ImageDataFormat format, int width, int height, bool init_to_zero) { diff --git a/webkit/glue/plugins/pepper_image_data.h b/webkit/glue/plugins/pepper_image_data.h index 75bead7..2c7adde 100644 --- a/webkit/glue/plugins/pepper_image_data.h +++ b/webkit/glue/plugins/pepper_image_data.h @@ -53,7 +53,7 @@ class ImageData : public Resource { static bool IsImageDataFormatSupported(PP_ImageDataFormat format); // Resource overrides. - virtual ImageData* AsImageData() { return this; } + virtual ImageData* AsImageData(); // PPB_ImageData implementation. bool Init(PP_ImageDataFormat format, diff --git a/webkit/glue/plugins/pepper_resource.cc b/webkit/glue/plugins/pepper_resource.cc index 851d6e7..34d6ee3 100644 --- a/webkit/glue/plugins/pepper_resource.cc +++ b/webkit/glue/plugins/pepper_resource.cc @@ -34,4 +34,9 @@ void Resource::StoppedTracking() { resource_id_ = 0; } +#define DEFINE_TYPE_GETTER(RESOURCE) \ + RESOURCE* Resource::As##RESOURCE() { return NULL; } +FOR_ALL_RESOURCES(DEFINE_TYPE_GETTER) +#undef DEFINE_TYPE_GETTER + } // namespace pepper diff --git a/webkit/glue/plugins/pepper_resource.h b/webkit/glue/plugins/pepper_resource.h index 551b89d..3d7d307 100644 --- a/webkit/glue/plugins/pepper_resource.h +++ b/webkit/glue/plugins/pepper_resource.h @@ -103,7 +103,7 @@ class Resource : public base::RefCountedThreadSafe<Resource> { // 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 @@ -135,7 +135,6 @@ class Resource : public base::RefCountedThreadSafe<Resource> { FOR_ALL_RESOURCES(DEFINE_RESOURCE_CAST) #undef DEFINE_RESOURCE_CAST -#undef FOR_ALL_RESOURCES } // namespace pepper #endif // WEBKIT_GLUE_PLUGINS_PEPPER_RESOURCE_H_ diff --git a/webkit/glue/plugins/pepper_transport.cc b/webkit/glue/plugins/pepper_transport.cc index 29a4495..f43d502 100644 --- a/webkit/glue/plugins/pepper_transport.cc +++ b/webkit/glue/plugins/pepper_transport.cc @@ -130,6 +130,10 @@ Transport::~Transport() { // TODO(juberti): teardown } +Transport* Transport::AsTransport() { + return this; +} + bool Transport::Init(const char* name, const char* proto) { // TODO(juberti): impl diff --git a/webkit/glue/plugins/pepper_transport.h b/webkit/glue/plugins/pepper_transport.h index fbba691..500dda0 100644 --- a/webkit/glue/plugins/pepper_transport.h +++ b/webkit/glue/plugins/pepper_transport.h @@ -19,9 +19,7 @@ class Transport : public Resource { explicit Transport(PluginModule* module); virtual ~Transport(); static const PPB_Transport_Dev* GetInterface(); - virtual Transport* AsTransport() { - return this; - } + virtual Transport* AsTransport(); bool Init(const char* name, const char* proto); private: diff --git a/webkit/glue/plugins/pepper_var.cc b/webkit/glue/plugins/pepper_var.cc index db83229..24fa2c3 100644 --- a/webkit/glue/plugins/pepper_var.cc +++ b/webkit/glue/plugins/pepper_var.cc @@ -652,6 +652,10 @@ Var::Var(PluginModule* module) : Resource(module) { Var::~Var() { } +Var* Var::AsVar() { + return this; +} + // static PP_Var Var::NPVariantToPPVar(PluginModule* module, const NPVariant* variant) { switch (variant->type) { @@ -744,6 +748,10 @@ StringVar::StringVar(PluginModule* module, const char* str, uint32 len) StringVar::~StringVar() { } +StringVar* StringVar::AsStringVar() { + return this; +} + // static PP_Var StringVar::StringToPPVar(PluginModule* module, const std::string& var) { return StringToPPVar(module, var.c_str(), var.size()); @@ -785,6 +793,10 @@ ObjectVar::~ObjectVar() { WebBindings::releaseObject(np_object_); } +ObjectVar* ObjectVar::AsObjectVar() { + return this; +} + // static PP_Var ObjectVar::NPObjectToPPVar(PluginModule* module, NPObject* object) { scoped_refptr<ObjectVar> object_var(module->ObjectVarForNPObject(object)); diff --git a/webkit/glue/plugins/pepper_var.h b/webkit/glue/plugins/pepper_var.h index 8929448..e59920a 100644 --- a/webkit/glue/plugins/pepper_var.h +++ b/webkit/glue/plugins/pepper_var.h @@ -28,7 +28,7 @@ class Var : public Resource { virtual ~Var(); // Resource overrides. - virtual Var* AsVar() { return this; } + virtual Var* AsVar(); // Returns a PP_Var that corresponds to the given NPVariant. The contents of // the NPVariant will be copied unless the NPVariant corresponds to an @@ -114,7 +114,7 @@ class StringVar : public Var { const std::string& value() const { return value_; } // Resource overrides. - virtual StringVar* AsStringVar() { return this; } + virtual StringVar* AsStringVar(); // Helper function to create a PP_Var of type string that contains a copy of // the given string. The input data must be valid UTF-8 encoded text, if it @@ -154,7 +154,7 @@ class ObjectVar : public Var { virtual ~ObjectVar(); // Resource overrides. - virtual ObjectVar* AsObjectVar() { return this; } + virtual ObjectVar* AsObjectVar(); // Returns the underlying NPObject corresponding to this ObjectVar. // Guaranteed non-NULL. diff --git a/webkit/glue/plugins/plugin_stream.cc b/webkit/glue/plugins/plugin_stream.cc index 728b180..e465e2d 100644 --- a/webkit/glue/plugins/plugin_stream.cc +++ b/webkit/glue/plugins/plugin_stream.cc @@ -244,6 +244,10 @@ bool PluginStream::Close(NPReason reason) { return true; } +webkit_glue::WebPluginResourceClient* PluginStream::AsResourceClient() { + return NULL; +} + void PluginStream::Notify(NPReason reason) { if (notify_needed_) { instance_->NPP_URLNotify(stream_.url, reason, notify_data_); diff --git a/webkit/glue/plugins/plugin_stream.h b/webkit/glue/plugins/plugin_stream.h index b277465..c5975b4 100644 --- a/webkit/glue/plugins/plugin_stream.h +++ b/webkit/glue/plugins/plugin_stream.h @@ -64,9 +64,7 @@ class PluginStream : public base::RefCounted<PluginStream> { // Close the stream. virtual bool Close(NPReason reason); - virtual webkit_glue::WebPluginResourceClient* AsResourceClient() { - return NULL; - } + virtual webkit_glue::WebPluginResourceClient* AsResourceClient(); // Cancels any HTTP requests initiated by the stream. virtual void CancelRequest() {} diff --git a/webkit/glue/webmediaplayer_impl.cc b/webkit/glue/webmediaplayer_impl.cc index 830a1942..13c448e 100644 --- a/webkit/glue/webmediaplayer_impl.cc +++ b/webkit/glue/webmediaplayer_impl.cc @@ -505,6 +505,14 @@ int WebMediaPlayerImpl::dataRate() const { return 0; } +WebKit::WebMediaPlayer::NetworkState WebMediaPlayerImpl::networkState() const { + return network_state_; +} + +WebKit::WebMediaPlayer::ReadyState WebMediaPlayerImpl::readyState() const { + return ready_state_; +} + const WebKit::WebTimeRanges& WebMediaPlayerImpl::buffered() { DCHECK(MessageLoop::current() == main_loop_); diff --git a/webkit/glue/webmediaplayer_impl.h b/webkit/glue/webmediaplayer_impl.h index d1f73a0..8aa6661 100644 --- a/webkit/glue/webmediaplayer_impl.h +++ b/webkit/glue/webmediaplayer_impl.h @@ -226,12 +226,8 @@ class WebMediaPlayerImpl : public WebKit::WebMediaPlayer, // Internal states of loading and network. // TODO(hclam): Ask the pipeline about the state rather than having reading // them from members which would cause race conditions. - virtual WebKit::WebMediaPlayer::NetworkState networkState() const { - return network_state_; - } - virtual WebKit::WebMediaPlayer::ReadyState readyState() const { - return ready_state_; - } + virtual WebKit::WebMediaPlayer::NetworkState networkState() const; + virtual WebKit::WebMediaPlayer::ReadyState readyState() const; virtual unsigned long long bytesLoaded() const; virtual unsigned long long totalBytes() const; |