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

Side by Side Diff: content/browser/site_per_process_browsertest.cc

Issue 2648423002: Rename feature policy classes. (Closed)
Patch Set: Rebase Created 3 years, 10 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
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | content/common/frame_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser/site_per_process_browsertest.h" 5 #include "content/browser/site_per_process_browsertest.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 655
656 protected: 656 protected:
657 void SetUpCommandLine(base::CommandLine* command_line) override { 657 void SetUpCommandLine(base::CommandLine* command_line) override {
658 SitePerProcessBrowserTest::SetUpCommandLine(command_line); 658 SitePerProcessBrowserTest::SetUpCommandLine(command_line);
659 // TODO(iclelland): Remove this switch when Feature Policy ships. 659 // TODO(iclelland): Remove this switch when Feature Policy ships.
660 // https://crbug.com/623682 660 // https://crbug.com/623682
661 command_line->AppendSwitchASCII(switches::kEnableBlinkFeatures, 661 command_line->AppendSwitchASCII(switches::kEnableBlinkFeatures,
662 "FeaturePolicy"); 662 "FeaturePolicy");
663 } 663 }
664 664
665 ParsedFeaturePolicy CreateFPHeader(const std::string& feature_name, 665 ParsedFeaturePolicyHeader CreateFPHeader(const std::string& feature_name,
666 const std::vector<GURL>& origins) { 666 const std::vector<GURL>& origins) {
667 ParsedFeaturePolicy result(1); 667 ParsedFeaturePolicyHeader result(1);
668 result[0].feature_name = feature_name; 668 result[0].feature_name = feature_name;
669 result[0].matches_all_origins = false; 669 result[0].matches_all_origins = false;
670 DCHECK(!origins.empty()); 670 DCHECK(!origins.empty());
671 for (const GURL& origin : origins) 671 for (const GURL& origin : origins)
672 result[0].origins.push_back(url::Origin(origin)); 672 result[0].origins.push_back(url::Origin(origin));
673 return result; 673 return result;
674 } 674 }
675 675
676 ParsedFeaturePolicy CreateFPHeaderMatchesAll( 676 ParsedFeaturePolicyHeader CreateFPHeaderMatchesAll(
677 const std::string& feature_name) { 677 const std::string& feature_name) {
678 ParsedFeaturePolicy result(1); 678 ParsedFeaturePolicyHeader result(1);
679 result[0].feature_name = feature_name; 679 result[0].feature_name = feature_name;
680 result[0].matches_all_origins = true; 680 result[0].matches_all_origins = true;
681 return result; 681 return result;
682 } 682 }
683 }; 683 };
684 684
685 bool operator==(const FeaturePolicyParsedWhitelist& first, 685 bool operator==(const ParsedFeaturePolicyDeclaration& first,
686 const FeaturePolicyParsedWhitelist& second) { 686 const ParsedFeaturePolicyDeclaration& second) {
687 return std::tie(first.feature_name, first.matches_all_origins, 687 return std::tie(first.feature_name, first.matches_all_origins,
688 first.origins) == std::tie(second.feature_name, 688 first.origins) == std::tie(second.feature_name,
689 second.matches_all_origins, 689 second.matches_all_origins,
690 second.origins); 690 second.origins);
691 } 691 }
692 692
693 double GetFrameDeviceScaleFactor(const ToRenderFrameHost& adapter) { 693 double GetFrameDeviceScaleFactor(const ToRenderFrameHost& adapter) {
694 double device_scale_factor; 694 double device_scale_factor;
695 const char kGetFrameDeviceScaleFactor[] = 695 const char kGetFrameDeviceScaleFactor[] =
696 "window.domAutomationController.send(window.devicePixelRatio);"; 696 "window.domAutomationController.send(window.devicePixelRatio);";
(...skipping 8469 matching lines...) Expand 10 before | Expand all | Expand 10 after
9166 shell(), embedded_test_server()->GetURL("b.com", "/title3.html"))); 9166 shell(), embedded_test_server()->GetURL("b.com", "/title3.html")));
9167 9167
9168 // Pretend that a.com just requested a context menu. This used to cause a 9168 // Pretend that a.com just requested a context menu. This used to cause a
9169 // because the RenderWidgetHostView is destroyed when the frame is swapped and 9169 // because the RenderWidgetHostView is destroyed when the frame is swapped and
9170 // added to pending delete list. 9170 // added to pending delete list.
9171 rfh->OnMessageReceived( 9171 rfh->OnMessageReceived(
9172 FrameHostMsg_ContextMenu(rfh->GetRoutingID(), ContextMenuParams())); 9172 FrameHostMsg_ContextMenu(rfh->GetRoutingID(), ContextMenuParams()));
9173 } 9173 }
9174 9174
9175 } // namespace content 9175 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | content/common/frame_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698