| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "bindings/core/v8/ScriptStreamer.h" | 5 #include "bindings/core/v8/ScriptStreamer.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ScriptSourceCode.h" | 7 #include "bindings/core/v8/ScriptSourceCode.h" |
| 8 #include "bindings/core/v8/ScriptStreamerThread.h" | 8 #include "bindings/core/v8/ScriptStreamerThread.h" |
| 9 #include "bindings/core/v8/V8Binding.h" | 9 #include "bindings/core/v8/V8Binding.h" |
| 10 #include "bindings/core/v8/V8BindingForTesting.h" | 10 #include "bindings/core/v8/V8BindingForTesting.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 74 |
| 75 void processTasksUntilStreamingComplete() { | 75 void processTasksUntilStreamingComplete() { |
| 76 while (ScriptStreamerThread::shared()->isRunningTask()) { | 76 while (ScriptStreamerThread::shared()->isRunningTask()) { |
| 77 testing::runPendingTasks(); | 77 testing::runPendingTasks(); |
| 78 } | 78 } |
| 79 // Once more, because the "streaming complete" notification might only | 79 // Once more, because the "streaming complete" notification might only |
| 80 // now be in the task queue. | 80 // now be in the task queue. |
| 81 testing::runPendingTasks(); | 81 testing::runPendingTasks(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 WebTaskRunner* m_loadingTaskRunner; // NOT OWNED | 84 RefPtr<WebTaskRunner> m_loadingTaskRunner; |
| 85 std::unique_ptr<Settings> m_settings; | 85 std::unique_ptr<Settings> m_settings; |
| 86 // The Resource and PendingScript where we stream from. These don't really | 86 // The Resource and PendingScript where we stream from. These don't really |
| 87 // fetch any data outside the test; the test controls the data by calling | 87 // fetch any data outside the test; the test controls the data by calling |
| 88 // ScriptResource::appendData. | 88 // ScriptResource::appendData. |
| 89 ResourceRequest m_resourceRequest; | 89 ResourceRequest m_resourceRequest; |
| 90 Persistent<ScriptResource> m_resource; | 90 Persistent<ScriptResource> m_resource; |
| 91 Persistent<PendingScript> m_pendingScript; | 91 Persistent<PendingScript> m_pendingScript; |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 class TestPendingScriptClient | 94 class TestPendingScriptClient |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 v8::TryCatch tryCatch(scope.isolate()); | 385 v8::TryCatch tryCatch(scope.isolate()); |
| 386 v8::Local<v8::Script> script; | 386 v8::Local<v8::Script> script; |
| 387 EXPECT_TRUE(V8ScriptRunner::compileScript(sourceCode, scope.isolate()) | 387 EXPECT_TRUE(V8ScriptRunner::compileScript(sourceCode, scope.isolate()) |
| 388 .ToLocal(&script)); | 388 .ToLocal(&script)); |
| 389 EXPECT_FALSE(tryCatch.HasCaught()); | 389 EXPECT_FALSE(tryCatch.HasCaught()); |
| 390 } | 390 } |
| 391 | 391 |
| 392 } // namespace | 392 } // namespace |
| 393 | 393 |
| 394 } // namespace blink | 394 } // namespace blink |
| OLD | NEW |