| 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 "ios/web/app/web_main_loop.h" | 5 #include "ios/web/app/web_main_loop.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 g_current_web_main_loop = nullptr; | 45 g_current_web_main_loop = nullptr; |
| 46 } | 46 } |
| 47 | 47 |
| 48 void WebMainLoop::Init() { | 48 void WebMainLoop::Init() { |
| 49 parts_.reset(web::GetWebClient()->CreateWebMainParts()); | 49 parts_.reset(web::GetWebClient()->CreateWebMainParts()); |
| 50 } | 50 } |
| 51 | 51 |
| 52 void WebMainLoop::EarlyInitialization() { | 52 void WebMainLoop::EarlyInitialization() { |
| 53 if (parts_) { | 53 if (parts_) { |
| 54 parts_->PreEarlyInitialization(); | 54 parts_->PreEarlyInitialization(); |
| 55 } | |
| 56 | |
| 57 #if defined(USE_NSS_VERIFIER) | |
| 58 // We want to be sure to init NSPR on the main thread. | |
| 59 crypto::EnsureNSPRInit(); | |
| 60 #endif | |
| 61 | |
| 62 if (parts_) { | |
| 63 parts_->PostEarlyInitialization(); | 55 parts_->PostEarlyInitialization(); |
| 64 } | 56 } |
| 65 } | 57 } |
| 66 | 58 |
| 67 void WebMainLoop::MainMessageLoopStart() { | 59 void WebMainLoop::MainMessageLoopStart() { |
| 68 if (parts_) { | 60 if (parts_) { |
| 69 parts_->PreMainMessageLoopStart(); | 61 parts_->PreMainMessageLoopStart(); |
| 70 } | 62 } |
| 71 | 63 |
| 72 // Create a MessageLoop if one does not already exist for the current thread. | 64 // Create a MessageLoop if one does not already exist for the current thread. |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 main_thread_.reset( | 265 main_thread_.reset( |
| 274 new WebThreadImpl(WebThread::UI, base::MessageLoop::current())); | 266 new WebThreadImpl(WebThread::UI, base::MessageLoop::current())); |
| 275 } | 267 } |
| 276 | 268 |
| 277 int WebMainLoop::WebThreadsStarted() { | 269 int WebMainLoop::WebThreadsStarted() { |
| 278 cookie_notification_bridge_.reset(new CookieNotificationBridge); | 270 cookie_notification_bridge_.reset(new CookieNotificationBridge); |
| 279 return result_code_; | 271 return result_code_; |
| 280 } | 272 } |
| 281 | 273 |
| 282 } // namespace web | 274 } // namespace web |
| OLD | NEW |