| 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 TestScriptResourceClient | 94 class TestScriptResourceClient |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 v8::TryCatch tryCatch(scope.isolate()); | 388 v8::TryCatch tryCatch(scope.isolate()); |
| 389 v8::Local<v8::Script> script; | 389 v8::Local<v8::Script> script; |
| 390 EXPECT_TRUE(V8ScriptRunner::compileScript(sourceCode, scope.isolate()) | 390 EXPECT_TRUE(V8ScriptRunner::compileScript(sourceCode, scope.isolate()) |
| 391 .ToLocal(&script)); | 391 .ToLocal(&script)); |
| 392 EXPECT_FALSE(tryCatch.HasCaught()); | 392 EXPECT_FALSE(tryCatch.HasCaught()); |
| 393 } | 393 } |
| 394 | 394 |
| 395 } // namespace | 395 } // namespace |
| 396 | 396 |
| 397 } // namespace blink | 397 } // namespace blink |
| OLD | NEW |