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 10 matching lines...) Expand all Loading... |
21 #include "base/shared_memory.h" | 21 #include "base/shared_memory.h" |
22 #include "base/string_util.h" | 22 #include "base/string_util.h" |
23 #include "base/task.h" | 23 #include "base/task.h" |
24 #include "base/thread_local.h" | 24 #include "base/thread_local.h" |
25 #include "base/utf_string_conversions.h" | 25 #include "base/utf_string_conversions.h" |
26 #include "base/values.h" | 26 #include "base/values.h" |
27 #include "chrome/common/appcache/appcache_dispatcher.h" | 27 #include "chrome/common/appcache/appcache_dispatcher.h" |
28 #include "chrome/common/child_process_logging.h" | 28 #include "chrome/common/child_process_logging.h" |
29 #include "chrome/common/chrome_switches.h" | 29 #include "chrome/common/chrome_switches.h" |
30 #include "chrome/common/db_message_filter.h" | 30 #include "chrome/common/db_message_filter.h" |
31 #include "chrome/common/dom_storage_common.h" | 31 #include "chrome/common/dom_storage_messages.h" |
32 #include "chrome/common/plugin_messages.h" | 32 #include "chrome/common/plugin_messages.h" |
33 #include "chrome/common/render_messages.h" | 33 #include "chrome/common/render_messages.h" |
34 #include "chrome/common/render_messages_params.h" | 34 #include "chrome/common/render_messages_params.h" |
35 #include "chrome/common/renderer_preferences.h" | 35 #include "chrome/common/renderer_preferences.h" |
36 #include "chrome/common/url_constants.h" | 36 #include "chrome/common/url_constants.h" |
37 #include "chrome/common/web_database_observer_impl.h" | 37 #include "chrome/common/web_database_observer_impl.h" |
38 #include "chrome/plugin/npobject_util.h" | 38 #include "chrome/plugin/npobject_util.h" |
39 // TODO(port) | 39 // TODO(port) |
40 #if defined(OS_WIN) | 40 #if defined(OS_WIN) |
41 #include "chrome/plugin/plugin_channel.h" | 41 #include "chrome/plugin/plugin_channel.h" |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 // callbacks. | 383 // callbacks. |
384 bool pumping_events = false, may_show_cookie_prompt = false; | 384 bool pumping_events = false, may_show_cookie_prompt = false; |
385 if (msg->is_sync()) { | 385 if (msg->is_sync()) { |
386 if (msg->is_caller_pumping_messages()) { | 386 if (msg->is_caller_pumping_messages()) { |
387 pumping_events = true; | 387 pumping_events = true; |
388 } else { | 388 } else { |
389 switch (msg->type()) { | 389 switch (msg->type()) { |
390 case ViewHostMsg_GetCookies::ID: | 390 case ViewHostMsg_GetCookies::ID: |
391 case ViewHostMsg_GetRawCookies::ID: | 391 case ViewHostMsg_GetRawCookies::ID: |
392 case ViewHostMsg_CookiesEnabled::ID: | 392 case ViewHostMsg_CookiesEnabled::ID: |
393 case ViewHostMsg_DOMStorageSetItem::ID: | 393 case DOMStorageHostMsg_SetItem::ID: |
394 case ViewHostMsg_SyncLoad::ID: | 394 case ViewHostMsg_SyncLoad::ID: |
395 case ViewHostMsg_AllowDatabase::ID: | 395 case ViewHostMsg_AllowDatabase::ID: |
396 may_show_cookie_prompt = true; | 396 may_show_cookie_prompt = true; |
397 pumping_events = true; | 397 pumping_events = true; |
398 break; | 398 break; |
399 } | 399 } |
400 } | 400 } |
401 } | 401 } |
402 | 402 |
403 bool suspend_webkit_shared_timer = true; // default value | 403 bool suspend_webkit_shared_timer = true; // default value |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 | 570 |
571 UpdateActiveExtensions(); | 571 UpdateActiveExtensions(); |
572 } | 572 } |
573 | 573 |
574 void RenderThread::OnExtensionSetHostPermissions( | 574 void RenderThread::OnExtensionSetHostPermissions( |
575 const GURL& extension_url, const std::vector<URLPattern>& permissions) { | 575 const GURL& extension_url, const std::vector<URLPattern>& permissions) { |
576 ExtensionProcessBindings::SetHostPermissions(extension_url, permissions); | 576 ExtensionProcessBindings::SetHostPermissions(extension_url, permissions); |
577 } | 577 } |
578 | 578 |
579 void RenderThread::OnDOMStorageEvent( | 579 void RenderThread::OnDOMStorageEvent( |
580 const ViewMsg_DOMStorageEvent_Params& params) { | 580 const DOMStorageMsg_Event_Params& params) { |
581 if (!dom_storage_event_dispatcher_.get()) | 581 if (!dom_storage_event_dispatcher_.get()) |
582 dom_storage_event_dispatcher_.reset(WebStorageEventDispatcher::create()); | 582 dom_storage_event_dispatcher_.reset(WebStorageEventDispatcher::create()); |
583 dom_storage_event_dispatcher_->dispatchStorageEvent(params.key_, | 583 dom_storage_event_dispatcher_->dispatchStorageEvent(params.key, |
584 params.old_value_, params.new_value_, params.origin_, params.url_, | 584 params.old_value, params.new_value, params.origin, params.url, |
585 params.storage_type_ == DOM_STORAGE_LOCAL); | 585 params.storage_type == DOM_STORAGE_LOCAL); |
586 } | 586 } |
587 | 587 |
588 void RenderThread::OnControlMessageReceived(const IPC::Message& msg) { | 588 void RenderThread::OnControlMessageReceived(const IPC::Message& msg) { |
589 // Some messages are handled by delegates. | 589 // Some messages are handled by delegates. |
590 if (appcache_dispatcher_->OnMessageReceived(msg)) | 590 if (appcache_dispatcher_->OnMessageReceived(msg)) |
591 return; | 591 return; |
592 if (indexed_db_dispatcher_->OnMessageReceived(msg)) | 592 if (indexed_db_dispatcher_->OnMessageReceived(msg)) |
593 return; | 593 return; |
594 | 594 |
595 IPC_BEGIN_MESSAGE_MAP(RenderThread, msg) | 595 IPC_BEGIN_MESSAGE_MAP(RenderThread, msg) |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 OnExtensionsUpdated) | 629 OnExtensionsUpdated) |
630 IPC_MESSAGE_HANDLER(ViewMsg_PurgeMemory, OnPurgeMemory) | 630 IPC_MESSAGE_HANDLER(ViewMsg_PurgeMemory, OnPurgeMemory) |
631 IPC_MESSAGE_HANDLER(ViewMsg_PurgePluginListCache, | 631 IPC_MESSAGE_HANDLER(ViewMsg_PurgePluginListCache, |
632 OnPurgePluginListCache) | 632 OnPurgePluginListCache) |
633 IPC_MESSAGE_HANDLER(ViewMsg_Extension_UpdatePageActions, | 633 IPC_MESSAGE_HANDLER(ViewMsg_Extension_UpdatePageActions, |
634 OnPageActionsUpdated) | 634 OnPageActionsUpdated) |
635 IPC_MESSAGE_HANDLER(ViewMsg_Extension_SetAPIPermissions, | 635 IPC_MESSAGE_HANDLER(ViewMsg_Extension_SetAPIPermissions, |
636 OnExtensionSetAPIPermissions) | 636 OnExtensionSetAPIPermissions) |
637 IPC_MESSAGE_HANDLER(ViewMsg_Extension_SetHostPermissions, | 637 IPC_MESSAGE_HANDLER(ViewMsg_Extension_SetHostPermissions, |
638 OnExtensionSetHostPermissions) | 638 OnExtensionSetHostPermissions) |
639 IPC_MESSAGE_HANDLER(ViewMsg_DOMStorageEvent, | 639 IPC_MESSAGE_HANDLER(DOMStorageMsg_Event, |
640 OnDOMStorageEvent) | 640 OnDOMStorageEvent) |
641 #if defined(IPC_MESSAGE_LOG_ENABLED) | 641 #if defined(IPC_MESSAGE_LOG_ENABLED) |
642 IPC_MESSAGE_HANDLER(ViewMsg_SetIPCLoggingEnabled, | 642 IPC_MESSAGE_HANDLER(ViewMsg_SetIPCLoggingEnabled, |
643 OnSetIPCLoggingEnabled) | 643 OnSetIPCLoggingEnabled) |
644 #endif | 644 #endif |
645 IPC_MESSAGE_HANDLER(ViewMsg_SpellChecker_Init, | 645 IPC_MESSAGE_HANDLER(ViewMsg_SpellChecker_Init, |
646 OnInitSpellChecker) | 646 OnInitSpellChecker) |
647 IPC_MESSAGE_HANDLER(ViewMsg_SpellChecker_WordAdded, | 647 IPC_MESSAGE_HANDLER(ViewMsg_SpellChecker_WordAdded, |
648 OnSpellCheckWordAdded) | 648 OnSpellCheckWordAdded) |
649 IPC_MESSAGE_HANDLER(ViewMsg_SpellChecker_EnableAutoSpellCorrect, | 649 IPC_MESSAGE_HANDLER(ViewMsg_SpellChecker_EnableAutoSpellCorrect, |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1138 } | 1138 } |
1139 | 1139 |
1140 return false; | 1140 return false; |
1141 } | 1141 } |
1142 | 1142 |
1143 void RenderThread::RegisterExtension(v8::Extension* extension, | 1143 void RenderThread::RegisterExtension(v8::Extension* extension, |
1144 bool restrict_to_extensions) { | 1144 bool restrict_to_extensions) { |
1145 WebScriptController::registerExtension(extension); | 1145 WebScriptController::registerExtension(extension); |
1146 v8_extensions_[extension->name()] = restrict_to_extensions; | 1146 v8_extensions_[extension->name()] = restrict_to_extensions; |
1147 } | 1147 } |
OLD | NEW |