| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 OwnPtr<BlobData> blobData; | 94 OwnPtr<BlobData> blobData; |
| 95 PassRefPtr<RawData> streamData; | 95 PassRefPtr<RawData> streamData; |
| 96 String type; | 96 String type; |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 static WebBlobRegistry* blobRegistry() | 99 static WebBlobRegistry* blobRegistry() |
| 100 { | 100 { |
| 101 return Platform::current()->blobRegistry(); | 101 return Platform::current()->blobRegistry(); |
| 102 } | 102 } |
| 103 | 103 |
| 104 typedef HashMap<String, RefPtr<SecurityOrigin> > BlobURLOriginMap; | 104 typedef HashMap<String, RefPtr<SecurityOrigin>> BlobURLOriginMap; |
| 105 static ThreadSpecific<BlobURLOriginMap>& originMap() | 105 static ThreadSpecific<BlobURLOriginMap>& originMap() |
| 106 { | 106 { |
| 107 // We want to create the BlobOriginCache exactly once because it is shared b
y all the threads. | 107 // We want to create the BlobOriginCache exactly once because it is shared b
y all the threads. |
| 108 AtomicallyInitializedStatic(BlobOriginCache*, cache = new BlobOriginCache); | 108 AtomicallyInitializedStatic(BlobOriginCache*, cache = new BlobOriginCache); |
| 109 (void)cache; // BlobOriginCache's constructor does the interesting work. | 109 (void)cache; // BlobOriginCache's constructor does the interesting work. |
| 110 | 110 |
| 111 AtomicallyInitializedStatic(ThreadSpecific<BlobURLOriginMap>*, map = new Thr
eadSpecific<BlobURLOriginMap>); | 111 AtomicallyInitializedStatic(ThreadSpecific<BlobURLOriginMap>*, map = new Thr
eadSpecific<BlobURLOriginMap>); |
| 112 return *map; | 112 return *map; |
| 113 } | 113 } |
| 114 | 114 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 } | 292 } |
| 293 | 293 |
| 294 SecurityOrigin* BlobOriginCache::cachedOrigin(const KURL& url) | 294 SecurityOrigin* BlobOriginCache::cachedOrigin(const KURL& url) |
| 295 { | 295 { |
| 296 if (url.protocolIs("blob")) | 296 if (url.protocolIs("blob")) |
| 297 return originMap()->get(url.string()); | 297 return originMap()->get(url.string()); |
| 298 return 0; | 298 return 0; |
| 299 } | 299 } |
| 300 | 300 |
| 301 } // namespace blink | 301 } // namespace blink |
| OLD | NEW |