OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBBLOBREGISTRY_IMPL_H_ | 5 #ifndef WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBBLOBREGISTRY_IMPL_H_ |
6 #define WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBBLOBREGISTRY_IMPL_H_ | 6 #define WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBBLOBREGISTRY_IMPL_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "third_party/WebKit/Source/Platform/chromium/public/WebBlobRegistry.h" | 9 #include "third_party/WebKit/Source/Platform/chromium/public/WebBlobRegistry.h" |
10 | 10 |
11 class GURL; | 11 class GURL; |
12 | 12 |
13 namespace webkit_blob { | 13 namespace webkit_blob { |
14 class BlobData; | 14 class BlobData; |
15 class BlobStorageController; | 15 class BlobStorageContext; |
16 } | 16 } |
17 | 17 |
18 class TestShellWebBlobRegistryImpl | 18 class TestShellWebBlobRegistryImpl |
19 : public WebKit::WebBlobRegistry, | 19 : public WebKit::WebBlobRegistry, |
20 public base::RefCountedThreadSafe<TestShellWebBlobRegistryImpl> { | 20 public base::RefCountedThreadSafe<TestShellWebBlobRegistryImpl> { |
21 public: | 21 public: |
22 static void InitializeOnIOThread( | 22 static void InitializeOnIOThread( |
23 webkit_blob::BlobStorageController* blob_storage_controller); | 23 webkit_blob::BlobStorageContext* blob_storage_context); |
24 static void Cleanup(); | 24 static void Cleanup(); |
25 | 25 |
26 TestShellWebBlobRegistryImpl(); | 26 TestShellWebBlobRegistryImpl(); |
27 | 27 |
28 // See WebBlobRegistry.h for documentation on these functions. | 28 // WebBlobRegistry interface implementation. |
29 virtual void registerBlobURL(const WebKit::WebURL& url, | 29 virtual void registerBlobData(const WebKit::WebString& uuid, |
30 WebKit::WebBlobData& data); | 30 const WebKit::WebBlobData&); |
31 virtual void registerBlobURL(const WebKit::WebURL& url, | 31 virtual void addBlobDataRef(const WebKit::WebString& uuid); |
32 const WebKit::WebURL& src_url); | 32 virtual void removeBlobDataRef(const WebKit::WebString& uuid); |
33 virtual void unregisterBlobURL(const WebKit::WebURL& url); | 33 virtual void registerPublicBlobURL(const WebKit::WebURL&, |
| 34 const WebKit::WebString& uuid); |
| 35 virtual void revokePublicBlobURL(const WebKit::WebURL&); |
34 | 36 |
35 protected: | 37 protected: |
36 virtual ~TestShellWebBlobRegistryImpl() {} | 38 virtual ~TestShellWebBlobRegistryImpl() {} |
37 | 39 |
38 private: | 40 private: |
39 friend class base::RefCountedThreadSafe<TestShellWebBlobRegistryImpl>; | 41 friend class base::RefCountedThreadSafe<TestShellWebBlobRegistryImpl>; |
40 | 42 |
41 // Run on I/O thread. | 43 // All processing for WebBlobRegistry calls are serialized on the I/O thread. |
42 void AddFinishedBlob(const GURL& url, webkit_blob::BlobData* blob_data); | 44 void AddFinishedBlob(webkit_blob::BlobData* blob_data); |
43 void CloneBlob(const GURL& url, const GURL& src_url); | 45 void AddBlobDataRef(const std::string& uuid); |
44 void RemoveBlob(const GURL& url); | 46 void RemoveBlobDataRef(const std::string& uuid); |
| 47 void RegisterPublicBlobURL(const GURL& url, const std::string& uuid); |
| 48 void RevokePublicBlobURL(const GURL& url); |
45 | 49 |
46 DISALLOW_COPY_AND_ASSIGN(TestShellWebBlobRegistryImpl); | 50 DISALLOW_COPY_AND_ASSIGN(TestShellWebBlobRegistryImpl); |
47 }; | 51 }; |
48 | 52 |
49 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBBLOBREGISTRY_IMPL_H_ | 53 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBBLOBREGISTRY_IMPL_H_ |
OLD | NEW |