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

Side by Side Diff: content/browser/frame_host/navigation_controller_impl.cc

Issue 2038233002: Using ResourceRequestBody as the type of HTTP body outside of //content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@make-resource-request-body-public
Patch Set: Rebasing... Created 4 years, 6 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 /* 5 /*
6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * 10 *
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 // unhandled, otherwise Telemetry can't tell if Navigation completed. 657 // unhandled, otherwise Telemetry can't tell if Navigation completed.
658 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( 658 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
659 cc::switches::kEnableGpuBenchmarking)) 659 cc::switches::kEnableGpuBenchmarking))
660 return; 660 return;
661 } 661 }
662 662
663 // Checks based on params.load_type. 663 // Checks based on params.load_type.
664 switch (params.load_type) { 664 switch (params.load_type) {
665 case LOAD_TYPE_DEFAULT: 665 case LOAD_TYPE_DEFAULT:
666 break; 666 break;
667 case LOAD_TYPE_BROWSER_INITIATED_HTTP_POST: 667 case LOAD_TYPE_HTTP_POST:
668 // TODO(lukasza): This assertion is false - it is also possible to POST to
669 // an chrome-extension://... URI. This might be more common when
670 // allowing renderer-initiated POST after fixing https://crbug.com/344348.
668 if (!params.url.SchemeIs(url::kHttpScheme) && 671 if (!params.url.SchemeIs(url::kHttpScheme) &&
669 !params.url.SchemeIs(url::kHttpsScheme)) { 672 !params.url.SchemeIs(url::kHttpsScheme)) {
670 NOTREACHED() << "Http post load must use http(s) scheme."; 673 NOTREACHED() << "Http post load must use http(s) scheme.";
671 return; 674 return;
672 } 675 }
673 break; 676 break;
674 case LOAD_TYPE_DATA: 677 case LOAD_TYPE_DATA:
675 if (!params.url.SchemeIs(url::kDataScheme)) { 678 if (!params.url.SchemeIs(url::kDataScheme)) {
676 NOTREACHED() << "Data load must use data scheme."; 679 NOTREACHED() << "Data load must use data scheme.";
677 return; 680 return;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 entry->set_intent_received_timestamp( 759 entry->set_intent_received_timestamp(
757 base::TimeTicks() + 760 base::TimeTicks() +
758 base::TimeDelta::FromMilliseconds(params.intent_received_timestamp)); 761 base::TimeDelta::FromMilliseconds(params.intent_received_timestamp));
759 } 762 }
760 entry->set_has_user_gesture(params.has_user_gesture); 763 entry->set_has_user_gesture(params.has_user_gesture);
761 #endif 764 #endif
762 765
763 switch (params.load_type) { 766 switch (params.load_type) {
764 case LOAD_TYPE_DEFAULT: 767 case LOAD_TYPE_DEFAULT:
765 break; 768 break;
766 case LOAD_TYPE_BROWSER_INITIATED_HTTP_POST: 769 case LOAD_TYPE_HTTP_POST:
767 entry->SetHasPostData(true); 770 entry->SetHasPostData(true);
768 entry->SetBrowserInitiatedPostData( 771 entry->SetPostData(params.post_data);
769 params.browser_initiated_post_data.get());
770 break; 772 break;
771 case LOAD_TYPE_DATA: 773 case LOAD_TYPE_DATA:
772 entry->SetBaseURLForDataURL(params.base_url_for_data_url); 774 entry->SetBaseURLForDataURL(params.base_url_for_data_url);
773 entry->SetVirtualURL(params.virtual_url_for_data_url); 775 entry->SetVirtualURL(params.virtual_url_for_data_url);
774 #if defined(OS_ANDROID) 776 #if defined(OS_ANDROID)
775 entry->SetDataURLAsString(params.data_url_as_string); 777 entry->SetDataURLAsString(params.data_url_as_string);
776 #endif 778 #endif
777 entry->SetCanLoadLocalResources(params.can_load_local_resources); 779 entry->SetCanLoadLocalResources(params.can_load_local_resources);
778 break; 780 break;
779 default: 781 default:
(...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after
2074 } 2076 }
2075 } 2077 }
2076 } 2078 }
2077 2079
2078 void NavigationControllerImpl::SetGetTimestampCallbackForTest( 2080 void NavigationControllerImpl::SetGetTimestampCallbackForTest(
2079 const base::Callback<base::Time()>& get_timestamp_callback) { 2081 const base::Callback<base::Time()>& get_timestamp_callback) {
2080 get_timestamp_callback_ = get_timestamp_callback; 2082 get_timestamp_callback_ = get_timestamp_callback;
2081 } 2083 }
2082 2084
2083 } // namespace content 2085 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698