OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google 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 15 matching lines...) Expand all Loading... |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef TestingPlatformSupport_h | 31 #ifndef TestingPlatformSupport_h |
32 #define TestingPlatformSupport_h | 32 #define TestingPlatformSupport_h |
33 | 33 |
34 #include "platform/PlatformExport.h" | 34 #include "platform/PlatformExport.h" |
35 #include "public/platform/Platform.h" | 35 #include "public/platform/Platform.h" |
| 36 #include "public/platform/WebCompositorSupport.h" |
36 #include "public/platform/WebDiscardableMemory.h" | 37 #include "public/platform/WebDiscardableMemory.h" |
37 #include "wtf/Vector.h" | 38 #include "wtf/Vector.h" |
38 | 39 |
39 namespace blink { | 40 namespace blink { |
40 | 41 |
41 class WebCompositorSupport; | 42 class WebCompositorSupport; |
42 class WebThread; | 43 class WebThread; |
43 | 44 |
44 class TestingDiscardableMemory : public WebDiscardableMemory { | 45 class TestingDiscardableMemory : public WebDiscardableMemory { |
45 public: | 46 public: |
46 explicit TestingDiscardableMemory(size_t); | 47 explicit TestingDiscardableMemory(size_t); |
47 ~TestingDiscardableMemory() override; | 48 ~TestingDiscardableMemory() override; |
48 | 49 |
49 // WebDiscardableMemory: | 50 // WebDiscardableMemory: |
50 bool lock() override; | 51 bool lock() override; |
51 void* data() override; | 52 void* data() override; |
52 void unlock() override; | 53 void unlock() override; |
53 WebMemoryAllocatorDump* createMemoryAllocatorDump(const WebString& name, Web
ProcessMemoryDump*) const override; | 54 WebMemoryAllocatorDump* createMemoryAllocatorDump(const WebString& name, Web
ProcessMemoryDump*) const override; |
54 | 55 |
55 private: | 56 private: |
56 Vector<char> m_data; | 57 Vector<char> m_data; |
57 bool m_isLocked; | 58 bool m_isLocked; |
58 }; | 59 }; |
59 | 60 |
| 61 class TestingCompositorSupport : public WebCompositorSupport { |
| 62 }; |
| 63 |
60 class TestingPlatformSupport : public Platform { | 64 class TestingPlatformSupport : public Platform { |
61 public: | 65 public: |
62 struct Config { | 66 struct Config { |
63 Config() | 67 Config() |
64 : hasDiscardableMemorySupport(false) | 68 : hasDiscardableMemorySupport(false) |
65 , compositorSupport(nullptr) { } | 69 , compositorSupport(nullptr) { } |
66 | 70 |
67 bool hasDiscardableMemorySupport; | 71 bool hasDiscardableMemorySupport; |
68 WebCompositorSupport* compositorSupport; | 72 WebCompositorSupport* compositorSupport; |
69 }; | 73 }; |
(...skipping 13 matching lines...) Expand all Loading... |
83 WebUnitTestSupport* unitTestSupport() override; | 87 WebUnitTestSupport* unitTestSupport() override; |
84 | 88 |
85 protected: | 89 protected: |
86 const Config m_config; | 90 const Config m_config; |
87 Platform* const m_oldPlatform; | 91 Platform* const m_oldPlatform; |
88 }; | 92 }; |
89 | 93 |
90 } // namespace blink | 94 } // namespace blink |
91 | 95 |
92 #endif // TestingPlatformSupport_h | 96 #endif // TestingPlatformSupport_h |
OLD | NEW |