OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_BLOB_HOLDER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_BLOB_HOLDER_H_ |
| 7 |
| 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/scoped_vector.h" |
| 10 #include "content/public/browser/web_contents_observer.h" |
| 11 #include "content/public/browser/web_contents_user_data.h" |
| 12 |
| 13 namespace content { |
| 14 class BlobHandle; |
| 15 } |
| 16 |
| 17 namespace extensions { |
| 18 |
| 19 // Used for holding onto Blobs created into the browser process until a |
| 20 // renderer takes over ownership. |
| 21 class BlobHolder : public content::WebContentsObserver, |
| 22 public content::WebContentsUserData<BlobHolder> { |
| 23 public: |
| 24 virtual ~BlobHolder(); |
| 25 |
| 26 void HoldBlobReference(scoped_ptr<content::BlobHandle> blob); |
| 27 |
| 28 private: |
| 29 explicit BlobHolder(content::WebContents* web_contents); |
| 30 friend class content::WebContentsUserData<BlobHolder>; |
| 31 |
| 32 // content::WebContentsObserver overrides. |
| 33 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 34 |
| 35 // Message handlers. |
| 36 void OnBlobOwnershipTaken(const std::string& uuid); |
| 37 |
| 38 ScopedVector<content::BlobHandle> held_blobs_; |
| 39 |
| 40 DISALLOW_COPY_AND_ASSIGN(BlobHolder); |
| 41 }; |
| 42 |
| 43 } // namespace extensions |
| 44 |
| 45 #endif // CHROME_BROWSER_EXTENSIONS_BLOB_HOLDER_H_ |
OLD | NEW |