Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 2737163002: content: Use leaky LazyInstance for maps in render_view_impl.cc (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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>::DestructorAtExit g_view_map = 267 static base::LazyInstance<ViewMap>::Leaky g_view_map =
268 LAZY_INSTANCE_INITIALIZER; 268 LAZY_INSTANCE_INITIALIZER;
269 typedef std::map<int32_t, RenderViewImpl*> RoutingIDViewMap; 269 typedef std::map<int32_t, RenderViewImpl*> RoutingIDViewMap;
270 static base::LazyInstance<RoutingIDViewMap>::DestructorAtExit 270 static base::LazyInstance<RoutingIDViewMap>::Leaky g_routing_id_view_map =
271 g_routing_id_view_map = LAZY_INSTANCE_INITIALIZER; 271 LAZY_INSTANCE_INITIALIZER;
272 272
273 // 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
274 // 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
275 // spamming the browser. 275 // spamming the browser.
276 // 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
277 // 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
278 // 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
279 // 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
280 // better than having to wake up all renderers during shutdown. 280 // better than having to wake up all renderers during shutdown.
281 const int kDelaySecondsForContentStateSyncHidden = 5; 281 const int kDelaySecondsForContentStateSyncHidden = 5;
(...skipping 2437 matching lines...) Expand 10 before | Expand all | Expand 10 after
2719 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); 2719 INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
2720 } 2720 }
2721 2721
2722 std::unique_ptr<InputEventAck> ack( 2722 std::unique_ptr<InputEventAck> ack(
2723 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type(), 2723 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type(),
2724 INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); 2724 INPUT_EVENT_ACK_STATE_NOT_CONSUMED));
2725 OnInputEventAck(std::move(ack)); 2725 OnInputEventAck(std::move(ack));
2726 } 2726 }
2727 2727
2728 } // namespace content 2728 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698