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

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

Issue 925263004: Merge 190035 "DatabaseManager::terminateDatabaseThread should ha..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/2272/
Patch Set: Created 5 years, 10 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/DatabaseManager.h ('k') | no next file » | 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 { 50 {
51 ASSERT(isMainThread()); 51 ASSERT(isMainThread());
52 if (!s_databaseManager) 52 if (!s_databaseManager)
53 s_databaseManager = new DatabaseManager(); 53 s_databaseManager = new DatabaseManager();
54 return *s_databaseManager; 54 return *s_databaseManager;
55 } 55 }
56 56
57 void DatabaseManager::terminateDatabaseThread() 57 void DatabaseManager::terminateDatabaseThread()
58 { 58 {
59 ASSERT(isMainThread()); 59 ASSERT(isMainThread());
60 if (!s_databaseManager || s_databaseManager->m_contextMap.isEmpty()) 60 if (!s_databaseManager)
61 return; 61 return;
62 // We have at most one DatabaseContext, which is for the main thread. 62 for (const Member<DatabaseContext>& context : s_databaseManager->m_contextMa p.values())
63 ASSERT(s_databaseManager->m_contextMap.size() == 1); 63 context->stopDatabases();
64 (*s_databaseManager->m_contextMap.values().begin())->stopDatabases();
65 } 64 }
66 65
67 DatabaseManager::DatabaseManager() 66 DatabaseManager::DatabaseManager()
68 #if ENABLE(ASSERT) 67 #if ENABLE(ASSERT)
69 : m_databaseContextRegisteredCount(0) 68 : m_databaseContextRegisteredCount(0)
70 , m_databaseContextInstanceCount(0) 69 , m_databaseContextInstanceCount(0)
71 #endif 70 #endif
72 { 71 {
73 } 72 }
74 73
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 { 230 {
232 return DatabaseTracker::tracker().fullPathForDatabase(origin, name, createIf DoesNotExist); 231 return DatabaseTracker::tracker().fullPathForDatabase(origin, name, createIf DoesNotExist);
233 } 232 }
234 233
235 void DatabaseManager::logErrorMessage(ExecutionContext* context, const String& m essage) 234 void DatabaseManager::logErrorMessage(ExecutionContext* context, const String& m essage)
236 { 235 {
237 context->addConsoleMessage(ConsoleMessage::create(StorageMessageSource, Erro rMessageLevel, message)); 236 context->addConsoleMessage(ConsoleMessage::create(StorageMessageSource, Erro rMessageLevel, message));
238 } 237 }
239 238
240 } // namespace blink 239 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/webdatabase/DatabaseManager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698