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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 23947003: Create WebContentsObserver callbacks for notifications, remove notifications from SSLManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: formatting Created 7 years, 3 months 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 | « content/browser/web_contents/web_contents_impl.h ('k') | content/public/browser/notification_types.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 2d3c542c58a29808e9a7f2b8257bf6608a935459..a51ec8cd37c102d2114188fc3bb95c4729e80ca7 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2179,8 +2179,8 @@ void WebContentsImpl::DidRedirectProvisionalLoad(
const GURL& source_url,
const GURL& target_url) {
// TODO(creis): Remove this method and have the pre-rendering code listen to
- // the ResourceDispatcherHost's RESOURCE_RECEIVED_REDIRECT notification
- // instead. See http://crbug.com/78512.
+ // WebContentsObserver::DidGetRedirectForResourceRequest instead.
+ // See http://crbug.com/78512.
GURL validated_source_url(source_url);
GURL validated_target_url(target_url);
RenderProcessHost* render_process_host =
@@ -2279,6 +2279,12 @@ void WebContentsImpl::OnDidLoadResourceFromMemoryCache(
url, GetRenderProcessHost()->GetID(), cert_id, cert_status, http_method,
mime_type, resource_type);
+ controller_.ssl_manager()->DidLoadFromMemoryCache(details);
+
+ FOR_EACH_OBSERVER(WebContentsObserver, observers_,
+ DidLoadResourceFromMemoryCache(details));
+
+ // TODO(avi): Remove. http://crbug.com/170921
NotificationService::current()->Notify(
NOTIFICATION_LOAD_FROM_MEMORY_CACHE,
Source<NavigationController>(&controller_),
@@ -2939,6 +2945,34 @@ void WebContentsImpl::RenderViewDeleted(RenderViewHost* rvh) {
FOR_EACH_OBSERVER(WebContentsObserver, observers_, RenderViewDeleted(rvh));
}
+void WebContentsImpl::DidGetResourceResponseStart(
+ const ResourceRequestDetails& details) {
+ controller_.ssl_manager()->DidStartResourceResponse(details);
+
+ FOR_EACH_OBSERVER(WebContentsObserver, observers_,
+ DidGetResourceResponseStart(details));
+
+ // TODO(avi): Remove. http://crbug.com/170921
+ NotificationService::current()->Notify(
+ NOTIFICATION_RESOURCE_RESPONSE_STARTED,
+ Source<WebContents>(this),
+ Details<const ResourceRequestDetails>(&details));
+}
+
+void WebContentsImpl::DidGetRedirectForResourceRequest(
+ const ResourceRedirectDetails& details) {
+ controller_.ssl_manager()->DidReceiveResourceRedirect(details);
+
+ FOR_EACH_OBSERVER(WebContentsObserver, observers_,
+ DidGetRedirectForResourceRequest(details));
+
+ // TODO(avi): Remove. http://crbug.com/170921
+ NotificationService::current()->Notify(
+ NOTIFICATION_RESOURCE_RECEIVED_REDIRECT,
+ Source<WebContents>(this),
+ Details<const ResourceRedirectDetails>(&details));
+}
+
void WebContentsImpl::DidNavigate(
RenderViewHost* rvh,
const ViewHostMsg_FrameNavigate_Params& params) {
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/public/browser/notification_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698