[Android WebView] Fix webview perf bot switchover to use org.chromium.webview_shell...
[chromium-blink-merge.git] / content / child / web_database_observer_impl.h
blobc8e1f28de610cc53818e0ff62cb3787fcad5dc10
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_CHILD_WEB_DATABASE_OBSERVER_IMPL_H_
6 #define CONTENT_CHILD_WEB_DATABASE_OBSERVER_IMPL_H_
8 #include "base/memory/ref_counted.h"
9 #include "ipc/ipc_sync_message_filter.h"
10 #include "storage/common/database/database_connections.h"
11 #include "third_party/WebKit/public/platform/WebDatabaseObserver.h"
13 namespace content {
15 class WebDatabaseObserverImpl : public blink::WebDatabaseObserver {
16 public:
17 explicit WebDatabaseObserverImpl(IPC::SyncMessageFilter* sender);
18 virtual ~WebDatabaseObserverImpl();
20 virtual void databaseOpened(
21 const blink::WebString& origin_identifier,
22 const blink::WebString& database_name,
23 const blink::WebString& database_display_name,
24 unsigned long estimated_size);
25 virtual void databaseModified(
26 const blink::WebString& origin_identifier,
27 const blink::WebString& database_name);
28 virtual void databaseClosed(
29 const blink::WebString& origin_identifier,
30 const blink::WebString& database_name);
31 virtual void reportOpenDatabaseResult(
32 const blink::WebString& origin_identifier,
33 const blink::WebString& database_name,
34 int callsite, int websql_error, int sqlite_error);
35 virtual void reportOpenDatabaseResult(
36 const blink::WebString& origin_identifier,
37 const blink::WebString& database_name,
38 int callsite,
39 int websql_error,
40 int sqlite_error,
41 double call_time);
42 virtual void reportChangeVersionResult(
43 const blink::WebString& origin_identifier,
44 const blink::WebString& database_name,
45 int callsite, int websql_error, int sqlite_error);
46 virtual void reportStartTransactionResult(
47 const blink::WebString& origin_identifier,
48 const blink::WebString& database_name,
49 int callsite, int websql_error, int sqlite_error);
50 virtual void reportCommitTransactionResult(
51 const blink::WebString& origin_identifier,
52 const blink::WebString& database_name,
53 int callsite, int websql_error, int sqlite_error);
54 virtual void reportExecuteStatementResult(
55 const blink::WebString& origin_identifier,
56 const blink::WebString& database_name,
57 int callsite, int websql_error, int sqlite_error);
58 virtual void reportVacuumDatabaseResult(
59 const blink::WebString& origin_identifier,
60 const blink::WebString& database_name,
61 int sqlite_error);
63 void WaitForAllDatabasesToClose();
65 private:
66 void HandleSqliteError(const blink::WebString& origin_identifier,
67 const blink::WebString& database_name,
68 int error);
70 scoped_refptr<IPC::SyncMessageFilter> sender_;
71 scoped_refptr<storage::DatabaseConnectionsWrapper> open_connections_;
73 DISALLOW_COPY_AND_ASSIGN(WebDatabaseObserverImpl);
76 } // namespace content
78 #endif // CONTENT_CHILD_WEB_DATABASE_OBSERVER_IMPL_H_