Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: Source/modules/webdatabase/DatabaseSync.h

Issue 198793003: Oilpan: Prepare to move SQLTransactionBackendSync and SQLTransactionSync to Oilpan heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: DatabaseSync owns observers. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 class DatabaseSync FINAL : public DatabaseBackendSync, public DatabaseBase, publ ic ScriptWrappable { 55 class DatabaseSync FINAL : public DatabaseBackendSync, public DatabaseBase, publ ic ScriptWrappable {
56 public: 56 public:
57 virtual ~DatabaseSync(); 57 virtual ~DatabaseSync();
58 virtual void trace(Visitor*) OVERRIDE; 58 virtual void trace(Visitor*) OVERRIDE;
59 59
60 void changeVersion(const String& oldVersion, const String& newVersion, PassO wnPtr<SQLTransactionSyncCallback>, ExceptionState&); 60 void changeVersion(const String& oldVersion, const String& newVersion, PassO wnPtr<SQLTransactionSyncCallback>, ExceptionState&);
61 void transaction(PassOwnPtr<SQLTransactionSyncCallback>, ExceptionState&); 61 void transaction(PassOwnPtr<SQLTransactionSyncCallback>, ExceptionState&);
62 void readTransaction(PassOwnPtr<SQLTransactionSyncCallback>, ExceptionState& ); 62 void readTransaction(PassOwnPtr<SQLTransactionSyncCallback>, ExceptionState& );
63 63
64 virtual void closeImmediately() OVERRIDE; 64 virtual void closeImmediately() OVERRIDE;
65 void observeTransaction(SQLTransactionSync&);
65 66
66 const String& lastErrorMessage() const { return m_lastErrorMessage; } 67 const String& lastErrorMessage() const { return m_lastErrorMessage; }
67 void setLastErrorMessage(const String& message) { m_lastErrorMessage = messa ge; } 68 void setLastErrorMessage(const String& message) { m_lastErrorMessage = messa ge; }
68 void setLastErrorMessage(const char* message, int sqliteCode, const char* sq liteMessage) 69 void setLastErrorMessage(const char* message, int sqliteCode, const char* sq liteMessage)
69 { 70 {
70 setLastErrorMessage(String::format("%s (%d, %s)", message, sqliteCode, s qliteMessage)); 71 setLastErrorMessage(String::format("%s (%d, %s)", message, sqliteCode, s qliteMessage));
71 } 72 }
72 73
73 private: 74 private:
74 DatabaseSync(PassRefPtr<DatabaseContext>, const String& name, 75 DatabaseSync(PassRefPtr<DatabaseContext>, const String& name,
75 const String& expectedVersion, const String& displayName, unsigned long estimatedSize); 76 const String& expectedVersion, const String& displayName, unsigned long estimatedSize);
76 static PassRefPtrWillBeRawPtr<DatabaseSync> create(ExecutionContext*, PassRe fPtrWillBeRawPtr<DatabaseBackendBase>); 77 static PassRefPtrWillBeRawPtr<DatabaseSync> create(ExecutionContext*, PassRe fPtrWillBeRawPtr<DatabaseBackendBase>);
77 78
78 void runTransaction(PassOwnPtr<SQLTransactionSyncCallback>, bool readOnly, E xceptionState&); 79 void runTransaction(PassOwnPtr<SQLTransactionSyncCallback>, bool readOnly, E xceptionState&);
79 void rollbackTransaction(PassRefPtr<SQLTransactionSync>); 80 void rollbackTransaction(SQLTransactionSync&);
81 #if ENABLE(OILPAN)
82 class TransactionObserver {
83 public:
84 explicit TransactionObserver(SQLTransactionSync& transaction) : m_transa ction(transaction) { }
85 ~TransactionObserver();
86
87 private:
88 SQLTransactionSync& m_transaction;
89 };
90
91 GC_PLUGIN_IGNORE("http://crbug.com/353083")
92 PersistentHeapHashMap<WeakMember<SQLTransactionSync>, OwnPtr<TransactionObse rver> > m_observers;
haraken 2014/03/18 09:59:09 I'd like to have a comment about why this needs to
zerny-chromium 2014/03/18 10:09:09 I think the bug report provides sufficient documen
haraken 2014/03/18 11:31:33 I want to have a comment about the threading issue
tkent 2014/03/19 04:58:39 I'll add a comment.
93 #endif
80 94
81 String m_lastErrorMessage; 95 String m_lastErrorMessage;
82 96
83 friend class DatabaseManager; 97 friend class DatabaseManager;
84 friend class DatabaseServer; // FIXME: remove this when the backend has been split out. 98 friend class DatabaseServer; // FIXME: remove this when the backend has been split out.
85 }; 99 };
86 100
87 } // namespace WebCore 101 } // namespace WebCore
88 102
89 #endif 103 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/modules/webdatabase/DatabaseSync.cpp » ('j') | Source/modules/webdatabase/DatabaseSync.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698