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

Side by Side Diff: third_party/WebKit/Source/platform/network/mime/MockMimeRegistry.h

Issue 2444873002: Move WebMIMERegistry impl from //content to blink:platform/network/mime (Closed)
Patch Set: rebased Created 4 years, 1 month 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
(Empty)
1 // Copyright 2016 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 MockMimeRegistry_h
6 #define MockMimeRegistry_h
7
8 #include "net/base/mime_util.h"
9 #include "public/platform/FilePathConversion.h"
10 #include "public/platform/mime_registry.mojom-blink.h"
11
12 namespace blink {
13
14 // Used for unit tests.
15 class MockMimeRegistry : public mojom::blink::MimeRegistry {
16 public:
17 MockMimeRegistry() = default;
18 ~MockMimeRegistry() = default;
19
20 void GetMimeTypeFromExtension(
21 const String& ext,
22 const GetMimeTypeFromExtensionCallback& callback) override {
23 std::string mimeType;
24 net::GetMimeTypeFromExtension(WebStringToFilePath(ext).value(), &mimeType);
25 callback.Run(String::fromUTF8(mimeType.data(), mimeType.length()));
26 }
27 };
28
29 } // namespace blink
30
31 #endif // MockMimeRegistry_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698