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

Unified Diff: Source/wtf/WTFPlatform.h

Issue 87983002: Add WTF::DiscardableMemory. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update comment Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/wtf/DiscardableMemory.h ('k') | Source/wtf/WTFPlatform.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/WTFPlatform.h
diff --git a/Source/core/testing/UnitTestHelpers.cpp b/Source/wtf/WTFPlatform.h
similarity index 71%
copy from Source/core/testing/UnitTestHelpers.cpp
copy to Source/wtf/WTFPlatform.h
index 8c5bc5bbe4552847c5199f067aa587a7d748e073..035972e79fe3b4e344b441a7f3117ae1177bdf0e 100644
--- a/Source/core/testing/UnitTestHelpers.cpp
+++ b/Source/wtf/WTFPlatform.h
@@ -17,35 +17,34 @@
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY 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 "core/testing/UnitTestHelpers.h"
-
-#include "public/platform/Platform.h"
-#include "public/platform/WebThread.h"
+#ifndef WTF_WTFPlatform_h
+#define WTF_WTFPlatform_h
+#include "wtf/Assertions.h"
+#include "wtf/DiscardableMemory.h"
+#include "wtf/PassOwnPtr.h"
-namespace WebCore {
-namespace testing {
+namespace WTF {
-class QuitTask : public blink::WebThread::Task {
+class WTFPlatform {
public:
- virtual void run()
- {
- blink::Platform::current()->currentThread()->exitRunLoop();
- }
+ virtual ~WTFPlatform() { }
+
+ virtual PassOwnPtr<DiscardableMemory> allocateAndLockDiscardableMemory(size_t bytes) = 0;
+
+ static WTFPlatform* getInstance() { return s_instance; }
+ static void setInstance(WTFPlatform* instance) { ASSERT(!s_instance); s_instance = instance; }
+
+private:
+ static WTFPlatform* s_instance;
};
-void runPendingTasks()
-{
- blink::Platform::current()->currentThread()->postTask(new QuitTask);
- blink::Platform::current()->currentThread()->enterRunLoop();
-}
+} // namespace WTF
-}
-}
+#endif
« no previous file with comments | « Source/wtf/DiscardableMemory.h ('k') | Source/wtf/WTFPlatform.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698