OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/child/web_database_observer_impl.h" | 5 #include "content/child/web_database_observer_impl.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
9 #include "content/common/database_messages.h" | 9 #include "content/common/database_messages.h" |
10 #include "third_party/WebKit/public/platform/WebCString.h" | 10 #include "third_party/WebKit/public/platform/WebCString.h" |
11 #include "third_party/WebKit/public/platform/WebString.h" | 11 #include "third_party/WebKit/public/platform/WebString.h" |
12 #include "third_party/WebKit/public/web/WebDatabase.h" | 12 #include "third_party/WebKit/public/web/WebDatabase.h" |
13 #include "third_party/sqlite/sqlite3.h" | 13 #include "third_party/sqlite/sqlite3.h" |
14 | 14 |
15 using WebKit::WebDatabase; | 15 using blink::WebDatabase; |
16 using WebKit::WebString; | 16 using blink::WebString; |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 namespace { | 19 namespace { |
20 | 20 |
21 const int kResultHistogramSize = 50; | 21 const int kResultHistogramSize = 50; |
22 const int kCallsiteHistogramSize = 10; | 22 const int kCallsiteHistogramSize = 10; |
23 | 23 |
24 int DetermineHistogramResult(int websql_error, int sqlite_error) { | 24 int DetermineHistogramResult(int websql_error, int sqlite_error) { |
25 // If we have a sqlite error, log it after trimming the extended bits. | 25 // If we have a sqlite error, log it after trimming the extended bits. |
26 // There are 26 possible values, but we leave room for some new ones. | 26 // There are 26 possible values, but we leave room for some new ones. |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 // high frequency (per-sqlstatement). | 172 // high frequency (per-sqlstatement). |
173 if (error == SQLITE_CORRUPT || error == SQLITE_NOTADB) { | 173 if (error == SQLITE_CORRUPT || error == SQLITE_NOTADB) { |
174 sender_->Send(new DatabaseHostMsg_HandleSqliteError( | 174 sender_->Send(new DatabaseHostMsg_HandleSqliteError( |
175 database.securityOrigin().databaseIdentifier().utf8(), | 175 database.securityOrigin().databaseIdentifier().utf8(), |
176 database.name(), | 176 database.name(), |
177 error)); | 177 error)); |
178 } | 178 } |
179 } | 179 } |
180 | 180 |
181 } // namespace content | 181 } // namespace content |
OLD | NEW |