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

Side by Side Diff: sky/engine/wtf/WTF.cpp

Issue 887883002: WTF should get time from base directly (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « sky/engine/wtf/WTF.h ('k') | sky/engine/wtf/testing/RunAllTests.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 25 matching lines...) Expand all
36 36
37 namespace WTF { 37 namespace WTF {
38 38
39 extern void initializeThreading(); 39 extern void initializeThreading();
40 40
41 bool s_initialized; 41 bool s_initialized;
42 bool s_shutdown; 42 bool s_shutdown;
43 bool Partitions::s_initialized; 43 bool Partitions::s_initialized;
44 PartitionAllocatorGeneric Partitions::m_bufferAllocator; 44 PartitionAllocatorGeneric Partitions::m_bufferAllocator;
45 45
46 void initialize(TimeFunction currentTimeFunction, TimeFunction monotonicallyIncr easingTimeFunction) 46 void initialize()
47 { 47 {
48 // WTF, and Blink in general, cannot handle being re-initialized, even if sh utdown first. 48 // WTF, and Blink in general, cannot handle being re-initialized, even if sh utdown first.
49 // Make that explicit here. 49 // Make that explicit here.
50 ASSERT(!s_initialized); 50 ASSERT(!s_initialized);
51 ASSERT(!s_shutdown); 51 ASSERT(!s_shutdown);
52 s_initialized = true; 52 s_initialized = true;
53 Partitions::initialize(); 53 Partitions::initialize();
54 setCurrentTimeFunction(currentTimeFunction);
55 setMonotonicallyIncreasingTimeFunction(monotonicallyIncreasingTimeFunction);
56 initializeThreading(); 54 initializeThreading();
57 } 55 }
58 56
59 void shutdown() 57 void shutdown()
60 { 58 {
61 ASSERT(s_initialized); 59 ASSERT(s_initialized);
62 ASSERT(!s_shutdown); 60 ASSERT(!s_shutdown);
63 s_shutdown = true; 61 s_shutdown = true;
64 Partitions::shutdown(); 62 Partitions::shutdown();
65 } 63 }
(...skipping 15 matching lines...) Expand all
81 spinLockUnlock(&lock); 79 spinLockUnlock(&lock);
82 } 80 }
83 81
84 void Partitions::shutdown() 82 void Partitions::shutdown()
85 { 83 {
86 fastMallocShutdown(); 84 fastMallocShutdown();
87 m_bufferAllocator.shutdown(); 85 m_bufferAllocator.shutdown();
88 } 86 }
89 87
90 } // namespace WTF 88 } // namespace WTF
OLDNEW
« no previous file with comments | « sky/engine/wtf/WTF.h ('k') | sky/engine/wtf/testing/RunAllTests.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698