diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-21 15:05:21 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-21 15:05:21 +0000 |
commit | 397908018088686f21a81bbb822c519bdc2eae7a (patch) | |
tree | 6bcbe9ae0d6038f782b4d628c3f1a4f098584463 /webkit/glue/plugins | |
parent | 77c327ddb532777dde7e3a6f5dc078d4a76dcfab (diff) | |
download | chromium_src-397908018088686f21a81bbb822c519bdc2eae7a.zip chromium_src-397908018088686f21a81bbb822c519bdc2eae7a.tar.gz chromium_src-397908018088686f21a81bbb822c519bdc2eae7a.tar.bz2 |
More removal of WebCore usage from webplugin_impl.cc
Adds a few helper methods on WebFrame.
R=jam
BUG=10036
TEST=none
Review URL: http://codereview.chromium.org/173152
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23956 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/plugins')
-rw-r--r-- | webkit/glue/plugins/plugin_instance.cc | 19 | ||||
-rw-r--r-- | webkit/glue/plugins/plugin_instance.h | 11 | ||||
-rw-r--r-- | webkit/glue/plugins/webplugin_delegate_impl.cc | 6 | ||||
-rw-r--r-- | webkit/glue/plugins/webplugin_delegate_impl.h | 4 | ||||
-rw-r--r-- | webkit/glue/plugins/webplugin_delegate_impl_gtk.cc | 6 | ||||
-rw-r--r-- | webkit/glue/plugins/webplugin_delegate_impl_mac.mm | 6 |
6 files changed, 23 insertions, 29 deletions
diff --git a/webkit/glue/plugins/plugin_instance.cc b/webkit/glue/plugins/plugin_instance.cc index 79b5b4f..061093d 100644 --- a/webkit/glue/plugins/plugin_instance.cc +++ b/webkit/glue/plugins/plugin_instance.cc @@ -66,13 +66,13 @@ PluginInstance::~PluginInstance() { plugin_->CloseInstance(); } -PluginStreamUrl *PluginInstance::CreateStream(int resource_id, - const std::string &url, - const std::string &mime_type, +PluginStreamUrl* PluginInstance::CreateStream(int resource_id, + const GURL& url, + const std::string& mime_type, bool notify_needed, - void *notify_data) { - PluginStreamUrl *stream = new PluginStreamUrl( - resource_id, GURL(url), this, notify_needed, notify_data); + void* notify_data) { + PluginStreamUrl* stream = new PluginStreamUrl( + resource_id, url, this, notify_needed, notify_data); AddStream(stream); return stream; @@ -142,7 +142,6 @@ bool PluginInstance::Start(const GURL& url, int param_count, bool load_manually) { load_manually_ = load_manually; - instance_url_ = url; unsigned short mode = load_manually_ ? NP_FULL : NP_EMBED; npp_->ndata = this; @@ -362,16 +361,12 @@ void PluginInstance::SendJavaScriptStream(const std::string& url, } } -void PluginInstance::DidReceiveManualResponse(const std::string& url, +void PluginInstance::DidReceiveManualResponse(const GURL& url, const std::string& mime_type, const std::string& headers, uint32 expected_length, uint32 last_modified) { DCHECK(load_manually_); - std::string response_url = url; - if (response_url.empty()) { - response_url = instance_url_.spec(); - } plugin_data_stream_ = CreateStream(-1, url, mime_type, false, NULL); diff --git a/webkit/glue/plugins/plugin_instance.h b/webkit/glue/plugins/plugin_instance.h index ba8824f8..bed2a55 100644 --- a/webkit/glue/plugins/plugin_instance.h +++ b/webkit/glue/plugins/plugin_instance.h @@ -110,11 +110,11 @@ class PluginInstance : public base::RefCountedThreadSafe<PluginInstance> { // Set object_url to true if the load is for the object tag's // url, or false if it's for a url that the plugin // fetched through NPN_GetUrl[Notify]. - PluginStreamUrl *CreateStream(int resource_id, - const std::string &url, - const std::string &mime_type, + PluginStreamUrl* CreateStream(int resource_id, + const GURL& url, + const std::string& mime_type, bool notify_needed, - void *notify_data); + void* notify_data); // For each instance, we track all streams. When the // instance closes, all remaining streams are also @@ -170,7 +170,7 @@ class PluginInstance : public base::RefCountedThreadSafe<PluginInstance> { bool success, bool notify_needed, intptr_t notify_data); - void DidReceiveManualResponse(const std::string& url, + void DidReceiveManualResponse(const GURL& url, const std::string& mime_type, const std::string& headers, uint32 expected_length, @@ -238,7 +238,6 @@ class PluginInstance : public base::RefCountedThreadSafe<PluginInstance> { #endif MessageLoop* message_loop_; scoped_refptr<PluginStreamUrl> plugin_data_stream_; - GURL instance_url_; // This flag if true indicates that the plugin data would be passed from // webkit. if false indicates that the plugin should download the data. diff --git a/webkit/glue/plugins/webplugin_delegate_impl.cc b/webkit/glue/plugins/webplugin_delegate_impl.cc index 05975f4..37efc33 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl.cc +++ b/webkit/glue/plugins/webplugin_delegate_impl.cc @@ -430,7 +430,7 @@ void WebPluginDelegateImpl::SendJavaScriptStream(const std::string& url, } void WebPluginDelegateImpl::DidReceiveManualResponse( - const std::string& url, const std::string& mime_type, + const GURL& url, const std::string& mime_type, const std::string& headers, uint32 expected_length, uint32 last_modified) { if (!windowless_) { // Calling NPP_WriteReady before NPP_SetWindow causes movies to not load in @@ -1192,7 +1192,7 @@ bool WebPluginDelegateImpl::HandleInputEvent(const WebInputEvent& event, } WebPluginResourceClient* WebPluginDelegateImpl::CreateResourceClient( - int resource_id, const std::string &url, bool notify_needed, + int resource_id, const GURL& url, bool notify_needed, intptr_t notify_data, intptr_t existing_stream) { // Stream already exists. This typically happens for range requests // initiated via NPN_RequestRead. @@ -1204,7 +1204,7 @@ WebPluginResourceClient* WebPluginDelegateImpl::CreateResourceClient( } if (notify_needed) { - instance()->SetURLLoadData(GURL(url.c_str()), notify_data); + instance()->SetURLLoadData(url, notify_data); } std::string mime_type; NPAPI::PluginStreamUrl *stream = instance()->CreateStream( diff --git a/webkit/glue/plugins/webplugin_delegate_impl.h b/webkit/glue/plugins/webplugin_delegate_impl.h index 4cbf9c1..106a040 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl.h +++ b/webkit/glue/plugins/webplugin_delegate_impl.h @@ -65,7 +65,7 @@ class WebPluginDelegateImpl : public WebPluginDelegate { const std::wstring& result, bool success, bool notify_needed, intptr_t notify_data); - virtual void DidReceiveManualResponse(const std::string& url, + virtual void DidReceiveManualResponse(const GURL& url, const std::string& mime_type, const std::string& headers, uint32 expected_length, @@ -76,7 +76,7 @@ class WebPluginDelegateImpl : public WebPluginDelegate { virtual FilePath GetPluginPath(); virtual void InstallMissingPlugin(); virtual WebPluginResourceClient* CreateResourceClient(int resource_id, - const std::string &url, + const GURL& url, bool notify_needed, intptr_t notify_data, intptr_t stream); diff --git a/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc b/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc index eb9f963..da236b4 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc +++ b/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc @@ -209,7 +209,7 @@ void WebPluginDelegateImpl::SendJavaScriptStream(const std::string& url, } void WebPluginDelegateImpl::DidReceiveManualResponse( - const std::string& url, const std::string& mime_type, + const GURL& url, const std::string& mime_type, const std::string& headers, uint32 expected_length, uint32 last_modified) { if (!windowless_) { // Calling NPP_WriteReady before NPP_SetWindow causes movies to not load in @@ -837,7 +837,7 @@ bool WebPluginDelegateImpl::HandleInputEvent(const WebInputEvent& event, } WebPluginResourceClient* WebPluginDelegateImpl::CreateResourceClient( - int resource_id, const std::string &url, bool notify_needed, + int resource_id, const GURL& url, bool notify_needed, intptr_t notify_data, intptr_t existing_stream) { // Stream already exists. This typically happens for range requests // initiated via NPN_RequestRead. @@ -851,7 +851,7 @@ WebPluginResourceClient* WebPluginDelegateImpl::CreateResourceClient( } if (notify_needed) { - instance()->SetURLLoadData(GURL(url.c_str()), notify_data); + instance()->SetURLLoadData(url, notify_data); } std::string mime_type; NPAPI::PluginStreamUrl *stream = instance()->CreateStream( diff --git a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm index ebec821..f52ed34 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm +++ b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm @@ -214,7 +214,7 @@ void WebPluginDelegateImpl::SendJavaScriptStream(const std::string& url, } void WebPluginDelegateImpl::DidReceiveManualResponse( - const std::string& url, const std::string& mime_type, + const GURL& url, const std::string& mime_type, const std::string& headers, uint32 expected_length, uint32 last_modified) { instance()->DidReceiveManualResponse(url, mime_type, headers, expected_length, last_modified); @@ -512,7 +512,7 @@ bool WebPluginDelegateImpl::HandleInputEvent(const WebInputEvent& event, } WebPluginResourceClient* WebPluginDelegateImpl::CreateResourceClient( - int resource_id, const std::string &url, bool notify_needed, + int resource_id, const GURL& url, bool notify_needed, intptr_t notify_data, intptr_t existing_stream) { // Stream already exists. This typically happens for range requests // initiated via NPN_RequestRead. @@ -526,7 +526,7 @@ WebPluginResourceClient* WebPluginDelegateImpl::CreateResourceClient( } if (notify_needed) { - instance()->SetURLLoadData(GURL(url.c_str()), notify_data); + instance()->SetURLLoadData(url, notify_data); } std::string mime_type; NPAPI::PluginStreamUrl *stream = instance()->CreateStream( |