diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-21 20:37:34 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-21 20:37:34 +0000 |
commit | b4c9d24055d39f74644eb22083c2d02ed58a62ce (patch) | |
tree | cf468f03b60942cbccd8a166713cf39a610f0131 | |
parent | 541025eca7bf1813da0d8a930afb6460eed7a4ef (diff) | |
download | chromium_src-b4c9d24055d39f74644eb22083c2d02ed58a62ce.zip chromium_src-b4c9d24055d39f74644eb22083c2d02ed58a62ce.tar.gz chromium_src-b4c9d24055d39f74644eb22083c2d02ed58a62ce.tar.bz2 |
* Revert "- Remove whitespace at the end of the line"
This reverts commit r3676.
Review URL: http://codereview.chromium.org/8025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3678 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/glue/SConscript | 2 | ||||
-rw-r--r-- | webkit/glue/webplugin_impl.cc | 65 | ||||
-rw-r--r-- | webkit/glue/webplugin_impl.h | 16 |
3 files changed, 31 insertions, 52 deletions
diff --git a/webkit/glue/SConscript b/webkit/glue/SConscript index f1a4c38..74881d9 100644 --- a/webkit/glue/SConscript +++ b/webkit/glue/SConscript @@ -58,7 +58,6 @@ input_files = [ 'webframeloaderclient_impl.cc', 'webhistoryitem_impl.cc', 'webkit_glue.cc', - 'webplugin_impl.cc', 'webtextinput_impl.cc', 'weburlrequest_impl.cc', 'webwidget_impl.cc', @@ -83,6 +82,7 @@ if env['PLATFORM'] == 'win32': 'plugins/webplugin_delegate_impl.cc', 'webdropdata.cc', 'webinputevent_win.cc', + 'webplugin_impl.cc', ]) env.ChromeStaticLibrary('glue', input_files) diff --git a/webkit/glue/webplugin_impl.cc b/webkit/glue/webplugin_impl.cc index b4144f0..46453c6 100644 --- a/webkit/glue/webplugin_impl.cc +++ b/webkit/glue/webplugin_impl.cc @@ -21,7 +21,7 @@ MSVC_PUSH_WARNING_LEVEL(0); #include "FrameView.h" #include "GraphicsContext.h" #include "HTMLNames.h" -#include "HTMLPlugInElement.h" +#include "HTMLPluginElement.h" #include "IntRect.h" #include "KURL.h" #include "KeyboardEvent.h" @@ -44,21 +44,18 @@ MSVC_POP_WARNING(); #include "base/message_loop.h" #include "base/string_util.h" #include "base/sys_string_conversions.h" -#include "glue_util.h" #include "net/base/escape.h" #include "webkit/glue/glue_util.h" #include "webkit/glue/multipart_response_delegate.h" #include "webkit/glue/webkit_glue.h" #include "webkit/glue/webplugin_impl.h" #include "webkit/glue/plugins/plugin_host.h" -#if defined(OS_WIN) #include "webkit/glue/plugins/plugin_instance.h" -#endif #include "webkit/glue/stacking_order_iterator.h" #include "webkit/glue/webview_impl.h" #include "googleurl/src/gurl.h" -// This class handles individual multipart responses. It is instantiated when +// This class handles invididual multipart responses. It is instantiated when // we receive HTTP status code 206 in the HTTP response. This indicates // that the response could have multiple parts each separated by a boundary // specified in the response header. @@ -66,7 +63,7 @@ class MultiPartResponseClient : public WebCore::ResourceHandleClient { public: MultiPartResponseClient(WebPluginResourceClient* resource_client) : resource_client_(resource_client) { - Clear(); + Clear(); } // Called when the multipart parser encounters an embedded multipart @@ -90,7 +87,7 @@ class MultiPartResponseClient : public WebCore::ResourceHandleClient { resource_client_->DidReceiveData( data, data_length, byte_range_lower_bound_); } - + void Clear() { resource_response_ = WebCore::ResourceResponse(); byte_range_lower_bound_ = 0; @@ -195,12 +192,12 @@ void WebPluginContainer::windowCutoutRects(const WebCore::IntRect& bounds, void WebPluginContainer::didReceiveResponse( const WebCore::ResourceResponse& response) { - + HttpResponseInfo http_response_info; ReadHttpResponseInfo(response, &http_response_info); impl_->delegate_->DidReceiveManualResponse( - http_response_info.url, + http_response_info.url, base::SysWideToNativeMB(http_response_info.mime_type), base::SysWideToNativeMB(impl_->GetAllHeaders(response)), http_response_info.expected_length, @@ -233,7 +230,7 @@ void WebPluginContainer::ReadHttpResponseInfo( // If the length comes in as -1, then it indicates that it was not // read off the HTTP headers. We replicate Safari webkit behavior here, // which is to set it to 0. - http_response->expected_length = + http_response->expected_length = static_cast<uint32>(std::max(response.expectedContentLength(), 0LL)); WebCore::String content_encoding = response.httpHeaderField("Content-Encoding"); @@ -270,15 +267,15 @@ WebPluginImpl::WebPluginImpl(WebCore::Element* element, WebFrameImpl* webframe, WebPluginDelegate* delegate, const GURL& plugin_url) - : windowless_(false), - window_(NULL), - element_(element), + : element_(element), webframe_(webframe), delegate_(delegate), + windowless_(false), + window_(NULL), force_geometry_update_(false), visible_(false), - received_first_paint_notification_(false), widget_(NULL), + received_first_paint_notification_(false), plugin_url_(plugin_url) { } @@ -398,11 +395,11 @@ RoutingStatus WebPluginImpl::RouteToFrame(const char *method, if (!frame()) return NOT_ROUTED; - // Take special action for JavaScript URLs + // Take special action for javascript URLs WebCore::String str_target = target; if (is_javascript_url) { WebCore::Frame *frameTarget = frame()->tree()->find(str_target); - // For security reasons, do not allow JavaScript on frames + // For security reasons, do not allow javascript on frames // other than this frame. if (frameTarget != frame()) { // FIXME - might be good to log this into a security @@ -689,22 +686,16 @@ void WebPluginImpl::paint(WebCore::GraphicsContext* gc, gc->translate(static_cast<float>(origin.x()), static_cast<float>(origin.y())); -#if defined(OS_WIN) // HDC is only used when in windowless mode. HDC hdc = gc->platformContext()->canvas()->beginPlatformPaint(); -#else - NOTIMPLEMENTED(); -#endif WebCore::IntRect window_rect = WebCore::IntRect(view->contentsToWindow(damage_rect.location()), damage_rect.size()); -#if defined(OS_WIN) delegate_->Paint(hdc, webkit_glue::FromIntRect(window_rect)); gc->platformContext()->canvas()->endPlatformPaint(); -#endif gc->restore(); } @@ -716,13 +707,9 @@ void WebPluginImpl::print(WebCore::GraphicsContext* gc) { return; gc->save(); -#if defined(OS_WIN) HDC hdc = gc->platformContext()->canvas()->beginPlatformPaint(); delegate_->Print(hdc); gc->platformContext()->canvas()->endPlatformPaint(); -#else - NOTIMPLEMENTED(); -#endif gc->restore(); } @@ -755,7 +742,6 @@ void WebPluginImpl::handleEvent(WebCore::Event* event) { } void WebPluginImpl::handleMouseEvent(WebCore::MouseEvent* event) { -#if defined(OS_WIN) DCHECK(parent()->isFrameView()); WebCore::IntPoint p = static_cast<WebCore::FrameView*>(parent())->contentsToWindow( @@ -839,13 +825,9 @@ void WebPluginImpl::handleMouseEvent(WebCore::MouseEvent* event) { // event. We need to reflect the changed cursor in the frame view as the // the mouse is moved in the boundaries of the windowless plugin. parent()->setCursor(WebCore::PlatformCursor(current_web_cursor)); -#else - NOTIMPLEMENTED(); -#endif } void WebPluginImpl::handleKeyboardEvent(WebCore::KeyboardEvent* event) { -#if defined(OS_WIN) NPEvent np_event; np_event.wParam = event->keyCode(); @@ -864,9 +846,6 @@ void WebPluginImpl::handleKeyboardEvent(WebCore::KeyboardEvent* event) { WebCursor current_web_cursor; if (!delegate_->HandleEvent(&np_event, ¤t_web_cursor)) event->setDefaultHandled(); -#else - NOTIMPLEMENTED(); -#endif } NPObject* WebPluginImpl::GetPluginScriptableObject() { @@ -905,16 +884,16 @@ std::wstring WebPluginImpl::GetAllHeaders( result.append(L"HTTP "); result.append(FormatNumber(response.httpStatusCode())); result.append(L" "); - result.append(StringToStdWString(status)); + result.append(status.characters(), status.length()); result.append(L"\n"); WebCore::HTTPHeaderMap::const_iterator it = response.httpHeaderFields().begin(); for (; it != response.httpHeaderFields().end(); ++it) { if (!it->first.isEmpty() && !it->second.isEmpty()) { - result.append(StringToStdWString(it->first)); + result.append(std::wstring(it->first.characters(), it->first.length())); result.append(L": "); - result.append(StringToStdWString(it->second)); + result.append(std::wstring(it->second.characters(), it->second.length())); result.append(L"\n"); } } @@ -934,7 +913,7 @@ void WebPluginImpl::didReceiveResponse(WebCore::ResourceHandle* handle, WebPluginContainer::ReadHttpResponseInfo(response, &http_response_info); bool cancel = false; - + if (response.httpStatusCode() == kHttpPartialResponseStatusCode) { HandleHttpMultipartResponse(response, client); return; @@ -991,7 +970,7 @@ void WebPluginImpl::didReceiveData(WebCore::ResourceHandle* handle, void WebPluginImpl::didFinishLoading(WebCore::ResourceHandle* handle) { WebPluginResourceClient* client = GetClientFromHandle(handle); if (client) { - MultiPartResponseHandlerMap::iterator index = + MultiPartResponseHandlerMap::iterator index = multi_part_response_map_.find(client); if (index != multi_part_response_map_.end()) { delete (*index).second; @@ -1193,7 +1172,7 @@ bool WebPluginImpl::InitiateHTTPRequest(int resource_id, if (!WebCore::FrameLoader::shouldHideReferrer(kurl, referrer)) info.request.setHTTPReferrer(referrer); - if (strcmp(method, "POST") == 0) { + if (lstrcmpA(method, "POST") == 0) { // Adds headers or form data to a request. This must be called before // we initiate the actual request. SetPostData(&info.request, buf, buf_len); @@ -1243,9 +1222,9 @@ void WebPluginImpl::HandleHttpMultipartResponse( MultiPartResponseClient* multi_part_response_client = new MultiPartResponseClient(client); - MultipartResponseDelegate* multi_part_response_handler = - new MultipartResponseDelegate(multi_part_response_client, NULL, - response, + MultipartResponseDelegate* multi_part_response_handler = + new MultipartResponseDelegate(multi_part_response_client, NULL, + response, multipart_boundary); multi_part_response_map_[client] = multi_part_response_handler; } diff --git a/webkit/glue/webplugin_impl.h b/webkit/glue/webplugin_impl.h index 827fa8c..56fa705 100644 --- a/webkit/glue/webplugin_impl.h +++ b/webkit/glue/webplugin_impl.h @@ -74,8 +74,8 @@ class WebPluginContainer : public WebCore::Widget { // can be used by any platform. void windowCutoutRects(const WebCore::IntRect& bounds, WTF::Vector<WebCore::IntRect>* cutouts) const; - - // These methods are invoked from webkit when it has data to be sent to the + + // These methods are invoked from webkit when it has data to be sent to the // plugin. The plugin in this case does not initiate a download for the data. void didReceiveResponse(const WebCore::ResourceResponse& response); void didReceiveData(const char *buffer, int length); @@ -88,7 +88,7 @@ class WebPluginContainer : public WebCore::Widget { uint32 last_modified; uint32 expected_length; }; - // Helper function to read fields in a HTTP response structure. + // 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, HttpResponseInfo* http_response); @@ -118,7 +118,7 @@ class WebPluginImpl : public WebPlugin, virtual NPObject* GetPluginScriptableObject(); - // Helper function for sorting post data. + // Helper function for sorting post data. static bool SetPostData(WebCore::ResourceRequest* request, const char *buf, uint32 length); @@ -137,10 +137,10 @@ class WebPluginImpl : public WebPlugin, // Executes the script passed in. The notify_needed and notify_data arguments // are passed in by the plugin process. These indicate whether the plugin - // expects a notification on script execution. We pass them back to the + // expects a notification on script execution. We pass them back to the // plugin as is. This avoids having to track the notification arguments // in the plugin process. - bool ExecuteScript(const std::string& url, const std::wstring& script, + bool ExecuteScript(const std::string& url, const std::wstring& script, bool notify_needed, int notify_data, bool popups_allowed); // Given a download request, check if we need to route the output @@ -258,7 +258,7 @@ class WebPluginImpl : public WebPlugin, WebCore::IntRect* clip_rect, std::vector<gfx::Rect>* cutout_rects); - void HandleURLRequest(const char *method, + void HandleURLRequest(const char *method, bool is_javascript_url, const char* target, unsigned int len, const char* buf, bool is_file_data, @@ -268,7 +268,7 @@ class WebPluginImpl : public WebPlugin, void CancelDocumentLoad(); void InitiateHTTPRangeRequest(const char* url, const char* range_info, - HANDLE existing_stream, bool notify_needed, + HANDLE existing_stream, bool notify_needed, HANDLE notify_data); // Handles HTTP multipart responses, i.e. responses received with a HTTP |