| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009, 2010 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 DCHECK(m_createFunction); | 45 DCHECK(m_createFunction); |
| 46 return m_createFunction(document); | 46 return m_createFunction(document); |
| 47 } | 47 } |
| 48 | 48 |
| 49 AXObjectCache::AXObjectCache() {} | 49 AXObjectCache::AXObjectCache() {} |
| 50 | 50 |
| 51 AXObjectCache::~AXObjectCache() {} | 51 AXObjectCache::~AXObjectCache() {} |
| 52 | 52 |
| 53 std::unique_ptr<ScopedAXObjectCache> ScopedAXObjectCache::create( | 53 std::unique_ptr<ScopedAXObjectCache> ScopedAXObjectCache::create( |
| 54 Document& document) { | 54 Document& document) { |
| 55 return wrapUnique(new ScopedAXObjectCache(document)); | 55 return WTF::wrapUnique(new ScopedAXObjectCache(document)); |
| 56 } | 56 } |
| 57 | 57 |
| 58 ScopedAXObjectCache::ScopedAXObjectCache(Document& document) | 58 ScopedAXObjectCache::ScopedAXObjectCache(Document& document) |
| 59 : m_document(&document) { | 59 : m_document(&document) { |
| 60 if (!m_document->axObjectCache()) | 60 if (!m_document->axObjectCache()) |
| 61 m_cache = AXObjectCache::create(*m_document); | 61 m_cache = AXObjectCache::create(*m_document); |
| 62 } | 62 } |
| 63 | 63 |
| 64 ScopedAXObjectCache::~ScopedAXObjectCache() { | 64 ScopedAXObjectCache::~ScopedAXObjectCache() { |
| 65 if (m_cache) | 65 if (m_cache) |
| 66 m_cache->dispose(); | 66 m_cache->dispose(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 AXObjectCache* ScopedAXObjectCache::get() { | 69 AXObjectCache* ScopedAXObjectCache::get() { |
| 70 if (m_cache) | 70 if (m_cache) |
| 71 return m_cache.get(); | 71 return m_cache.get(); |
| 72 AXObjectCache* cache = m_document->axObjectCache(); | 72 AXObjectCache* cache = m_document->axObjectCache(); |
| 73 DCHECK(cache); | 73 DCHECK(cache); |
| 74 return cache; | 74 return cache; |
| 75 } | 75 } |
| 76 | 76 |
| 77 } // namespace blink | 77 } // namespace blink |
| OLD | NEW |