Bug 1377587, part 2 - Rename ExposedPropertiesOnly to OpaqueWithSilentFailing. r=krizsa
authorAndrew McCreight <continuation@gmail.com>
Thu, 07 Sep 2017 11:17:16 -0700
changeset 429641 cdb4e0259eebe3db8f2abeb31aa4696656f3c2e2
parent 429640 0a058c19c23507038bf2a1c830ddc34ca90fb578
child 429642 fd7548ea80ed1d73f03804cb52fac6e05d8bf296
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskrizsa
bugs1377587
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1377587, part 2 - Rename ExposedPropertiesOnly to OpaqueWithSilentFailing. r=krizsa This class doesn't have anything to do with __exposedProps__ any more, so give it a more descriptive name. We'd still like to remove it entirely eventually. MozReview-Commit-ID: 87KCpG6f8rI
js/xpconnect/wrappers/AccessCheck.cpp
js/xpconnect/wrappers/AccessCheck.h
js/xpconnect/wrappers/ChromeObjectWrapper.h
--- a/js/xpconnect/wrappers/AccessCheck.cpp
+++ b/js/xpconnect/wrappers/AccessCheck.cpp
@@ -305,18 +305,18 @@ AccessCheck::reportCrossOriginDenial(JSC
                   NS_LITERAL_CSTRING(" on cross-origin object");
     }
     ErrorResult rv;
     rv.ThrowDOMException(NS_ERROR_DOM_SECURITY_ERR, message);
     MOZ_ALWAYS_TRUE(rv.MaybeSetPendingException(cx));
 }
 
 bool
-ExposedPropertiesOnly::deny(JSContext* cx, js::Wrapper::Action act, HandleId id,
-                            bool mayThrow)
+OpaqueWithSilentFailing::deny(JSContext* cx, js::Wrapper::Action act, HandleId id,
+                              bool mayThrow)
 {
     // Fail silently for GET, ENUMERATE, and GET_PROPERTY_DESCRIPTOR.
     if (act == js::Wrapper::GET || act == js::Wrapper::ENUMERATE ||
         act == js::Wrapper::GET_PROPERTY_DESCRIPTOR)
     {
         // Note that ReportWrapperDenial doesn't do any _exception_ reporting,
         // so we want to do this regardless of the value of mayThrow.
         return ReportWrapperDenial(cx, id, WrapperDenialForCOW,
--- a/js/xpconnect/wrappers/AccessCheck.h
+++ b/js/xpconnect/wrappers/AccessCheck.h
@@ -104,17 +104,17 @@ struct CrossOriginAccessiblePropertiesOn
     }
 };
 
 // This class used to support permitting access to properties if they
 // appeared in an access list on the object, but now it acts like an
 // Opaque wrapper, with the exception that it fails silently for GET,
 // ENUMERATE, and GET_PROPERTY_DESCRIPTOR. This is done for backwards
 // compatibility. See bug 1397513.
-struct ExposedPropertiesOnly : public Policy {
+struct OpaqueWithSilentFailing : public Policy {
     static bool check(JSContext* cx, JS::HandleObject wrapper, JS::HandleId id, js::Wrapper::Action act) {
         return false;
     }
 
     static bool deny(JSContext* cx, js::Wrapper::Action act, JS::HandleId id,
                      bool mayThrow);
     static bool allowNativeCall(JSContext* cx, JS::IsAcceptableThis test, JS::NativeImpl impl) {
         return false;
--- a/js/xpconnect/wrappers/ChromeObjectWrapper.h
+++ b/js/xpconnect/wrappers/ChromeObjectWrapper.h
@@ -8,24 +8,24 @@
 #define __ChromeObjectWrapper_h__
 
 #include "mozilla/Attributes.h"
 
 #include "FilteringWrapper.h"
 
 namespace xpc {
 
-struct ExposedPropertiesOnly;
+struct OpaqueWithSilentFailing;
 
 // When a vanilla chrome JS object is exposed to content, we use a wrapper that
 // fails silently on GET, ENUMERATE, and GET_PROPERTY_DESCRIPTOR for legacy
 // reasons. For extra security, we override the traps that allow content to pass
 // an object to chrome, and perform extra security checks on them.
 #define ChromeObjectWrapperBase \
-  FilteringWrapper<js::CrossCompartmentSecurityWrapper, ExposedPropertiesOnly>
+  FilteringWrapper<js::CrossCompartmentSecurityWrapper, OpaqueWithSilentFailing>
 
 class ChromeObjectWrapper : public ChromeObjectWrapperBase
 {
   public:
     constexpr ChromeObjectWrapper() : ChromeObjectWrapperBase(0) {}
 
     virtual bool defineProperty(JSContext* cx, JS::Handle<JSObject*> wrapper,
                                 JS::Handle<jsid> id,