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

Side by Side Diff: content/common/content_security_policy/csp_context.cc

Issue 2716583003: Rename Origin.unique() to opaque().
Patch Set: Update new uses post-rebase Created 3 years, 4 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/child/db_message_filter.cc ('k') | content/common/cross_site_document_classifier.cc » ('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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/common/content_security_policy/csp_context.h" 5 #include "content/common/content_security_policy/csp_context.h"
6 6
7 namespace content { 7 namespace content {
8 8
9 namespace { 9 namespace {
10 10
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 *new_url = new_url->ReplaceComponents(replacements); 63 *new_url = new_url->ReplaceComponents(replacements);
64 return true; 64 return true;
65 } 65 }
66 } 66 }
67 return false; 67 return false;
68 } 68 }
69 69
70 void CSPContext::SetSelf(const url::Origin origin) { 70 void CSPContext::SetSelf(const url::Origin origin) {
71 self_source_.reset(); 71 self_source_.reset();
72 72
73 // When the origin is unique, no URL should match with 'self'. That's why 73 // When the origin is opaque, no URL should match with 'self'. That's why
74 // |self_source_| stays undefined here. 74 // |self_source_| stays undefined here.
75 if (origin.unique()) 75 if (origin.opaque())
76 return; 76 return;
77 77
78 if (origin.scheme() == url::kFileScheme) { 78 if (origin.scheme() == url::kFileScheme) {
79 self_source_ = CSPSource(url::kFileScheme, "", false, url::PORT_UNSPECIFIED, 79 self_source_ = CSPSource(url::kFileScheme, "", false, url::PORT_UNSPECIFIED,
80 false, ""); 80 false, "");
81 return; 81 return;
82 } 82 }
83 83
84 self_source_ = CSPSource( 84 self_source_ = CSPSource(
85 origin.scheme(), origin.host(), false, 85 origin.scheme(), origin.host(), false,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 disposition(disposition), 126 disposition(disposition),
127 after_redirect(after_redirect), 127 after_redirect(after_redirect),
128 source_location(source_location) {} 128 source_location(source_location) {}
129 129
130 CSPViolationParams::CSPViolationParams(const CSPViolationParams& other) = 130 CSPViolationParams::CSPViolationParams(const CSPViolationParams& other) =
131 default; 131 default;
132 132
133 CSPViolationParams::~CSPViolationParams() {} 133 CSPViolationParams::~CSPViolationParams() {}
134 134
135 } // namespace content 135 } // namespace content
OLDNEW
« no previous file with comments | « content/child/db_message_filter.cc ('k') | content/common/cross_site_document_classifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698