Roll src/third_party/WebKit f298044:aa8346d (svn 202628:202629)
[chromium-blink-merge.git] / chrome / browser / prerender / prerender_final_status.cc
blob3c7e8f9e0a47597c77dda38c467aeb9a05b014fe
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
3 // found in the LICENSE file.
5 #include "chrome/browser/prerender/prerender_final_status.h"
7 #include "chrome/browser/prerender/prerender_manager.h"
9 namespace prerender {
11 namespace {
13 const char* kFinalStatusNames[] = {
14 "Used",
15 "Timed Out",
16 "Evicted",
17 "Manager Shutdown",
18 "Closed",
19 "Create New Window",
20 "Profile Destroyed",
21 "App Terminating",
22 "Javascript Alert",
23 "Auth Needed",
24 "HTTPS",
25 "Download",
26 "Memory Limit Exceeded",
27 "JS Out Of Memory",
28 "Renderer Unresponsive",
29 "Too many processes",
30 "Rate Limit Exceeded",
31 "Pending Skipped",
32 "Control Group",
33 "HTML5 Media",
34 "Source Render View Closed",
35 "Renderer Crashed",
36 "Unsupported Scheme",
37 "Invalid HTTP Method",
38 "window.print",
39 "Recently Visited",
40 "window.opener",
41 "Page ID Conflict",
42 "Safe Browsing",
43 "Fragment Mismatch",
44 "SSL Client Certificate Requested",
45 "Cache or History Cleared",
46 "Cancelled",
47 "SSL Error",
48 "Cross-Site Navigation Pending",
49 "DevTools Attached To The Tab",
50 "Session Storage Namespace Mismatch",
51 "No Use Group",
52 "Match Complete Dummy",
53 "Duplicate",
54 "OpenURL",
55 "WouldHaveBeenUsed",
56 "Register Protocol Handler",
57 "Creating Audio Stream",
58 "Page Being Captured",
59 "Bad Deferred Redirect",
60 "Navigation Uncommitted",
61 "New Navigation Entry",
62 "Cookie Store Not Loaded",
63 "Cookie Conflict",
64 "Non-Empty Browsing Instance",
65 "Navigation Intercepted",
66 "Max",
68 static_assert(arraysize(kFinalStatusNames) == FINAL_STATUS_MAX + 1,
69 "status name count mismatch");
71 } // namespace
73 const char* NameFromFinalStatus(FinalStatus final_status) {
74 DCHECK_LT(static_cast<unsigned int>(final_status),
75 arraysize(kFinalStatusNames));
76 return kFinalStatusNames[final_status];
79 } // namespace prerender