mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Merge revision 449-452 changes:
- Linux: Fix window destruction crash. - Linux: Fix cefclient shutdown crash. - Remove WebURLRequestTest.CANCEL test with WUR_STATE_LOADING due to flakiness. - Linux: Initialize the 'proxy_type' variable to make the compiler happy. git-svn-id: https://chromiumembedded.googlecode.com/svn/branches/963@454 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -786,8 +786,11 @@ void CefBrowserImpl::UIT_DestroyBrowser()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Clean up anything associated with the WebViewHost widget.
|
// Clean up anything associated with the WebViewHost widget.
|
||||||
UIT_GetWebViewHost()->webwidget()->close();
|
if (webviewhost_.get()) {
|
||||||
webviewhost_.reset();
|
if (webviewhost_->webwidget())
|
||||||
|
webviewhost_->webwidget()->close();
|
||||||
|
webviewhost_.reset();
|
||||||
|
}
|
||||||
|
|
||||||
// Remove the reference added in UIT_CreateBrowser().
|
// Remove the reference added in UIT_CreateBrowser().
|
||||||
Release();
|
Release();
|
||||||
|
@ -18,6 +18,14 @@
|
|||||||
using WebKit::WebRect;
|
using WebKit::WebRect;
|
||||||
using WebKit::WebSize;
|
using WebKit::WebSize;
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
void window_destroyed(GtkWidget* widget, CefBrowserImpl* browser) {
|
||||||
|
browser->UIT_DestroyBrowser();
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
void CefBrowserImpl::ParentWindowWillClose()
|
void CefBrowserImpl::ParentWindowWillClose()
|
||||||
{
|
{
|
||||||
// TODO(port): Implement this method if necessary.
|
// TODO(port): Implement this method if necessary.
|
||||||
@ -84,6 +92,8 @@ bool CefBrowserImpl::UIT_CreateBrowser(const CefString& url)
|
|||||||
dev_tools_agent_->SetWebView(webviewhost_->webview());
|
dev_tools_agent_->SetWebView(webviewhost_->webview());
|
||||||
|
|
||||||
window_info_.m_Widget = webviewhost_->view_handle();
|
window_info_.m_Widget = webviewhost_->view_handle();
|
||||||
|
g_signal_connect(G_OBJECT(window_info_.m_Widget), "destroy",
|
||||||
|
G_CALLBACK(window_destroyed), this);
|
||||||
|
|
||||||
Unlock();
|
Unlock();
|
||||||
|
|
||||||
@ -176,11 +186,8 @@ int CefBrowserImpl::UIT_GetPagesCount(WebKit::WebFrame* frame)
|
|||||||
// static
|
// static
|
||||||
void CefBrowserImpl::UIT_CloseView(gfx::NativeView view)
|
void CefBrowserImpl::UIT_CloseView(gfx::NativeView view)
|
||||||
{
|
{
|
||||||
GtkWidget* window =
|
GtkWidget* window = gtk_widget_get_toplevel(GTK_WIDGET(view));
|
||||||
gtk_widget_get_parent(gtk_widget_get_parent(GTK_WIDGET(view)));
|
gtk_widget_destroy(window);
|
||||||
|
|
||||||
MessageLoop::current()->PostTask(FROM_HERE, NewRunnableFunction(
|
|
||||||
>k_widget_destroy, GTK_WIDGET(window)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
|
@ -194,7 +194,6 @@ class WebWidgetHost {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
static gfx::NativeView CreateWidget(gfx::NativeView parent_view,
|
static gfx::NativeView CreateWidget(gfx::NativeView parent_view,
|
||||||
WebWidgetHost* host);
|
WebWidgetHost* host);
|
||||||
void WindowDestroyed();
|
|
||||||
void Resize(const gfx::Size& size);
|
void Resize(const gfx::Size& size);
|
||||||
virtual void KeyEvent(GdkEventKey* event);
|
virtual void KeyEvent(GdkEventKey* event);
|
||||||
#endif
|
#endif
|
||||||
|
@ -84,8 +84,6 @@ class WebWidgetHostGtkWidget {
|
|||||||
G_CALLBACK(&HandleConfigure), host);
|
G_CALLBACK(&HandleConfigure), host);
|
||||||
g_signal_connect(widget, "expose-event",
|
g_signal_connect(widget, "expose-event",
|
||||||
G_CALLBACK(&HandleExpose), host);
|
G_CALLBACK(&HandleExpose), host);
|
||||||
g_signal_connect(widget, "destroy",
|
|
||||||
G_CALLBACK(&HandleDestroy), host);
|
|
||||||
g_signal_connect(widget, "key-press-event",
|
g_signal_connect(widget, "key-press-event",
|
||||||
G_CALLBACK(&HandleKeyPress), host);
|
G_CALLBACK(&HandleKeyPress), host);
|
||||||
g_signal_connect(widget, "key-release-event",
|
g_signal_connect(widget, "key-release-event",
|
||||||
@ -154,16 +152,6 @@ class WebWidgetHostGtkWidget {
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The GdkWindow was destroyed.
|
|
||||||
static gboolean HandleDestroy(GtkWidget* widget, void* unused) {
|
|
||||||
// The associated WebWidgetHost instance may have already been destroyed.
|
|
||||||
WebWidgetHost* host = static_cast<WebWidgetHost*>(
|
|
||||||
g_object_get_data(G_OBJECT(widget), kWebWidgetHostKey));
|
|
||||||
if (host)
|
|
||||||
host->WindowDestroyed();
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Keyboard key pressed.
|
// Keyboard key pressed.
|
||||||
static gboolean HandleKeyPress(GtkWidget* widget,
|
static gboolean HandleKeyPress(GtkWidget* widget,
|
||||||
GdkEventKey* event,
|
GdkEventKey* event,
|
||||||
@ -455,10 +443,6 @@ void WebWidgetHost::PaintRect(const gfx::Rect& rect) {
|
|||||||
set_painting(false);
|
set_painting(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebWidgetHost::WindowDestroyed() {
|
|
||||||
delete this;
|
|
||||||
}
|
|
||||||
|
|
||||||
void WebWidgetHost::SendKeyEvent(cef_key_type_t type, int key, int modifiers,
|
void WebWidgetHost::SendKeyEvent(cef_key_type_t type, int key, int modifiers,
|
||||||
bool sysChar, bool imeChar)
|
bool sysChar, bool imeChar)
|
||||||
{
|
{
|
||||||
|
@ -218,7 +218,7 @@ void AppGetSettings(CefSettings& settings, CefRefPtr<CefApp>& app)
|
|||||||
|
|
||||||
// Retrieve command-line proxy configuration, if any.
|
// Retrieve command-line proxy configuration, if any.
|
||||||
bool has_proxy = false;
|
bool has_proxy = false;
|
||||||
cef_proxy_type_t proxy_type;
|
cef_proxy_type_t proxy_type = PROXY_TYPE_DIRECT;
|
||||||
CefString proxy_config;
|
CefString proxy_config;
|
||||||
|
|
||||||
if (g_command_line->HasSwitch(cefclient::kProxyType)) {
|
if (g_command_line->HasSwitch(cefclient::kProxyType)) {
|
||||||
|
@ -20,8 +20,7 @@ char szWorkingDir[512]; // The current working directory
|
|||||||
extern CefRefPtr<ClientHandler> g_handler;
|
extern CefRefPtr<ClientHandler> g_handler;
|
||||||
|
|
||||||
void destroy(void) {
|
void destroy(void) {
|
||||||
CefShutdown();
|
CefQuitMessageLoop();
|
||||||
exit(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerminationSignalHandler(int signatl) {
|
void TerminationSignalHandler(int signatl) {
|
||||||
@ -421,6 +420,8 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
CefRunMessageLoop();
|
CefRunMessageLoop();
|
||||||
|
|
||||||
|
CefShutdown();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ public:
|
|||||||
size_t len = contents_.length();
|
size_t len = contents_.length();
|
||||||
test_results_.contentLength = len;
|
test_results_.contentLength = len;
|
||||||
#ifdef WEB_URLREQUEST_DEBUG
|
#ifdef WEB_URLREQUEST_DEBUG
|
||||||
printf("Response: %d - %s\n", len, contents_.c_str());
|
printf("Response: %lu - %s\n", len, contents_.c_str());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
TestCompleted();
|
TestCompleted();
|
||||||
@ -455,15 +455,14 @@ TEST(WebURLRequestTest, CANCEL)
|
|||||||
|
|
||||||
cef_weburlrequest_state_t cancelAt[] = {
|
cef_weburlrequest_state_t cancelAt[] = {
|
||||||
WUR_STATE_STARTED,
|
WUR_STATE_STARTED,
|
||||||
WUR_STATE_HEADERS_RECEIVED,
|
WUR_STATE_HEADERS_RECEIVED
|
||||||
WUR_STATE_LOADING
|
|
||||||
};
|
};
|
||||||
|
|
||||||
for (unsigned int i=0; i < COUNTOF_(cancelAt); ++i) {
|
for (unsigned int i=0; i < COUNTOF_(cancelAt); ++i) {
|
||||||
TestResults tr;
|
TestResults tr;
|
||||||
CefRefPtr<BrowserTestHandler> browser = new BrowserForTest(tr, cancelAt[i]);
|
CefRefPtr<BrowserTestHandler> browser = new BrowserForTest(tr, cancelAt[i]);
|
||||||
browser->ExecuteTest();
|
browser->ExecuteTest();
|
||||||
EXPECT_TRUE(tr.got_abort);
|
EXPECT_TRUE(tr.got_abort) << "i = " << i;
|
||||||
EXPECT_TRUE(tr.got_deleted);
|
EXPECT_TRUE(tr.got_deleted);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user