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 "chrome/browser/prerender/prerender_link_manager.h" | 5 #include "chrome/browser/prerender/prerender_link_manager.h" |
6 | 6 |
7 #include <functional> | 7 #include <functional> |
8 #include <limits> | 8 #include <limits> |
9 #include <memory> | 9 #include <memory> |
10 #include <set> | 10 #include <set> |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 enum RelTypeHistogramEnum { | 67 enum RelTypeHistogramEnum { |
68 RelTypeHistogramEnumNone = 0, | 68 RelTypeHistogramEnumNone = 0, |
69 RelTypeHistogramEnumPrerender = PrerenderRelTypePrerender, | 69 RelTypeHistogramEnumPrerender = PrerenderRelTypePrerender, |
70 RelTypeHistogramEnumNext = PrerenderRelTypeNext, | 70 RelTypeHistogramEnumNext = PrerenderRelTypeNext, |
71 RelTypeHistogramEnumPrerenderAndNext = | 71 RelTypeHistogramEnumPrerenderAndNext = |
72 PrerenderRelTypePrerender | PrerenderRelTypeNext, | 72 PrerenderRelTypePrerender | PrerenderRelTypeNext, |
73 RelTypeHistogramEnumMax, | 73 RelTypeHistogramEnumMax, |
74 }; | 74 }; |
75 | 75 |
76 void RecordLinkManagerAdded(const uint32_t rel_types) { | 76 void RecordLinkManagerAdded(const uint32_t rel_types) { |
77 const uint32_t enum_value = rel_types & (RelTypeHistogramEnumMax - 1); | 77 const RelTypeHistogramEnum enum_value = static_cast<RelTypeHistogramEnum>( |
| 78 rel_types & (RelTypeHistogramEnumMax - 1)); |
78 UMA_HISTOGRAM_ENUMERATION("Prerender.RelTypesLinkAdded", enum_value, | 79 UMA_HISTOGRAM_ENUMERATION("Prerender.RelTypesLinkAdded", enum_value, |
79 RelTypeHistogramEnumMax); | 80 RelTypeHistogramEnumMax); |
80 } | 81 } |
81 | 82 |
82 void RecordLinkManagerStarting(const uint32_t rel_types) { | 83 void RecordLinkManagerStarting(const uint32_t rel_types) { |
83 const uint32_t enum_value = rel_types & (RelTypeHistogramEnumMax - 1); | 84 const RelTypeHistogramEnum enum_value = static_cast<RelTypeHistogramEnum>( |
| 85 rel_types & (RelTypeHistogramEnumMax - 1)); |
84 UMA_HISTOGRAM_ENUMERATION("Prerender.RelTypesLinkStarted", enum_value, | 86 UMA_HISTOGRAM_ENUMERATION("Prerender.RelTypesLinkStarted", enum_value, |
85 RelTypeHistogramEnumMax); | 87 RelTypeHistogramEnumMax); |
86 } | 88 } |
87 | 89 |
88 void Send(int child_id, IPC::Message* raw_message) { | 90 void Send(int child_id, IPC::Message* raw_message) { |
89 using content::RenderProcessHost; | 91 using content::RenderProcessHost; |
90 std::unique_ptr<IPC::Message> own_message(raw_message); | 92 std::unique_ptr<IPC::Message> own_message(raw_message); |
91 | 93 |
92 RenderProcessHost* render_process_host = RenderProcessHost::FromID(child_id); | 94 RenderProcessHost* render_process_host = RenderProcessHost::FromID(child_id); |
93 if (!render_process_host) | 95 if (!render_process_host) |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 Send(prerender->launcher_child_id, | 532 Send(prerender->launcher_child_id, |
531 new PrerenderMsg_OnPrerenderStop(prerender->prerender_id)); | 533 new PrerenderMsg_OnPrerenderStop(prerender->prerender_id)); |
532 RemovePrerender(prerender); | 534 RemovePrerender(prerender); |
533 StartPrerenders(); | 535 StartPrerenders(); |
534 } | 536 } |
535 | 537 |
536 void PrerenderLinkManager::OnPrerenderNetworkBytesChanged( | 538 void PrerenderLinkManager::OnPrerenderNetworkBytesChanged( |
537 PrerenderHandle* prerender_handle) {} | 539 PrerenderHandle* prerender_handle) {} |
538 | 540 |
539 } // namespace prerender | 541 } // namespace prerender |
OLD | NEW |