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

Side by Side Diff: content/test/mock_webblob_registry_impl.h

Issue 434833002: Add mock WebBlobRegistry to TestWebKitPlatformSupport. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed feedback. Created 6 years, 4 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
« no previous file with comments | « content/content_tests.gypi ('k') | content/test/mock_webblob_registry_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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 CONTENT_CHILD_FILEAPI_WEBBLOBREGISTRY_IMPL_H_ 5 #ifndef CONTENT_TEST_MOCK_WEB_BLOB_REGISTRY_IMPL_H
6 #define CONTENT_CHILD_FILEAPI_WEBBLOBREGISTRY_IMPL_H_ 6 #define CONTENT_TEST_MOCK_WEB_BLOB_REGISTRY_IMPL_H
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/macros.h"
9 #include "third_party/WebKit/public/platform/WebBlobRegistry.h" 9 #include "third_party/WebKit/public/platform/WebBlobRegistry.h"
10 #include "webkit/common/blob/blob_data.h"
11
12 namespace blink {
13 class WebBlobData;
14 class WebString;
15 class WebThreadSafeData;
16 class WebURL;
17 }
18 10
19 namespace content { 11 namespace content {
20 class ThreadSafeSender;
21 12
22 class WebBlobRegistryImpl : public blink::WebBlobRegistry { 13 class MockWebBlobRegistryImpl : public blink::WebBlobRegistry {
23 public: 14 public:
24 explicit WebBlobRegistryImpl(ThreadSafeSender* sender); 15 MockWebBlobRegistryImpl();
25 virtual ~WebBlobRegistryImpl(); 16 virtual ~MockWebBlobRegistryImpl();
26 17
27 virtual void registerBlobData(const blink::WebString& uuid, 18 virtual void registerBlobData(const blink::WebString& uuid,
28 const blink::WebBlobData& data); 19 const blink::WebBlobData& data);
29 virtual void addBlobDataRef(const blink::WebString& uuid); 20 virtual void addBlobDataRef(const blink::WebString& uuid);
30 virtual void removeBlobDataRef(const blink::WebString& uuid); 21 virtual void removeBlobDataRef(const blink::WebString& uuid);
31 virtual void registerPublicBlobURL(const blink::WebURL&, 22 virtual void registerPublicBlobURL(const blink::WebURL&,
32 const blink::WebString& uuid); 23 const blink::WebString& uuid);
33 virtual void revokePublicBlobURL(const blink::WebURL&); 24 virtual void revokePublicBlobURL(const blink::WebURL&);
34 25
35 // Additional support for Streams. 26 // Additional support for Streams.
36 virtual void registerStreamURL(const blink::WebURL& url, 27 virtual void registerStreamURL(const blink::WebURL& url,
37 const blink::WebString& content_type); 28 const blink::WebString& content_type);
38 virtual void registerStreamURL(const blink::WebURL& url, 29 virtual void registerStreamURL(const blink::WebURL& url,
39 const blink::WebURL& src_url); 30 const blink::WebURL& src_url);
40 virtual void addDataToStream(const blink::WebURL& url, 31 virtual void addDataToStream(const blink::WebURL& url,
41 blink::WebThreadSafeData& data); 32 blink::WebThreadSafeData& data);
42 virtual void finalizeStream(const blink::WebURL& url); 33 virtual void finalizeStream(const blink::WebURL& url);
43 virtual void abortStream(const blink::WebURL& url); 34 virtual void abortStream(const blink::WebURL& url);
44 virtual void unregisterStreamURL(const blink::WebURL& url); 35 virtual void unregisterStreamURL(const blink::WebURL& url);
45 36
46 private: 37 private:
47 void SendDataForBlob(const std::string& uuid_str, 38 DISALLOW_COPY_AND_ASSIGN(MockWebBlobRegistryImpl);
48 const blink::WebThreadSafeData& data);
49
50 scoped_refptr<ThreadSafeSender> sender_;
51 }; 39 };
52 40
53 } // namespace content 41 } // namespace content
54 42
55 #endif // CONTENT_CHILD_FILEAPI_WEBBLOBREGISTRY_IMPL_H_ 43 #endif // CONTENT_TEST_MOCK_WEB_BLOB_REGISTRY_IMPL_H
OLDNEW
« no previous file with comments | « content/content_tests.gypi ('k') | content/test/mock_webblob_registry_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698