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

Side by Side Diff: third_party/WebKit/Source/web/WebFrame.cpp

Issue 2712773002: Add trace event for detecting main frame in loading metrics. (Closed)
Patch Set: fix condition Created 3 years, 9 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "public/web/WebFrame.h" 5 #include "public/web/WebFrame.h"
6 6
7 #include "bindings/core/v8/WindowProxyManager.h" 7 #include "bindings/core/v8/WindowProxyManager.h"
8 #include "core/HTMLNames.h" 8 #include "core/HTMLNames.h"
9 #include "core/frame/FrameHost.h" 9 #include "core/frame/FrameHost.h"
10 #include "core/frame/FrameView.h" 10 #include "core/frame/FrameView.h"
11 #include "core/frame/LocalFrame.h" 11 #include "core/frame/LocalFrame.h"
12 #include "core/frame/RemoteFrame.h" 12 #include "core/frame/RemoteFrame.h"
13 #include "core/html/HTMLFrameElementBase.h" 13 #include "core/html/HTMLFrameElementBase.h"
14 #include "core/html/HTMLFrameOwnerElement.h" 14 #include "core/html/HTMLFrameOwnerElement.h"
15 #include "core/page/Page.h" 15 #include "core/page/Page.h"
16 #include "platform/UserGestureIndicator.h" 16 #include "platform/UserGestureIndicator.h"
17 #include "platform/heap/Handle.h" 17 #include "platform/heap/Handle.h"
18 #include "platform/instrumentation/tracing/TraceEvent.h"
18 #include "public/web/WebElement.h" 19 #include "public/web/WebElement.h"
19 #include "public/web/WebFrameOwnerProperties.h" 20 #include "public/web/WebFrameOwnerProperties.h"
20 #include "public/web/WebSandboxFlags.h" 21 #include "public/web/WebSandboxFlags.h"
21 #include "web/OpenedFrameTracker.h" 22 #include "web/OpenedFrameTracker.h"
22 #include "web/RemoteFrameOwner.h" 23 #include "web/RemoteFrameOwner.h"
23 #include "web/WebLocalFrameImpl.h" 24 #include "web/WebLocalFrameImpl.h"
24 #include "web/WebRemoteFrameImpl.h" 25 #include "web/WebRemoteFrameImpl.h"
25 #include <algorithm> 26 #include <algorithm>
26 27
27 namespace blink { 28 namespace blink {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // In this case, the core LocalFrame is already initialized, so just 93 // In this case, the core LocalFrame is already initialized, so just
93 // update a bit of state. 94 // update a bit of state.
94 LocalFrame& localFrame = *toWebLocalFrameImpl(frame)->frame(); 95 LocalFrame& localFrame = *toWebLocalFrameImpl(frame)->frame();
95 DCHECK_EQ(owner, localFrame.owner()); 96 DCHECK_EQ(owner, localFrame.owner());
96 if (owner) { 97 if (owner) {
97 owner->setContentFrame(localFrame); 98 owner->setContentFrame(localFrame);
98 if (owner->isLocal()) 99 if (owner->isLocal())
99 toHTMLFrameOwnerElement(owner)->setWidget(localFrame.view()); 100 toHTMLFrameOwnerElement(owner)->setWidget(localFrame.view());
100 } else { 101 } else {
101 localFrame.page()->setMainFrame(&localFrame); 102 localFrame.page()->setMainFrame(&localFrame);
103 // This trace event is needed to detect the main frame of the
104 // renderer in telemetry metrics. See crbug.com/692112#c11.
105 TRACE_EVENT_INSTANT1("loading", "markAsMainFrame",
106 TRACE_EVENT_SCOPE_THREAD, "frame", &localFrame);
102 } 107 }
103 } else { 108 } else {
104 toWebRemoteFrameImpl(frame)->initializeCoreFrame(host, owner, name, 109 toWebRemoteFrameImpl(frame)->initializeCoreFrame(host, owner, name,
105 uniqueName); 110 uniqueName);
106 } 111 }
107 112
108 if (oldFrame->hasReceivedUserGesture()) 113 if (oldFrame->hasReceivedUserGesture())
109 frame->toImplBase()->frame()->setDocumentHasReceivedUserGesture(); 114 frame->toImplBase()->frame()->setDocumentHasReceivedUserGesture();
110 115
111 frame->toImplBase()->frame()->getWindowProxyManager()->setGlobals(globals); 116 frame->toImplBase()->frame()->getWindowProxyManager()->setGlobals(globals);
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 for (WebFrame* child = frame->firstChild(); child; 313 for (WebFrame* child = frame->firstChild(); child;
309 child = child->nextSibling()) 314 child = child->nextSibling())
310 traceFrame(visitor, child); 315 traceFrame(visitor, child);
311 } 316 }
312 317
313 void WebFrame::close() { 318 void WebFrame::close() {
314 m_openedFrameTracker->dispose(); 319 m_openedFrameTracker->dispose();
315 } 320 }
316 321
317 } // namespace blink 322 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698