OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 } | 42 } |
43 | 43 |
44 void Platform::initialize(Platform* platform) | 44 void Platform::initialize(Platform* platform) |
45 { | 45 { |
46 s_platform = platform; | 46 s_platform = platform; |
47 if (s_platform) | 47 if (s_platform) |
48 s_platform->m_mainThread = platform->currentThread(); | 48 s_platform->m_mainThread = platform->currentThread(); |
49 | 49 |
50 // TODO(ssid): remove this check after fixing crbug.com/486782. | 50 // TODO(ssid): remove this check after fixing crbug.com/486782. |
51 if (s_platform && s_platform->m_mainThread) | 51 if (s_platform && s_platform->m_mainThread) |
52 s_platform->registerMemoryDumpProvider(PartitionAllocMemoryDumpProvider:
:instance()); | 52 s_platform->registerMemoryDumpProvider(PartitionAllocMemoryDumpProvider:
:instance(), "PartitionAlloc"); |
53 } | 53 } |
54 | 54 |
55 void Platform::shutdown() | 55 void Platform::shutdown() |
56 { | 56 { |
57 if (s_platform->m_mainThread) | 57 if (s_platform->m_mainThread) |
58 s_platform->unregisterMemoryDumpProvider(PartitionAllocMemoryDumpProvide
r::instance()); | 58 s_platform->unregisterMemoryDumpProvider(PartitionAllocMemoryDumpProvide
r::instance()); |
59 | 59 |
60 if (s_platform) | 60 if (s_platform) |
61 s_platform->m_mainThread = 0; | 61 s_platform->m_mainThread = 0; |
62 s_platform = 0; | 62 s_platform = 0; |
63 } | 63 } |
64 | 64 |
65 Platform* Platform::current() | 65 Platform* Platform::current() |
66 { | 66 { |
67 return s_platform; | 67 return s_platform; |
68 } | 68 } |
69 | 69 |
70 WebThread* Platform::mainThread() const | 70 WebThread* Platform::mainThread() const |
71 { | 71 { |
72 return m_mainThread; | 72 return m_mainThread; |
73 } | 73 } |
74 | 74 |
75 } // namespace blink | 75 } // namespace blink |
OLD | NEW |