Commit b1f98f2b authored by ananta's avatar ananta Committed by Commit bot

The metro_driver should not block the UI thread while waiting for the Chrome...

The metro_driver should not block the UI thread while waiting for the Chrome browser IPC channel to be initialized.

This causes the taskbar to become unresponsive for a bit on Windows 7. Windows 8 also has the same
problem. However it is not as visible as on Windows 7.

Fix is to do the IPC channel dance in a timer.

BUG=417100
R=cpu

Review URL: https://codereview.chromium.org/593353003

Cr-Commit-Position: refs/heads/master@{#297058}
parent 4c5a4267
This diff is collapsed.
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop.h"
#include "base/strings/string16.h" #include "base/strings/string16.h"
#include "base/threading/thread.h"
#include "ipc/ipc_listener.h"
#include "ui/events/event_constants.h" #include "ui/events/event_constants.h"
#include "win8/metro_driver/direct3d_helper.h" #include "win8/metro_driver/direct3d_helper.h"
#include "win8/metro_driver/ime/ime_popup_observer.h" #include "win8/metro_driver/ime/ime_popup_observer.h"
...@@ -196,6 +198,12 @@ class ChromeAppViewAsh ...@@ -196,6 +198,12 @@ class ChromeAppViewAsh
HRESULT OnSizeChanged(winui::Core::ICoreWindow* sender, HRESULT OnSizeChanged(winui::Core::ICoreWindow* sender,
winui::Core::IWindowSizeChangedEventArgs* args); winui::Core::IWindowSizeChangedEventArgs* args);
// This function checks if the Chrome browser channel is initialized. If yes
// then it goes ahead and starts up the viewer in Chrome OS mode. If not it
// posts a delayed task and checks again. It does this for a duration of 10
// seconds and then bails.
void StartChromeOSMode();
mswr::ComPtr<winui::Core::ICoreWindow> window_; mswr::ComPtr<winui::Core::ICoreWindow> window_;
mswr::ComPtr<winapp::Core::ICoreApplicationView> view_; mswr::ComPtr<winapp::Core::ICoreApplicationView> view_;
EventRegistrationToken activated_token_; EventRegistrationToken activated_token_;
...@@ -220,8 +228,11 @@ class ChromeAppViewAsh ...@@ -220,8 +228,11 @@ class ChromeAppViewAsh
// Set the D3D swap chain and nothing else. // Set the D3D swap chain and nothing else.
metro_driver::Direct3DHelper direct3d_helper_; metro_driver::Direct3DHelper direct3d_helper_;
// The IPC channel IO thread.
scoped_ptr<base::Thread> io_thread_;
// The channel to Chrome, in particular to the MetroViewerProcessHost. // The channel to Chrome, in particular to the MetroViewerProcessHost.
IPC::ChannelProxy* ui_channel_; scoped_ptr<IPC::ChannelProxy> ui_channel_;
// The actual window behind the view surface. // The actual window behind the view surface.
HWND core_window_hwnd_; HWND core_window_hwnd_;
...@@ -241,6 +252,10 @@ class ChromeAppViewAsh ...@@ -241,6 +252,10 @@ class ChromeAppViewAsh
// The cursor set by the chroem browser process. // The cursor set by the chroem browser process.
HCURSOR last_cursor_; HCURSOR last_cursor_;
// Pointer to the channel listener for the channel between the viewer and
// the browser.
IPC::Listener* channel_listener_;
}; };
#endif // WIN8_METRO_DRIVER_CHROME_APP_VIEW_ASH_H_ #endif // WIN8_METRO_DRIVER_CHROME_APP_VIEW_ASH_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment