diff options
author | boliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-08 00:31:01 +0000 |
---|---|---|
committer | boliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-08 00:31:01 +0000 |
commit | 2985ed758610fb7d6d3a8d2400328d3ad7383fca (patch) | |
tree | 5f4873df3edd23b5e46702fc758da989a62a650e /content/renderer | |
parent | a9f94bc6fc85c5d406035402e116f1ae29b0b675 (diff) | |
download | chromium_src-2985ed758610fb7d6d3a8d2400328d3ad7383fca.zip chromium_src-2985ed758610fb7d6d3a8d2400328d3ad7383fca.tar.gz chromium_src-2985ed758610fb7d6d3a8d2400328d3ad7383fca.tar.bz2 |
Remove Android WebView synchronous find.
After the browser UI thread and the renderer compositor
threads are merged, all synchronous calls from UI to
renderer will possible deadlocks since the renderer
webkit thread blocks on the compositor thread all the time.
Therefore remove support for synchronous find in page which
is already an deprecated API.
BUG=179436
TBR=palmer@chromium.org (Only removing ipc message)
Review URL: https://chromiumcodereview.appspot.com/12383030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186827 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer')
-rw-r--r-- | content/renderer/render_view_impl.cc | 66 | ||||
-rw-r--r-- | content/renderer/render_view_impl.h | 20 |
2 files changed, 0 insertions, 86 deletions
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index 53e390b..e6abe7b 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc @@ -649,7 +649,6 @@ RenderViewImpl::RenderViewImpl(RenderViewImplParams* params) update_frame_info_scheduled_(false), expected_content_intent_id_(0), media_player_proxy_(NULL), - synchronous_find_active_match_ordinal_(-1), enumeration_completion_id_(0), ALLOW_THIS_IN_INITIALIZER_LIST( load_progress_tracker_(new LoadProgressTracker(this))), @@ -1105,7 +1104,6 @@ bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) { OnActivateNearestFindResult) IPC_MESSAGE_HANDLER(ViewMsg_FindMatchRects, OnFindMatchRects) IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) - IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewMsg_SynchronousFind, OnSynchronousFind) IPC_MESSAGE_HANDLER(ViewMsg_UndoScrollFocusedEditableNodeIntoView, OnUndoScrollFocusedEditableNodeIntoRect) IPC_MESSAGE_HANDLER(ViewMsg_EnableHidingTopControls, @@ -4243,19 +4241,6 @@ void RenderViewImpl::SendFindReply(int request_id, int ordinal, const WebRect& selection_rect, bool final_status_update) { -#if defined(OS_ANDROID) - if (synchronous_find_reply_message_.get()) { - if (final_status_update) { - ViewMsg_SynchronousFind::WriteReplyParams( - synchronous_find_reply_message_.get(), - match_count, - match_count ? synchronous_find_active_match_ordinal_ : 0); - Send(synchronous_find_reply_message_.release()); - } - return; - } -#endif - Send(new ViewHostMsg_Find_Reply(routing_id_, request_id, match_count, @@ -4302,15 +4287,6 @@ void RenderViewImpl::reportFindInPageMatchCount(int request_id, void RenderViewImpl::reportFindInPageSelection(int request_id, int active_match_ordinal, const WebRect& selection_rect) { -#if defined(OS_ANDROID) - // If this was a SynchronousFind request, we need to remember the ordinal - // value here for replying when reportFindInPageMatchCount is called. - if (synchronous_find_reply_message_.get()) { - synchronous_find_active_match_ordinal_ = active_match_ordinal; - return; - } -#endif - SendFindReply(request_id, -1, active_match_ordinal, @@ -4886,19 +4862,6 @@ WebKit::WebPlugin* RenderViewImpl::GetWebPluginFromPluginDocument() { void RenderViewImpl::OnFind(int request_id, const string16& search_text, const WebFindOptions& options) { -#if defined(OS_ANDROID) - // Make sure any asynchronous messages do not disrupt an ongoing synchronous - // find request as it might lead to deadlocks. Also, these should be safe to - // ignore since they would belong to a previous find request. - if (synchronous_find_reply_message_.get()) - return; -#endif - Find(request_id, search_text, options); -} - -void RenderViewImpl::Find(int request_id, - const string16& search_text, - const WebFindOptions& options) { WebFrame* main_frame = webview()->mainFrame(); // Check if the plugin still exists in the document. @@ -5015,18 +4978,6 @@ void RenderViewImpl::Find(int request_id, } void RenderViewImpl::OnStopFinding(StopFindAction action) { -#if defined(OS_ANDROID) - // Make sure any asynchronous messages do not disrupt an ongoing synchronous - // find request as it might lead to deadlocks. Also, these should be safe to - // ignore since they would belong to a previous find request. - if (synchronous_find_reply_message_.get()) - return; -#endif - - StopFinding(action); -} - -void RenderViewImpl::StopFinding(StopFindAction action) { WebView* view = webview(); if (!view) return; @@ -5061,23 +5012,6 @@ void RenderViewImpl::StopFinding(StopFindAction action) { } #if defined(OS_ANDROID) -void RenderViewImpl::OnSynchronousFind(int request_id, - const string16& search_string, - const WebFindOptions& options, - IPC::Message* reply_msg) { - // It is impossible for simultaneous blocking finds to occur. - CHECK(!synchronous_find_reply_message_.get()); - synchronous_find_reply_message_.reset(reply_msg); - - // Find next should be asynchronous in order to minimize blocking - // the UI thread as much as possible. - DCHECK(!options.findNext); - StopFinding(STOP_FIND_ACTION_KEEP_SELECTION); - synchronous_find_active_match_ordinal_ = -1; - - Find(request_id, search_string, options); -} - void RenderViewImpl::OnActivateNearestFindResult(int request_id, float x, float y) { if (!webview()) diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h index 80b4c21..c11df2c 100644 --- a/content/renderer/render_view_impl.h +++ b/content/renderer/render_view_impl.h @@ -1065,10 +1065,6 @@ class CONTENT_EXPORT RenderViewImpl void OnFindMatchRects(int current_version); void OnSelectPopupMenuItems(bool canceled, const std::vector<int>& selected_indices); - void OnSynchronousFind(int request_id, - const string16& search_string, - const WebKit::WebFindOptions& options, - IPC::Message* reply_msg); void OnUndoScrollFocusedEditableNodeIntoRect(); void OnEnableHidingTopControls(bool enable); #elif defined(OS_MACOSX) @@ -1140,11 +1136,6 @@ class CONTENT_EXPORT RenderViewImpl // doesn't have a frame at the specified size, the first is returned. bool DownloadFavicon(int id, const GURL& image_url, int image_size); - // Starts a new find-in-page search or looks for the next match. - void Find(int request_id, - const string16& search_text, - const WebKit::WebFindOptions& options); - GURL GetAlternateErrorPageURL(const GURL& failed_url, ErrorPageType error_type); @@ -1205,9 +1196,6 @@ class CONTENT_EXPORT RenderViewImpl // Starts nav_state_sync_timer_ if it isn't already running. void StartNavStateSyncTimerIfNecessary(); - // Stops the current find-in-page search. - void StopFinding(StopFindAction action); - // Dispatches the current state of selection on the webpage to the browser if // it has changed. // TODO(varunjain): delete this method once we figure out how to keep @@ -1500,14 +1488,6 @@ class CONTENT_EXPORT RenderViewImpl // created in the renderer process. scoped_ptr<webkit_media::MediaPlayerBridgeManagerImpl> media_bridge_manager_; - // Holds the message used to return find results to the browser during - // synchronous find-in-page requests. Only non-null during these requests. - scoped_ptr<IPC::Message> synchronous_find_reply_message_; - - // The active find-in-page match ordinal during synchronous requests. - // Needed to be remembered across WebKit callbacks. - int synchronous_find_active_match_ordinal_; - // A date/time picker object for date and time related input elements. scoped_ptr<RendererDateTimePicker> date_time_picker_client_; #endif |