diff options
author | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-04 20:45:49 +0000 |
---|---|---|
committer | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-04 20:45:49 +0000 |
commit | 6d054d9a4318fd6bbc73ec289b38db1a1898c57a (patch) | |
tree | 0e62901542eb6344520cca0f113812ac5f76eb00 /ceee | |
parent | 9e1de49d1f0f304c6734fb95c0f3cd0030dcff91 (diff) | |
download | chromium_src-6d054d9a4318fd6bbc73ec289b38db1a1898c57a.zip chromium_src-6d054d9a4318fd6bbc73ec289b38db1a1898c57a.tar.gz chromium_src-6d054d9a4318fd6bbc73ec289b38db1a1898c57a.tar.bz2 |
Revert 68293 - Revert 68290 - Restored missing BrokerRpcClient::Connect.
Fixed leaking of BrokerRpcClient.
(relanding for vitalybuka@chromium.org)
BUG=65392
TEST=none
Review URL: http://codereview.chromium.org/5610004
TBR=vitalybuka@chromium.org
Review URL: http://codereview.chromium.org/5533007
TBR=joi@chromium.org
Review URL: http://codereview.chromium.org/5544010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68296 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ceee')
-rw-r--r-- | ceee/ie/plugin/bho/cookie_accountant.h | 8 | ||||
-rw-r--r-- | ceee/ie/plugin/bho/executor.cc | 14 | ||||
-rw-r--r-- | ceee/ie/plugin/bho/executor.h | 3 | ||||
-rw-r--r-- | ceee/ie/plugin/bho/webrequest_notifier.cc | 5 | ||||
-rw-r--r-- | ceee/ie/plugin/bho/webrequest_notifier.h | 3 |
5 files changed, 28 insertions, 5 deletions
diff --git a/ceee/ie/plugin/bho/cookie_accountant.h b/ceee/ie/plugin/bho/cookie_accountant.h index 46efd20..8e7423b 100644 --- a/ceee/ie/plugin/bho/cookie_accountant.h +++ b/ceee/ie/plugin/bho/cookie_accountant.h @@ -54,8 +54,11 @@ class CookieAccountant { // queue the events sent to the broker. They don't need to be sent to the BHO // because they don't need tab_id anyway. CookieAccountant() - : cookie_events_funnel_(new BrokerRpcClient(true)), + : broker_rpc_client_(true), + cookie_events_funnel_(&broker_rpc_client_), patching_wininet_functions_(false) { + HRESULT hr = broker_rpc_client_.Connect(true); + DCHECK(SUCCEEDED(hr)); } virtual ~CookieAccountant(); @@ -110,6 +113,9 @@ class CookieAccountant { // Sets the cookie store ID for a script cookie event. void SetScriptCookieStoreId(cookie_api::CookieInfo* cookie); + // Broker RPC client. + BrokerRpcClient broker_rpc_client_; + // The funnel for sending cookie events to the broker. CookieEventsFunnel cookie_events_funnel_; diff --git a/ceee/ie/plugin/bho/executor.cc b/ceee/ie/plugin/bho/executor.cc index 9e2dc60..56c8e97 100644 --- a/ceee/ie/plugin/bho/executor.cc +++ b/ceee/ie/plugin/bho/executor.cc @@ -370,7 +370,11 @@ HRESULT AsyncTabCall::Signal() { return hr; } -CeeeExecutor::CeeeExecutor() : hwnd_(NULL) { +CeeeExecutor::CeeeExecutor() + : hwnd_(NULL), + // Don't restart on broker crash. It won't work because executor was + // already registered in dead broker. + broker_rpc_client_(false) { } CeeeExecutor::~CeeeExecutor() { @@ -426,9 +430,13 @@ HRESULT CeeeExecutor::Initialize(CeeeWindowHandle hwnd) { // Infobar. In any case, the construction below should have a reference to // a BHO and its EventSender so we don't create Infobars before the tab_id // is ready. - if (window_utils::GetTopLevelParent(hwnd_) != hwnd_) + if (window_utils::GetTopLevelParent(hwnd_) != hwnd_) { + hr = broker_rpc_client_.Connect(true); + if (FAILED(hr)) + return hr; infobar_manager_.reset( - new infobar_api::InfobarManager(hwnd_, new BrokerRpcClient(false))); + new infobar_api::InfobarManager(hwnd_, &broker_rpc_client_)); + } return S_OK; } diff --git a/ceee/ie/plugin/bho/executor.h b/ceee/ie/plugin/bho/executor.h index 7df38fe..63ec87a 100644 --- a/ceee/ie/plugin/bho/executor.h +++ b/ceee/ie/plugin/bho/executor.h @@ -272,6 +272,9 @@ class ATL_NO_VTABLE CeeeExecutor // Mainly for unit testing purposes. void set_cookie_store_is_registered(bool is_registered); + // Broker RPC client. + BrokerRpcClient broker_rpc_client_; + // Instance of InfobarManager for the tab associated with the thread to which // the executor is attached. scoped_ptr<infobar_api::InfobarManager> infobar_manager_; diff --git a/ceee/ie/plugin/bho/webrequest_notifier.cc b/ceee/ie/plugin/bho/webrequest_notifier.cc index 609dc45..5f65a8b 100644 --- a/ceee/ie/plugin/bho/webrequest_notifier.cc +++ b/ceee/ie/plugin/bho/webrequest_notifier.cc @@ -32,7 +32,10 @@ WebRequestNotifier::WebRequestNotifier() : internet_status_callback_stub_(NULL), start_count_(0), initialize_state_(NOT_INITIALIZED), - webrequest_events_funnel_(new BrokerRpcClient(true)) { + broker_rpc_client_(true), + webrequest_events_funnel_(&broker_rpc_client_) { + HRESULT hr = broker_rpc_client_.Connect(true); + DCHECK(SUCCEEDED(hr)); } WebRequestNotifier::~WebRequestNotifier() { diff --git a/ceee/ie/plugin/bho/webrequest_notifier.h b/ceee/ie/plugin/bho/webrequest_notifier.h index 2529c42..0676bf65 100644 --- a/ceee/ie/plugin/bho/webrequest_notifier.h +++ b/ceee/ie/plugin/bho/webrequest_notifier.h @@ -400,6 +400,9 @@ class WebRequestNotifier { app::win::IATPatchFunction http_send_request_w_patch_; app::win::IATPatchFunction internet_read_file_patch_; + // Broker RPC client. + BrokerRpcClient broker_rpc_client_; + // The funnel for sending webRequest events to the broker. WebRequestEventsFunnel webrequest_events_funnel_; |