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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 switch (thread_id) { | 316 switch (thread_id) { |
317 case BrowserThread::DB: | 317 case BrowserThread::DB: |
318 thread_to_start = &db_thread_; | 318 thread_to_start = &db_thread_; |
319 break; | 319 break; |
320 case BrowserThread::WEBKIT: | 320 case BrowserThread::WEBKIT: |
321 // For now, the WebKit thread in the browser is owned by | 321 // For now, the WebKit thread in the browser is owned by |
322 // ResourceDispatcherHost, not by the content framework. Until | 322 // ResourceDispatcherHost, not by the content framework. Until |
323 // this is fixed, we don't start the thread but still call | 323 // this is fixed, we don't start the thread but still call |
324 // Pre/PostStartThread for the ID. | 324 // Pre/PostStartThread for the ID. |
325 break; | 325 break; |
| 326 case BrowserThread::FILE_USER_BLOCKING: |
| 327 thread_to_start = &file_user_blocking_thread_; |
| 328 break; |
326 case BrowserThread::FILE: | 329 case BrowserThread::FILE: |
327 thread_to_start = &file_thread_; | 330 thread_to_start = &file_thread_; |
328 #if defined(OS_WIN) | 331 #if defined(OS_WIN) |
329 // On Windows, the FILE thread needs to be have a UI message loop | 332 // On Windows, the FILE thread needs to be have a UI message loop |
330 // which pumps messages in such a way that Google Update can | 333 // which pumps messages in such a way that Google Update can |
331 // communicate back to us. | 334 // communicate back to us. |
332 options = &ui_message_loop_options; | 335 options = &ui_message_loop_options; |
333 #else | 336 #else |
334 options = &io_message_loop_options; | 337 options = &io_message_loop_options; |
335 #endif | 338 #endif |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 switch (thread_id) { | 442 switch (thread_id) { |
440 case BrowserThread::DB: | 443 case BrowserThread::DB: |
441 thread_to_stop = &db_thread_; | 444 thread_to_stop = &db_thread_; |
442 break; | 445 break; |
443 case BrowserThread::WEBKIT: | 446 case BrowserThread::WEBKIT: |
444 // For now, the WebKit thread in the browser is owned by | 447 // For now, the WebKit thread in the browser is owned by |
445 // ResourceDispatcherHost, not by the content framework. Until | 448 // ResourceDispatcherHost, not by the content framework. Until |
446 // this is fixed, we don't stop the thread but still call | 449 // this is fixed, we don't stop the thread but still call |
447 // Pre/PostStopThread for the ID. | 450 // Pre/PostStopThread for the ID. |
448 break; | 451 break; |
| 452 case BrowserThread::FILE_USER_BLOCKING: |
| 453 thread_to_stop = &file_user_blocking_thread_; |
| 454 break; |
449 case BrowserThread::FILE: | 455 case BrowserThread::FILE: |
450 thread_to_stop = &file_thread_; | 456 thread_to_stop = &file_thread_; |
451 break; | 457 break; |
452 case BrowserThread::PROCESS_LAUNCHER: | 458 case BrowserThread::PROCESS_LAUNCHER: |
453 thread_to_stop = &process_launcher_thread_; | 459 thread_to_stop = &process_launcher_thread_; |
454 break; | 460 break; |
455 case BrowserThread::CACHE: | 461 case BrowserThread::CACHE: |
456 thread_to_stop = &cache_thread_; | 462 thread_to_stop = &cache_thread_; |
457 break; | 463 break; |
458 case BrowserThread::IO: | 464 case BrowserThread::IO: |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 MessageLoopForUI::current()->PostTask(FROM_HERE, parameters_.ui_task); | 545 MessageLoopForUI::current()->PostTask(FROM_HERE, parameters_.ui_task); |
540 | 546 |
541 #if defined(OS_MACOSX) | 547 #if defined(OS_MACOSX) |
542 MessageLoopForUI::current()->Run(); | 548 MessageLoopForUI::current()->Run(); |
543 #else | 549 #else |
544 MessageLoopForUI::current()->RunWithDispatcher(NULL); | 550 MessageLoopForUI::current()->RunWithDispatcher(NULL); |
545 #endif | 551 #endif |
546 } | 552 } |
547 | 553 |
548 } // namespace content | 554 } // namespace content |
OLD | NEW |