Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(410)

Side by Side Diff: Source/modules/accessibility/AXInlineTextBox.cpp

Issue 1175533004: Refactor: Clear m_axObjectCache when AXObject detaches (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added ASSERT Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 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 21 matching lines...) Expand all
32 #include "core/dom/Range.h" 32 #include "core/dom/Range.h"
33 #include "core/layout/LayoutText.h" 33 #include "core/layout/LayoutText.h"
34 #include "modules/accessibility/AXObjectCacheImpl.h" 34 #include "modules/accessibility/AXObjectCacheImpl.h"
35 #include "platform/LayoutUnit.h" 35 #include "platform/LayoutUnit.h"
36 36
37 37
38 namespace blink { 38 namespace blink {
39 39
40 using namespace HTMLNames; 40 using namespace HTMLNames;
41 41
42 AXInlineTextBox::AXInlineTextBox(PassRefPtr<AbstractInlineTextBox> inlineTextBox , AXObjectCacheImpl* axObjectCache) 42 AXInlineTextBox::AXInlineTextBox(PassRefPtr<AbstractInlineTextBox> inlineTextBox , AXObjectCacheImpl& axObjectCache)
43 : AXObject(axObjectCache) 43 : AXObject(axObjectCache)
44 , m_inlineTextBox(inlineTextBox) 44 , m_inlineTextBox(inlineTextBox)
45 { 45 {
46 } 46 }
47 47
48 AXInlineTextBox::~AXInlineTextBox() 48 AXInlineTextBox::~AXInlineTextBox()
49 { 49 {
50 if (m_axObjectCache && m_inlineTextBox) 50 if (m_axObjectCache && m_inlineTextBox)
51 m_axObjectCache->remove(m_inlineTextBox.get()); 51 m_axObjectCache->remove(m_inlineTextBox.get());
52 } 52 }
53 53
54 PassRefPtr<AXInlineTextBox> AXInlineTextBox::create(PassRefPtr<AbstractInlineTex tBox> inlineTextBox, AXObjectCacheImpl* axObjectCache) 54 PassRefPtr<AXInlineTextBox> AXInlineTextBox::create(PassRefPtr<AbstractInlineTex tBox> inlineTextBox, AXObjectCacheImpl& axObjectCache)
55 { 55 {
56 return adoptRef(new AXInlineTextBox(inlineTextBox, axObjectCache)); 56 return adoptRef(new AXInlineTextBox(inlineTextBox, axObjectCache));
57 } 57 }
58 58
59 void AXInlineTextBox::init() 59 void AXInlineTextBox::init()
60 { 60 {
61 } 61 }
62 62
63 void AXInlineTextBox::detach() 63 void AXInlineTextBox::detach()
64 { 64 {
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 if (previousOnLine) 176 if (previousOnLine)
177 return m_axObjectCache->getOrCreate(previousOnLine.get()); 177 return m_axObjectCache->getOrCreate(previousOnLine.get());
178 178
179 if (!m_inlineTextBox->isFirst()) 179 if (!m_inlineTextBox->isFirst())
180 return 0; 180 return 0;
181 181
182 return parentObject()->previousOnLine(); 182 return parentObject()->previousOnLine();
183 } 183 }
184 184
185 } // namespace blink 185 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/accessibility/AXInlineTextBox.h ('k') | Source/modules/accessibility/AXLayoutObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698