Destroy CefResponseManager on the correct thread (issue #570).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@632 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
parent
9c9711c2d8
commit
8b1748bbf5
|
@ -499,6 +499,7 @@ void CefBrowserHostImpl::DestroyBrowser() {
|
|||
}
|
||||
|
||||
registrar_.reset(NULL);
|
||||
response_manager_.reset(NULL);
|
||||
content::WebContentsObserver::Observe(NULL);
|
||||
web_contents_.reset(NULL);
|
||||
|
||||
|
@ -669,7 +670,7 @@ void CefBrowserHostImpl::SendCommand(
|
|||
params.user_initiated = false;
|
||||
|
||||
if (responseHandler.get()) {
|
||||
params.request_id = response_manager_.RegisterHandler(responseHandler);
|
||||
params.request_id = response_manager_->RegisterHandler(responseHandler);
|
||||
params.expect_response = true;
|
||||
} else {
|
||||
params.request_id = -1;
|
||||
|
@ -705,7 +706,7 @@ void CefBrowserHostImpl::SendCode(
|
|||
params.user_initiated = false;
|
||||
|
||||
if (responseHandler.get()) {
|
||||
params.request_id = response_manager_.RegisterHandler(responseHandler);
|
||||
params.request_id = response_manager_->RegisterHandler(responseHandler);
|
||||
params.expect_response = true;
|
||||
} else {
|
||||
params.request_id = -1;
|
||||
|
@ -1031,13 +1032,13 @@ void CefBrowserHostImpl::OnRequest(const Cef_Request_Params& params) {
|
|||
}
|
||||
|
||||
void CefBrowserHostImpl::OnResponse(const Cef_Response_Params& params) {
|
||||
response_manager_.RunHandler(params);
|
||||
response_manager_->RunHandler(params);
|
||||
if (params.expect_response_ack)
|
||||
Send(new CefMsg_ResponseAck(routing_id(), params.request_id));
|
||||
}
|
||||
|
||||
void CefBrowserHostImpl::OnResponseAck(int request_id) {
|
||||
response_manager_.RunAckHandler(request_id);
|
||||
response_manager_->RunAckHandler(request_id);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1102,6 +1103,7 @@ CefBrowserHostImpl::CefBrowserHostImpl(const CefWindowInfo& window_info,
|
|||
registrar_.reset(new content::NotificationRegistrar);
|
||||
registrar_->Add(this, content::NOTIFICATION_WEB_CONTENTS_TITLE_UPDATED,
|
||||
content::Source<content::WebContents>(web_contents));
|
||||
response_manager_.reset(new CefResponseManager);
|
||||
|
||||
placeholder_frame_ =
|
||||
new CefFrameHostImpl(this, CefFrameHostImpl::kInvalidFrameId, true);
|
||||
|
|
|
@ -353,15 +353,15 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
|||
// Used when no other frame exists. Provides limited functionality.
|
||||
CefRefPtr<CefFrameHostImpl> placeholder_frame_;
|
||||
|
||||
// Manages response registrations.
|
||||
CefResponseManager response_manager_;
|
||||
|
||||
// Used for managing notification subscriptions.
|
||||
scoped_ptr<content::NotificationRegistrar> registrar_;
|
||||
|
||||
// Used for proxying cookie requests.
|
||||
scoped_refptr<CefURLRequestContextGetterProxy> request_context_proxy_;
|
||||
|
||||
// Manages response registrations.
|
||||
scoped_ptr<CefResponseManager> response_manager_;
|
||||
|
||||
// Used for creating and managing JavaScript dialogs.
|
||||
scoped_ptr<CefJavaScriptDialogCreator> dialog_creator_;
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include "libcef/common/cef_messages.h"
|
||||
#include "libcef/common/content_client.h"
|
||||
#include "libcef/common/process_message_impl.h"
|
||||
#include "libcef/common/response_manager.h"
|
||||
#include "libcef/renderer/content_renderer_client.h"
|
||||
#include "libcef/renderer/thread_util.h"
|
||||
#include "libcef/renderer/webkit_glue.h"
|
||||
|
@ -261,6 +262,7 @@ CefBrowserImpl::CefBrowserImpl(content::RenderView* render_view)
|
|||
browser_window_id_(kInvalidBrowserId),
|
||||
is_popup_(false),
|
||||
last_focused_frame_id_(kInvalidFrameId) {
|
||||
response_manager_.reset(new CefResponseManager);
|
||||
}
|
||||
|
||||
CefBrowserImpl::~CefBrowserImpl() {
|
||||
|
@ -424,6 +426,8 @@ void CefBrowserImpl::OnDestruct() {
|
|||
handler->OnBrowserDestroyed(this);
|
||||
}
|
||||
|
||||
response_manager_.reset(NULL);
|
||||
|
||||
CefContentRendererClient::Get()->OnBrowserDestroyed(this);
|
||||
}
|
||||
|
||||
|
@ -655,11 +659,11 @@ void CefBrowserImpl::OnRequest(const Cef_Request_Params& params) {
|
|||
}
|
||||
|
||||
void CefBrowserImpl::OnResponse(const Cef_Response_Params& params) {
|
||||
response_manager_.RunHandler(params);
|
||||
response_manager_->RunHandler(params);
|
||||
if (params.expect_response_ack)
|
||||
Send(new CefHostMsg_ResponseAck(routing_id(), params.request_id));
|
||||
}
|
||||
|
||||
void CefBrowserImpl::OnResponseAck(int request_id) {
|
||||
response_manager_.RunAckHandler(request_id);
|
||||
response_manager_->RunAckHandler(request_id);
|
||||
}
|
||||
|
|
|
@ -13,10 +13,10 @@
|
|||
|
||||
#include "include/cef_browser.h"
|
||||
#include "include/cef_client.h"
|
||||
#include "libcef/common/response_manager.h"
|
||||
#include "libcef/common/tracker.h"
|
||||
#include "libcef/renderer/frame_impl.h"
|
||||
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "content/public/renderer/render_view_observer.h"
|
||||
|
||||
class GURL;
|
||||
|
@ -24,6 +24,7 @@ struct CefMsg_LoadRequest_Params;
|
|||
struct Cef_Request_Params;
|
||||
struct Cef_Response_Params;
|
||||
class CefContentRendererClient;
|
||||
class CefResponseManager;
|
||||
|
||||
namespace base {
|
||||
class ListValue;
|
||||
|
@ -125,7 +126,7 @@ class CefBrowserImpl : public CefBrowser,
|
|||
FrameObjectMap frame_objects_;
|
||||
|
||||
// Manages response registrations.
|
||||
CefResponseManager response_manager_;
|
||||
scoped_ptr<CefResponseManager> response_manager_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING(CefBrowserImpl);
|
||||
DISALLOW_COPY_AND_ASSIGN(CefBrowserImpl);
|
||||
|
|
Loading…
Reference in New Issue