| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013, Google Inc. All rights reserved. | 2 * Copyright (c) 2013, 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 class Document; | 44 class Document; |
| 45 class LocalFrame; | 45 class LocalFrame; |
| 46 class FrameView; | 46 class FrameView; |
| 47 class IntSize; | 47 class IntSize; |
| 48 class Settings; | 48 class Settings; |
| 49 | 49 |
| 50 typedef void (*FrameSettingOverrideFunction)(Settings&); | 50 typedef void (*FrameSettingOverrideFunction)(Settings&); |
| 51 | 51 |
| 52 // Creates a dummy Page, LocalFrame, and FrameView whose clients are all no-op. | 52 // Creates a dummy Page, LocalFrame, and FrameView whose clients are all no-op. |
| 53 // | 53 // |
| 54 // This class can be used when you write unit tests for components which do not
work correctly without layoutObjects. | 54 // This class can be used when you write unit tests for components which do not |
| 55 // To make sure the layoutObjects are created, you need to call |frameView().lay
out()| after you add nodes into | 55 // work correctly without layoutObjects. To make sure the layoutObjects are |
| 56 // created, you need to call |frameView().layout()| after you add nodes into |
| 56 // |document()|. | 57 // |document()|. |
| 57 // | 58 // |
| 58 // Since DummyPageHolder stores empty clients in it, it must outlive the Page, L
ocalFrame, FrameView and any other objects | 59 // Since DummyPageHolder stores empty clients in it, it must outlive the Page, |
| 59 // created by it. DummyPageHolder's destructor ensures this condition by checkin
g remaining references to the LocalFrame. | 60 // LocalFrame, FrameView and any other objects created by it. DummyPageHolder's |
| 61 // destructor ensures this condition by checking remaining references to the |
| 62 // LocalFrame. |
| 60 | 63 |
| 61 class DummyPageHolder { | 64 class DummyPageHolder { |
| 62 WTF_MAKE_NONCOPYABLE(DummyPageHolder); | 65 WTF_MAKE_NONCOPYABLE(DummyPageHolder); |
| 63 USING_FAST_MALLOC(DummyPageHolder); | 66 USING_FAST_MALLOC(DummyPageHolder); |
| 64 | 67 |
| 65 public: | 68 public: |
| 66 static std::unique_ptr<DummyPageHolder> create( | 69 static std::unique_ptr<DummyPageHolder> create( |
| 67 const IntSize& initialViewSize = IntSize(), | 70 const IntSize& initialViewSize = IntSize(), |
| 68 Page::PageClients* = 0, | 71 Page::PageClients* = 0, |
| 69 FrameLoaderClient* = nullptr, | 72 FrameLoaderClient* = nullptr, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 83 | 86 |
| 84 Persistent<Page> m_page; | 87 Persistent<Page> m_page; |
| 85 Persistent<LocalFrame> m_frame; | 88 Persistent<LocalFrame> m_frame; |
| 86 | 89 |
| 87 Persistent<FrameLoaderClient> m_frameLoaderClient; | 90 Persistent<FrameLoaderClient> m_frameLoaderClient; |
| 88 }; | 91 }; |
| 89 | 92 |
| 90 } // namespace blink | 93 } // namespace blink |
| 91 | 94 |
| 92 #endif // DummyPageHolder_h | 95 #endif // DummyPageHolder_h |
| OLD | NEW |