OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
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 19 matching lines...) Expand all Loading... |
30 #include "DOMURL.h" | 30 #include "DOMURL.h" |
31 | 31 |
32 #include "KURL.h" | 32 #include "KURL.h" |
33 #include "ScriptExecutionContext.h" | 33 #include "ScriptExecutionContext.h" |
34 | 34 |
35 namespace WebCore { | 35 namespace WebCore { |
36 | 36 |
37 DOMURL::DOMURL(ScriptExecutionContext* scriptExecutionContext) | 37 DOMURL::DOMURL(ScriptExecutionContext* scriptExecutionContext) |
38 : m_scriptExecutionContext(scriptExecutionContext) | 38 : m_scriptExecutionContext(scriptExecutionContext) |
39 { | 39 { |
| 40 m_scriptExecutionContext->createdDomUrl(this); |
| 41 } |
| 42 |
| 43 DOMURL::~DOMURL() |
| 44 { |
| 45 if (m_scriptExecutionContext) |
| 46 m_scriptExecutionContext->destroyedDomUrl(this); |
| 47 } |
| 48 |
| 49 void DOMURL::contextDestroyed() |
| 50 { |
| 51 ASSERT(m_scriptExecutionContext); |
| 52 m_scriptExecutionContext = 0; |
40 } | 53 } |
41 | 54 |
42 String DOMURL::createObjectURL(Blob* blob) | 55 String DOMURL::createObjectURL(Blob* blob) |
43 { | 56 { |
44 if (!m_scriptExecutionContext) | 57 if (!m_scriptExecutionContext) |
45 return String(); | 58 return String(); |
46 return m_scriptExecutionContext->createPublicBlobURL(blob).string(); | 59 return m_scriptExecutionContext->createPublicBlobURL(blob).string(); |
47 } | 60 } |
48 | 61 |
49 void DOMURL::revokeObjectURL(const String& urlString) | 62 void DOMURL::revokeObjectURL(const String& urlString) |
50 { | 63 { |
51 if (!m_scriptExecutionContext) | 64 if (!m_scriptExecutionContext) |
52 return; | 65 return; |
53 m_scriptExecutionContext->revokePublicBlobURL(KURL(KURL(), urlString)); | 66 m_scriptExecutionContext->revokePublicBlobURL(KURL(KURL(), urlString)); |
54 } | 67 } |
55 | 68 |
56 } // namespace WebCore | 69 } // namespace WebCore |
57 | 70 |
58 #endif // ENABLE(BLOB) | 71 #endif // ENABLE(BLOB) |
OLD | NEW |