~alinuxninja/nginx-edge/trunk

« back to all changes in this revision

Viewing changes to debian/modules/ngx_pagespeed/psol/include/third_party/chromium/src/net/base/platform_mime_util.h

  • Committer: Vivian
  • Date: 2015-12-04 18:20:11 UTC
  • Revision ID: git-v1:a36f2bc32e884f7473b3a47040e5411306144d7d
* Do not extract psol.tar.gz

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
3
 
// found in the LICENSE file.
4
 
 
5
 
#ifndef NET_BASE_PLATFORM_MIME_UTIL_H_
6
 
#define NET_BASE_PLATFORM_MIME_UTIL_H_
7
 
 
8
 
#include <string>
9
 
 
10
 
#include "base/containers/hash_tables.h"
11
 
#include "base/files/file_path.h"
12
 
 
13
 
namespace net {
14
 
 
15
 
// Encapsulates the platform-specific functionality in mime_util.
16
 
class PlatformMimeUtil {
17
 
 public:
18
 
  // See documentation for base::GetPreferredExtensionForMimeType [mime_util.h]
19
 
  bool GetPreferredExtensionForMimeType(
20
 
      const std::string& mime_type,
21
 
      base::FilePath::StringType* extension) const;
22
 
 
23
 
  // Adds all the extensions that the platform associates with the type
24
 
  // |mime_type| to the set |extensions|.  Returns at least the value returned
25
 
  // by GetPreferredExtensionForMimeType.
26
 
  void GetPlatformExtensionsForMimeType(
27
 
      const std::string& mime_type,
28
 
      base::hash_set<base::FilePath::StringType>* extensions) const;
29
 
 
30
 
 protected:
31
 
  // Get the mime type (if any) that is associated with the file extension.
32
 
  // Returns true if a corresponding mime type exists.
33
 
  bool GetPlatformMimeTypeFromExtension(const base::FilePath::StringType& ext,
34
 
                                        std::string* mime_type) const;
35
 
};
36
 
 
37
 
}  // namespace net
38
 
 
39
 
#endif  // NET_BASE_PLATFORM_MIME_UTIL_H_