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

Side by Side Diff: content/browser/frame_host/render_frame_host_manager.cc

Issue 1098763003: Send origin updates to frame proxies when a frame navigates to new origin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Charlie's nits Created 5 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/frame_host/render_frame_host_manager.h" 5 #include "content/browser/frame_host/render_frame_host_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after
881 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( 881 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
882 switches::kSitePerProcess)) 882 switches::kSitePerProcess))
883 return; 883 return;
884 884
885 for (const auto& pair : proxy_hosts_) { 885 for (const auto& pair : proxy_hosts_) {
886 pair.second->Send( 886 pair.second->Send(
887 new FrameMsg_DidUpdateName(pair.second->GetRoutingID(), name)); 887 new FrameMsg_DidUpdateName(pair.second->GetRoutingID(), name));
888 } 888 }
889 } 889 }
890 890
891 void RenderFrameHostManager::OnDidUpdateOrigin(const url::Origin& origin) {
892 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
893 switches::kSitePerProcess))
894 return;
895
896 for (const auto& pair : proxy_hosts_) {
897 pair.second->Send(
898 new FrameMsg_DidUpdateOrigin(pair.second->GetRoutingID(), origin));
899 }
900 }
901
891 void RenderFrameHostManager::Observe( 902 void RenderFrameHostManager::Observe(
892 int type, 903 int type,
893 const NotificationSource& source, 904 const NotificationSource& source,
894 const NotificationDetails& details) { 905 const NotificationDetails& details) {
895 switch (type) { 906 switch (type) {
896 case NOTIFICATION_RENDERER_PROCESS_CLOSED: 907 case NOTIFICATION_RENDERER_PROCESS_CLOSED:
897 case NOTIFICATION_RENDERER_PROCESS_CLOSING: 908 case NOTIFICATION_RENDERER_PROCESS_CLOSING:
898 RendererProcessClosing( 909 RendererProcessClosing(
899 Source<RenderProcessHost>(source).ptr()); 910 Source<RenderProcessHost>(source).ptr());
900 break; 911 break;
(...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after
2084 void RenderFrameHostManager::DeleteRenderFrameProxyHost( 2095 void RenderFrameHostManager::DeleteRenderFrameProxyHost(
2085 SiteInstance* instance) { 2096 SiteInstance* instance) {
2086 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); 2097 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId());
2087 if (iter != proxy_hosts_.end()) { 2098 if (iter != proxy_hosts_.end()) {
2088 delete iter->second; 2099 delete iter->second;
2089 proxy_hosts_.erase(iter); 2100 proxy_hosts_.erase(iter);
2090 } 2101 }
2091 } 2102 }
2092 2103
2093 } // namespace content 2104 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698