Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / prerender / prerender_events.cc
blob5e8389d0df75305798e402d3824c3d541c309bb1
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/prerender/prerender_events.h"
7 #include "base/basictypes.h"
8 #include "base/logging.h"
10 namespace prerender {
12 namespace {
14 const char* kEventNames[] = {
15 "swapin no delegate",
16 "swapin candidate",
17 "swapin candidate namespace matches",
18 "swapin no merge pending",
19 "swapin merging disabled",
20 "swapin issuing merge",
21 "swapin merge for swapin candidate",
22 "merge result no pending swapin",
23 "merge result timeout cb",
24 "merge result result cb",
25 "merge result timed out",
26 "merge result merge done",
27 "merge result result namespace not found",
28 "merge result result namespace not alias",
29 "merge result result not logging",
30 "merge result result no transactions",
31 "merge result result too many transactions",
32 "merge result result not mergeable",
33 "merge result result mergeable",
34 "merge result merge failed",
35 "merge result swapping in",
36 "merge result swapin successful",
37 "merge result swapin failed",
38 "Max",
41 COMPILE_ASSERT(arraysize(kEventNames) == PRERENDER_EVENT_MAX + 1,
42 PrerenderEvent_name_count_mismatch);
44 } // namespace
46 const char* NameFromPrerenderEvent(PrerenderEvent event) {
47 DCHECK(static_cast<int>(event) >= 0 &&
48 event <= PRERENDER_EVENT_MAX);
49 return kEventNames[event];
52 } // namespace prerender