Chromium Code Reviews| Index: third_party/WebKit/Source/core/origin_trials/DocumentOriginTrialContext.h |
| diff --git a/third_party/WebKit/Source/core/origin_trials/DocumentOriginTrialContext.h b/third_party/WebKit/Source/core/origin_trials/DocumentOriginTrialContext.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..3ea5bc2cc951c91953ea689b070ea0dc9a6f0685 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/origin_trials/DocumentOriginTrialContext.h |
| @@ -0,0 +1,39 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef DocumentOriginTrialContext_h |
| +#define DocumentOriginTrialContext_h |
| + |
| +#include "core/CoreExport.h" |
| +#include "core/dom/Document.h" |
| +#include "core/origin_trials/OriginTrialContext.h" |
| +#include "platform/heap/Handle.h" |
| +#include "wtf/Forward.h" |
| +#include <utility> |
| + |
| +namespace blink { |
| + |
| +class WebApiKeyValidator; |
| + |
| +// DocumentOriginTrialContext is a specialization of OriginTrialContext for |
| +// the Document execution context. It enables and disables feature trials based |
| +// on the tokens found in <meta> tags in the document header. |
| +class CORE_EXPORT DocumentOriginTrialContext : public OriginTrialContext { |
| +public: |
| + explicit DocumentOriginTrialContext(Document*); |
| + ~DocumentOriginTrialContext() override = default; |
| + |
| + ExecutionContext* executionContext() override { return m_parent; } |
| + |
| +protected: |
| + friend class DocumentOriginTrialContextTest; |
| + Vector<String> getTokens() override; |
| + |
| +private: |
| + RawPtrWillBeWeakPersistent<Document> m_parent; |
|
sof
2016/03/01 21:55:21
Please move DocumentOriginTrialContext to the Oilp
jbroman
2016/03/01 23:29:21
Agreed that WeakPersistent is icky. If Document* i
sof
2016/03/02 12:36:29
For an example of owner-ownee w/Oilpan that's near
iclelland
2016/03/03 21:47:01
Done. Moved to heap, replaced this with RawPtrWill
|
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // DocumentOriginTrialContext_h |