| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <memory> | 5 #include <memory> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) | 74 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) |
| 75 gin::V8Initializer::LoadV8Snapshot(); | 75 gin::V8Initializer::LoadV8Snapshot(); |
| 76 gin::V8Initializer::LoadV8Natives(); | 76 gin::V8Initializer::LoadV8Natives(); |
| 77 #endif | 77 #endif |
| 78 | 78 |
| 79 blink::initialize(this); | 79 blink::initialize(this); |
| 80 } | 80 } |
| 81 | 81 |
| 82 ~BlinkInitializer() override {} | 82 ~BlinkInitializer() override {} |
| 83 | 83 |
| 84 blink::WebThread* currentThread() override { return main_thread_.get(); } |
| 85 |
| 84 private: | 86 private: |
| 85 std::unique_ptr<blink::scheduler::WebThreadImplForUtilityThread> main_thread_; | 87 std::unique_ptr<blink::scheduler::WebThreadImplForUtilityThread> main_thread_; |
| 86 | 88 |
| 87 DISALLOW_COPY_AND_ASSIGN(BlinkInitializer); | 89 DISALLOW_COPY_AND_ASSIGN(BlinkInitializer); |
| 88 }; | 90 }; |
| 89 | 91 |
| 90 base::LazyInstance<BlinkInitializer>::Leaky g_blink_initializer = | 92 base::LazyInstance<BlinkInitializer>::Leaky g_blink_initializer = |
| 91 LAZY_INSTANCE_INITIALIZER; | 93 LAZY_INSTANCE_INITIALIZER; |
| 92 | 94 |
| 93 class ImageDecoderImplTest : public testing::Test { | 95 class ImageDecoderImplTest : public testing::Test { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 const char kRandomData[] = "u gycfy7xdjkhfgui bdui "; | 154 const char kRandomData[] = "u gycfy7xdjkhfgui bdui "; |
| 153 std::vector<unsigned char> jpg(kRandomData, | 155 std::vector<unsigned char> jpg(kRandomData, |
| 154 kRandomData + sizeof(kRandomData)); | 156 kRandomData + sizeof(kRandomData)); |
| 155 | 157 |
| 156 Request request(decoder()); | 158 Request request(decoder()); |
| 157 request.DecodeImage(jpg, false); | 159 request.DecodeImage(jpg, false); |
| 158 EXPECT_TRUE(request.bitmap().isNull()); | 160 EXPECT_TRUE(request.bitmap().isNull()); |
| 159 } | 161 } |
| 160 | 162 |
| 161 } // namespace image_decoder | 163 } // namespace image_decoder |
| OLD | NEW |