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

Side by Side Diff: Source/platform/weborigin/SecurityOrigin.cpp

Issue 1082173003: Support whitelisting to handle insecure origins as trustworthy origins (blink) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: no lock (for now) Created 5 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/platform/weborigin/SecurityPolicy.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 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 374
375 return true; 375 return true;
376 } 376 }
377 377
378 bool SecurityOrigin::isPotentiallyTrustworthy(String& errorMessage) const 378 bool SecurityOrigin::isPotentiallyTrustworthy(String& errorMessage) const
379 { 379 {
380 ASSERT(m_protocol != "data"); 380 ASSERT(m_protocol != "data");
381 if (SchemeRegistry::shouldTreatURLSchemeAsSecure(m_protocol) || isLocal() || isLocalhost()) 381 if (SchemeRegistry::shouldTreatURLSchemeAsSecure(m_protocol) || isLocal() || isLocalhost())
382 return true; 382 return true;
383 383
384 if (SecurityPolicy::isOriginWhiteListedTrustworthy(*this))
385 return true;
386
384 errorMessage = "Only secure origins are allowed (see: https://goo.gl/Y0ZkNV) ."; 387 errorMessage = "Only secure origins are allowed (see: https://goo.gl/Y0ZkNV) .";
385 return false; 388 return false;
386 } 389 }
387 390
388 SecurityOrigin::Policy SecurityOrigin::canShowNotifications() const 391 SecurityOrigin::Policy SecurityOrigin::canShowNotifications() const
389 { 392 {
390 if (m_universalAccess) 393 if (m_universalAccess)
391 return AlwaysAllow; 394 return AlwaysAllow;
392 if (isUnique()) 395 if (isUnique())
393 return AlwaysDeny; 396 return AlwaysDeny;
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 } 534 }
532 535
533 void SecurityOrigin::transferPrivilegesFrom(const SecurityOrigin& origin) 536 void SecurityOrigin::transferPrivilegesFrom(const SecurityOrigin& origin)
534 { 537 {
535 m_universalAccess = origin.m_universalAccess; 538 m_universalAccess = origin.m_universalAccess;
536 m_canLoadLocalResources = origin.m_canLoadLocalResources; 539 m_canLoadLocalResources = origin.m_canLoadLocalResources;
537 m_enforceFilePathSeparation = origin.m_enforceFilePathSeparation; 540 m_enforceFilePathSeparation = origin.m_enforceFilePathSeparation;
538 } 541 }
539 542
540 } // namespace blink 543 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/platform/weborigin/SecurityPolicy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698