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

Side by Side Diff: content/child/web_url_loader_impl.cc

Issue 1064413003: PlzNavigate: make RenderViewtest helper functions work (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 // 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 "content/child/web_url_loader_impl.h" 5 #include "content/child/web_url_loader_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <deque> 8 #include <deque>
9 #include <string> 9 #include <string>
10 10
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 // browser. 442 // browser.
443 if (stream_override_.get()) { 443 if (stream_override_.get()) {
444 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( 444 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(
445 switches::kEnableBrowserSideNavigation)); 445 switches::kEnableBrowserSideNavigation));
446 DCHECK(!sync_load_response); 446 DCHECK(!sync_load_response);
447 DCHECK_NE(WebURLRequest::FrameTypeNone, request.frameType()); 447 DCHECK_NE(WebURLRequest::FrameTypeNone, request.frameType());
448 DCHECK_EQ("GET", request.httpMethod().latin1()); 448 DCHECK_EQ("GET", request.httpMethod().latin1());
449 url = stream_override_->stream_url; 449 url = stream_override_->stream_url;
450 } 450 }
451 451
452 // PlzNavigate: the only navigation requests going through the WebURLLoader
453 // are the ones created by CommitNavigation.
454 DCHECK(!base::CommandLine::ForCurrentProcess()->HasSwitch(
455 switches::kEnableBrowserSideNavigation) ||
456 stream_override_.get() ||
457 request.frameType() == WebURLRequest::FrameTypeNone);
458
459 if (CanHandleDataURLRequestLocally()) { 452 if (CanHandleDataURLRequestLocally()) {
460 if (sync_load_response) { 453 if (sync_load_response) {
461 // This is a sync load. Do the work now. 454 // This is a sync load. Do the work now.
462 sync_load_response->url = url; 455 sync_load_response->url = url;
463 sync_load_response->error_code = 456 sync_load_response->error_code =
464 GetInfoFromDataURL(sync_load_response->url, sync_load_response, 457 GetInfoFromDataURL(sync_load_response->url, sync_load_response,
465 &sync_load_response->data); 458 &sync_load_response->data);
466 } else { 459 } else {
467 task_runner_->PostTask(FROM_HERE, 460 task_runner_->PostTask(FROM_HERE,
468 base::Bind(&Context::HandleDataURL, this)); 461 base::Bind(&Context::HandleDataURL, this));
469 } 462 }
470 return; 463 return;
471 } 464 }
472 465
466 // PlzNavigate: the only navigation requests going through the WebURLLoader
467 // are the ones created by CommitNavigation.
468 DCHECK(!base::CommandLine::ForCurrentProcess()->HasSwitch(
clamy 2015/04/08 14:19:30 Several tests load HTML through a data url, requir
Charlie Reis 2015/04/09 00:47:40 Sure. Please update the comment, though, since th
clamy 2015/04/09 15:55:06 Done.
469 switches::kEnableBrowserSideNavigation) ||
470 stream_override_.get() ||
471 request.frameType() == WebURLRequest::FrameTypeNone);
carlosk 2015/04/08 15:16:42 For clarity this should be updated to use (the rec
clamy 2015/04/09 15:55:06 Done. Clearer indeed.
472
473 GURL referrer_url( 473 GURL referrer_url(
474 request.httpHeaderField(WebString::fromUTF8("Referer")).latin1()); 474 request.httpHeaderField(WebString::fromUTF8("Referer")).latin1());
475 const std::string& method = request.httpMethod().latin1(); 475 const std::string& method = request.httpMethod().latin1();
476 476
477 // TODO(brettw) this should take parameter encoding into account when 477 // TODO(brettw) this should take parameter encoding into account when
478 // creating the GURLs. 478 // creating the GURLs.
479 479
480 // TODO(horo): Check credentials flag is unset when credentials mode is omit. 480 // TODO(horo): Check credentials flag is unset when credentials mode is omit.
481 // Check credentials flag is set when credentials mode is include. 481 // Check credentials flag is set when credentials mode is include.
482 482
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
1138 int intra_priority_value) { 1138 int intra_priority_value) {
1139 context_->DidChangePriority(new_priority, intra_priority_value); 1139 context_->DidChangePriority(new_priority, intra_priority_value);
1140 } 1140 }
1141 1141
1142 bool WebURLLoaderImpl::attachThreadedDataReceiver( 1142 bool WebURLLoaderImpl::attachThreadedDataReceiver(
1143 blink::WebThreadedDataReceiver* threaded_data_receiver) { 1143 blink::WebThreadedDataReceiver* threaded_data_receiver) {
1144 return context_->AttachThreadedDataReceiver(threaded_data_receiver); 1144 return context_->AttachThreadedDataReceiver(threaded_data_receiver);
1145 } 1145 }
1146 1146
1147 } // namespace content 1147 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/public/test/render_view_test.cc » ('j') | content/public/test/render_view_test.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698