OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 base::Thread::Options* options = &default_options; | 315 base::Thread::Options* options = &default_options; |
316 | 316 |
317 switch (thread_id) { | 317 switch (thread_id) { |
318 case BrowserThread::DB: | 318 case BrowserThread::DB: |
319 thread_to_start = &db_thread_; | 319 thread_to_start = &db_thread_; |
320 break; | 320 break; |
321 case BrowserThread::WEBKIT: | 321 case BrowserThread::WEBKIT: |
322 // Special case as WebKitThread is a separate | 322 // Special case as WebKitThread is a separate |
323 // type. |thread_to_start| is not used in this case. | 323 // type. |thread_to_start| is not used in this case. |
324 break; | 324 break; |
| 325 case BrowserThread::FILE_USER_BLOCKING: |
| 326 thread_to_start = &file_user_blocking_thread_; |
| 327 break; |
325 case BrowserThread::FILE: | 328 case BrowserThread::FILE: |
326 thread_to_start = &file_thread_; | 329 thread_to_start = &file_thread_; |
327 #if defined(OS_WIN) | 330 #if defined(OS_WIN) |
328 // On Windows, the FILE thread needs to be have a UI message loop | 331 // On Windows, the FILE thread needs to be have a UI message loop |
329 // which pumps messages in such a way that Google Update can | 332 // which pumps messages in such a way that Google Update can |
330 // communicate back to us. | 333 // communicate back to us. |
331 options = &ui_message_loop_options; | 334 options = &ui_message_loop_options; |
332 #else | 335 #else |
333 options = &io_message_loop_options; | 336 options = &io_message_loop_options; |
334 #endif | 337 #endif |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 // - (Not sure why DB stops last.) | 444 // - (Not sure why DB stops last.) |
442 scoped_ptr<BrowserProcessSubThread>* thread_to_stop = NULL; | 445 scoped_ptr<BrowserProcessSubThread>* thread_to_stop = NULL; |
443 switch (thread_id) { | 446 switch (thread_id) { |
444 case BrowserThread::DB: | 447 case BrowserThread::DB: |
445 thread_to_stop = &db_thread_; | 448 thread_to_stop = &db_thread_; |
446 break; | 449 break; |
447 case BrowserThread::WEBKIT: | 450 case BrowserThread::WEBKIT: |
448 // Special case as WebKitThread is a separate | 451 // Special case as WebKitThread is a separate |
449 // type. |thread_to_stop| is not used in this case. | 452 // type. |thread_to_stop| is not used in this case. |
450 break; | 453 break; |
| 454 case BrowserThread::FILE_USER_BLOCKING: |
| 455 thread_to_stop = &file_user_blocking_thread_; |
| 456 break; |
451 case BrowserThread::FILE: | 457 case BrowserThread::FILE: |
452 thread_to_stop = &file_thread_; | 458 thread_to_stop = &file_thread_; |
453 break; | 459 break; |
454 case BrowserThread::PROCESS_LAUNCHER: | 460 case BrowserThread::PROCESS_LAUNCHER: |
455 thread_to_stop = &process_launcher_thread_; | 461 thread_to_stop = &process_launcher_thread_; |
456 break; | 462 break; |
457 case BrowserThread::CACHE: | 463 case BrowserThread::CACHE: |
458 thread_to_stop = &cache_thread_; | 464 thread_to_stop = &cache_thread_; |
459 break; | 465 break; |
460 case BrowserThread::IO: | 466 case BrowserThread::IO: |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 MessageLoopForUI::current()->PostTask(FROM_HERE, parameters_.ui_task); | 554 MessageLoopForUI::current()->PostTask(FROM_HERE, parameters_.ui_task); |
549 | 555 |
550 #if defined(OS_MACOSX) | 556 #if defined(OS_MACOSX) |
551 MessageLoopForUI::current()->Run(); | 557 MessageLoopForUI::current()->Run(); |
552 #else | 558 #else |
553 MessageLoopForUI::current()->RunWithDispatcher(NULL); | 559 MessageLoopForUI::current()->RunWithDispatcher(NULL); |
554 #endif | 560 #endif |
555 } | 561 } |
556 | 562 |
557 } // namespace content | 563 } // namespace content |
OLD | NEW |