OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/public/app/content_main_runner.h" | 5 #include "content/public/app/content_main_runner.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include "base/allocator/allocator_extension.h" | 9 #include "base/allocator/allocator_extension.h" |
10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 ContentMainRunnerImpl() | 472 ContentMainRunnerImpl() |
473 : is_initialized_(false), | 473 : is_initialized_(false), |
474 is_shutdown_(false), | 474 is_shutdown_(false), |
475 completed_basic_startup_(false), | 475 completed_basic_startup_(false), |
476 delegate_(NULL) { | 476 delegate_(NULL) { |
477 #if defined(OS_WIN) | 477 #if defined(OS_WIN) |
478 memset(&sandbox_info_, 0, sizeof(sandbox_info_)); | 478 memset(&sandbox_info_, 0, sizeof(sandbox_info_)); |
479 #endif | 479 #endif |
480 } | 480 } |
481 | 481 |
482 ~ContentMainRunnerImpl() { | 482 virtual ~ContentMainRunnerImpl() { |
483 if (is_initialized_ && !is_shutdown_) | 483 if (is_initialized_ && !is_shutdown_) |
484 Shutdown(); | 484 Shutdown(); |
485 } | 485 } |
486 | 486 |
487 #if defined(USE_TCMALLOC) | 487 #if defined(USE_TCMALLOC) |
488 static bool GetAllocatorWasteSizeThunk(size_t* size) { | 488 static bool GetAllocatorWasteSizeThunk(size_t* size) { |
489 size_t heap_size, allocated_bytes, unmapped_bytes; | 489 size_t heap_size, allocated_bytes, unmapped_bytes; |
490 MallocExtension* ext = MallocExtension::instance(); | 490 MallocExtension* ext = MallocExtension::instance(); |
491 if (ext->GetNumericProperty("generic.heap_size", &heap_size) && | 491 if (ext->GetNumericProperty("generic.heap_size", &heap_size) && |
492 ext->GetNumericProperty("generic.current_allocated_bytes", | 492 ext->GetNumericProperty("generic.current_allocated_bytes", |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 | 812 |
813 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 813 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
814 }; | 814 }; |
815 | 815 |
816 // static | 816 // static |
817 ContentMainRunner* ContentMainRunner::Create() { | 817 ContentMainRunner* ContentMainRunner::Create() { |
818 return new ContentMainRunnerImpl(); | 818 return new ContentMainRunnerImpl(); |
819 } | 819 } |
820 | 820 |
821 } // namespace content | 821 } // namespace content |
OLD | NEW |