| OLD | NEW | 
|    1 /* |    1 /* | 
|    2  * Copyright (C) 2010 Google, Inc. All Rights Reserved. |    2  * Copyright (C) 2010 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 |    5  * modification, are permitted provided that the following conditions | 
|    6  * are met: |    6  * are met: | 
|    7  * 1. Redistributions of source code must retain the above copyright |    7  * 1. Redistributions of source code must retain the above copyright | 
|    8  *    notice, this list of conditions and the following disclaimer. |    8  *    notice, this list of conditions and the following disclaimer. | 
|    9  * 2. Redistributions in binary form must reproduce the above copyright |    9  * 2. Redistributions in binary form must reproduce the above copyright | 
|   10  *    notice, this list of conditions and the following disclaimer in the |   10  *    notice, this list of conditions and the following disclaimer in the | 
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   74 } |   74 } | 
|   75  |   75  | 
|   76 void ScriptRunner::suspend() |   76 void ScriptRunner::suspend() | 
|   77 { |   77 { | 
|   78     m_timer.stop(); |   78     m_timer.stop(); | 
|   79 } |   79 } | 
|   80  |   80  | 
|   81 void ScriptRunner::resume() |   81 void ScriptRunner::resume() | 
|   82 { |   82 { | 
|   83     if (hasPendingScripts()) |   83     if (hasPendingScripts()) | 
|   84         m_timer.startOneShot(0); |   84         m_timer.startOneShot(0, FROM_HERE); | 
|   85 } |   85 } | 
|   86  |   86  | 
|   87 void ScriptRunner::notifyScriptReady(ScriptLoader* scriptLoader, ExecutionType e
     xecutionType) |   87 void ScriptRunner::notifyScriptReady(ScriptLoader* scriptLoader, ExecutionType e
     xecutionType) | 
|   88 { |   88 { | 
|   89     switch (executionType) { |   89     switch (executionType) { | 
|   90     case ASYNC_EXECUTION: |   90     case ASYNC_EXECUTION: | 
|   91         ASSERT(m_pendingAsyncScripts.contains(scriptLoader)); |   91         ASSERT(m_pendingAsyncScripts.contains(scriptLoader)); | 
|   92         m_scriptsToExecuteSoon.append(m_pendingAsyncScripts.take(scriptLoader)); |   92         m_scriptsToExecuteSoon.append(m_pendingAsyncScripts.take(scriptLoader)); | 
|   93         break; |   93         break; | 
|   94  |   94  | 
|   95     case IN_ORDER_EXECUTION: |   95     case IN_ORDER_EXECUTION: | 
|   96         ASSERT(!m_scriptsToExecuteInOrder.isEmpty()); |   96         ASSERT(!m_scriptsToExecuteInOrder.isEmpty()); | 
|   97         break; |   97         break; | 
|   98     } |   98     } | 
|   99     m_timer.startOneShot(0); |   99     m_timer.startOneShot(0, FROM_HERE); | 
|  100 } |  100 } | 
|  101  |  101  | 
|  102 void ScriptRunner::notifyScriptLoadError(ScriptLoader* scriptLoader, ExecutionTy
     pe executionType) |  102 void ScriptRunner::notifyScriptLoadError(ScriptLoader* scriptLoader, ExecutionTy
     pe executionType) | 
|  103 { |  103 { | 
|  104     switch (executionType) { |  104     switch (executionType) { | 
|  105     case ASYNC_EXECUTION: |  105     case ASYNC_EXECUTION: | 
|  106         ASSERT(m_pendingAsyncScripts.contains(scriptLoader)); |  106         ASSERT(m_pendingAsyncScripts.contains(scriptLoader)); | 
|  107         m_pendingAsyncScripts.remove(scriptLoader); |  107         m_pendingAsyncScripts.remove(scriptLoader); | 
|  108         m_document->decrementLoadEventDelayCount(); |  108         m_document->decrementLoadEventDelayCount(); | 
|  109         break; |  109         break; | 
| (...skipping 22 matching lines...) Expand all  Loading... | 
|  132     size_t size = scripts.size(); |  132     size_t size = scripts.size(); | 
|  133     for (size_t i = 0; i < size; ++i) { |  133     for (size_t i = 0; i < size; ++i) { | 
|  134         ScriptResource* resource = scripts[i].resource(); |  134         ScriptResource* resource = scripts[i].resource(); | 
|  135         RefPtr<Element> element = scripts[i].releaseElementAndClear(); |  135         RefPtr<Element> element = scripts[i].releaseElementAndClear(); | 
|  136         toScriptLoaderIfPossible(element.get())->execute(resource); |  136         toScriptLoaderIfPossible(element.get())->execute(resource); | 
|  137         m_document->decrementLoadEventDelayCount(); |  137         m_document->decrementLoadEventDelayCount(); | 
|  138     } |  138     } | 
|  139 } |  139 } | 
|  140  |  140  | 
|  141 } |  141 } | 
| OLD | NEW |