Chromium Code Reviews| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 73 class ImageLoader::Task : public blink::WebThread::Task { | 73 class ImageLoader::Task : public blink::WebThread::Task { |
| 74 public: | 74 public: |
| 75 static PassOwnPtr<Task> create(ImageLoader* loader, UpdateFromElementBehavio r updateBehavior) | 75 static PassOwnPtr<Task> create(ImageLoader* loader, UpdateFromElementBehavio r updateBehavior) |
| 76 { | 76 { |
| 77 return adoptPtr(new Task(loader, updateBehavior)); | 77 return adoptPtr(new Task(loader, updateBehavior)); |
| 78 } | 78 } |
| 79 | 79 |
| 80 Task(ImageLoader* loader, UpdateFromElementBehavior updateBehavior) | 80 Task(ImageLoader* loader, UpdateFromElementBehavior updateBehavior) |
| 81 : m_loader(loader) | 81 : m_loader(loader) |
| 82 , m_shouldBypassMainWorldCSP(shouldBypassMainWorldCSP(loader)) | 82 , m_shouldBypassMainWorldCSP(shouldBypassMainWorldCSP(loader)) |
| 83 , m_updateBehavior(updateBehavior) | |
|
kouhei (in TOK)
2015/02/13 00:25:58
unintended change?
sof
2015/02/13 06:40:48
It helps to be have the weak factory last, and kee
kouhei (in TOK)
2015/02/13 09:00:34
sgtm. It might be helpful to mention about this ch
| |
| 83 , m_weakFactory(this) | 84 , m_weakFactory(this) |
| 84 , m_updateBehavior(updateBehavior) | |
| 85 { | 85 { |
| 86 } | 86 } |
| 87 | 87 |
| 88 virtual void run() override | 88 virtual void run() override |
| 89 { | 89 { |
| 90 if (m_loader) { | 90 if (m_loader) { |
| 91 #if ENABLE(OILPAN) | |
| 92 if (Heap::willObjectBeLazilySwept(m_loader)) | |
| 93 return; | |
|
kouhei (in TOK)
2015/02/13 00:25:58
Is this needed for all places where non-Oilpan obj
haraken
2015/02/13 01:41:59
In most cases, no.
This hack is needed only when
sof
2015/02/13 06:40:48
I will go through the Microtasks and check if they
| |
| 94 #endif | |
| 91 m_loader->doUpdateFromElement(m_shouldBypassMainWorldCSP, m_updateBe havior); | 95 m_loader->doUpdateFromElement(m_shouldBypassMainWorldCSP, m_updateBe havior); |
| 92 } | 96 } |
| 93 } | 97 } |
| 94 | 98 |
| 95 void clearLoader() | 99 void clearLoader() |
|
haraken
2015/02/13 01:38:53
Another possible fix would be to call clearLoader(
sof
2015/02/13 06:40:48
Wouldn't that lead to more unavoidable GC work, wo
haraken
2015/02/13 09:20:20
Whether we should use Heap::willObjectBeLazilySwep
sof
2015/02/13 09:38:46
When time, I need to look into what I thought were
| |
| 96 { | 100 { |
| 97 m_loader = 0; | 101 m_loader = 0; |
| 98 } | 102 } |
| 99 | 103 |
| 100 WeakPtr<Task> createWeakPtr() | 104 WeakPtr<Task> createWeakPtr() |
| 101 { | 105 { |
| 102 return m_weakFactory.createWeakPtr(); | 106 return m_weakFactory.createWeakPtr(); |
| 103 } | 107 } |
| 104 | 108 |
| 105 private: | 109 private: |
| 106 ImageLoader* m_loader; | 110 ImageLoader* m_loader; |
| 107 BypassMainWorldBehavior m_shouldBypassMainWorldCSP; | 111 BypassMainWorldBehavior m_shouldBypassMainWorldCSP; |
| 112 UpdateFromElementBehavior m_updateBehavior; | |
|
kouhei (in TOK)
2015/02/13 00:25:58
Ditto.
| |
| 108 WeakPtrFactory<Task> m_weakFactory; | 113 WeakPtrFactory<Task> m_weakFactory; |
| 109 UpdateFromElementBehavior m_updateBehavior; | |
| 110 }; | 114 }; |
| 111 | 115 |
| 112 ImageLoader::ImageLoader(Element* element) | 116 ImageLoader::ImageLoader(Element* element) |
| 113 : m_element(element) | 117 : m_element(element) |
| 114 , m_image(0) | 118 , m_image(0) |
| 115 , m_derefElementTimer(this, &ImageLoader::timerFired) | 119 , m_derefElementTimer(this, &ImageLoader::timerFired) |
| 116 , m_hasPendingLoadEvent(false) | 120 , m_hasPendingLoadEvent(false) |
| 117 , m_hasPendingErrorEvent(false) | 121 , m_hasPendingErrorEvent(false) |
| 118 , m_imageComplete(true) | 122 , m_imageComplete(true) |
| 119 , m_loadingImageDocument(false) | 123 , m_loadingImageDocument(false) |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 589 #endif | 593 #endif |
| 590 } | 594 } |
| 591 | 595 |
| 592 #if ENABLE(OILPAN) | 596 #if ENABLE(OILPAN) |
| 593 ImageLoader::ImageLoaderClientRemover::~ImageLoaderClientRemover() | 597 ImageLoader::ImageLoaderClientRemover::~ImageLoaderClientRemover() |
| 594 { | 598 { |
| 595 m_loader.willRemoveClient(m_client); | 599 m_loader.willRemoveClient(m_client); |
| 596 } | 600 } |
| 597 #endif | 601 #endif |
| 598 } | 602 } |
| OLD | NEW |