OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 { | 266 { |
267 if (isMainThread()) { | 267 if (isMainThread()) { |
268 if (WebBlobRegistry* registry = blobRegistry()) | 268 if (WebBlobRegistry* registry = blobRegistry()) |
269 registry->finalizeStream(url); | 269 registry->finalizeStream(url); |
270 } else { | 270 } else { |
271 OwnPtr<BlobRegistryContext> context = adoptPtr(new BlobRegistryContext(u
rl)); | 271 OwnPtr<BlobRegistryContext> context = adoptPtr(new BlobRegistryContext(u
rl)); |
272 callOnMainThread(&finalizeStreamTask, context.leakPtr()); | 272 callOnMainThread(&finalizeStreamTask, context.leakPtr()); |
273 } | 273 } |
274 } | 274 } |
275 | 275 |
| 276 static void abortStreamTask(void* context) |
| 277 { |
| 278 OwnPtr<BlobRegistryContext> blobRegistryContext = adoptPtr(static_cast<BlobR
egistryContext*>(context)); |
| 279 if (WebBlobRegistry* registry = blobRegistry()) |
| 280 registry->abortStream(blobRegistryContext->url); |
| 281 } |
| 282 |
| 283 void BlobRegistry::abortStream(const KURL& url) |
| 284 { |
| 285 if (isMainThread()) { |
| 286 if (WebBlobRegistry* registry = blobRegistry()) |
| 287 registry->abortStream(url); |
| 288 } else { |
| 289 OwnPtr<BlobRegistryContext> context = adoptPtr(new BlobRegistryContext(u
rl)); |
| 290 callOnMainThread(&abortStreamTask, context.leakPtr()); |
| 291 } |
| 292 } |
| 293 |
276 static void unregisterStreamURLTask(void* context) | 294 static void unregisterStreamURLTask(void* context) |
277 { | 295 { |
278 OwnPtr<BlobRegistryContext> blobRegistryContext = adoptPtr(static_cast<BlobR
egistryContext*>(context)); | 296 OwnPtr<BlobRegistryContext> blobRegistryContext = adoptPtr(static_cast<BlobR
egistryContext*>(context)); |
279 if (WebBlobRegistry* registry = blobRegistry()) | 297 if (WebBlobRegistry* registry = blobRegistry()) |
280 registry->unregisterStreamURL(blobRegistryContext->url); | 298 registry->unregisterStreamURL(blobRegistryContext->url); |
281 } | 299 } |
282 | 300 |
283 void BlobRegistry::unregisterStreamURL(const KURL& url) | 301 void BlobRegistry::unregisterStreamURL(const KURL& url) |
284 { | 302 { |
285 removeFromOriginMap(url); | 303 removeFromOriginMap(url); |
(...skipping 13 matching lines...) Expand all Loading... |
299 } | 317 } |
300 | 318 |
301 SecurityOrigin* BlobOriginCache::cachedOrigin(const KURL& url) | 319 SecurityOrigin* BlobOriginCache::cachedOrigin(const KURL& url) |
302 { | 320 { |
303 if (url.protocolIs("blob")) | 321 if (url.protocolIs("blob")) |
304 return originMap()->get(url.string()); | 322 return originMap()->get(url.string()); |
305 return 0; | 323 return 0; |
306 } | 324 } |
307 | 325 |
308 } // namespace WebCore | 326 } // namespace WebCore |
OLD | NEW |