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

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: Addressed CR feedback from creis@. 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 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 // unhandled, otherwise Telemetry can't tell if Navigation completed. 662 // unhandled, otherwise Telemetry can't tell if Navigation completed.
663 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( 663 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
664 cc::switches::kEnableGpuBenchmarking)) 664 cc::switches::kEnableGpuBenchmarking))
665 return; 665 return;
666 } 666 }
667 667
668 // Checks based on params.load_type. 668 // Checks based on params.load_type.
669 switch (params.load_type) { 669 switch (params.load_type) {
670 case LOAD_TYPE_DEFAULT: 670 case LOAD_TYPE_DEFAULT:
671 break; 671 break;
672 case LOAD_TYPE_BROWSER_INITIATED_HTTP_POST: 672 case LOAD_TYPE_HTTP_POST:
673 // TODO(lukasza): This assertion is false - it is also possible to POST to
674 // an chrome-extension://... URI. This might be more common when
675 // allowing renderer-initiated POST after fixing https://crbug.com/344348.
673 if (!params.url.SchemeIs(url::kHttpScheme) && 676 if (!params.url.SchemeIs(url::kHttpScheme) &&
674 !params.url.SchemeIs(url::kHttpsScheme)) { 677 !params.url.SchemeIs(url::kHttpsScheme)) {
675 NOTREACHED() << "Http post load must use http(s) scheme."; 678 NOTREACHED() << "Http post load must use http(s) scheme.";
676 return; 679 return;
677 } 680 }
678 break; 681 break;
679 case LOAD_TYPE_DATA: 682 case LOAD_TYPE_DATA:
680 if (!params.url.SchemeIs(url::kDataScheme)) { 683 if (!params.url.SchemeIs(url::kDataScheme)) {
681 NOTREACHED() << "Data load must use data scheme."; 684 NOTREACHED() << "Data load must use data scheme.";
682 return; 685 return;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 entry->set_intent_received_timestamp( 764 entry->set_intent_received_timestamp(
762 base::TimeTicks() + 765 base::TimeTicks() +
763 base::TimeDelta::FromMilliseconds(params.intent_received_timestamp)); 766 base::TimeDelta::FromMilliseconds(params.intent_received_timestamp));
764 } 767 }
765 entry->set_has_user_gesture(params.has_user_gesture); 768 entry->set_has_user_gesture(params.has_user_gesture);
766 #endif 769 #endif
767 770
768 switch (params.load_type) { 771 switch (params.load_type) {
769 case LOAD_TYPE_DEFAULT: 772 case LOAD_TYPE_DEFAULT:
770 break; 773 break;
771 case LOAD_TYPE_BROWSER_INITIATED_HTTP_POST: 774 case LOAD_TYPE_HTTP_POST:
772 entry->SetHasPostData(true); 775 entry->SetHasPostData(true);
773 entry->SetBrowserInitiatedPostData( 776 entry->SetPostData(params.post_data);
774 params.browser_initiated_post_data.get());
775 break; 777 break;
776 case LOAD_TYPE_DATA: 778 case LOAD_TYPE_DATA:
777 entry->SetBaseURLForDataURL(params.base_url_for_data_url); 779 entry->SetBaseURLForDataURL(params.base_url_for_data_url);
778 entry->SetVirtualURL(params.virtual_url_for_data_url); 780 entry->SetVirtualURL(params.virtual_url_for_data_url);
779 #if defined(OS_ANDROID) 781 #if defined(OS_ANDROID)
780 entry->SetDataURLAsString(params.data_url_as_string); 782 entry->SetDataURLAsString(params.data_url_as_string);
781 #endif 783 #endif
782 entry->SetCanLoadLocalResources(params.can_load_local_resources); 784 entry->SetCanLoadLocalResources(params.can_load_local_resources);
783 break; 785 break;
784 default: 786 default:
(...skipping 1275 matching lines...) Expand 10 before | Expand all | Expand 10 after
2060 } 2062 }
2061 } 2063 }
2062 } 2064 }
2063 2065
2064 void NavigationControllerImpl::SetGetTimestampCallbackForTest( 2066 void NavigationControllerImpl::SetGetTimestampCallbackForTest(
2065 const base::Callback<base::Time()>& get_timestamp_callback) { 2067 const base::Callback<base::Time()>& get_timestamp_callback) {
2066 get_timestamp_callback_ = get_timestamp_callback; 2068 get_timestamp_callback_ = get_timestamp_callback;
2067 } 2069 }
2068 2070
2069 } // namespace content 2071 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698