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

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

Issue 596083005: DatabaseBackend should not post a task to an already terminated database thread (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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/DatabaseContext.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) 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 virtual ~DatabaseContext(); 53 virtual ~DatabaseContext();
54 void trace(Visitor*); 54 void trace(Visitor*);
55 55
56 // For life-cycle management (inherited from ActiveDOMObject): 56 // For life-cycle management (inherited from ActiveDOMObject):
57 virtual void contextDestroyed() OVERRIDE; 57 virtual void contextDestroyed() OVERRIDE;
58 virtual void stop() OVERRIDE; 58 virtual void stop() OVERRIDE;
59 59
60 DatabaseContext* backend(); 60 DatabaseContext* backend();
61 DatabaseThread* databaseThread(); 61 DatabaseThread* databaseThread();
62 bool databaseThreadAvailable();
62 63
63 void setHasOpenDatabases() { m_hasOpenDatabases = true; } 64 void setHasOpenDatabases() { m_hasOpenDatabases = true; }
64 // Blocks the caller thread until cleanup tasks are completed. 65 // Blocks the caller thread until cleanup tasks are completed.
65 void stopDatabases(); 66 void stopDatabases();
66 67
67 bool allowDatabaseAccess() const; 68 bool allowDatabaseAccess() const;
68 69
69 SecurityOrigin* securityOrigin() const; 70 SecurityOrigin* securityOrigin() const;
70 bool isContextThread() const; 71 bool isContextThread() const;
71 72
72 private: 73 private:
73 explicit DatabaseContext(ExecutionContext*); 74 explicit DatabaseContext(ExecutionContext*);
74 75
75 RefPtrWillBeMember<DatabaseThread> m_databaseThread; 76 RefPtrWillBeMember<DatabaseThread> m_databaseThread;
76 bool m_hasOpenDatabases; // This never changes back to false, even after the database thread is closed. 77 bool m_hasOpenDatabases; // This never changes back to false, even after the database thread is closed.
77 bool m_hasRequestedTermination; 78 bool m_hasRequestedTermination;
78 }; 79 };
79 80
80 } // namespace blink 81 } // namespace blink
81 82
82 #endif // DatabaseContext_h 83 #endif // DatabaseContext_h
OLDNEW
« no previous file with comments | « Source/modules/webdatabase/Database.cpp ('k') | Source/modules/webdatabase/DatabaseContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698