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

Side by Side 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, 2 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 | « content/renderer/render_frame_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 2948 matching lines...) Expand 10 before | Expand all | Expand 10 after
2959 // |report_frame_name_changes| is set (used by <webview>). If needed, this 2959 // |report_frame_name_changes| is set (used by <webview>). If needed, this
2960 // can be optimized further by only sending the update if there are any 2960 // can be optimized further by only sending the update if there are any
2961 // remote frames in the frame tree, or delaying and batching up IPCs if 2961 // remote frames in the frame tree, or delaying and batching up IPCs if
2962 // updates are happening too frequently. 2962 // updates are happening too frequently.
2963 if (SiteIsolationPolicy::AreCrossProcessFramesPossible() || 2963 if (SiteIsolationPolicy::AreCrossProcessFramesPossible() ||
2964 render_view_->renderer_preferences_.report_frame_name_changes) { 2964 render_view_->renderer_preferences_.report_frame_name_changes) {
2965 Send(new FrameHostMsg_DidChangeName( 2965 Send(new FrameHostMsg_DidChangeName(
2966 routing_id_, base::UTF16ToUTF8(base::StringPiece16(name)), 2966 routing_id_, base::UTF16ToUTF8(base::StringPiece16(name)),
2967 base::UTF16ToUTF8(base::StringPiece16(unique_name)))); 2967 base::UTF16ToUTF8(base::StringPiece16(unique_name))));
2968 } 2968 }
2969
2970 if (!committed_first_load_) {
Charlie Reis 2016/10/01 00:05:12 nit: No braces.
dcheng 2016/10/01 20:25:14 Done.
2971 name_changed_before_first_commit_ = true;
2972 }
2969 } 2973 }
2970 2974
2971 void RenderFrameImpl::didEnforceInsecureRequestPolicy( 2975 void RenderFrameImpl::didEnforceInsecureRequestPolicy(
2972 blink::WebInsecureRequestPolicy policy) { 2976 blink::WebInsecureRequestPolicy policy) {
2973 Send(new FrameHostMsg_EnforceInsecureRequestPolicy(routing_id_, policy)); 2977 Send(new FrameHostMsg_EnforceInsecureRequestPolicy(routing_id_, policy));
2974 } 2978 }
2975 2979
2976 void RenderFrameImpl::didUpdateToUniqueOrigin( 2980 void RenderFrameImpl::didUpdateToUniqueOrigin(
2977 bool is_potentially_trustworthy_unique_origin) { 2981 bool is_potentially_trustworthy_unique_origin) {
2978 Send(new FrameHostMsg_UpdateToUniqueOrigin( 2982 Send(new FrameHostMsg_UpdateToUniqueOrigin(
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
3344 } 3348 }
3345 3349
3346 void RenderFrameImpl::didCommitProvisionalLoad( 3350 void RenderFrameImpl::didCommitProvisionalLoad(
3347 blink::WebLocalFrame* frame, 3351 blink::WebLocalFrame* frame,
3348 const blink::WebHistoryItem& item, 3352 const blink::WebHistoryItem& item,
3349 blink::WebHistoryCommitType commit_type) { 3353 blink::WebHistoryCommitType commit_type) {
3350 TRACE_EVENT2("navigation,rail", "RenderFrameImpl::didCommitProvisionalLoad", 3354 TRACE_EVENT2("navigation,rail", "RenderFrameImpl::didCommitProvisionalLoad",
3351 "id", routing_id_, 3355 "id", routing_id_,
3352 "url", GetLoadingUrl().possibly_invalid_spec()); 3356 "url", GetLoadingUrl().possibly_invalid_spec());
3353 DCHECK_EQ(frame_, frame); 3357 DCHECK_EQ(frame_, frame);
3358
3359 // TODO(dcheng): Remove this UMA once we have enough measurements.
3360 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
3361 if (!IsMainFrame()) {
3362 UMA_HISTOGRAM_BOOLEAN(
3363 "SessionRestore.SubFrameUniqueNameChangedBeforeFirstCommit",
3364 name_changed_before_first_commit_);
3365 }
3366 committed_first_load_ = true;
3367 }
3368
3354 DocumentState* document_state = 3369 DocumentState* document_state =
3355 DocumentState::FromDataSource(frame->dataSource()); 3370 DocumentState::FromDataSource(frame->dataSource());
3356 NavigationStateImpl* navigation_state = 3371 NavigationStateImpl* navigation_state =
3357 static_cast<NavigationStateImpl*>(document_state->navigation_state()); 3372 static_cast<NavigationStateImpl*>(document_state->navigation_state());
3358 WebURLResponseExtraDataImpl* extra_data = 3373 WebURLResponseExtraDataImpl* extra_data =
3359 GetExtraDataFromResponse(frame->dataSource()->response()); 3374 GetExtraDataFromResponse(frame->dataSource()->response());
3360 // Only update the Lo-Fi and effective connection type states for new main 3375 // Only update the Lo-Fi and effective connection type states for new main
3361 // frame documents. Subframes inherit from the main frame and should not 3376 // frame documents. Subframes inherit from the main frame and should not
3362 // change at commit time. 3377 // change at commit time.
3363 if (is_main_frame_ && !navigation_state->WasWithinSamePage()) { 3378 if (is_main_frame_ && !navigation_state->WasWithinSamePage()) {
(...skipping 3071 matching lines...) Expand 10 before | Expand all | Expand 10 after
6435 // event target. Potentially a Pepper plugin will receive the event. 6450 // event target. Potentially a Pepper plugin will receive the event.
6436 // In order to tell whether a plugin gets the last mouse event and which it 6451 // In order to tell whether a plugin gets the last mouse event and which it
6437 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6452 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6438 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6453 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6439 // |pepper_last_mouse_event_target_|. 6454 // |pepper_last_mouse_event_target_|.
6440 pepper_last_mouse_event_target_ = nullptr; 6455 pepper_last_mouse_event_target_ = nullptr;
6441 #endif 6456 #endif
6442 } 6457 }
6443 6458
6444 } // namespace content 6459 } // namespace content
OLDNEW
« 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