| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CONTENT_COMMON_WEB_DATABASE_OBSERVER_IMPL_H_ | 5 #ifndef CONTENT_COMMON_WEB_DATABASE_OBSERVER_IMPL_H_ |
| 6 #define CONTENT_COMMON_WEB_DATABASE_OBSERVER_IMPL_H_ | 6 #define CONTENT_COMMON_WEB_DATABASE_OBSERVER_IMPL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "ipc/ipc_message.h" | 10 #include "ipc/ipc_message.h" |
| 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabaseObserver.h
" | 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabaseObserver.h
" |
| 12 #include "webkit/database/database_connections.h" | 12 #include "webkit/database/database_connections.h" |
| 13 | 13 |
| 14 class WebDatabaseObserverImpl : public WebKit::WebDatabaseObserver { | 14 class WebDatabaseObserverImpl : public WebKit::WebDatabaseObserver { |
| 15 public: | 15 public: |
| 16 explicit WebDatabaseObserverImpl(IPC::Message::Sender* sender); | 16 explicit WebDatabaseObserverImpl(IPC::Message::Sender* sender); |
| 17 virtual ~WebDatabaseObserverImpl(); | 17 virtual ~WebDatabaseObserverImpl(); |
| 18 | 18 |
| 19 virtual void databaseOpened(const WebKit::WebDatabase& database) OVERRIDE; | 19 virtual void databaseOpened(const WebKit::WebDatabase& database) OVERRIDE; |
| 20 virtual void databaseModified(const WebKit::WebDatabase& database) OVERRIDE; | 20 virtual void databaseModified(const WebKit::WebDatabase& database) OVERRIDE; |
| 21 virtual void databaseClosed(const WebKit::WebDatabase& database) OVERRIDE; | 21 virtual void databaseClosed(const WebKit::WebDatabase& database) OVERRIDE; |
| 22 | 22 |
| 23 virtual void reportOpenDatabaseResult( | 23 virtual void reportOpenDatabaseResult( |
| 24 const WebKit::WebDatabase& database, int callsite, | 24 const WebKit::WebDatabase& database, int callsite, |
| 25 int webSqlErrorCode, int sqliteErrorCode) OVERRIDE; | 25 int websql_error, int sqlite_error) OVERRIDE; |
| 26 virtual void reportChangeVersionResult( | 26 virtual void reportChangeVersionResult( |
| 27 const WebKit::WebDatabase& database, int callsite, | 27 const WebKit::WebDatabase& database, int callsite, |
| 28 int webSqlErrorCode, int sqliteErrorCode) OVERRIDE; | 28 int websql_error, int sqlite_error) OVERRIDE; |
| 29 virtual void reportStartTransactionResult( | 29 virtual void reportStartTransactionResult( |
| 30 const WebKit::WebDatabase& database, int callsite, | 30 const WebKit::WebDatabase& database, int callsite, |
| 31 int webSqlErrorCode, int sqliteErrorCode) OVERRIDE; | 31 int websql_error, int sqlite_error) OVERRIDE; |
| 32 virtual void reportCommitTransactionResult( | 32 virtual void reportCommitTransactionResult( |
| 33 const WebKit::WebDatabase& database, int callsite, | 33 const WebKit::WebDatabase& database, int callsite, |
| 34 int webSqlErrorCode, int sqliteErrorCode) OVERRIDE; | 34 int websql_error, int sqlite_error) OVERRIDE; |
| 35 virtual void reportExecuteStatementResult( | 35 virtual void reportExecuteStatementResult( |
| 36 const WebKit::WebDatabase& database, int callsite, | 36 const WebKit::WebDatabase& database, int callsite, |
| 37 int webSqlErrorCode, int sqliteErrorCode) OVERRIDE; | 37 int websql_error, int sqlite_error) OVERRIDE; |
| 38 virtual void reportVacuumDatabaseResult( | 38 virtual void reportVacuumDatabaseResult( |
| 39 const WebKit::WebDatabase& database, int sqliteErrorCode) OVERRIDE; | 39 const WebKit::WebDatabase& database, int sqlite_error) OVERRIDE; |
| 40 | 40 |
| 41 void WaitForAllDatabasesToClose(); | 41 void WaitForAllDatabasesToClose(); |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 void HandleSqliteError(const WebKit::WebDatabase& database, int error); |
| 45 |
| 44 IPC::Message::Sender* sender_; | 46 IPC::Message::Sender* sender_; |
| 45 scoped_refptr<webkit_database::DatabaseConnectionsWrapper> open_connections_; | 47 scoped_refptr<webkit_database::DatabaseConnectionsWrapper> open_connections_; |
| 46 }; | 48 }; |
| 47 | 49 |
| 48 #endif // CONTENT_COMMON_WEB_DATABASE_OBSERVER_IMPL_H_ | 50 #endif // CONTENT_COMMON_WEB_DATABASE_OBSERVER_IMPL_H_ |
| OLD | NEW |