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

Side by Side Diff: third_party/WebKit/Source/core/loader/NavigationScheduler.cpp

Issue 2814703004: Make blink::ResourceRequest ctors explicit (Closed)
Patch Set: simplify Created 3 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 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
5 * (http://www.torchmobile.com/) 5 * (http://www.torchmobile.com/)
6 * Copyright (C) 2009 Adam Barth. All rights reserved. 6 * Copyright (C) 2009 Adam Barth. All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 kCheckContentSecurityPolicy) { 169 kCheckContentSecurityPolicy) {
170 if (ContentSecurityPolicy::ShouldBypassMainWorld(origin_document)) { 170 if (ContentSecurityPolicy::ShouldBypassMainWorld(origin_document)) {
171 should_check_main_world_content_security_policy_ = 171 should_check_main_world_content_security_policy_ =
172 kDoNotCheckContentSecurityPolicy; 172 kDoNotCheckContentSecurityPolicy;
173 } 173 }
174 } 174 }
175 175
176 void Fire(LocalFrame* frame) override { 176 void Fire(LocalFrame* frame) override {
177 std::unique_ptr<UserGestureIndicator> gesture_indicator = 177 std::unique_ptr<UserGestureIndicator> gesture_indicator =
178 CreateUserGestureIndicator(); 178 CreateUserGestureIndicator();
179 FrameLoadRequest request(OriginDocument(), url_, "_self", 179 FrameLoadRequest request(OriginDocument(), ResourceRequest(url_), "_self",
180 should_check_main_world_content_security_policy_); 180 should_check_main_world_content_security_policy_);
181 request.SetReplacesCurrentItem(ReplacesCurrentItem()); 181 request.SetReplacesCurrentItem(ReplacesCurrentItem());
182 request.SetClientRedirect(ClientRedirectPolicy::kClientRedirect); 182 request.SetClientRedirect(ClientRedirectPolicy::kClientRedirect);
183 183
184 ScheduledNavigationType type = 184 ScheduledNavigationType type =
185 IsLocationChange() ? ScheduledNavigationType::kScheduledLocationChange 185 IsLocationChange() ? ScheduledNavigationType::kScheduledLocationChange
186 : ScheduledNavigationType::kScheduledURLNavigation; 186 : ScheduledNavigationType::kScheduledURLNavigation;
187 MaybeLogScheduledNavigationClobber(type, frame); 187 MaybeLogScheduledNavigationClobber(type, frame);
188 frame->Loader().Load(request); 188 frame->Loader().Load(request);
189 } 189 }
(...skipping 16 matching lines...) Expand all
206 replaces_current_item); 206 replaces_current_item);
207 } 207 }
208 208
209 bool ShouldStartTimer(LocalFrame* frame) override { 209 bool ShouldStartTimer(LocalFrame* frame) override {
210 return frame->GetDocument()->LoadEventFinished(); 210 return frame->GetDocument()->LoadEventFinished();
211 } 211 }
212 212
213 void Fire(LocalFrame* frame) override { 213 void Fire(LocalFrame* frame) override {
214 std::unique_ptr<UserGestureIndicator> gesture_indicator = 214 std::unique_ptr<UserGestureIndicator> gesture_indicator =
215 CreateUserGestureIndicator(); 215 CreateUserGestureIndicator();
216 FrameLoadRequest request(OriginDocument(), Url(), "_self"); 216 FrameLoadRequest request(OriginDocument(), ResourceRequest(Url()), "_self");
217 request.SetReplacesCurrentItem(ReplacesCurrentItem()); 217 request.SetReplacesCurrentItem(ReplacesCurrentItem());
218 if (EqualIgnoringFragmentIdentifier(frame->GetDocument()->Url(), 218 if (EqualIgnoringFragmentIdentifier(frame->GetDocument()->Url(),
219 request.GetResourceRequest().Url())) { 219 request.GetResourceRequest().Url())) {
220 request.GetResourceRequest().SetCachePolicy( 220 request.GetResourceRequest().SetCachePolicy(
221 WebCachePolicy::kValidatingCacheData); 221 WebCachePolicy::kValidatingCacheData);
222 } 222 }
223 request.SetClientRedirect(ClientRedirectPolicy::kClientRedirect); 223 request.SetClientRedirect(ClientRedirectPolicy::kClientRedirect);
224 MaybeLogScheduledNavigationClobber( 224 MaybeLogScheduledNavigationClobber(
225 ScheduledNavigationType::kScheduledRedirect, frame); 225 ScheduledNavigationType::kScheduledRedirect, frame);
226 frame->Loader().Load(request); 226 frame->Loader().Load(request);
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 replaces_current_item || MustReplaceCurrentItem(frame_); 431 replaces_current_item || MustReplaceCurrentItem(frame_);
432 432
433 // If the URL we're going to navigate to is the same as the current one, 433 // If the URL we're going to navigate to is the same as the current one,
434 // except for the fragment part, we don't need to schedule the location 434 // except for the fragment part, we don't need to schedule the location
435 // change. We'll skip this optimization for cross-origin navigations to 435 // change. We'll skip this optimization for cross-origin navigations to
436 // minimize the navigator's ability to execute timing attacks. 436 // minimize the navigator's ability to execute timing attacks.
437 if (origin_document->GetSecurityOrigin()->CanAccess( 437 if (origin_document->GetSecurityOrigin()->CanAccess(
438 frame_->GetDocument()->GetSecurityOrigin())) { 438 frame_->GetDocument()->GetSecurityOrigin())) {
439 if (url.HasFragmentIdentifier() && 439 if (url.HasFragmentIdentifier() &&
440 EqualIgnoringFragmentIdentifier(frame_->GetDocument()->Url(), url)) { 440 EqualIgnoringFragmentIdentifier(frame_->GetDocument()->Url(), url)) {
441 FrameLoadRequest request(origin_document, url, "_self"); 441 FrameLoadRequest request(origin_document, ResourceRequest(url), "_self");
442 request.SetReplacesCurrentItem(replaces_current_item); 442 request.SetReplacesCurrentItem(replaces_current_item);
443 if (replaces_current_item) 443 if (replaces_current_item)
444 request.SetClientRedirect(ClientRedirectPolicy::kClientRedirect); 444 request.SetClientRedirect(ClientRedirectPolicy::kClientRedirect);
445 frame_->Loader().Load(request); 445 frame_->Loader().Load(request);
446 return; 446 return;
447 } 447 }
448 } 448 }
449 449
450 Schedule(ScheduledLocationChange::Create(origin_document, url, 450 Schedule(ScheduledLocationChange::Create(origin_document, url,
451 replaces_current_item)); 451 replaces_current_item));
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 navigate_task_handle_.Cancel(); 544 navigate_task_handle_.Cancel();
545 redirect_.Clear(); 545 redirect_.Clear();
546 } 546 }
547 547
548 DEFINE_TRACE(NavigationScheduler) { 548 DEFINE_TRACE(NavigationScheduler) {
549 visitor->Trace(frame_); 549 visitor->Trace(frame_);
550 visitor->Trace(redirect_); 550 visitor->Trace(redirect_);
551 } 551 }
552 552
553 } // namespace blink 553 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/ImageLoader.cpp ('k') | third_party/WebKit/Source/core/loader/PingLoaderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698