Chromium Code Reviews| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 48 #include "wtf/PtrUtil.h" | 48 #include "wtf/PtrUtil.h" |
| 49 #include "wtf/WTF.h" | 49 #include "wtf/WTF.h" |
| 50 #include "wtf/allocator/Partitions.h" | 50 #include "wtf/allocator/Partitions.h" |
| 51 #include "wtf/text/AtomicString.h" | 51 #include "wtf/text/AtomicString.h" |
| 52 #include "wtf/text/TextEncoding.h" | 52 #include "wtf/text/TextEncoding.h" |
| 53 #include <memory> | 53 #include <memory> |
| 54 #include <v8.h> | 54 #include <v8.h> |
| 55 | 55 |
| 56 namespace blink { | 56 namespace blink { |
| 57 | 57 |
| 58 namespace { | 58 namespace helpers { |
|
Nico
2016/07/14 19:58:52
why is this needed?
Daniel Bratell
2016/07/15 06:43:55
Doesn't seem to be needed. It used to be needed be
| |
| 59 | 59 |
| 60 class EndOfTaskRunner : public WebThread::TaskObserver { | 60 class EndOfTaskRunner : public WebThread::TaskObserver { |
| 61 public: | 61 public: |
| 62 void willProcessTask() override | 62 void willProcessTask() override |
| 63 { | 63 { |
| 64 AnimationClock::notifyTaskStart(); | 64 AnimationClock::notifyTaskStart(); |
| 65 } | 65 } |
| 66 void didProcessTask() override | 66 void didProcessTask() override |
| 67 { | 67 { |
| 68 Microtask::performCheckpoint(mainThreadIsolate()); | 68 Microtask::performCheckpoint(mainThreadIsolate()); |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 84 { | 84 { |
| 85 Platform::initialize(platform); | 85 Platform::initialize(platform); |
| 86 | 86 |
| 87 V8Initializer::initializeMainThread(); | 87 V8Initializer::initializeMainThread(); |
| 88 | 88 |
| 89 modulesInitializer().initialize(); | 89 modulesInitializer().initialize(); |
| 90 | 90 |
| 91 // currentThread is null if we are running on a thread without a message loo p. | 91 // currentThread is null if we are running on a thread without a message loo p. |
| 92 if (WebThread* currentThread = platform->currentThread()) { | 92 if (WebThread* currentThread = platform->currentThread()) { |
| 93 DCHECK(!s_endOfTaskRunner); | 93 DCHECK(!s_endOfTaskRunner); |
| 94 s_endOfTaskRunner = new EndOfTaskRunner; | 94 s_endOfTaskRunner = new helpers::EndOfTaskRunner; |
| 95 currentThread->addTaskObserver(s_endOfTaskRunner); | 95 currentThread->addTaskObserver(s_endOfTaskRunner); |
| 96 } | 96 } |
| 97 } | 97 } |
| 98 | 98 |
| 99 void shutdown() | 99 void shutdown() |
| 100 { | 100 { |
| 101 ThreadState::current()->cleanupMainThread(); | 101 ThreadState::current()->cleanupMainThread(); |
| 102 | 102 |
| 103 // currentThread() is null if we are running on a thread without a message l oop. | 103 // currentThread() is null if we are running on a thread without a message l oop. |
| 104 if (Platform::current()->currentThread()) { | 104 if (Platform::current()->currentThread()) { |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 185 WorkerBackingThread:: | 185 WorkerBackingThread:: |
| 186 MemoryPressureNotificationToWorkerThreadIsolates(level); | 186 MemoryPressureNotificationToWorkerThreadIsolates(level); |
| 187 } | 187 } |
| 188 | 188 |
| 189 void setRAILModeOnWorkerThreadIsolates(v8::RAILMode railMode) | 189 void setRAILModeOnWorkerThreadIsolates(v8::RAILMode railMode) |
| 190 { | 190 { |
| 191 WorkerBackingThread::setRAILModeOnWorkerThreadIsolates(railMode); | 191 WorkerBackingThread::setRAILModeOnWorkerThreadIsolates(railMode); |
| 192 } | 192 } |
| 193 | 193 |
| 194 } // namespace blink | 194 } // namespace blink |
| OLD | NEW |