| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/renderer/render_thread.h" | 5 #include "chrome/renderer/render_thread.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 | 586 |
| 587 void RenderThread::OnDOMStorageEvent( | 587 void RenderThread::OnDOMStorageEvent( |
| 588 const DOMStorageMsg_Event_Params& params) { | 588 const DOMStorageMsg_Event_Params& params) { |
| 589 if (!dom_storage_event_dispatcher_.get()) | 589 if (!dom_storage_event_dispatcher_.get()) |
| 590 dom_storage_event_dispatcher_.reset(WebStorageEventDispatcher::create()); | 590 dom_storage_event_dispatcher_.reset(WebStorageEventDispatcher::create()); |
| 591 dom_storage_event_dispatcher_->dispatchStorageEvent(params.key, | 591 dom_storage_event_dispatcher_->dispatchStorageEvent(params.key, |
| 592 params.old_value, params.new_value, params.origin, params.url, | 592 params.old_value, params.new_value, params.origin, params.url, |
| 593 params.storage_type == DOM_STORAGE_LOCAL); | 593 params.storage_type == DOM_STORAGE_LOCAL); |
| 594 } | 594 } |
| 595 | 595 |
| 596 void RenderThread::OnControlMessageReceived(const IPC::Message& msg) { | 596 bool RenderThread::OnControlMessageReceived(const IPC::Message& msg) { |
| 597 // Some messages are handled by delegates. | 597 // Some messages are handled by delegates. |
| 598 if (appcache_dispatcher_->OnMessageReceived(msg)) | 598 if (appcache_dispatcher_->OnMessageReceived(msg)) |
| 599 return; | 599 return true; |
| 600 if (indexed_db_dispatcher_->OnMessageReceived(msg)) | 600 if (indexed_db_dispatcher_->OnMessageReceived(msg)) |
| 601 return; | 601 return true; |
| 602 | 602 |
| 603 bool handled = true; |
| 603 IPC_BEGIN_MESSAGE_MAP(RenderThread, msg) | 604 IPC_BEGIN_MESSAGE_MAP(RenderThread, msg) |
| 604 IPC_MESSAGE_HANDLER(ViewMsg_VisitedLink_NewTable, OnUpdateVisitedLinks) | 605 IPC_MESSAGE_HANDLER(ViewMsg_VisitedLink_NewTable, OnUpdateVisitedLinks) |
| 605 IPC_MESSAGE_HANDLER(ViewMsg_VisitedLink_Add, OnAddVisitedLinks) | 606 IPC_MESSAGE_HANDLER(ViewMsg_VisitedLink_Add, OnAddVisitedLinks) |
| 606 IPC_MESSAGE_HANDLER(ViewMsg_VisitedLink_Reset, OnResetVisitedLinks) | 607 IPC_MESSAGE_HANDLER(ViewMsg_VisitedLink_Reset, OnResetVisitedLinks) |
| 607 IPC_MESSAGE_HANDLER(ViewMsg_SetContentSettingsForCurrentURL, | 608 IPC_MESSAGE_HANDLER(ViewMsg_SetContentSettingsForCurrentURL, |
| 608 OnSetContentSettingsForCurrentURL) | 609 OnSetContentSettingsForCurrentURL) |
| 609 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForCurrentURL, | 610 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForCurrentURL, |
| 610 OnSetZoomLevelForCurrentURL) | 611 OnSetZoomLevelForCurrentURL) |
| 611 IPC_MESSAGE_HANDLER(ViewMsg_SetIsIncognitoProcess, OnSetIsIncognitoProcess) | 612 IPC_MESSAGE_HANDLER(ViewMsg_SetIsIncognitoProcess, OnSetIsIncognitoProcess) |
| 612 IPC_MESSAGE_HANDLER(ViewMsg_SetNextPageID, OnSetNextPageID) | 613 IPC_MESSAGE_HANDLER(ViewMsg_SetNextPageID, OnSetNextPageID) |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 IPC_MESSAGE_HANDLER(ViewMsg_SpellChecker_Init, | 654 IPC_MESSAGE_HANDLER(ViewMsg_SpellChecker_Init, |
| 654 OnInitSpellChecker) | 655 OnInitSpellChecker) |
| 655 IPC_MESSAGE_HANDLER(ViewMsg_SpellChecker_WordAdded, | 656 IPC_MESSAGE_HANDLER(ViewMsg_SpellChecker_WordAdded, |
| 656 OnSpellCheckWordAdded) | 657 OnSpellCheckWordAdded) |
| 657 IPC_MESSAGE_HANDLER(ViewMsg_SpellChecker_EnableAutoSpellCorrect, | 658 IPC_MESSAGE_HANDLER(ViewMsg_SpellChecker_EnableAutoSpellCorrect, |
| 658 OnSpellCheckEnableAutoSpellCorrect) | 659 OnSpellCheckEnableAutoSpellCorrect) |
| 659 IPC_MESSAGE_HANDLER(ViewMsg_GpuChannelEstablished, OnGpuChannelEstablished) | 660 IPC_MESSAGE_HANDLER(ViewMsg_GpuChannelEstablished, OnGpuChannelEstablished) |
| 660 IPC_MESSAGE_HANDLER(ViewMsg_SetPhishingModel, OnSetPhishingModel) | 661 IPC_MESSAGE_HANDLER(ViewMsg_SetPhishingModel, OnSetPhishingModel) |
| 661 IPC_MESSAGE_HANDLER(ViewMsg_SpeechInput_SetFeatureEnabled, | 662 IPC_MESSAGE_HANDLER(ViewMsg_SpeechInput_SetFeatureEnabled, |
| 662 OnSetSpeechInputEnabled) | 663 OnSetSpeechInputEnabled) |
| 664 IPC_MESSAGE_UNHANDLED(handled = false) |
| 663 IPC_END_MESSAGE_MAP() | 665 IPC_END_MESSAGE_MAP() |
| 666 return handled; |
| 664 } | 667 } |
| 665 | 668 |
| 666 void RenderThread::OnSetSpeechInputEnabled(bool enabled) { | 669 void RenderThread::OnSetSpeechInputEnabled(bool enabled) { |
| 667 DCHECK(!webkit_client_.get()); | 670 DCHECK(!webkit_client_.get()); |
| 668 is_speech_input_enabled_ = enabled; | 671 is_speech_input_enabled_ = enabled; |
| 669 } | 672 } |
| 670 | 673 |
| 671 void RenderThread::OnSetNextPageID(int32 next_page_id) { | 674 void RenderThread::OnSetNextPageID(int32 next_page_id) { |
| 672 // This should only be called at process initialization time, so we shouldn't | 675 // This should only be called at process initialization time, so we shouldn't |
| 673 // have to worry about thread-safety. | 676 // have to worry about thread-safety. |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1147 } | 1150 } |
| 1148 | 1151 |
| 1149 return false; | 1152 return false; |
| 1150 } | 1153 } |
| 1151 | 1154 |
| 1152 void RenderThread::RegisterExtension(v8::Extension* extension, | 1155 void RenderThread::RegisterExtension(v8::Extension* extension, |
| 1153 bool restrict_to_extensions) { | 1156 bool restrict_to_extensions) { |
| 1154 WebScriptController::registerExtension(extension); | 1157 WebScriptController::registerExtension(extension); |
| 1155 v8_extensions_[extension->name()] = restrict_to_extensions; | 1158 v8_extensions_[extension->name()] = restrict_to_extensions; |
| 1156 } | 1159 } |
| OLD | NEW |