Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Intel Inc. All rights reserved. | 2 * Copyright (C) 2013 Intel 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 30 | 30 |
| 31 #ifndef ResourceTimingInfo_h | 31 #ifndef ResourceTimingInfo_h |
| 32 #define ResourceTimingInfo_h | 32 #define ResourceTimingInfo_h |
| 33 | 33 |
| 34 #include "platform/network/ResourceRequest.h" | 34 #include "platform/network/ResourceRequest.h" |
| 35 #include "platform/network/ResourceResponse.h" | 35 #include "platform/network/ResourceResponse.h" |
| 36 #include "wtf/text/AtomicString.h" | 36 #include "wtf/text/AtomicString.h" |
| 37 | 37 |
| 38 namespace blink { | 38 namespace blink { |
| 39 | 39 |
| 40 class ResourceTimingInfo { | 40 struct CrossThreadResourceTimingInfoData; |
| 41 | |
| 42 class PLATFORM_EXPORT ResourceTimingInfo { | |
| 41 public: | 43 public: |
| 42 static PassOwnPtr<ResourceTimingInfo> create(const AtomicString& type, const double time, bool isMainResource) | 44 static PassOwnPtr<ResourceTimingInfo> create(const AtomicString& type, const double time, bool isMainResource) |
| 43 { | 45 { |
| 44 return adoptPtr(new ResourceTimingInfo(type, time, isMainResource)); | 46 return adoptPtr(new ResourceTimingInfo(type, time, isMainResource)); |
| 45 } | 47 } |
| 48 static PassOwnPtr<ResourceTimingInfo> adopt(PassOwnPtr<CrossThreadResourceTi mingInfoData>); | |
| 49 | |
| 50 // Gets a copy of the data suitable for passing to another thread. | |
| 51 PassOwnPtr<CrossThreadResourceTimingInfoData> copyData() const; | |
| 46 | 52 |
| 47 double initialTime() const { return m_initialTime; } | 53 double initialTime() const { return m_initialTime; } |
| 48 bool isMainResource() const { return m_isMainResource; } | 54 bool isMainResource() const { return m_isMainResource; } |
| 49 | 55 |
| 50 void setInitiatorType(const AtomicString& type) { m_type = type; } | 56 void setInitiatorType(const AtomicString& type) { m_type = type; } |
| 51 const AtomicString& initiatorType() const { return m_type; } | 57 const AtomicString& initiatorType() const { return m_type; } |
| 52 | 58 |
| 53 void setOriginalTimingAllowOrigin(const AtomicString& originalTimingAllowOri gin) { m_originalTimingAllowOrigin = originalTimingAllowOrigin; } | 59 void setOriginalTimingAllowOrigin(const AtomicString& originalTimingAllowOri gin) { m_originalTimingAllowOrigin = originalTimingAllowOrigin; } |
| 54 const AtomicString& originalTimingAllowOrigin() const { return m_originalTim ingAllowOrigin; } | 60 const AtomicString& originalTimingAllowOrigin() const { return m_originalTim ingAllowOrigin; } |
| 55 | 61 |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 83 AtomicString m_type; | 89 AtomicString m_type; |
| 84 AtomicString m_originalTimingAllowOrigin; | 90 AtomicString m_originalTimingAllowOrigin; |
| 85 double m_initialTime; | 91 double m_initialTime; |
| 86 double m_loadFinishTime; | 92 double m_loadFinishTime; |
| 87 ResourceRequest m_initialRequest; | 93 ResourceRequest m_initialRequest; |
| 88 ResourceResponse m_finalResponse; | 94 ResourceResponse m_finalResponse; |
| 89 Vector<ResourceResponse> m_redirectChain; | 95 Vector<ResourceResponse> m_redirectChain; |
| 90 bool m_isMainResource; | 96 bool m_isMainResource; |
| 91 }; | 97 }; |
| 92 | 98 |
| 99 struct CrossThreadResourceTimingInfoData { | |
| 100 WTF_MAKE_NONCOPYABLE(CrossThreadResourceTimingInfoData); WTF_MAKE_FAST_ALLOC ATED(CrossThreadResourceTimingInfoData); | |
|
tkent
2015/06/24 02:03:58
Do not write two expressions on one line.
Kunihiko Sakamoto
2015/06/24 02:47:50
Done.
| |
| 101 public: | |
| 102 CrossThreadResourceTimingInfoData() { } | |
|
tkent
2015/06/24 02:03:58
nit: Remove a space between { and }.
Kunihiko Sakamoto
2015/06/24 02:47:50
Done.
| |
| 103 | |
| 104 String m_type; | |
| 105 String m_originalTimingAllowOrigin; | |
| 106 double m_initialTime; | |
| 107 double m_loadFinishTime; | |
| 108 OwnPtr<CrossThreadResourceRequestData> m_initialRequest; | |
| 109 OwnPtr<CrossThreadResourceResponseData> m_finalResponse; | |
| 110 Vector<OwnPtr<CrossThreadResourceResponseData>> m_redirectChain; | |
| 111 bool m_isMainResource; | |
| 112 }; | |
| 113 | |
| 93 } // namespace blink | 114 } // namespace blink |
| 94 | 115 |
| 95 #endif | 116 #endif |
| OLD | NEW |