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

Side by Side Diff: third_party/WebKit/Source/platform/blob/BlobRegistry.cpp

Issue 2892953006: WIP POC blob transport over mojo
Patch Set: pass mojo blobs over ipc Created 3 years, 6 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
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 // See the definition of the origin of a Blob URL in the File API spec. 82 // See the definition of the origin of a Blob URL in the File API spec.
83 if (origin && BlobURL::GetOrigin(url) == "null") 83 if (origin && BlobURL::GetOrigin(url) == "null")
84 OriginMap()->insert(url.GetString(), origin); 84 OriginMap()->insert(url.GetString(), origin);
85 } 85 }
86 86
87 static void RemoveFromOriginMap(const KURL& url) { 87 static void RemoveFromOriginMap(const KURL& url) {
88 if (BlobURL::GetOrigin(url) == "null") 88 if (BlobURL::GetOrigin(url) == "null")
89 OriginMap()->erase(url.GetString()); 89 OriginMap()->erase(url.GetString());
90 } 90 }
91 91
92 base::SingleThreadTaskRunner* BlobRegistry::GetIORunner() {
93 return GetBlobRegistry()->GetIORunner();
94 }
95
92 void BlobRegistry::RegisterBlobData(const String& uuid, 96 void BlobRegistry::RegisterBlobData(const String& uuid,
93 std::unique_ptr<BlobData> data) { 97 std::unique_ptr<BlobData> data) {
94 GetBlobRegistry()->RegisterBlobData(uuid, WebBlobData(std::move(data))); 98 GetBlobRegistry()->RegisterBlobData(uuid, WebBlobData(std::move(data)));
95 } 99 }
96 100
97 void BlobRegistry::AddBlobDataRef(const String& uuid) { 101 void BlobRegistry::AddBlobDataRef(const String& uuid) {
98 GetBlobRegistry()->AddBlobDataRef(uuid); 102 GetBlobRegistry()->AddBlobDataRef(uuid);
99 } 103 }
100 104
101 void BlobRegistry::RemoveBlobDataRef(const String& uuid) { 105 void BlobRegistry::RemoveBlobDataRef(const String& uuid) {
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 SecurityOrigin::SetMap(this); 223 SecurityOrigin::SetMap(this);
220 } 224 }
221 225
222 SecurityOrigin* BlobOriginMap::GetOrigin(const KURL& url) { 226 SecurityOrigin* BlobOriginMap::GetOrigin(const KURL& url) {
223 if (url.ProtocolIs("blob")) 227 if (url.ProtocolIs("blob"))
224 return OriginMap()->at(url.GetString()); 228 return OriginMap()->at(url.GetString());
225 return 0; 229 return 0;
226 } 230 }
227 231
228 } // namespace blink 232 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698