| 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 #ifndef CONTENT_CHILD_WEB_DATABASE_OBSERVER_IMPL_H_ | 5 #ifndef CONTENT_CHILD_WEB_DATABASE_OBSERVER_IMPL_H_ |
| 6 #define CONTENT_CHILD_WEB_DATABASE_OBSERVER_IMPL_H_ | 6 #define CONTENT_CHILD_WEB_DATABASE_OBSERVER_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "ipc/ipc_sync_message_filter.h" | 10 #include "ipc/ipc_sync_message_filter.h" |
| 11 #include "storage/common/database/database_connections.h" | 11 #include "storage/common/database/database_connections.h" |
| 12 #include "third_party/WebKit/public/platform/WebDatabaseObserver.h" | 12 #include "third_party/WebKit/public/platform/WebDatabaseObserver.h" |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 class SingleThreadTaskRunner; | 15 class SingleThreadTaskRunner; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace content { | 18 namespace content { |
| 19 | 19 |
| 20 class WebDatabaseObserverImpl : public blink::WebDatabaseObserver { | 20 class WebDatabaseObserverImpl : public blink::WebDatabaseObserver { |
| 21 public: | 21 public: |
| 22 explicit WebDatabaseObserverImpl(IPC::SyncMessageFilter* sender); | 22 explicit WebDatabaseObserverImpl(IPC::SyncMessageFilter* sender); |
| 23 virtual ~WebDatabaseObserverImpl(); | 23 virtual ~WebDatabaseObserverImpl(); |
| 24 | 24 |
| 25 void databaseOpened(const blink::WebString& origin_identifier, | 25 void databaseOpened(const blink::WebSecurityOrigin& origin, |
| 26 const blink::WebString& database_name, | 26 const blink::WebString& database_name, |
| 27 const blink::WebString& database_display_name, | 27 const blink::WebString& database_display_name, |
| 28 unsigned long estimated_size) override; | 28 unsigned long estimated_size) override; |
| 29 void databaseModified(const blink::WebString& origin_identifier, | 29 void databaseModified(const blink::WebSecurityOrigin& origin, |
| 30 const blink::WebString& database_name) override; | 30 const blink::WebString& database_name) override; |
| 31 void databaseClosed(const blink::WebString& origin_identifier, | 31 void databaseClosed(const blink::WebSecurityOrigin& origin, |
| 32 const blink::WebString& database_name) override; | 32 const blink::WebString& database_name) override; |
| 33 void reportOpenDatabaseResult(const blink::WebString& origin_identifier, | 33 void reportOpenDatabaseResult(const blink::WebSecurityOrigin& origin, |
| 34 const blink::WebString& database_name, | 34 const blink::WebString& database_name, |
| 35 int callsite, | 35 int callsite, |
| 36 int websql_error, | 36 int websql_error, |
| 37 int sqlite_error, | 37 int sqlite_error, |
| 38 double call_time) override; | 38 double call_time) override; |
| 39 void reportChangeVersionResult(const blink::WebString& origin_identifier, | 39 void reportChangeVersionResult(const blink::WebSecurityOrigin& origin, |
| 40 const blink::WebString& database_name, | 40 const blink::WebString& database_name, |
| 41 int callsite, | 41 int callsite, |
| 42 int websql_error, | 42 int websql_error, |
| 43 int sqlite_error) override; | 43 int sqlite_error) override; |
| 44 void reportStartTransactionResult(const blink::WebString& origin_identifier, | 44 void reportStartTransactionResult(const blink::WebSecurityOrigin& origin, |
| 45 const blink::WebString& database_name, | 45 const blink::WebString& database_name, |
| 46 int callsite, | 46 int callsite, |
| 47 int websql_error, | 47 int websql_error, |
| 48 int sqlite_error) override; | 48 int sqlite_error) override; |
| 49 void reportCommitTransactionResult(const blink::WebString& origin_identifier, | 49 void reportCommitTransactionResult(const blink::WebSecurityOrigin& origin, |
| 50 const blink::WebString& database_name, | 50 const blink::WebString& database_name, |
| 51 int callsite, | 51 int callsite, |
| 52 int websql_error, | 52 int websql_error, |
| 53 int sqlite_error) override; | 53 int sqlite_error) override; |
| 54 void reportExecuteStatementResult(const blink::WebString& origin_identifier, | 54 void reportExecuteStatementResult(const blink::WebSecurityOrigin& origin, |
| 55 const blink::WebString& database_name, | 55 const blink::WebString& database_name, |
| 56 int callsite, | 56 int callsite, |
| 57 int websql_error, | 57 int websql_error, |
| 58 int sqlite_error) override; | 58 int sqlite_error) override; |
| 59 void reportVacuumDatabaseResult(const blink::WebString& origin_identifier, | 59 void reportVacuumDatabaseResult(const blink::WebSecurityOrigin& origin, |
| 60 const blink::WebString& database_name, | 60 const blink::WebString& database_name, |
| 61 int sqlite_error) override; | 61 int sqlite_error) override; |
| 62 | 62 |
| 63 bool WaitForAllDatabasesToClose(base::TimeDelta timeout); | 63 bool WaitForAllDatabasesToClose(base::TimeDelta timeout); |
| 64 | 64 |
| 65 private: | 65 private: |
| 66 void HandleSqliteError(const blink::WebString& origin_identifier, | 66 void HandleSqliteError(const blink::WebSecurityOrigin& origin, |
| 67 const blink::WebString& database_name, | 67 const blink::WebString& database_name, |
| 68 int error); | 68 int error); |
| 69 | 69 |
| 70 scoped_refptr<IPC::SyncMessageFilter> sender_; | 70 scoped_refptr<IPC::SyncMessageFilter> sender_; |
| 71 scoped_refptr<storage::DatabaseConnectionsWrapper> open_connections_; | 71 scoped_refptr<storage::DatabaseConnectionsWrapper> open_connections_; |
| 72 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; | 72 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; |
| 73 | 73 |
| 74 DISALLOW_COPY_AND_ASSIGN(WebDatabaseObserverImpl); | 74 DISALLOW_COPY_AND_ASSIGN(WebDatabaseObserverImpl); |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 } // namespace content | 77 } // namespace content |
| 78 | 78 |
| 79 #endif // CONTENT_CHILD_WEB_DATABASE_OBSERVER_IMPL_H_ | 79 #endif // CONTENT_CHILD_WEB_DATABASE_OBSERVER_IMPL_H_ |
| OLD | NEW |