| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 void runAsync() | 59 void runAsync() |
| 60 { | 60 { |
| 61 if (m_suspended) { | 61 if (m_suspended) { |
| 62 ASSERT(!m_timer.isActive()); | 62 ASSERT(!m_timer.isActive()); |
| 63 m_runWhenResumed = true; | 63 m_runWhenResumed = true; |
| 64 return; | 64 return; |
| 65 } | 65 } |
| 66 | 66 |
| 67 // FIXME: runAsync should take a TraceLocation and pass it to timer here
. | 67 // FIXME: runAsync should take a TraceLocation and pass it to timer here
. |
| 68 if (!m_timer.isActive()) | 68 if (!m_timer.isActive()) |
| 69 m_timer.startOneShot(0, FROM_HERE); | 69 m_timer.startOneShot(0, BLINK_FROM_HERE); |
| 70 } | 70 } |
| 71 | 71 |
| 72 // If it's scheduled to run the method, cancel it and remember to schedule | 72 // If it's scheduled to run the method, cancel it and remember to schedule |
| 73 // it again when resume() is called. Mainly for implementing | 73 // it again when resume() is called. Mainly for implementing |
| 74 // ActiveDOMObject::suspend(). | 74 // ActiveDOMObject::suspend(). |
| 75 void suspend() | 75 void suspend() |
| 76 { | 76 { |
| 77 if (m_suspended) | 77 if (m_suspended) |
| 78 return; | 78 return; |
| 79 m_suspended = true; | 79 m_suspended = true; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 90 { | 90 { |
| 91 if (!m_suspended) | 91 if (!m_suspended) |
| 92 return; | 92 return; |
| 93 m_suspended = false; | 93 m_suspended = false; |
| 94 | 94 |
| 95 if (!m_runWhenResumed) | 95 if (!m_runWhenResumed) |
| 96 return; | 96 return; |
| 97 | 97 |
| 98 m_runWhenResumed = false; | 98 m_runWhenResumed = false; |
| 99 // FIXME: resume should take a TraceLocation and pass it to timer here. | 99 // FIXME: resume should take a TraceLocation and pass it to timer here. |
| 100 m_timer.startOneShot(0, FROM_HERE); | 100 m_timer.startOneShot(0, BLINK_FROM_HERE); |
| 101 } | 101 } |
| 102 | 102 |
| 103 void stop() | 103 void stop() |
| 104 { | 104 { |
| 105 if (m_suspended) { | 105 if (m_suspended) { |
| 106 ASSERT(!m_timer.isActive()); | 106 ASSERT(!m_timer.isActive()); |
| 107 m_runWhenResumed = false; | 107 m_runWhenResumed = false; |
| 108 m_suspended = false; | 108 m_suspended = false; |
| 109 return; | 109 return; |
| 110 } | 110 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 138 TargetClass* m_object; | 138 TargetClass* m_object; |
| 139 TargetMethod m_method; | 139 TargetMethod m_method; |
| 140 | 140 |
| 141 bool m_suspended; | 141 bool m_suspended; |
| 142 bool m_runWhenResumed; | 142 bool m_runWhenResumed; |
| 143 }; | 143 }; |
| 144 | 144 |
| 145 } | 145 } |
| 146 | 146 |
| 147 #endif | 147 #endif |
| OLD | NEW |