| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights reserv
ed. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights reserv
ed. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 else | 99 else |
| 100 m_scriptState = ScriptState::from(context); | 100 m_scriptState = ScriptState::from(context); |
| 101 } | 101 } |
| 102 | 102 |
| 103 ~Task() override | 103 ~Task() override |
| 104 { | 104 { |
| 105 } | 105 } |
| 106 | 106 |
| 107 void run() override | 107 void run() override |
| 108 { | 108 { |
| 109 if (m_loader) { | 109 if (!m_loader) |
| 110 #if ENABLE(OILPAN) | 110 return; |
| 111 // Oilpan: this WebThread::Task microtask may run after the | 111 if (m_scriptState->contextIsValid()) { |
| 112 // loader has been GCed, but not yet lazily swept & finalized | 112 ScriptState::Scope scope(m_scriptState.get()); |
| 113 // (when this task's loader reference will be cleared.) | 113 m_loader->doUpdateFromElement(m_shouldBypassMainWorldCSP, m_updateBe
havior); |
| 114 // | 114 } else { |
| 115 // Handle this transient condition by explicitly checking here | 115 m_loader->doUpdateFromElement(m_shouldBypassMainWorldCSP, m_updateBe
havior); |
| 116 // before going ahead with the update operation. Unsafe to do it | |
| 117 // if so, as the objects that the loader refers to may have been | |
| 118 // finalized by this time. | |
| 119 if (Heap::willObjectBeLazilySwept(m_loader)) | |
| 120 return; | |
| 121 #endif | |
| 122 if (m_scriptState->contextIsValid()) { | |
| 123 ScriptState::Scope scope(m_scriptState.get()); | |
| 124 m_loader->doUpdateFromElement(m_shouldBypassMainWorldCSP, m_upda
teBehavior); | |
| 125 } else { | |
| 126 m_loader->doUpdateFromElement(m_shouldBypassMainWorldCSP, m_upda
teBehavior); | |
| 127 } | |
| 128 } | 116 } |
| 129 } | 117 } |
| 130 | 118 |
| 131 void clearLoader() | 119 void clearLoader() |
| 132 { | 120 { |
| 133 m_loader = 0; | 121 m_loader = 0; |
| 134 m_scriptState.clear(); | 122 m_scriptState.clear(); |
| 135 } | 123 } |
| 136 | 124 |
| 137 WeakPtr<Task> createWeakPtr() | 125 WeakPtr<Task> createWeakPtr() |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 #endif | 651 #endif |
| 664 } | 652 } |
| 665 | 653 |
| 666 #if ENABLE(OILPAN) | 654 #if ENABLE(OILPAN) |
| 667 ImageLoader::ImageLoaderClientRemover::~ImageLoaderClientRemover() | 655 ImageLoader::ImageLoaderClientRemover::~ImageLoaderClientRemover() |
| 668 { | 656 { |
| 669 m_loader.willRemoveClient(m_client); | 657 m_loader.willRemoveClient(m_client); |
| 670 } | 658 } |
| 671 #endif | 659 #endif |
| 672 } | 660 } |
| OLD | NEW |