Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Unified Diff: ceee/ie/plugin/bho/web_progress_notifier.cc

Issue 4989002: Firing event to broker without worker thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ceee/ie/plugin/bho/web_progress_notifier.h ('k') | ceee/ie/plugin/bho/web_progress_notifier_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ceee/ie/plugin/bho/web_progress_notifier.cc
===================================================================
--- ceee/ie/plugin/bho/web_progress_notifier.cc (revision 66617)
+++ ceee/ie/plugin/bho/web_progress_notifier.cc (working copy)
@@ -9,6 +9,7 @@
#include "base/string_util.h"
#include "ceee/common/com_utils.h"
#include "ceee/ie/plugin/bho/dom_utils.h"
+#include "ceee/ie/plugin/bho/webnavigation_events_funnel.h"
namespace {
@@ -121,8 +122,13 @@
return;
// TODO(yzshen@google.com): add support for requestId.
- HRESULT hr = webnavigation_events_funnel().OnBeforeNavigate(
- tab_handle_, url, frame_info->frame_id, -1, base::Time::Now());
+ HRESULT hr = E_POINTER;
+ WebNavigationEventsFunnel* funnel = webnavigation_events_funnel();
+ DCHECK(funnel != NULL);
+ if (funnel) {
+ hr = funnel->OnBeforeNavigate(tab_handle_, url, frame_info->frame_id, -1,
+ base::Time::Now());
+ }
DCHECK(SUCCEEDED(hr))
<< "Failed to fire the webNavigation.onBeforeNavigate event "
<< com::LogHr(hr);
@@ -190,8 +196,13 @@
HasPotentialJavaScriptRedirect(browser);
}
- HRESULT hr = webnavigation_events_funnel().OnCompleted(
- tab_handle_, url, frame_info->frame_id, base::Time::Now());
+ HRESULT hr = E_POINTER;
+ WebNavigationEventsFunnel* funnel = webnavigation_events_funnel();
+ DCHECK(funnel != NULL);
+ if (funnel) {
+ hr = funnel->OnCompleted(tab_handle_, url, frame_info->frame_id,
+ base::Time::Now());
+ }
DCHECK(SUCCEEDED(hr)) << "Failed to fire the webNavigation.onCompleted event "
<< com::LogHr(hr);
}
@@ -230,11 +241,16 @@
}
}
- HRESULT hr = webnavigation_events_funnel().OnCommitted(
+ HRESULT hr = E_POINTER;
+ WebNavigationEventsFunnel* funnel = webnavigation_events_funnel();
+ DCHECK(funnel != NULL);
+ if (funnel) {
+ hr = funnel->OnCommitted(
tab_handle_, url, frame_info->frame_id,
PageTransition::CoreTransitionString(frame_info->transition_type),
TransitionQualifiersString(frame_info->transition_qualifiers).c_str(),
timestamp);
+ }
DCHECK(SUCCEEDED(hr)) << "Failed to fire the webNavigation.onCommitted event "
<< com::LogHr(hr);
@@ -254,8 +270,13 @@
if (!GetFrameInfo(browser, &frame_info))
return;
- HRESULT hr = webnavigation_events_funnel().OnErrorOccurred(
- tab_handle_, url, frame_info->frame_id, CComBSTR(L""), base::Time::Now());
+ HRESULT hr = E_POINTER;
+ WebNavigationEventsFunnel* funnel = webnavigation_events_funnel();
+ DCHECK(funnel != NULL);
+ if (funnel) {
+ hr = funnel->OnErrorOccurred(tab_handle_, url,
+ frame_info->frame_id, CComBSTR(L""), base::Time::Now());
+ }
DCHECK(SUCCEEDED(hr))
<< "Failed to fire the webNavigation.onErrorOccurred event "
<< com::LogHr(hr);
@@ -268,8 +289,13 @@
if (FilterOutWebBrowserEvent(NULL, FilteringInfo::NEW_WINDOW))
return;
- HRESULT hr = webnavigation_events_funnel().OnBeforeRetarget(
- tab_handle_, url_context, url, base::Time::Now());
+ HRESULT hr = E_POINTER;
+ WebNavigationEventsFunnel* funnel = webnavigation_events_funnel();
+ DCHECK(funnel != NULL);
+ if (funnel) {
+ hr = funnel->OnBeforeRetarget(tab_handle_, url_context, url,
+ base::Time::Now());
+ }
DCHECK(SUCCEEDED(hr))
<< "Failed to fire the webNavigation.onBeforeRetarget event "
<< com::LogHr(hr);
@@ -305,6 +331,19 @@
}
}
+WebNavigationEventsFunnel* WebProgressNotifier::webnavigation_events_funnel() {
+ if (!webnavigation_events_funnel_.get())
+ webnavigation_events_funnel_.reset(new WebNavigationEventsFunnel());
+ return webnavigation_events_funnel_.get();
+}
+
+WebRequestNotifier* WebProgressNotifier::webrequest_notifier() {
+ if (cached_webrequest_notifier_ == NULL) {
+ cached_webrequest_notifier_ = ProductionWebRequestNotifier::get();
+ }
+ return cached_webrequest_notifier_;
+}
+
WindowMessageSource* WebProgressNotifier::CreateWindowMessageSource() {
scoped_ptr<WindowMessageSource> source(new WindowMessageSource());
« no previous file with comments | « ceee/ie/plugin/bho/web_progress_notifier.h ('k') | ceee/ie/plugin/bho/web_progress_notifier_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698