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

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

Issue 327323002: Start removing the double-negative !ASSERT_DISABLED (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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
« no previous file with comments | « Source/modules/webdatabase/Database.cpp ('k') | Source/modules/webdatabase/DatabaseManager.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2012 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 class DatabaseManager { 53 class DatabaseManager {
54 WTF_MAKE_NONCOPYABLE(DatabaseManager); WTF_MAKE_FAST_ALLOCATED; 54 WTF_MAKE_NONCOPYABLE(DatabaseManager); WTF_MAKE_FAST_ALLOCATED;
55 public: 55 public:
56 static DatabaseManager& manager(); 56 static DatabaseManager& manager();
57 57
58 // These 2 methods are for DatabaseContext (un)registration, and should only 58 // These 2 methods are for DatabaseContext (un)registration, and should only
59 // be called by the DatabaseContext constructor and destructor. 59 // be called by the DatabaseContext constructor and destructor.
60 void registerDatabaseContext(DatabaseContext*); 60 void registerDatabaseContext(DatabaseContext*);
61 void unregisterDatabaseContext(DatabaseContext*); 61 void unregisterDatabaseContext(DatabaseContext*);
62 62
63 #if !ASSERT_DISABLED 63 #if ASSERT_ENABLED
64 void didConstructDatabaseContext(); 64 void didConstructDatabaseContext();
65 void didDestructDatabaseContext(); 65 void didDestructDatabaseContext();
66 #else 66 #else
67 void didConstructDatabaseContext() { } 67 void didConstructDatabaseContext() { }
68 void didDestructDatabaseContext() { } 68 void didDestructDatabaseContext() { }
69 #endif 69 #endif
70 70
71 static void throwExceptionForDatabaseError(DatabaseError, const String& erro rMessage, ExceptionState&); 71 static void throwExceptionForDatabaseError(DatabaseError, const String& erro rMessage, ExceptionState&);
72 72
73 PassRefPtrWillBeRawPtr<Database> openDatabase(ExecutionContext*, const Strin g& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize, PassOwnPtr<DatabaseCallback>, DatabaseError&, String& errorMessa ge); 73 PassRefPtrWillBeRawPtr<Database> openDatabase(ExecutionContext*, const Strin g& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize, PassOwnPtr<DatabaseCallback>, DatabaseError&, String& errorMessa ge);
(...skipping 25 matching lines...) Expand all
99 AbstractDatabaseServer* m_server; 99 AbstractDatabaseServer* m_server;
100 100
101 // Access to the following fields require locking m_contextMapLock: 101 // Access to the following fields require locking m_contextMapLock:
102 #if ENABLE(OILPAN) 102 #if ENABLE(OILPAN)
103 // We can't use PersistentHeapHashMap because multiple threads update the ma p. 103 // We can't use PersistentHeapHashMap because multiple threads update the ma p.
104 typedef HashMap<ExecutionContext*, OwnPtr<Persistent<DatabaseContext> > > Co ntextMap; 104 typedef HashMap<ExecutionContext*, OwnPtr<Persistent<DatabaseContext> > > Co ntextMap;
105 #else 105 #else
106 typedef HashMap<ExecutionContext*, RefPtr<DatabaseContext> > ContextMap; 106 typedef HashMap<ExecutionContext*, RefPtr<DatabaseContext> > ContextMap;
107 #endif 107 #endif
108 ContextMap m_contextMap; 108 ContextMap m_contextMap;
109 #if !ASSERT_DISABLED 109 #if ASSERT_ENABLED
110 int m_databaseContextRegisteredCount; 110 int m_databaseContextRegisteredCount;
111 int m_databaseContextInstanceCount; 111 int m_databaseContextInstanceCount;
112 #endif 112 #endif
113 Mutex m_contextMapLock; 113 Mutex m_contextMapLock;
114 }; 114 };
115 115
116 } // namespace WebCore 116 } // namespace WebCore
117 117
118 #endif // DatabaseManager_h 118 #endif // DatabaseManager_h
OLDNEW
« no previous file with comments | « Source/modules/webdatabase/Database.cpp ('k') | Source/modules/webdatabase/DatabaseManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698