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

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

Issue 1504403003: Calling isSecureContext() with no arguments (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved isSecureContext() implementation to base class Created 5 years 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 | « third_party/WebKit/Source/platform/weborigin/SecurityOrigin.h ('k') | no next file » | 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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 if (SchemeRegistry::shouldTreatURLSchemeAsSecure(m_protocol) || isLocal() || isLocalhost()) 360 if (SchemeRegistry::shouldTreatURLSchemeAsSecure(m_protocol) || isLocal() || isLocalhost())
361 return true; 361 return true;
362 362
363 if (SecurityPolicy::isOriginWhiteListedTrustworthy(*this)) 363 if (SecurityPolicy::isOriginWhiteListedTrustworthy(*this))
364 return true; 364 return true;
365 365
366 errorMessage = "Only secure origins are allowed (see: https://goo.gl/Y0ZkNV) ."; 366 errorMessage = "Only secure origins are allowed (see: https://goo.gl/Y0ZkNV) .";
367 return false; 367 return false;
368 } 368 }
369 369
370 bool SecurityOrigin::isPotentiallyTrustworthy() const
estark 2015/12/14 20:50:44 Hmmm... since you've already introduced the no-arg
371 {
estark 2015/12/14 20:50:44 I would suggest the following: bool SecurityOrigi
372 String unusedErrorMessage;
373 return isPotentiallyTrustworthy(unusedErrorMessage);
374 }
375
370 void SecurityOrigin::grantLoadLocalResources() 376 void SecurityOrigin::grantLoadLocalResources()
371 { 377 {
372 // Granting privileges to some, but not all, documents in a SecurityOrigin 378 // Granting privileges to some, but not all, documents in a SecurityOrigin
373 // is a security hazard because the documents without the privilege can 379 // is a security hazard because the documents without the privilege can
374 // obtain the privilege by injecting script into the documents that have 380 // obtain the privilege by injecting script into the documents that have
375 // been granted the privilege. 381 // been granted the privilege.
376 m_canLoadLocalResources = true; 382 m_canLoadLocalResources = true;
377 } 383 }
378 384
379 void SecurityOrigin::grantUniversalAccess() 385 void SecurityOrigin::grantUniversalAccess()
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 } 547 }
542 548
543 void SecurityOrigin::transferPrivilegesFrom(PassOwnPtr<PrivilegeData> privilegeD ata) 549 void SecurityOrigin::transferPrivilegesFrom(PassOwnPtr<PrivilegeData> privilegeD ata)
544 { 550 {
545 m_universalAccess = privilegeData->m_universalAccess; 551 m_universalAccess = privilegeData->m_universalAccess;
546 m_canLoadLocalResources = privilegeData->m_canLoadLocalResources; 552 m_canLoadLocalResources = privilegeData->m_canLoadLocalResources;
547 m_blockLocalAccessFromLocalOrigin = privilegeData->m_blockLocalAccessFromLoc alOrigin; 553 m_blockLocalAccessFromLocalOrigin = privilegeData->m_blockLocalAccessFromLoc alOrigin;
548 } 554 }
549 555
550 } // namespace blink 556 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/weborigin/SecurityOrigin.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698