| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 static void cryptographicallyRandomValues(unsigned char* buffer, size_t length) | 156 static void cryptographicallyRandomValues(unsigned char* buffer, size_t length) |
| 157 { | 157 { |
| 158 Platform::current()->cryptographicallyRandomValues(buffer, length); | 158 Platform::current()->cryptographicallyRandomValues(buffer, length); |
| 159 } | 159 } |
| 160 | 160 |
| 161 static void callOnMainThreadFunction(WTF::MainThreadFunction function, void* con
text) | 161 static void callOnMainThreadFunction(WTF::MainThreadFunction function, void* con
text) |
| 162 { | 162 { |
| 163 Platform::current()->mainThread()->postTask(FROM_HERE, new MainThreadTaskRun
ner(function, context)); | 163 Platform::current()->mainThread()->postTask(FROM_HERE, new MainThreadTaskRun
ner(function, context)); |
| 164 } | 164 } |
| 165 | 165 |
| 166 static void adjustAmountOfExternalAllocatedMemory(int size) |
| 167 { |
| 168 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(size); |
| 169 } |
| 170 |
| 166 void initializeWithoutV8(Platform* platform) | 171 void initializeWithoutV8(Platform* platform) |
| 167 { | 172 { |
| 168 ASSERT(!s_webKitInitialized); | 173 ASSERT(!s_webKitInitialized); |
| 169 s_webKitInitialized = true; | 174 s_webKitInitialized = true; |
| 170 | 175 |
| 171 ASSERT(platform); | 176 ASSERT(platform); |
| 172 Platform::initialize(platform); | 177 Platform::initialize(platform); |
| 173 | 178 |
| 174 WTF::setRandomSource(cryptographicallyRandomValues); | 179 WTF::setRandomSource(cryptographicallyRandomValues); |
| 175 WTF::initialize(currentTimeFunction, monotonicallyIncreasingTimeFunction, sy
stemTraceTimeFunction, histogramEnumerationFunction); | 180 WTF::initialize(currentTimeFunction, monotonicallyIncreasingTimeFunction, sy
stemTraceTimeFunction, histogramEnumerationFunction, adjustAmountOfExternalAlloc
atedMemory); |
| 176 WTF::initializeMainThread(callOnMainThreadFunction); | 181 WTF::initializeMainThread(callOnMainThreadFunction); |
| 177 Heap::init(); | 182 Heap::init(); |
| 178 | 183 |
| 179 ThreadState::attachMainThread(); | 184 ThreadState::attachMainThread(); |
| 180 // currentThread() is null if we are running on a thread without a message l
oop. | 185 // currentThread() is null if we are running on a thread without a message l
oop. |
| 181 if (WebThread* currentThread = platform->currentThread()) { | 186 if (WebThread* currentThread = platform->currentThread()) { |
| 182 ASSERT(!s_pendingGCRunner); | 187 ASSERT(!s_pendingGCRunner); |
| 183 s_pendingGCRunner = new PendingGCRunner; | 188 s_pendingGCRunner = new PendingGCRunner; |
| 184 currentThread->addTaskObserver(s_pendingGCRunner); | 189 currentThread->addTaskObserver(s_pendingGCRunner); |
| 185 | 190 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 ASSERT(!reloadPages); | 294 ASSERT(!reloadPages); |
| 290 Page::refreshPlugins(); | 295 Page::refreshPlugins(); |
| 291 } | 296 } |
| 292 | 297 |
| 293 void decommitFreeableMemory() | 298 void decommitFreeableMemory() |
| 294 { | 299 { |
| 295 WTF::Partitions::decommitFreeableMemory(); | 300 WTF::Partitions::decommitFreeableMemory(); |
| 296 } | 301 } |
| 297 | 302 |
| 298 } // namespace blink | 303 } // namespace blink |
| OLD | NEW |