| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Motorola Mobility Inc. | 2 * Copyright (C) 2012 Motorola Mobility Inc. |
| 3 * Copyright (C) 2013 Google Inc. All Rights Reserved. | 3 * Copyright (C) 2013 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 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "platform/blob/BlobURL.h" | 30 #include "platform/blob/BlobURL.h" |
| 31 #include "platform/weborigin/KURL.h" | 31 #include "platform/weborigin/KURL.h" |
| 32 #include "wtf/Vector.h" | 32 #include "wtf/Vector.h" |
| 33 #include "wtf/text/StringHash.h" | 33 #include "wtf/text/StringHash.h" |
| 34 | 34 |
| 35 namespace blink { | 35 namespace blink { |
| 36 | 36 |
| 37 class SecurityOrigin; | 37 class SecurityOrigin; |
| 38 | 38 |
| 39 PublicURLManager* PublicURLManager::create(ExecutionContext* context) { | 39 PublicURLManager* PublicURLManager::create(ExecutionContext* context) { |
| 40 PublicURLManager* publicURLManager = new PublicURLManager(context); | 40 return new PublicURLManager(context); |
| 41 publicURLManager->suspendIfNeeded(); | |
| 42 return publicURLManager; | |
| 43 } | 41 } |
| 44 | 42 |
| 45 PublicURLManager::PublicURLManager(ExecutionContext* context) | 43 PublicURLManager::PublicURLManager(ExecutionContext* context) |
| 46 : SuspendableObject(context), m_isStopped(false) {} | 44 : ContextLifecycleObserver(context), m_isStopped(false) {} |
| 47 | 45 |
| 48 String PublicURLManager::registerURL(ExecutionContext* context, | 46 String PublicURLManager::registerURL(ExecutionContext* context, |
| 49 URLRegistrable* registrable, | 47 URLRegistrable* registrable, |
| 50 const String& uuid) { | 48 const String& uuid) { |
| 51 SecurityOrigin* origin = context->getSecurityOrigin(); | 49 SecurityOrigin* origin = context->getSecurityOrigin(); |
| 52 const KURL& url = BlobURL::createPublicURL(origin); | 50 const KURL& url = BlobURL::createPublicURL(origin); |
| 53 DCHECK(!url.isEmpty()); | 51 DCHECK(!url.isEmpty()); |
| 54 const String& urlString = url.getString(); | 52 const String& urlString = url.getString(); |
| 55 | 53 |
| 56 if (!m_isStopped) { | 54 if (!m_isStopped) { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 m_isStopped = true; | 98 m_isStopped = true; |
| 101 for (auto& registryUrl : m_registryToURL) { | 99 for (auto& registryUrl : m_registryToURL) { |
| 102 for (auto& url : registryUrl.value) | 100 for (auto& url : registryUrl.value) |
| 103 registryUrl.key->unregisterURL(KURL(ParsedURLString, url.key)); | 101 registryUrl.key->unregisterURL(KURL(ParsedURLString, url.key)); |
| 104 } | 102 } |
| 105 | 103 |
| 106 m_registryToURL.clear(); | 104 m_registryToURL.clear(); |
| 107 } | 105 } |
| 108 | 106 |
| 109 DEFINE_TRACE(PublicURLManager) { | 107 DEFINE_TRACE(PublicURLManager) { |
| 110 SuspendableObject::trace(visitor); | 108 ContextLifecycleObserver::trace(visitor); |
| 111 } | 109 } |
| 112 | 110 |
| 113 } // namespace blink | 111 } // namespace blink |
| OLD | NEW |