OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * Copyright (C) 2011 Google, Inc. All Rights Reserved. | 3 * Copyright (C) 2011 Google, Inc. All Rights Reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 DatabaseContext* self = new DatabaseContext(context); | 93 DatabaseContext* self = new DatabaseContext(context); |
94 DatabaseManager::manager().registerDatabaseContext(self); | 94 DatabaseManager::manager().registerDatabaseContext(self); |
95 return self; | 95 return self; |
96 } | 96 } |
97 | 97 |
98 DatabaseContext::DatabaseContext(ExecutionContext* context) | 98 DatabaseContext::DatabaseContext(ExecutionContext* context) |
99 : ActiveDOMObject(context) | 99 : ActiveDOMObject(context) |
100 , m_hasOpenDatabases(false) | 100 , m_hasOpenDatabases(false) |
101 , m_hasRequestedTermination(false) | 101 , m_hasRequestedTermination(false) |
102 { | 102 { |
103 DCHECK(isMainThread()); | |
104 | |
105 // ActiveDOMObject expects this to be called to set internal flags. | 103 // ActiveDOMObject expects this to be called to set internal flags. |
106 suspendIfNeeded(); | 104 suspendIfNeeded(); |
107 | 105 |
108 // For debug accounting only. We must do this before we register the | 106 // For debug accounting only. We must do this before we register the |
109 // instance. The assertions assume this. | 107 // instance. The assertions assume this. |
110 DatabaseManager::manager().didConstructDatabaseContext(); | 108 DatabaseManager::manager().didConstructDatabaseContext(); |
111 } | 109 } |
112 | 110 |
113 DatabaseContext::~DatabaseContext() | 111 DatabaseContext::~DatabaseContext() |
114 { | 112 { |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 { | 197 { |
200 return getExecutionContext()->getSecurityOrigin(); | 198 return getExecutionContext()->getSecurityOrigin(); |
201 } | 199 } |
202 | 200 |
203 bool DatabaseContext::isContextThread() const | 201 bool DatabaseContext::isContextThread() const |
204 { | 202 { |
205 return getExecutionContext()->isContextThread(); | 203 return getExecutionContext()->isContextThread(); |
206 } | 204 } |
207 | 205 |
208 } // namespace blink | 206 } // namespace blink |
OLD | NEW |