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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 void Platform::initialize(Platform* platform) | 45 void Platform::initialize(Platform* platform) |
46 { | 46 { |
47 s_platform = platform; | 47 s_platform = platform; |
48 if (s_platform) | 48 if (s_platform) |
49 s_platform->m_mainThread = platform->currentThread(); | 49 s_platform->m_mainThread = platform->currentThread(); |
50 | 50 |
51 // TODO(ssid): remove this check after fixing crbug.com/486782. | 51 // TODO(ssid): remove this check after fixing crbug.com/486782. |
52 if (s_platform && s_platform->m_mainThread) { | 52 if (s_platform && s_platform->m_mainThread) { |
53 s_platform->registerMemoryDumpProvider(PartitionAllocMemoryDumpProvider:
:instance()); | 53 s_platform->registerMemoryDumpProvider(PartitionAllocMemoryDumpProvider:
:instance()); |
54 s_platform->registerMemoryDumpProvider(BlinkGCMemoryDumpProvider::instan
ce()); | |
55 } | 54 } |
56 } | 55 } |
57 | 56 |
58 void Platform::shutdown() | 57 void Platform::shutdown() |
59 { | 58 { |
60 if (s_platform->m_mainThread) { | 59 if (s_platform->m_mainThread) { |
61 s_platform->unregisterMemoryDumpProvider(PartitionAllocMemoryDumpProvide
r::instance()); | 60 s_platform->unregisterMemoryDumpProvider(PartitionAllocMemoryDumpProvide
r::instance()); |
62 s_platform->unregisterMemoryDumpProvider(BlinkGCMemoryDumpProvider::inst
ance()); | |
63 } | 61 } |
64 | 62 |
65 if (s_platform) | 63 if (s_platform) |
66 s_platform->m_mainThread = 0; | 64 s_platform->m_mainThread = 0; |
67 s_platform = 0; | 65 s_platform = 0; |
68 } | 66 } |
69 | 67 |
70 Platform* Platform::current() | 68 Platform* Platform::current() |
71 { | 69 { |
72 return s_platform; | 70 return s_platform; |
73 } | 71 } |
74 | 72 |
75 WebThread* Platform::mainThread() const | 73 WebThread* Platform::mainThread() const |
76 { | 74 { |
77 return m_mainThread; | 75 return m_mainThread; |
78 } | 76 } |
79 | 77 |
80 } // namespace blink | 78 } // namespace blink |
OLD | NEW |