diff options
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/webplugin.h | 7 | ||||
-rw-r--r-- | webkit/glue/webplugin_delegate.h | 30 | ||||
-rw-r--r-- | webkit/glue/webplugin_impl.cc | 19 | ||||
-rw-r--r-- | webkit/glue/webplugin_impl.h | 8 |
4 files changed, 36 insertions, 28 deletions
diff --git a/webkit/glue/webplugin.h b/webkit/glue/webplugin.h index 8354e7d..7350df4 100644 --- a/webkit/glue/webplugin.h +++ b/webkit/glue/webplugin.h @@ -12,6 +12,9 @@ #include "base/file_path.h" #include "base/gfx/rect.h" +// TODO(port): type typedefs are obviously incorrect on non-Windows +// platforms, but now a lot of code now accidentally depends on them +// existing. #ifdef out these declarations and fix all the users. typedef struct HWND__* HWND; typedef void* HANDLE; @@ -123,7 +126,7 @@ class WebPlugin { // Handles GetURL/GetURLNotify/PostURL/PostURLNotify requests initiated // by plugins. - virtual void HandleURLRequest(const char *method, + virtual void HandleURLRequest(const char *method, bool is_javascript_url, const char* target, unsigned int len, const char* buf, bool is_file_data, @@ -157,7 +160,7 @@ class WebPluginResourceClient { uint32 last_modified, bool request_is_seekable, bool* cancel) = 0; - virtual void DidReceiveData(const char* buffer, int length, + virtual void DidReceiveData(const char* buffer, int length, int data_offset) = 0; virtual void DidFinishLoading() = 0; virtual void DidFail() = 0; diff --git a/webkit/glue/webplugin_delegate.h b/webkit/glue/webplugin_delegate.h index 7ffd952..16d9c50 100644 --- a/webkit/glue/webplugin_delegate.h +++ b/webkit/glue/webplugin_delegate.h @@ -15,12 +15,13 @@ #include "third_party/npapi/bindings/npapi.h" typedef struct HDC__* HDC; +struct NPObject; class GURL; -class WebPlugin; -struct NPObject; class WebCursor; +class WebPlugin; class WebPluginResourceClient; + // This is the interface that a plugin implementation needs to provide. class WebPluginDelegate { public: @@ -32,10 +33,10 @@ class WebPluginDelegate { // If this function returns false the plugin isn't started and shouldn't be // called again. If this method succeeds, then the WebPlugin is valid until // PluginDestroyed is called. - // The load_manually parameter if true indicates that the plugin data would - // be passed from webkit. if false indicates that the plugin should download - // the data. This also controls whether the plugin is instantiated as a full - // page plugin (NP_FULL) or embedded (NP_EMBED) + // The load_manually parameter if true indicates that the plugin data would + // be passed from webkit. if false indicates that the plugin should download + // the data. This also controls whether the plugin is instantiated as a full + // page plugin (NP_FULL) or embedded (NP_EMBED). virtual bool Initialize(const GURL& url, char** argn, char** argv, int argc, WebPlugin* plugin, bool load_manually) = 0; @@ -72,7 +73,7 @@ class WebPluginDelegate { // Receives notification about a resource load that the plugin initiated // for a frame. virtual void DidFinishLoadWithReason(NPReason reason) = 0; - + // Returns the process id of the process that is running the plugin. virtual int GetProcessId() = 0; @@ -80,11 +81,11 @@ class WebPluginDelegate { // The result of the script execution is returned via this function. virtual void SendJavaScriptStream(const std::string& url, - const std::wstring& result, - bool success, bool notify_needed, + const std::wstring& result, + bool success, bool notify_needed, int notify_data) = 0; - // Receives notification about data being available. + // Receives notification about data being available. virtual void DidReceiveManualResponse(const std::string& url, const std::string& mime_type, const std::string& headers, @@ -100,10 +101,10 @@ class WebPluginDelegate { // Indicates a failure in data receipt. virtual void DidManualLoadFail() = 0; - // Only Available after Initialize is called. + // Only available after Initialize is called. virtual FilePath GetPluginPath() = 0; - // Only Supported when the plugin is the default plugin. + // Only supported when the plugin is the default plugin. virtual void InstallMissingPlugin() = 0; // Creates a WebPluginResourceClient instance and returns the same. @@ -112,8 +113,9 @@ class WebPluginDelegate { bool notify_needed, void *notify_data, void* stream) = 0; - // Notifies the delegate about a Get/Post URL request getting routed - virtual void URLRequestRouted(const std::string&url, bool notify_needed, + + // Notifies the delegate about a Get/Post URL request getting routed. + virtual void URLRequestRouted(const std::string&url, bool notify_needed, void* notify_data) = 0; private: DISALLOW_EVIL_CONSTRUCTORS(WebPluginDelegate); diff --git a/webkit/glue/webplugin_impl.cc b/webkit/glue/webplugin_impl.cc index a095b79..d7d32a4 100644 --- a/webkit/glue/webplugin_impl.cc +++ b/webkit/glue/webplugin_impl.cc @@ -113,7 +113,7 @@ class MultiPartResponseClient : public WebCore::ResourceHandleClient { WebPluginResourceClient* resource_client_; }; -WebPluginContainer::WebPluginContainer(WebPluginImpl* impl) +WebPluginContainer::WebPluginContainer(WebPluginImpl* impl) : impl_(impl), ignore_response_error_(false) { } @@ -128,8 +128,8 @@ NPObject* WebPluginContainer::GetPluginScriptableObject() { } #if USE(JSC) -bool WebPluginContainer::isPluginView() const { - return true; +bool WebPluginContainer::isPluginView() const { + return true; } #endif @@ -156,7 +156,8 @@ void WebPluginContainer::invalidateRect(const WebCore::IntRect& rect) { if (parent()) { WebCore::IntRect damageRect = convertToContainingWindow(rect); - // Get our clip rect and intersect with it to ensure we don't invalidate too much. + // Get our clip rect and intersect with it to ensure we don't + // invalidate too much. WebCore::IntRect clipRect = parent()->windowClipRect(); damageRect.intersect(clipRect); @@ -209,7 +210,7 @@ void WebPluginContainer::frameRectsChanged() { // reversed, Flash won't load videos. void WebPluginContainer::setParent(WebCore::ScrollView* view) { WebCore::Widget::setParent(view); - if (view) { + if (view) { impl_->setFrameRect(frameRect()); impl_->delegate_->FlushGeometryUpdates(); } @@ -371,7 +372,7 @@ bool WebPluginImpl::ExecuteScript(const std::string& url, // we also need to addref the frame. WTF::RefPtr<WebCore::Frame> cur_frame(frame()); - WebCore::ScriptValue result = + WebCore::ScriptValue result = frame()->loader()->executeScript(script_str, popups_allowed); WebCore::String script_result; std::wstring wresult; @@ -990,7 +991,7 @@ void WebPluginImpl::didReceiveResponse(WebCore::ResourceHandle* handle, for (size_t i = 0; i < clients_.size(); ++i) { if (clients_[i].handle.get() == handle) { WebPluginResourceClient* resource_client = - delegate_->CreateResourceClient(clients_[i].id, + delegate_->CreateResourceClient(clients_[i].id, plugin_url_.spec().c_str(), NULL, false, NULL); clients_[i].client = resource_client; @@ -1233,7 +1234,7 @@ bool WebPluginImpl::InitiateHTTPRequest(int resource_id, // plugin SRC url as the referrer if it is available. if (use_plugin_src_as_referrer && !plugin_url_.spec().empty()) { referrer = webkit_glue::StdStringToString(plugin_url_.spec()); - } else { + } else { referrer = frame()->loader()->outgoingReferrer(); } @@ -1353,7 +1354,7 @@ bool WebPluginImpl::ReinitializePluginForResponse( // Force a geometry update to occur to ensure that the plugin becomes // visible. widget_->frameRectsChanged(); - delegate_->FlushGeometryUpdates(); + delegate_->FlushGeometryUpdates(); return true; } diff --git a/webkit/glue/webplugin_impl.h b/webkit/glue/webplugin_impl.h index 4f6782a..b99b784 100644 --- a/webkit/glue/webplugin_impl.h +++ b/webkit/glue/webplugin_impl.h @@ -56,7 +56,7 @@ class WebPluginContainer : public WebCore::Widget { WebPluginContainer(WebPluginImpl* impl); virtual ~WebPluginContainer(); NPObject* GetPluginScriptableObject(); - + // Widget methods: virtual void setFrameRect(const WebCore::IntRect& rect); virtual void paint(WebCore::GraphicsContext*, const WebCore::IntRect& rect); @@ -98,6 +98,7 @@ class WebPluginContainer : public WebCore::Widget { uint32 last_modified; uint32 expected_length; }; + // Helper function to read fields in a HTTP response structure. // These fields are written to the HttpResponseInfo structure passed in. static void ReadHttpResponseInfo(const WebCore::ResourceResponse& response, @@ -272,7 +273,8 @@ class WebPluginImpl : public WebPlugin, WebCore::Frame* frame() { return webframe_ ? webframe_->frame() : NULL; } - // Calculates the bounds of the plugin widget based on the frame rect passed in. + // Calculates the bounds of the plugin widget based on the frame + // rect passed in. void CalculateBounds(const WebCore::IntRect& frame_rect, WebCore::IntRect* window_rect, WebCore::IntRect* clip_rect, @@ -308,7 +310,7 @@ class WebPluginImpl : public WebPlugin, bool ReinitializePluginForResponse(WebCore::ResourceHandle* response_handle); // Helper functions to convert an array of names/values to a vector. - static void ArrayToVector(int total_values, char** values, + static void ArrayToVector(int total_values, char** values, std::vector<std::string>* value_vector); struct ClientInfo { |