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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2385773003: Add UMA to measure feasibility of making unique names immutable (Closed)
Patch Set: Created 4 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/renderer/render_frame_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 7132bd367d88338464c8d1f69e1b07f75172e6f2..39aa40c081f5ac0905f11b19c817922631ae968d 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -2966,6 +2966,10 @@ void RenderFrameImpl::didChangeName(const blink::WebString& name,
routing_id_, base::UTF16ToUTF8(base::StringPiece16(name)),
base::UTF16ToUTF8(base::StringPiece16(unique_name))));
}
+
+ if (!committed_first_load_) {
Charlie Reis 2016/10/01 00:05:12 nit: No braces.
dcheng 2016/10/01 20:25:14 Done.
+ name_changed_before_first_commit_ = true;
+ }
}
void RenderFrameImpl::didEnforceInsecureRequestPolicy(
@@ -3351,6 +3355,17 @@ void RenderFrameImpl::didCommitProvisionalLoad(
"id", routing_id_,
"url", GetLoadingUrl().possibly_invalid_spec());
DCHECK_EQ(frame_, frame);
+
+ // TODO(dcheng): Remove this UMA once we have enough measurements.
+ if (!committed_first_load_ && !current_history_item_.isNull()) {
Charlie Reis 2016/10/01 00:05:12 Why isn't current_history_item_ enough (here and a
dcheng 2016/10/01 20:25:14 I added a comment to try to make the purpose clear
+ if (!IsMainFrame()) {
+ UMA_HISTOGRAM_BOOLEAN(
+ "SessionRestore.SubFrameUniqueNameChangedBeforeFirstCommit",
+ name_changed_before_first_commit_);
+ }
+ committed_first_load_ = true;
+ }
+
DocumentState* document_state =
DocumentState::FromDataSource(frame->dataSource());
NavigationStateImpl* navigation_state =
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698