| 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/renderer/render_thread.h" | 5 #include "content/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 16 matching lines...) Expand all Loading... |
| 27 #include "content/common/db_message_filter.h" | 27 #include "content/common/db_message_filter.h" |
| 28 #include "content/common/dom_storage_messages.h" | 28 #include "content/common/dom_storage_messages.h" |
| 29 #include "content/common/gpu/gpu_messages.h" | 29 #include "content/common/gpu/gpu_messages.h" |
| 30 #include "content/common/npobject_util.h" | 30 #include "content/common/npobject_util.h" |
| 31 #include "content/common/plugin_messages.h" | 31 #include "content/common/plugin_messages.h" |
| 32 #include "content/common/renderer_preferences.h" | 32 #include "content/common/renderer_preferences.h" |
| 33 #include "content/common/resource_messages.h" | 33 #include "content/common/resource_messages.h" |
| 34 #include "content/common/view_messages.h" | 34 #include "content/common/view_messages.h" |
| 35 #include "content/common/web_database_observer_impl.h" | 35 #include "content/common/web_database_observer_impl.h" |
| 36 #include "content/public/renderer/content_renderer_client.h" | 36 #include "content/public/renderer/content_renderer_client.h" |
| 37 #include "content/public/renderer/render_process_observer.h" |
| 38 #include "content/public/renderer/render_view_visitor.h" |
| 37 #include "content/renderer/devtools_agent_filter.h" | 39 #include "content/renderer/devtools_agent_filter.h" |
| 38 #include "content/renderer/gpu/gpu_channel_host.h" | 40 #include "content/renderer/gpu/gpu_channel_host.h" |
| 39 #include "content/renderer/indexed_db_dispatcher.h" | 41 #include "content/renderer/indexed_db_dispatcher.h" |
| 40 #include "content/renderer/media/audio_input_message_filter.h" | 42 #include "content/renderer/media/audio_input_message_filter.h" |
| 41 #include "content/renderer/media/audio_message_filter.h" | 43 #include "content/renderer/media/audio_message_filter.h" |
| 42 #include "content/renderer/media/video_capture_impl_manager.h" | 44 #include "content/renderer/media/video_capture_impl_manager.h" |
| 43 #include "content/renderer/media/video_capture_message_filter.h" | 45 #include "content/renderer/media/video_capture_message_filter.h" |
| 44 #include "content/renderer/plugin_channel_host.h" | 46 #include "content/renderer/plugin_channel_host.h" |
| 45 #include "content/renderer/render_process_impl.h" | 47 #include "content/renderer/render_process_impl.h" |
| 46 #include "content/renderer/render_process_observer.h" | |
| 47 #include "content/renderer/render_view.h" | 48 #include "content/renderer/render_view.h" |
| 48 #include "content/renderer/render_view_visitor.h" | |
| 49 #include "content/renderer/renderer_webidbfactory_impl.h" | 49 #include "content/renderer/renderer_webidbfactory_impl.h" |
| 50 #include "content/renderer/renderer_webkitplatformsupport_impl.h" | 50 #include "content/renderer/renderer_webkitplatformsupport_impl.h" |
| 51 #include "ipc/ipc_channel_handle.h" | 51 #include "ipc/ipc_channel_handle.h" |
| 52 #include "ipc/ipc_platform_file.h" | 52 #include "ipc/ipc_platform_file.h" |
| 53 #include "net/base/net_errors.h" | 53 #include "net/base/net_errors.h" |
| 54 #include "net/base/net_util.h" | 54 #include "net/base/net_util.h" |
| 55 #include "third_party/tcmalloc/chromium/src/google/malloc_extension.h" | 55 #include "third_party/tcmalloc/chromium/src/google/malloc_extension.h" |
| 56 #include "third_party/WebKit/Source/WebKit/chromium/public/WebColor.h" | 56 #include "third_party/WebKit/Source/WebKit/chromium/public/WebColor.h" |
| 57 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h" | 57 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h" |
| 58 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 58 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 88 #endif | 88 #endif |
| 89 | 89 |
| 90 using WebKit::WebDocument; | 90 using WebKit::WebDocument; |
| 91 using WebKit::WebFrame; | 91 using WebKit::WebFrame; |
| 92 using WebKit::WebNetworkStateNotifier; | 92 using WebKit::WebNetworkStateNotifier; |
| 93 using WebKit::WebRuntimeFeatures; | 93 using WebKit::WebRuntimeFeatures; |
| 94 using WebKit::WebScriptController; | 94 using WebKit::WebScriptController; |
| 95 using WebKit::WebString; | 95 using WebKit::WebString; |
| 96 using WebKit::WebStorageEventDispatcher; | 96 using WebKit::WebStorageEventDispatcher; |
| 97 using WebKit::WebView; | 97 using WebKit::WebView; |
| 98 using content::RenderProcessObserver; |
| 98 | 99 |
| 99 namespace { | 100 namespace { |
| 100 static const double kInitialIdleHandlerDelayS = 1.0 /* seconds */; | 101 static const double kInitialIdleHandlerDelayS = 1.0 /* seconds */; |
| 101 | 102 |
| 102 #if defined(TOUCH_UI) | 103 #if defined(TOUCH_UI) |
| 103 static const int kPopupListBoxMinimumRowHeight = 60; | 104 static const int kPopupListBoxMinimumRowHeight = 60; |
| 104 #endif | 105 #endif |
| 105 | 106 |
| 106 // Keep the global RenderThread in a TLS slot so it is impossible to access | 107 // Keep the global RenderThread in a TLS slot so it is impossible to access |
| 107 // incorrectly from the wrong thread. | 108 // incorrectly from the wrong thread. |
| 108 static base::LazyInstance<base::ThreadLocalPointer<RenderThread> > lazy_tls( | 109 static base::LazyInstance<base::ThreadLocalPointer<RenderThread> > lazy_tls( |
| 109 base::LINKER_INITIALIZED); | 110 base::LINKER_INITIALIZED); |
| 110 | 111 |
| 111 class RenderViewZoomer : public RenderViewVisitor { | 112 class RenderViewZoomer : public content::RenderViewVisitor { |
| 112 public: | 113 public: |
| 113 RenderViewZoomer(const GURL& url, double zoom_level) | 114 RenderViewZoomer(const GURL& url, double zoom_level) |
| 114 : zoom_level_(zoom_level) { | 115 : zoom_level_(zoom_level) { |
| 115 host_ = net::GetHostOrSpecFromURL(url); | 116 host_ = net::GetHostOrSpecFromURL(url); |
| 116 } | 117 } |
| 117 | 118 |
| 118 virtual bool Visit(RenderView* render_view) { | 119 virtual bool Visit(RenderView* render_view) { |
| 119 WebView* webview = render_view->webview(); | 120 WebView* webview = render_view->webview(); |
| 120 WebDocument document = webview->mainFrame()->document(); | 121 WebDocument document = webview->mainFrame()->document(); |
| 121 | 122 |
| (...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 | 725 |
| 725 void RenderThread::RegisterExtension(v8::Extension* extension) { | 726 void RenderThread::RegisterExtension(v8::Extension* extension) { |
| 726 WebScriptController::registerExtension(extension); | 727 WebScriptController::registerExtension(extension); |
| 727 v8_extensions_.insert(extension->name()); | 728 v8_extensions_.insert(extension->name()); |
| 728 } | 729 } |
| 729 | 730 |
| 730 bool RenderThread::IsRegisteredExtension( | 731 bool RenderThread::IsRegisteredExtension( |
| 731 const std::string& v8_extension_name) const { | 732 const std::string& v8_extension_name) const { |
| 732 return v8_extensions_.find(v8_extension_name) != v8_extensions_.end(); | 733 return v8_extensions_.find(v8_extension_name) != v8_extensions_.end(); |
| 733 } | 734 } |
| OLD | NEW |