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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 498883002: Add/improve tracing in navigation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase on ToT. Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.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/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 450
451 SetDelegate(NULL); 451 SetDelegate(NULL);
452 452
453 STLDeleteContainerPairSecondPointers(destruction_observers_.begin(), 453 STLDeleteContainerPairSecondPointers(destruction_observers_.begin(),
454 destruction_observers_.end()); 454 destruction_observers_.end());
455 } 455 }
456 456
457 WebContentsImpl* WebContentsImpl::CreateWithOpener( 457 WebContentsImpl* WebContentsImpl::CreateWithOpener(
458 const WebContents::CreateParams& params, 458 const WebContents::CreateParams& params,
459 WebContentsImpl* opener) { 459 WebContentsImpl* opener) {
460 TRACE_EVENT0("browser", "WebContentsImpl::CreateWithOpener"); 460 TRACE_EVENT0("browser,navigation", "WebContentsImpl::CreateWithOpener");
Charlie Reis 2014/08/27 22:05:13 Why is this a navigation event?
nasko 2014/08/27 23:30:01 Done.
461 WebContentsImpl* new_contents = new WebContentsImpl( 461 WebContentsImpl* new_contents = new WebContentsImpl(
462 params.browser_context, params.opener_suppressed ? NULL : opener); 462 params.browser_context, params.opener_suppressed ? NULL : opener);
463 463
464 if (params.guest_delegate) { 464 if (params.guest_delegate) {
465 // This makes |new_contents| act as a guest. 465 // This makes |new_contents| act as a guest.
466 // For more info, see comment above class BrowserPluginGuest. 466 // For more info, see comment above class BrowserPluginGuest.
467 BrowserPluginGuest::Create(new_contents, params.guest_delegate); 467 BrowserPluginGuest::Create(new_contents, params.guest_delegate);
468 // We are instantiating a WebContents for browser plugin. Set its subframe 468 // We are instantiating a WebContents for browser plugin. Set its subframe
469 // bit to true. 469 // bit to true.
470 new_contents->is_subframe_ = true; 470 new_contents->is_subframe_ = true;
(...skipping 2615 matching lines...) Expand 10 before | Expand all | Expand 10 after
3086 is_loading_ = is_loading; 3086 is_loading_ = is_loading;
3087 waiting_for_response_ = is_loading; 3087 waiting_for_response_ = is_loading;
3088 is_load_to_different_document_ = to_different_document; 3088 is_load_to_different_document_ = to_different_document;
3089 3089
3090 if (delegate_) 3090 if (delegate_)
3091 delegate_->LoadingStateChanged(this, to_different_document); 3091 delegate_->LoadingStateChanged(this, to_different_document);
3092 NotifyNavigationStateChanged(INVALIDATE_TYPE_LOAD); 3092 NotifyNavigationStateChanged(INVALIDATE_TYPE_LOAD);
3093 3093
3094 std::string url = (details ? details->url.possibly_invalid_spec() : "NULL"); 3094 std::string url = (details ? details->url.possibly_invalid_spec() : "NULL");
3095 if (is_loading) { 3095 if (is_loading) {
3096 TRACE_EVENT_ASYNC_BEGIN1("browser", "WebContentsImpl Loading", this, 3096 TRACE_EVENT_ASYNC_BEGIN1("browser,navigation", "WebContentsImpl Loading",
3097 "URL", url); 3097 this, "URL", url);
3098 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 3098 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
3099 DidStartLoading(render_view_host)); 3099 DidStartLoading(render_view_host));
3100 } else { 3100 } else {
3101 TRACE_EVENT_ASYNC_END1("browser", "WebContentsImpl Loading", this, 3101 TRACE_EVENT_ASYNC_END1("browser,navigation", "WebContentsImpl Loading",
3102 "URL", url); 3102 this, "URL", url);
3103 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 3103 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
3104 DidStopLoading(render_view_host)); 3104 DidStopLoading(render_view_host));
3105 } 3105 }
3106 3106
3107 // TODO(avi): Remove. http://crbug.com/170921 3107 // TODO(avi): Remove. http://crbug.com/170921
3108 int type = is_loading ? NOTIFICATION_LOAD_START : NOTIFICATION_LOAD_STOP; 3108 int type = is_loading ? NOTIFICATION_LOAD_START : NOTIFICATION_LOAD_STOP;
3109 NotificationDetails det = NotificationService::NoDetails(); 3109 NotificationDetails det = NotificationService::NoDetails();
3110 if (details) 3110 if (details)
3111 det = Details<LoadNotificationDetails>(details); 3111 det = Details<LoadNotificationDetails>(details);
3112 NotificationService::current()->Notify( 3112 NotificationService::current()->Notify(
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
4020 NavigationEntry* 4020 NavigationEntry*
4021 WebContentsImpl::GetLastCommittedNavigationEntryForRenderManager() { 4021 WebContentsImpl::GetLastCommittedNavigationEntryForRenderManager() {
4022 return controller_.GetLastCommittedEntry(); 4022 return controller_.GetLastCommittedEntry();
4023 } 4023 }
4024 4024
4025 bool WebContentsImpl::CreateRenderViewForRenderManager( 4025 bool WebContentsImpl::CreateRenderViewForRenderManager(
4026 RenderViewHost* render_view_host, 4026 RenderViewHost* render_view_host,
4027 int opener_route_id, 4027 int opener_route_id,
4028 int proxy_routing_id, 4028 int proxy_routing_id,
4029 bool for_main_frame_navigation) { 4029 bool for_main_frame_navigation) {
4030 TRACE_EVENT0("browser", "WebContentsImpl::CreateRenderViewForRenderManager"); 4030 TRACE_EVENT0("browser,navigation",
4031 "WebContentsImpl::CreateRenderViewForRenderManager");
4031 // Can be NULL during tests. 4032 // Can be NULL during tests.
4032 RenderWidgetHostViewBase* rwh_view; 4033 RenderWidgetHostViewBase* rwh_view;
4033 // TODO(kenrb): RenderWidgetHostViewChildFrame special casing is temporary 4034 // TODO(kenrb): RenderWidgetHostViewChildFrame special casing is temporary
4034 // until RenderWidgetHost is attached to RenderFrameHost. We need to special 4035 // until RenderWidgetHost is attached to RenderFrameHost. We need to special
4035 // case this because RWH is still a base class of RenderViewHost, and child 4036 // case this because RWH is still a base class of RenderViewHost, and child
4036 // frame RWHVs are unique in that they do not have their own WebContents. 4037 // frame RWHVs are unique in that they do not have their own WebContents.
4037 if (!for_main_frame_navigation) { 4038 if (!for_main_frame_navigation) {
4038 RenderWidgetHostViewChildFrame* rwh_view_child = 4039 RenderWidgetHostViewChildFrame* rwh_view_child =
4039 new RenderWidgetHostViewChildFrame(render_view_host); 4040 new RenderWidgetHostViewChildFrame(render_view_host);
4040 rwh_view = rwh_view_child; 4041 rwh_view = rwh_view_child;
(...skipping 27 matching lines...) Expand all
4068 render_widget_host->WasResized(); 4069 render_widget_host->WasResized();
4069 } 4070 }
4070 #endif 4071 #endif
4071 4072
4072 return true; 4073 return true;
4073 } 4074 }
4074 4075
4075 bool WebContentsImpl::CreateRenderFrameForRenderManager( 4076 bool WebContentsImpl::CreateRenderFrameForRenderManager(
4076 RenderFrameHost* render_frame_host, 4077 RenderFrameHost* render_frame_host,
4077 int parent_routing_id) { 4078 int parent_routing_id) {
4078 TRACE_EVENT0("browser", "WebContentsImpl::CreateRenderFrameForRenderManager"); 4079 TRACE_EVENT0("browser,navigation",
4080 "WebContentsImpl::CreateRenderFrameForRenderManager");
4079 4081
4080 RenderFrameHostImpl* rfh = 4082 RenderFrameHostImpl* rfh =
4081 static_cast<RenderFrameHostImpl*>(render_frame_host); 4083 static_cast<RenderFrameHostImpl*>(render_frame_host);
4082 if (!rfh->CreateRenderFrame(parent_routing_id)) 4084 if (!rfh->CreateRenderFrame(parent_routing_id))
4083 return false; 4085 return false;
4084 4086
4085 // TODO(nasko): When RenderWidgetHost is owned by RenderFrameHost, the passed 4087 // TODO(nasko): When RenderWidgetHost is owned by RenderFrameHost, the passed
4086 // RenderFrameHost will have to be associated with the appropriate 4088 // RenderFrameHost will have to be associated with the appropriate
4087 // RenderWidgetHostView or a new one should be created here. 4089 // RenderWidgetHostView or a new one should be created here.
4088 4090
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
4242 node->render_manager()->ResumeResponseDeferredAtStart(); 4244 node->render_manager()->ResumeResponseDeferredAtStart();
4243 } 4245 }
4244 4246
4245 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { 4247 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) {
4246 force_disable_overscroll_content_ = force_disable; 4248 force_disable_overscroll_content_ = force_disable;
4247 if (view_) 4249 if (view_)
4248 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); 4250 view_->SetOverscrollControllerEnabled(CanOverscrollContent());
4249 } 4251 }
4250 4252
4251 } // namespace content 4253 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698