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

Side by Side Diff: Source/core/fileapi/BlobRegistry.cpp

Issue 23490013: Add method to abort Stream construction to BlobRegistry (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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/core/fileapi/BlobRegistry.h ('k') | public/platform/WebBlobRegistry.h » ('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) 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
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
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
OLDNEW
« no previous file with comments | « Source/core/fileapi/BlobRegistry.h ('k') | public/platform/WebBlobRegistry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698