OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/app/content_service_manager_main_delegate.h" |
| 6 |
| 7 #include "content/public/app/content_main_runner.h" |
| 8 |
| 9 namespace content { |
| 10 |
| 11 ContentServiceManagerMainDelegate::ContentServiceManagerMainDelegate( |
| 12 const ContentMainParams& params) |
| 13 : content_main_params_(params), |
| 14 content_main_runner_(ContentMainRunner::Create()) {} |
| 15 |
| 16 ContentServiceManagerMainDelegate::~ContentServiceManagerMainDelegate() = |
| 17 default; |
| 18 |
| 19 int ContentServiceManagerMainDelegate::Initialize( |
| 20 const InitializeParams& params) { |
| 21 #if defined(OS_ANDROID) |
| 22 // May be called twice on Android due to the way browser startup requests are |
| 23 // dispatched by the system. |
| 24 if (initialized_) |
| 25 return -1; |
| 26 #endif |
| 27 |
| 28 #if defined(OS_MACOSX) |
| 29 content_main_params_.autorelease_pool = params.autorelease_pool; |
| 30 #endif |
| 31 |
| 32 return content_main_runner_->Initialize(content_main_params_); |
| 33 } |
| 34 |
| 35 int ContentServiceManagerMainDelegate::Run() { |
| 36 return content_main_runner_->Run(); |
| 37 } |
| 38 |
| 39 void ContentServiceManagerMainDelegate::ShutDown() { |
| 40 #if !defined(OS_ANDROID) |
| 41 content_main_runner_->Shutdown(); |
| 42 #endif |
| 43 } |
| 44 |
| 45 } // namespace content |
OLD | NEW |