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

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

Issue 2022483003: ABANDONED CL: LoadURLParams: Add |method| + removing LOAD_TYPE_BROWSER_INITIATED_HTTP_POST. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@post-data-my-stuff
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 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:
673 if (!params.url.SchemeIs(url::kHttpScheme) &&
674 !params.url.SchemeIs(url::kHttpsScheme)) {
675 NOTREACHED() << "Http post load must use http(s) scheme.";
676 return;
677 }
678 break;
679 case LOAD_TYPE_DATA: 672 case LOAD_TYPE_DATA:
680 if (!params.url.SchemeIs(url::kDataScheme)) { 673 if (!params.url.SchemeIs(url::kDataScheme)) {
681 NOTREACHED() << "Data load must use data scheme."; 674 NOTREACHED() << "Data load must use data scheme.";
682 return; 675 return;
683 } 676 }
684 break; 677 break;
685 default: 678 default:
686 NOTREACHED(); 679 NOTREACHED();
687 break; 680 break;
688 }; 681 };
682 if (params.method == "POST") {
683 if (!params.url.SchemeIs(url::kHttpScheme) &&
684 !params.url.SchemeIs(url::kHttpsScheme)) {
685 NOTREACHED() << "Http post load must use http(s) scheme.";
686 return;
687 }
688 } else {
689 DCHECK(!params.browser_initiated_post_data);
690 }
689 691
690 // The user initiated a load, we don't need to reload anymore. 692 // The user initiated a load, we don't need to reload anymore.
691 needs_reload_ = false; 693 needs_reload_ = false;
692 694
693 bool override = false; 695 bool override = false;
694 switch (params.override_user_agent) { 696 switch (params.override_user_agent) {
695 case UA_OVERRIDE_INHERIT: 697 case UA_OVERRIDE_INHERIT:
696 override = ShouldKeepOverride(GetLastCommittedEntry()); 698 override = ShouldKeepOverride(GetLastCommittedEntry());
697 break; 699 break;
698 case UA_OVERRIDE_TRUE: 700 case UA_OVERRIDE_TRUE:
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 entry->set_intent_received_timestamp( 763 entry->set_intent_received_timestamp(
762 base::TimeTicks() + 764 base::TimeTicks() +
763 base::TimeDelta::FromMilliseconds(params.intent_received_timestamp)); 765 base::TimeDelta::FromMilliseconds(params.intent_received_timestamp));
764 } 766 }
765 entry->set_has_user_gesture(params.has_user_gesture); 767 entry->set_has_user_gesture(params.has_user_gesture);
766 #endif 768 #endif
767 769
768 switch (params.load_type) { 770 switch (params.load_type) {
769 case LOAD_TYPE_DEFAULT: 771 case LOAD_TYPE_DEFAULT:
770 break; 772 break;
771 case LOAD_TYPE_BROWSER_INITIATED_HTTP_POST:
772 entry->SetHasPostData(true);
773 entry->SetBrowserInitiatedPostData(
774 params.browser_initiated_post_data.get());
775 break;
776 case LOAD_TYPE_DATA: 773 case LOAD_TYPE_DATA:
777 entry->SetBaseURLForDataURL(params.base_url_for_data_url); 774 entry->SetBaseURLForDataURL(params.base_url_for_data_url);
778 entry->SetVirtualURL(params.virtual_url_for_data_url); 775 entry->SetVirtualURL(params.virtual_url_for_data_url);
779 #if defined(OS_ANDROID) 776 #if defined(OS_ANDROID)
780 entry->SetDataURLAsString(params.data_url_as_string); 777 entry->SetDataURLAsString(params.data_url_as_string);
781 #endif 778 #endif
782 entry->SetCanLoadLocalResources(params.can_load_local_resources); 779 entry->SetCanLoadLocalResources(params.can_load_local_resources);
783 break; 780 break;
784 default: 781 default:
785 NOTREACHED(); 782 NOTREACHED();
786 break; 783 break;
787 }; 784 };
788 785
786 if (params.method == "POST") {
787 entry->SetHasPostData(true);
788 entry->SetBrowserInitiatedPostData(
789 params.browser_initiated_post_data.get());
790 }
791
789 LoadEntry(std::move(entry)); 792 LoadEntry(std::move(entry));
790 } 793 }
791 794
792 bool NavigationControllerImpl::PendingEntryMatchesHandle( 795 bool NavigationControllerImpl::PendingEntryMatchesHandle(
793 NavigationHandleImpl* handle) const { 796 NavigationHandleImpl* handle) const {
794 return pending_entry_ && 797 return pending_entry_ &&
795 pending_entry_->GetUniqueID() == handle->pending_nav_entry_id(); 798 pending_entry_->GetUniqueID() == handle->pending_nav_entry_id();
796 } 799 }
797 800
798 bool NavigationControllerImpl::RendererDidNavigate( 801 bool NavigationControllerImpl::RendererDidNavigate(
(...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after
2060 } 2063 }
2061 } 2064 }
2062 } 2065 }
2063 2066
2064 void NavigationControllerImpl::SetGetTimestampCallbackForTest( 2067 void NavigationControllerImpl::SetGetTimestampCallbackForTest(
2065 const base::Callback<base::Time()>& get_timestamp_callback) { 2068 const base::Callback<base::Time()>& get_timestamp_callback) {
2066 get_timestamp_callback_ = get_timestamp_callback; 2069 get_timestamp_callback_ = get_timestamp_callback;
2067 } 2070 }
2068 2071
2069 } // namespace content 2072 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698