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_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 using content::V8ValueConverter; | 244 using content::V8ValueConverter; |
245 using webkit_glue::AltErrorPageResourceFetcher; | 245 using webkit_glue::AltErrorPageResourceFetcher; |
246 using webkit_glue::FormField; | 246 using webkit_glue::FormField; |
247 using webkit_glue::PasswordForm; | 247 using webkit_glue::PasswordForm; |
248 using webkit_glue::PasswordFormDomManager; | 248 using webkit_glue::PasswordFormDomManager; |
249 using webkit_glue::ResourceFetcher; | 249 using webkit_glue::ResourceFetcher; |
250 | 250 |
251 //----------------------------------------------------------------------------- | 251 //----------------------------------------------------------------------------- |
252 | 252 |
253 typedef std::map<WebKit::WebView*, RenderViewImpl*> ViewMap; | 253 typedef std::map<WebKit::WebView*, RenderViewImpl*> ViewMap; |
254 static base::LazyInstance<ViewMap> g_view_map(base::LINKER_INITIALIZED); | 254 static base::LazyInstance<ViewMap> g_view_map = LAZY_INSTANCE_INITIALIZER; |
255 | 255 |
256 // Time, in seconds, we delay before sending content state changes (such as form | 256 // Time, in seconds, we delay before sending content state changes (such as form |
257 // state and scroll position) to the browser. We delay sending changes to avoid | 257 // state and scroll position) to the browser. We delay sending changes to avoid |
258 // spamming the browser. | 258 // spamming the browser. |
259 // To avoid having tab/session restore require sending a message to get the | 259 // To avoid having tab/session restore require sending a message to get the |
260 // current content state during tab closing we use a shorter timeout for the | 260 // current content state during tab closing we use a shorter timeout for the |
261 // foreground renderer. This means there is a small window of time from which | 261 // foreground renderer. This means there is a small window of time from which |
262 // content state is modified and not sent to session restore, but this is | 262 // content state is modified and not sent to session restore, but this is |
263 // better than having to wake up all renderers during shutdown. | 263 // better than having to wake up all renderers during shutdown. |
264 static const int kDelaySecondsForContentStateSyncHidden = 5; | 264 static const int kDelaySecondsForContentStateSyncHidden = 5; |
(...skipping 4439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4704 return webview()->settings()->useThreadedCompositor(); | 4704 return webview()->settings()->useThreadedCompositor(); |
4705 } | 4705 } |
4706 | 4706 |
4707 void RenderViewImpl::OnJavaBridgeInit( | 4707 void RenderViewImpl::OnJavaBridgeInit( |
4708 const IPC::ChannelHandle& channel_handle) { | 4708 const IPC::ChannelHandle& channel_handle) { |
4709 DCHECK(!java_bridge_dispatcher_.get()); | 4709 DCHECK(!java_bridge_dispatcher_.get()); |
4710 #if defined(ENABLE_JAVA_BRIDGE) | 4710 #if defined(ENABLE_JAVA_BRIDGE) |
4711 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this, channel_handle)); | 4711 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this, channel_handle)); |
4712 #endif | 4712 #endif |
4713 } | 4713 } |
OLD | NEW |