OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MockFetchContext_h | 5 #ifndef MockFetchContext_h |
6 #define MockFetchContext_h | 6 #define MockFetchContext_h |
7 | 7 |
8 #include "core/fetch/FetchContext.h" | 8 #include "core/fetch/FetchContext.h" |
9 #include "core/fetch/FetchRequest.h" | 9 #include "core/fetch/FetchRequest.h" |
10 #include "platform/network/ResourceTimingInfo.h" | 10 #include "platform/network/ResourceTimingInfo.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 void addResourceTiming( | 60 void addResourceTiming( |
61 const ResourceTimingInfo& resourceTimingInfo) override { | 61 const ResourceTimingInfo& resourceTimingInfo) override { |
62 m_transferSize = resourceTimingInfo.transferSize(); | 62 m_transferSize = resourceTimingInfo.transferSize(); |
63 } | 63 } |
64 long long getTransferSize() const { return m_transferSize; } | 64 long long getTransferSize() const { return m_transferSize; } |
65 | 65 |
66 private: | 66 private: |
67 MockFetchContext(LoadPolicy loadPolicy) | 67 MockFetchContext(LoadPolicy loadPolicy) |
68 : m_loadPolicy(loadPolicy), | 68 : m_loadPolicy(loadPolicy), |
69 m_policy(CachePolicyVerify), | 69 m_policy(CachePolicyVerify), |
70 m_runner(wrapUnique(new scheduler::FakeWebTaskRunner)), | 70 m_runner(WTF::wrapUnique(new scheduler::FakeWebTaskRunner)), |
71 m_complete(false), | 71 m_complete(false), |
72 m_transferSize(-1) {} | 72 m_transferSize(-1) {} |
73 | 73 |
74 enum LoadPolicy m_loadPolicy; | 74 enum LoadPolicy m_loadPolicy; |
75 CachePolicy m_policy; | 75 CachePolicy m_policy; |
76 std::unique_ptr<scheduler::FakeWebTaskRunner> m_runner; | 76 std::unique_ptr<scheduler::FakeWebTaskRunner> m_runner; |
77 bool m_complete; | 77 bool m_complete; |
78 long long m_transferSize; | 78 long long m_transferSize; |
79 }; | 79 }; |
80 | 80 |
81 } // namespace blink | 81 } // namespace blink |
82 | 82 |
83 #endif | 83 #endif |
OLD | NEW |