OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 26 matching lines...) Expand all Loading... |
37 #include "platform/heap/Handle.h" | 37 #include "platform/heap/Handle.h" |
38 #include "wtf/Forward.h" | 38 #include "wtf/Forward.h" |
39 | 39 |
40 namespace blink { | 40 namespace blink { |
41 | 41 |
42 class Database; | 42 class Database; |
43 class ExecutionContext; | 43 class ExecutionContext; |
44 class InspectorDatabaseAgent; | 44 class InspectorDatabaseAgent; |
45 class Page; | 45 class Page; |
46 | 46 |
47 class MODULES_EXPORT DatabaseClient : public Supplement<Page> { | 47 class MODULES_EXPORT DatabaseClient : public GarbageCollected<DatabaseClient>, |
| 48 public Supplement<Page> { |
| 49 USING_GARBAGE_COLLECTED_MIXIN(DatabaseClient); |
48 WTF_MAKE_NONCOPYABLE(DatabaseClient); | 50 WTF_MAKE_NONCOPYABLE(DatabaseClient); |
49 | 51 |
50 public: | 52 public: |
51 DatabaseClient(); | 53 DatabaseClient(); |
52 virtual ~DatabaseClient() {} | |
53 | 54 |
54 DECLARE_VIRTUAL_TRACE(); | 55 DECLARE_VIRTUAL_TRACE(); |
55 | 56 |
56 virtual bool allowDatabase(ExecutionContext*, | 57 bool allowDatabase(ExecutionContext*, |
57 const String& name, | 58 const String& name, |
58 const String& displayName, | 59 const String& displayName, |
59 unsigned estimatedSize) = 0; | 60 unsigned estimatedSize); |
60 | 61 |
61 void didOpenDatabase(Database*, | 62 void didOpenDatabase(Database*, |
62 const String& domain, | 63 const String& domain, |
63 const String& name, | 64 const String& name, |
64 const String& version); | 65 const String& version); |
65 | 66 |
66 static DatabaseClient* fromPage(Page*); | 67 static DatabaseClient* fromPage(Page*); |
67 static DatabaseClient* from(ExecutionContext*); | 68 static DatabaseClient* from(ExecutionContext*); |
68 static const char* supplementName(); | 69 static const char* supplementName(); |
69 | 70 |
70 void setInspectorAgent(InspectorDatabaseAgent*); | 71 void setInspectorAgent(InspectorDatabaseAgent*); |
71 | 72 |
72 private: | 73 private: |
73 Member<InspectorDatabaseAgent> m_inspectorAgent; | 74 Member<InspectorDatabaseAgent> m_inspectorAgent; |
74 }; | 75 }; |
75 | 76 |
76 MODULES_EXPORT void provideDatabaseClientTo(Page&, DatabaseClient*); | 77 MODULES_EXPORT void provideDatabaseClientTo(Page&, DatabaseClient*); |
77 | 78 |
78 } // namespace blink | 79 } // namespace blink |
79 | 80 |
80 #endif // DatabaseClient_h | 81 #endif // DatabaseClient_h |
OLD | NEW |