| Index: Source/platform/network/ResourceTimingInfo.h
|
| diff --git a/Source/core/timing/ResourceTimingInfo.h b/Source/platform/network/ResourceTimingInfo.h
|
| similarity index 77%
|
| rename from Source/core/timing/ResourceTimingInfo.h
|
| rename to Source/platform/network/ResourceTimingInfo.h
|
| index dd18ac675f9db4cae4c820192ff2f2f823e0599c..0db4292350851b0fe33b211dde0c007d1c819932 100644
|
| --- a/Source/core/timing/ResourceTimingInfo.h
|
| +++ b/Source/platform/network/ResourceTimingInfo.h
|
| @@ -31,18 +31,25 @@
|
| #ifndef ResourceTimingInfo_h
|
| #define ResourceTimingInfo_h
|
|
|
| +#include "platform/CrossThreadCopier.h"
|
| #include "platform/network/ResourceRequest.h"
|
| #include "platform/network/ResourceResponse.h"
|
| #include "wtf/text/AtomicString.h"
|
|
|
| namespace blink {
|
|
|
| -class ResourceTimingInfo {
|
| +struct CrossThreadResourceTimingInfoData;
|
| +
|
| +class PLATFORM_EXPORT ResourceTimingInfo {
|
| public:
|
| static PassOwnPtr<ResourceTimingInfo> create(const AtomicString& type, const double time, bool isMainResource)
|
| {
|
| return adoptPtr(new ResourceTimingInfo(type, time, isMainResource));
|
| }
|
| + static PassOwnPtr<ResourceTimingInfo> adopt(PassOwnPtr<CrossThreadResourceTimingInfoData>);
|
| +
|
| + // Gets a copy of the data suitable for passing to another thread.
|
| + PassOwnPtr<CrossThreadResourceTimingInfoData> copyData() const;
|
|
|
| double initialTime() const { return m_initialTime; }
|
| bool isMainResource() const { return m_isMainResource; }
|
| @@ -90,6 +97,27 @@ private:
|
| bool m_isMainResource;
|
| };
|
|
|
| +struct CrossThreadResourceTimingInfoData {
|
| + WTF_MAKE_NONCOPYABLE(CrossThreadResourceTimingInfoData);
|
| + WTF_MAKE_FAST_ALLOCATED(CrossThreadResourceTimingInfoData);
|
| +public:
|
| + CrossThreadResourceTimingInfoData() {}
|
| +
|
| + String m_type;
|
| + String m_originalTimingAllowOrigin;
|
| + double m_initialTime;
|
| + double m_loadFinishTime;
|
| + OwnPtr<CrossThreadResourceRequestData> m_initialRequest;
|
| + OwnPtr<CrossThreadResourceResponseData> m_finalResponse;
|
| + Vector<OwnPtr<CrossThreadResourceResponseData>> m_redirectChain;
|
| + bool m_isMainResource;
|
| +};
|
| +
|
| +template<> struct CrossThreadCopierBase<false, false, false, ResourceTimingInfo> {
|
| + typedef PassOwnPtr<CrossThreadResourceTimingInfoData> Type;
|
| + static Type copy(const ResourceTimingInfo& info) { return info.copyData(); }
|
| +};
|
| +
|
| } // namespace blink
|
|
|
| #endif
|
|
|