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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 #endif | 395 #endif |
396 | 396 |
397 #if defined(OS_WIN) | 397 #if defined(OS_WIN) |
398 system_message_window_.reset(new SystemMessageWindowWin); | 398 system_message_window_.reset(new SystemMessageWindowWin); |
399 #endif | 399 #endif |
400 | 400 |
401 if (parts_.get()) | 401 if (parts_.get()) |
402 parts_->PostMainMessageLoopStart(); | 402 parts_->PostMainMessageLoopStart(); |
403 | 403 |
404 #if defined(OS_ANDROID) | 404 #if defined(OS_ANDROID) |
405 SurfaceTexturePeer::InitInstance(new SurfaceTexturePeerBrowserImpl( | 405 SurfaceTexturePeer::InitInstance(new SurfaceTexturePeerBrowserImpl()); |
406 parameters_.command_line.HasSwitch( | |
407 switches::kMediaPlayerInRenderProcess))); | |
408 DataFetcherImplAndroid::Init(base::android::AttachCurrentThread()); | 406 DataFetcherImplAndroid::Init(base::android::AttachCurrentThread()); |
409 #endif | 407 #endif |
410 | 408 |
411 if (parsed_command_line_.HasSwitch(switches::kMemoryMetrics)) { | 409 if (parsed_command_line_.HasSwitch(switches::kMemoryMetrics)) { |
412 memory_observer_.reset(new MemoryObserver()); | 410 memory_observer_.reset(new MemoryObserver()); |
413 MessageLoop::current()->AddTaskObserver(memory_observer_.get()); | 411 MessageLoop::current()->AddTaskObserver(memory_observer_.get()); |
414 } | 412 } |
415 } | 413 } |
416 | 414 |
417 void BrowserMainLoop::CreateThreads() { | 415 void BrowserMainLoop::CreateThreads() { |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); | 812 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); |
815 if (parameters_.ui_task) | 813 if (parameters_.ui_task) |
816 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); | 814 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); |
817 | 815 |
818 base::RunLoop run_loop; | 816 base::RunLoop run_loop; |
819 run_loop.Run(); | 817 run_loop.Run(); |
820 #endif | 818 #endif |
821 } | 819 } |
822 | 820 |
823 } // namespace content | 821 } // namespace content |
OLD | NEW |