| Index: Source/bindings/core/dart/DartPersistentValue.cpp
|
| diff --git a/Source/web/PrerendererClientImpl.cpp b/Source/bindings/core/dart/DartPersistentValue.cpp
|
| similarity index 76%
|
| copy from Source/web/PrerendererClientImpl.cpp
|
| copy to Source/bindings/core/dart/DartPersistentValue.cpp
|
| index dec8343abca77309f743bc562c29e63c95430b15..400f2f00e925e36f55a1b81a208711551570e7f6 100644
|
| --- a/Source/web/PrerendererClientImpl.cpp
|
| +++ b/Source/bindings/core/dart/DartPersistentValue.cpp
|
| @@ -26,30 +26,36 @@
|
| * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| - *
|
| */
|
| -
|
| #include "config.h"
|
| -#include "web/PrerendererClientImpl.h"
|
| +#include "bindings/core/dart/DartPersistentValue.h"
|
|
|
| -#include "platform/Prerender.h"
|
| -#include "public/platform/WebPrerender.h"
|
| -#include "public/web/WebPrerendererClient.h"
|
| -#include "web/WebViewImpl.h"
|
| +#include "bindings/core/dart/DartDOMData.h"
|
| +#include "bindings/core/dart/DartUtilities.h"
|
|
|
| namespace blink {
|
|
|
| -PrerendererClientImpl::PrerendererClientImpl(WebPrerendererClient* client)
|
| - : m_client(client)
|
| +DartPersistentValue::DartPersistentValue(Dart_Handle value)
|
| +{
|
| + m_value = Dart_NewPersistentHandle(value);
|
| +}
|
| +
|
| +DartPersistentValue::~DartPersistentValue()
|
| {
|
| + clear();
|
| }
|
|
|
| -void PrerendererClientImpl::willAddPrerender(Prerender* prerender)
|
| +void DartPersistentValue::clear()
|
| {
|
| - if (!m_client)
|
| + if (!isIsolateAlive())
|
| return;
|
| - WebPrerender webPrerender(prerender);
|
| - m_client->willAddPrerender(&webPrerender);
|
| +
|
| + if (!m_value)
|
| + return;
|
| +
|
| + DartIsolateScope scope(isolate());
|
| + Dart_DeletePersistentHandle(m_value);
|
| + m_value = 0;
|
| }
|
|
|
| -} // namespace blink
|
| +}
|
|
|