OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
7 | 7 |
8 #include "chrome/browser/renderer_host/browser_render_process_host.h" | 8 #include "chrome/browser/renderer_host/browser_render_process_host.h" |
9 | 9 |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 DCHECK_EQ(backgrounded_, (visible_widgets_ == 0)); | 397 DCHECK_EQ(backgrounded_, (visible_widgets_ == 0)); |
398 visible_widgets_--; | 398 visible_widgets_--; |
399 DCHECK_GE(visible_widgets_, 0); | 399 DCHECK_GE(visible_widgets_, 0); |
400 if (visible_widgets_ == 0) { | 400 if (visible_widgets_ == 0) { |
401 DCHECK(!backgrounded_); | 401 DCHECK(!backgrounded_); |
402 SetBackgrounded(true); | 402 SetBackgrounded(true); |
403 } | 403 } |
404 } | 404 } |
405 | 405 |
406 void BrowserRenderProcessHost::AddWord(const string16& word) { | 406 void BrowserRenderProcessHost::AddWord(const string16& word) { |
407 base::Thread* io_thread = g_browser_process->io_thread(); | |
408 SpellChecker* spellchecker = profile()->GetSpellChecker(); | 407 SpellChecker* spellchecker = profile()->GetSpellChecker(); |
409 if (spellchecker) { | 408 if (spellchecker) { |
410 io_thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod( | 409 ChromeThread::PostTask( |
411 spellchecker, &SpellChecker::AddWord, word)); | 410 ChromeThread::IO, FROM_HERE, |
| 411 NewRunnableMethod(spellchecker, &SpellChecker::AddWord, word)); |
412 } | 412 } |
413 } | 413 } |
414 | 414 |
415 void BrowserRenderProcessHost::AddVisitedLinks( | 415 void BrowserRenderProcessHost::AddVisitedLinks( |
416 const VisitedLinkCommon::Fingerprints& links) { | 416 const VisitedLinkCommon::Fingerprints& links) { |
417 visited_link_updater_->AddLinks(links); | 417 visited_link_updater_->AddLinks(links); |
418 if (visible_widgets_ == 0) | 418 if (visible_widgets_ == 0) |
419 return; | 419 return; |
420 | 420 |
421 visited_link_updater_->Update(this); | 421 visited_link_updater_->Update(this); |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1033 profile()->GetExtensionMessageService()->RemoveEventListener( | 1033 profile()->GetExtensionMessageService()->RemoveEventListener( |
1034 event_name, id()); | 1034 event_name, id()); |
1035 } | 1035 } |
1036 } | 1036 } |
1037 | 1037 |
1038 void BrowserRenderProcessHost::OnExtensionCloseChannel(int port_id) { | 1038 void BrowserRenderProcessHost::OnExtensionCloseChannel(int port_id) { |
1039 if (profile()->GetExtensionMessageService()) { | 1039 if (profile()->GetExtensionMessageService()) { |
1040 profile()->GetExtensionMessageService()->CloseChannel(port_id); | 1040 profile()->GetExtensionMessageService()->CloseChannel(port_id); |
1041 } | 1041 } |
1042 } | 1042 } |
OLD | NEW |