| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 using blink::WebRuntimeFeatures; | 257 using blink::WebRuntimeFeatures; |
| 258 using base::Time; | 258 using base::Time; |
| 259 using base::TimeDelta; | 259 using base::TimeDelta; |
| 260 | 260 |
| 261 | 261 |
| 262 namespace content { | 262 namespace content { |
| 263 | 263 |
| 264 //----------------------------------------------------------------------------- | 264 //----------------------------------------------------------------------------- |
| 265 | 265 |
| 266 typedef std::map<blink::WebView*, RenderViewImpl*> ViewMap; | 266 typedef std::map<blink::WebView*, RenderViewImpl*> ViewMap; |
| 267 static base::LazyInstance<ViewMap> g_view_map = LAZY_INSTANCE_INITIALIZER; | 267 static base::LazyInstance<ViewMap>::DestructorAtExit g_view_map = |
| 268 LAZY_INSTANCE_INITIALIZER; |
| 268 typedef std::map<int32_t, RenderViewImpl*> RoutingIDViewMap; | 269 typedef std::map<int32_t, RenderViewImpl*> RoutingIDViewMap; |
| 269 static base::LazyInstance<RoutingIDViewMap> g_routing_id_view_map = | 270 static base::LazyInstance<RoutingIDViewMap>::DestructorAtExit |
| 270 LAZY_INSTANCE_INITIALIZER; | 271 g_routing_id_view_map = LAZY_INSTANCE_INITIALIZER; |
| 271 | 272 |
| 272 // Time, in seconds, we delay before sending content state changes (such as form | 273 // Time, in seconds, we delay before sending content state changes (such as form |
| 273 // state and scroll position) to the browser. We delay sending changes to avoid | 274 // state and scroll position) to the browser. We delay sending changes to avoid |
| 274 // spamming the browser. | 275 // spamming the browser. |
| 275 // To avoid having tab/session restore require sending a message to get the | 276 // To avoid having tab/session restore require sending a message to get the |
| 276 // current content state during tab closing we use a shorter timeout for the | 277 // current content state during tab closing we use a shorter timeout for the |
| 277 // foreground renderer. This means there is a small window of time from which | 278 // foreground renderer. This means there is a small window of time from which |
| 278 // content state is modified and not sent to session restore, but this is | 279 // content state is modified and not sent to session restore, but this is |
| 279 // better than having to wake up all renderers during shutdown. | 280 // better than having to wake up all renderers during shutdown. |
| 280 const int kDelaySecondsForContentStateSyncHidden = 5; | 281 const int kDelaySecondsForContentStateSyncHidden = 5; |
| (...skipping 2437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2718 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | 2719 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); |
| 2719 } | 2720 } |
| 2720 | 2721 |
| 2721 std::unique_ptr<InputEventAck> ack( | 2722 std::unique_ptr<InputEventAck> ack( |
| 2722 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type(), | 2723 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type(), |
| 2723 INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); | 2724 INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); |
| 2724 OnInputEventAck(std::move(ack)); | 2725 OnInputEventAck(std::move(ack)); |
| 2725 } | 2726 } |
| 2726 | 2727 |
| 2727 } // namespace content | 2728 } // namespace content |
| OLD | NEW |