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

Side by Side Diff: content/test/test_render_frame_host.cc

Issue 1294243004: PlzNavigate: Make ServiceWorker work with PlzNavigate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Style, placeholders, all that stuff Created 5 years, 4 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 // 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/test/test_render_frame_host.h" 5 #include "content/test/test_render_frame_host.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "content/browser/frame_host/frame_tree.h" 8 #include "content/browser/frame_host/frame_tree.h"
9 #include "content/browser/frame_host/navigation_handle_impl.h" 9 #include "content/browser/frame_host/navigation_handle_impl.h"
10 #include "content/browser/frame_host/navigation_request.h" 10 #include "content/browser/frame_host/navigation_request.h"
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 321
322 void TestRenderFrameHost::SendRendererInitiatedNavigationRequest( 322 void TestRenderFrameHost::SendRendererInitiatedNavigationRequest(
323 const GURL& url, 323 const GURL& url,
324 bool has_user_gesture) { 324 bool has_user_gesture) {
325 // Since this is renderer-initiated navigation, the RenderFrame must be 325 // Since this is renderer-initiated navigation, the RenderFrame must be
326 // initialized. Do it if it hasn't happened yet. 326 // initialized. Do it if it hasn't happened yet.
327 InitializeRenderFrameIfNeeded(); 327 InitializeRenderFrameIfNeeded();
328 328
329 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 329 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
330 switches::kEnableBrowserSideNavigation)) { 330 switches::kEnableBrowserSideNavigation)) {
331 BeginNavigationParams begin_params("GET", std::string(), net::LOAD_NORMAL, 331 BeginNavigationParams begin_params(
332 has_user_gesture); 332 "GET", std::string(), net::LOAD_NORMAL, has_user_gesture, false,
333 FETCH_REQUEST_MODE_NO_CORS, FETCH_CREDENTIALS_MODE_SAME_ORIGIN,
334 FetchRedirectMode::FOLLOW_MODE, REQUEST_CONTEXT_TYPE_LOCATION,
335 REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL);
nasko 2015/08/20 16:49:51 This can be called for subframes too, let's not ha
Fabrice (no longer in Chrome) 2015/08/26 13:23:25 Done.
333 CommonNavigationParams common_params; 336 CommonNavigationParams common_params;
334 common_params.url = url; 337 common_params.url = url;
335 common_params.referrer = Referrer(GURL(), blink::WebReferrerPolicyDefault); 338 common_params.referrer = Referrer(GURL(), blink::WebReferrerPolicyDefault);
336 common_params.transition = ui::PAGE_TRANSITION_LINK; 339 common_params.transition = ui::PAGE_TRANSITION_LINK;
337 OnBeginNavigation(common_params, begin_params, 340 OnBeginNavigation(common_params, begin_params,
338 scoped_refptr<ResourceRequestBody>()); 341 scoped_refptr<ResourceRequestBody>());
339 } 342 }
340 } 343 }
341 344
342 void TestRenderFrameHost::DidDisownOpener() { 345 void TestRenderFrameHost::DidDisownOpener() {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 // cleared during DidFailProvisionalLoad). 395 // cleared during DidFailProvisionalLoad).
393 int page_id = entry ? entry->GetPageID() : -1; 396 int page_id = entry ? entry->GetPageID() : -1;
394 if (page_id == -1) { 397 if (page_id == -1) {
395 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(delegate()); 398 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(delegate());
396 page_id = web_contents->GetMaxPageIDForSiteInstance(GetSiteInstance()) + 1; 399 page_id = web_contents->GetMaxPageIDForSiteInstance(GetSiteInstance()) + 1;
397 } 400 }
398 return page_id; 401 return page_id;
399 } 402 }
400 403
401 } // namespace content 404 } // namespace content
OLDNEW
« content/renderer/render_frame_impl.cc ('K') | « content/renderer/render_frame_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698