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/browser/browser_main_loop.h" | 5 #include "content/browser/browser_main_loop.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/hi_res_timer_manager.h" | 10 #include "base/hi_res_timer_manager.h" |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 | 394 |
395 #if defined(OS_ANDROID) | 395 #if defined(OS_ANDROID) |
396 SurfaceTexturePeer::InitInstance(new SurfaceTexturePeerBrowserImpl( | 396 SurfaceTexturePeer::InitInstance(new SurfaceTexturePeerBrowserImpl( |
397 parameters_.command_line.HasSwitch( | 397 parameters_.command_line.HasSwitch( |
398 switches::kMediaPlayerInRenderProcess))); | 398 switches::kMediaPlayerInRenderProcess))); |
399 DataFetcherImplAndroid::Init(base::android::AttachCurrentThread()); | 399 DataFetcherImplAndroid::Init(base::android::AttachCurrentThread()); |
400 #endif | 400 #endif |
401 | 401 |
402 if (parsed_command_line_.HasSwitch(switches::kMemoryMetrics)) { | 402 if (parsed_command_line_.HasSwitch(switches::kMemoryMetrics)) { |
403 memory_observer_.reset(new MemoryObserver()); | 403 memory_observer_.reset(new MemoryObserver()); |
404 main_message_loop_->AddTaskObserver(memory_observer_.get()); | 404 MessageLoop::current()->AddTaskObserver(memory_observer_.get()); |
405 } | 405 } |
406 } | 406 } |
407 | 407 |
408 void BrowserMainLoop::CreateThreads() { | 408 void BrowserMainLoop::CreateThreads() { |
409 if (parts_.get()) | 409 if (parts_.get()) |
410 result_code_ = parts_->PreCreateThreads(); | 410 result_code_ = parts_->PreCreateThreads(); |
411 | 411 |
412 #if !defined(OS_IOS) && (!defined(GOOGLE_CHROME_BUILD) || defined(OS_ANDROID)) | 412 #if !defined(OS_IOS) && (!defined(GOOGLE_CHROME_BUILD) || defined(OS_ANDROID)) |
413 // Single-process is an unsupported and not fully tested mode, so | 413 // Single-process is an unsupported and not fully tested mode, so |
414 // don't enable it for official Chrome builds (except on Android). | 414 // don't enable it for official Chrome builds (except on Android). |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); | 805 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); |
806 if (parameters_.ui_task) | 806 if (parameters_.ui_task) |
807 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); | 807 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); |
808 | 808 |
809 base::RunLoop run_loop; | 809 base::RunLoop run_loop; |
810 run_loop.Run(); | 810 run_loop.Run(); |
811 #endif | 811 #endif |
812 } | 812 } |
813 | 813 |
814 } // namespace content | 814 } // namespace content |
OLD | NEW |