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

Side by Side Diff: third_party/WebKit/Source/platform/blob/BlobData.h

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 20 matching lines...) Expand all
31 #ifndef BlobData_h 31 #ifndef BlobData_h
32 #define BlobData_h 32 #define BlobData_h
33 33
34 #include <memory> 34 #include <memory>
35 #include "base/gtest_prod_util.h" 35 #include "base/gtest_prod_util.h"
36 #include "platform/FileMetadata.h" 36 #include "platform/FileMetadata.h"
37 #include "platform/weborigin/KURL.h" 37 #include "platform/weborigin/KURL.h"
38 #include "platform/wtf/Forward.h" 38 #include "platform/wtf/Forward.h"
39 #include "platform/wtf/ThreadSafeRefCounted.h" 39 #include "platform/wtf/ThreadSafeRefCounted.h"
40 #include "platform/wtf/text/WTFString.h" 40 #include "platform/wtf/text/WTFString.h"
41 #include "public/platform/blobs.mojom-blink.h"
41 42
42 namespace blink { 43 namespace blink {
43 44
44 class BlobDataHandle; 45 class BlobDataHandle;
45 46
46 class PLATFORM_EXPORT RawData : public ThreadSafeRefCounted<RawData> { 47 class PLATFORM_EXPORT RawData : public ThreadSafeRefCounted<RawData> {
47 public: 48 public:
48 static PassRefPtr<RawData> Create() { return AdoptRef(new RawData()); } 49 static PassRefPtr<RawData> Create() { return AdoptRef(new RawData()); }
49 50
50 void DetachFromCurrentThread(); 51 void DetachFromCurrentThread();
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 // For deserialization of script values and ipc messages. 236 // For deserialization of script values and ipc messages.
236 static PassRefPtr<BlobDataHandle> Create(const String& uuid, 237 static PassRefPtr<BlobDataHandle> Create(const String& uuid,
237 const String& type, 238 const String& type,
238 long long size) { 239 long long size) {
239 return AdoptRef(new BlobDataHandle(uuid, type, size)); 240 return AdoptRef(new BlobDataHandle(uuid, type, size));
240 } 241 }
241 242
242 String Uuid() const { return uuid_.IsolatedCopy(); } 243 String Uuid() const { return uuid_.IsolatedCopy(); }
243 String GetType() const { return type_.IsolatedCopy(); } 244 String GetType() const { return type_.IsolatedCopy(); }
244 unsigned long long size() const { return size_; } 245 unsigned long long size() const { return size_; }
246 storage::mojom::blink::Blob* blob() const { return blob_.get(); }
245 247
246 bool IsSingleUnknownSizeFile() const { return is_single_unknown_size_file_; } 248 bool IsSingleUnknownSizeFile() const { return is_single_unknown_size_file_; }
247 249
248 ~BlobDataHandle(); 250 ~BlobDataHandle();
249 251
250 private: 252 private:
251 BlobDataHandle(); 253 BlobDataHandle();
252 BlobDataHandle(std::unique_ptr<BlobData>, long long size); 254 BlobDataHandle(std::unique_ptr<BlobData>, long long size);
253 BlobDataHandle(const String& uuid, const String& type, long long size); 255 BlobDataHandle(const String& uuid, const String& type, long long size);
254 256
255 const String uuid_; 257 const String uuid_;
256 const String type_; 258 const String type_;
257 const long long size_; 259 const long long size_;
258 const bool is_single_unknown_size_file_; 260 const bool is_single_unknown_size_file_;
261 storage::mojom::blink::BlobPtr blob_;
259 }; 262 };
260 263
261 } // namespace blink 264 } // namespace blink
262 265
263 #endif // BlobData_h 266 #endif // BlobData_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/blob/BlobBytesProvider.cpp ('k') | third_party/WebKit/Source/platform/blob/BlobData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698