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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 86 HandleScopeManager() : m_nesting(0) { } | 86 HandleScopeManager() : m_nesting(0) { } |
| 87 | 87 |
| 88 ~HandleScopeManager() | 88 ~HandleScopeManager() |
| 89 { | 89 { |
| 90 ASSERT(!m_nesting); | 90 ASSERT(!m_nesting); |
| 91 } | 91 } |
| 92 | 92 |
| 93 virtual void willProcessTask() | 93 virtual void willProcessTask() |
| 94 { | 94 { |
| 95 // FIXME(oilpan): instead of managing this state in the willProcessTask we need | 95 // FIXME(oilpan): instead of managing this state in the willProcessTask we need |
| 96 // to explicitly manage paused state in the event loop itself. | 96 // to explicitly manage thread state in the event loop itself. |
| 97 if (!m_nesting && WebCore::ThreadState::MainThreadState()->isPaused()) | 97 if (!m_nesting && WebCore::ThreadState::MainThreadState()->isInSafePoint ()) |
|
Mads Ager (chromium)
2013/12/05 09:22:24
isAtSafePoint?
haraken
2013/12/05 09:37:40
Done. (I called it inSafePoint since we have Threa
| |
| 98 WebCore::ThreadState::MainThreadState()->resumed(); | 98 WebCore::ThreadState::MainThreadState()->leaveSafePoint(); |
| 99 | 99 |
| 100 m_nesting++; | 100 m_nesting++; |
| 101 } | 101 } |
| 102 | 102 |
| 103 virtual void didProcessTask() | 103 virtual void didProcessTask() |
| 104 { | 104 { |
| 105 // FIXME(oilpan): Apparently we can get here without a call to willProce ssTask. | 105 // FIXME(oilpan): Apparently we can get here without a call to willProce ssTask. |
| 106 if (m_nesting) | 106 if (m_nesting) |
| 107 m_nesting--; | 107 m_nesting--; |
| 108 | 108 |
| 109 if (!m_nesting) { | 109 if (!m_nesting) { |
| 110 WebCore::ThreadState* threadState = WebCore::ThreadState::MainThread State(); | 110 WebCore::ThreadState* threadState = WebCore::ThreadState::MainThread State(); |
| 111 threadState->paused(WebCore::ThreadState::NoHeapPointersOnStack); | 111 threadState->enterSafePoint(WebCore::ThreadState::NoHeapPointersOnSt ack); |
| 112 } | 112 } |
| 113 } | 113 } |
| 114 | 114 |
| 115 private: | 115 private: |
| 116 int m_nesting; | 116 int m_nesting; |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 } // namespace | 119 } // namespace |
| 120 | 120 |
| 121 static WebThread::TaskObserver* s_endOfTaskRunner = 0; | 121 static WebThread::TaskObserver* s_endOfTaskRunner = 0; |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 253 UNUSED_PARAM(name); | 253 UNUSED_PARAM(name); |
| 254 #endif // !LOG_DISABLED | 254 #endif // !LOG_DISABLED |
| 255 } | 255 } |
| 256 | 256 |
| 257 void resetPluginCache(bool reloadPages) | 257 void resetPluginCache(bool reloadPages) |
| 258 { | 258 { |
| 259 WebCore::Page::refreshPlugins(reloadPages); | 259 WebCore::Page::refreshPlugins(reloadPages); |
| 260 } | 260 } |
| 261 | 261 |
| 262 } // namespace WebKit | 262 } // namespace WebKit |
| OLD | NEW |