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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 sizeInMB = supportedMaxSizeInMB - 1; | 59 sizeInMB = supportedMaxSizeInMB - 1; |
60 | 60 |
61 // Send a UseCounter only when we see the highest memory usage | 61 // Send a UseCounter only when we see the highest memory usage |
62 // we've ever seen. | 62 // we've ever seen. |
63 DEFINE_STATIC_LOCAL(EnumerationHistogram, committedSizeHistogram, ("Partitio
nAlloc.CommittedSize", supportedMaxSizeInMB)); | 63 DEFINE_STATIC_LOCAL(EnumerationHistogram, committedSizeHistogram, ("Partitio
nAlloc.CommittedSize", supportedMaxSizeInMB)); |
64 committedSizeHistogram.count(sizeInMB); | 64 committedSizeHistogram.count(sizeInMB); |
65 } | 65 } |
66 | 66 |
67 static void callOnMainThreadFunction(WTF::MainThreadFunction function, void* con
text) | 67 static void callOnMainThreadFunction(WTF::MainThreadFunction function, void* con
text) |
68 { | 68 { |
69 Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FROM_H
ERE, threadSafeBind(function, AllowCrossThreadAccess(context))); | 69 Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FROM_H
ERE, threadSafeBind(function, crossThreadUnretained(context))); |
70 } | 70 } |
71 | 71 |
72 void Platform::initialize(Platform* platform) | 72 void Platform::initialize(Platform* platform) |
73 { | 73 { |
74 ASSERT(!s_platform); | 74 ASSERT(!s_platform); |
75 ASSERT(platform); | 75 ASSERT(platform); |
76 s_platform = platform; | 76 s_platform = platform; |
77 s_platform->m_mainThread = platform->currentThread(); | 77 s_platform->m_mainThread = platform->currentThread(); |
78 | 78 |
79 WTF::Partitions::initialize(maxObservedSizeFunction); | 79 WTF::Partitions::initialize(maxObservedSizeFunction); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 { | 138 { |
139 return m_mainThread; | 139 return m_mainThread; |
140 } | 140 } |
141 | 141 |
142 ServiceRegistry* Platform::serviceRegistry() | 142 ServiceRegistry* Platform::serviceRegistry() |
143 { | 143 { |
144 return ServiceRegistry::getEmptyServiceRegistry(); | 144 return ServiceRegistry::getEmptyServiceRegistry(); |
145 } | 145 } |
146 | 146 |
147 } // namespace blink | 147 } // namespace blink |
OLD | NEW |