Home
last modified time | relevance | path

Searched refs:mime_type (Results 1 – 25 of 125) sorted by relevance

12345

/external/cronet/net/base/
Dmime_sniffer_unittest.cc30 std::string mime_type; in SniffMimeType() local
32 ForceSniffFileUrlsForHtml::kDisabled, &mime_type); in SniffMimeType()
33 return mime_type; in SniffMimeType()
68 std::string mime_type; in TEST() local
78 ForceSniffFileUrlsForHtml::kDisabled, &mime_type); in TEST()
79 EXPECT_EQ("text/plain", mime_type); in TEST()
81 ForceSniffFileUrlsForHtml::kDisabled, &mime_type); in TEST()
82 EXPECT_EQ("text/plain", mime_type); in TEST()
84 ForceSniffFileUrlsForHtml::kDisabled, &mime_type); in TEST()
85 EXPECT_EQ("application/octet-stream", mime_type); in TEST()
[all …]
Dmime_util.cc34 std::string* mime_type) const;
37 std::string* mime_type) const;
40 std::string* mime_type) const;
43 const std::string& mime_type,
47 const std::string& mime_type) const;
62 std::string* mime_type) const;
70 const char* const mime_type; member
251 return mapping.mime_type; in FindMimeType()
275 const std::string& mime_type, in FindPreferredExtension() argument
278 if (mime_type == "application/octet-stream") in FindPreferredExtension()
[all …]
Ddata_url_unittest.cc21 const char* mime_type; member
162 std::string mime_type; in TEST() local
165 bool ok = DataURL::Parse(GURL(test.url), &mime_type, &charset, &data); in TEST()
167 EXPECT_EQ(test.mime_type, mime_type); in TEST()
174 std::string mime_type; in TEST() local
179 ASSERT_EQ(OK, DataURL::BuildResponse(GURL("data:,Hello"), "GET", &mime_type, in TEST()
182 EXPECT_EQ("text/plain", mime_type); in TEST()
201 std::string mime_type; in TEST() local
206 DataURL::BuildResponse(GURL("data:,Hello"), method, &mime_type, in TEST()
209 EXPECT_EQ("text/plain", mime_type); in TEST()
[all …]
Dmime_util_unittest.cc30 const char* const mime_type; in TEST() member
54 std::string mime_type; in TEST() local
55 if (GetWellKnownMimeTypeFromExtension(test.extension, &mime_type)) in TEST()
56 EXPECT_EQ(test.mime_type, mime_type); in TEST()
58 EXPECT_EQ(test.mime_type, nullptr); in TEST()
114 std::string mime_type; in TEST() local
115 if (GetMimeTypeFromExtension(test.extension, &mime_type)) in TEST()
116 EXPECT_THAT(test.mime_types, Contains(mime_type)); in TEST()
129 const std::string mime_type; in TEST() member
140 auto rv = GetPreferredExtensionForMimeType(test.mime_type, &extension); in TEST()
[all …]
Dmime_util.h36 std::string* mime_type);
44 std::string* mime_type);
49 std::string* mime_type);
55 const std::string& mime_type,
61 const std::string& mime_type);
72 std::string* mime_type,
126 const std::string& mime_type,
Dmime_sniffer.cc105 const char* const mime_type; member
111 #define MAGIC_NUMBER(mime_type, magic) \ argument
112 { (mime_type), base::StringPiece((magic), sizeof(magic) - 1), false, nullptr }
125 #define MAGIC_MASK(mime_type, magic, mask) \ argument
127 (mime_type), base::StringPiece((magic), verified_sizeof(magic, mask) - 1), \
132 #define MAGIC_STRING(mime_type, magic) \ argument
133 { (mime_type), base::StringPiece((magic), sizeof(magic) - 1), true, nullptr }
336 result->assign(magic_entry.mime_type); in MatchMagicNumber()
611 static bool IsUnknownMimeType(base::StringPiece mime_type) { in IsUnknownMimeType() argument
625 if (mime_type == unknown_mime_type) in IsUnknownMimeType()
[all …]
Dfilename_util_icu.cc52 const std::string& mime_type, in GetSuggestedFilename() argument
55 suggested_name, mime_type, default_name, in GetSuggestedFilename()
64 const std::string& mime_type, in GenerateFileName() argument
67 suggested_name, mime_type, default_file_name, in GenerateFileName()
75 const std::string& mime_type, in GenerateFileName() argument
79 url, content_disposition, referrer_charset, suggested_name, mime_type, in GenerateFileName()
Dfilename_util_internal.cc31 const std::string& mime_type, in GetCorrectedExtensionUnsafe() argument
40 if (mime_type.empty()) in GetCorrectedExtensionUnsafe()
50 if (!GetPreferredExtensionForMimeType(mime_type, &preferred_mime_extension)) in GetCorrectedExtensionUnsafe()
57 GetExtensionsForMimeType(mime_type, &all_mime_extensions); in GetCorrectedExtensionUnsafe()
187 void EnsureSafeExtension(const std::string& mime_type, in EnsureSafeExtension() argument
192 GetCorrectedExtensionUnsafe(mime_type, ignore_extension, *file_name); in EnsureSafeExtension()
224 const std::string& mime_type, in GetSuggestedFilenameImpl() argument
294 GenerateSafeFileName(mime_type, overwrite_extension, &result); in GetSuggestedFilenameImpl()
312 const std::string& mime_type, in GenerateFileNameImpl() argument
317 url, content_disposition, referrer_charset, suggested_name, mime_type, in GenerateFileNameImpl()
Ddata_url.cc46 std::string* mime_type, in Parse() argument
52 DCHECK(mime_type->empty()); in Parse()
163 *mime_type = std::move(mime_type_value); in Parse()
170 std::string* mime_type, in BuildResponse() argument
177 if (!DataURL::Parse(url, mime_type, charset, data)) in BuildResponse()
183 DCHECK(!mime_type->empty()); in BuildResponse()
189 std::string content_type = *mime_type; in BuildResponse()
Dplatform_mime_util_win.cc31 const std::string& mime_type, in GetPlatformPreferredExtensionForMimeType() argument
34 L"MIME\\Database\\Content Type\\" + base::UTF8ToWide(mime_type); in GetPlatformPreferredExtensionForMimeType()
47 const std::string& mime_type, in GetPlatformExtensionsForMimeType() argument
54 if (GetPlatformPreferredExtensionForMimeType(mime_type, &ext)) in GetPlatformExtensionsForMimeType()
Dfilename_util.h72 const std::string& mime_type,
81 const std::string& mime_type,
92 const std::string& mime_type,
131 NET_EXPORT void GenerateSafeFileName(const std::string& mime_type,
Dplatform_mime_util.h22 const std::string& mime_type,
30 const std::string& mime_type,
36 std::string* mime_type) const;
Dplatform_mime_util_mac.mm81 const std::string& mime_type,
87 [UTType typeWithMIMEType:base::SysUTF8ToNSString(mime_type)];
99 base::SysUTF8ToCFStringRef(mime_type));
128 const std::string& mime_type,
134 [UTType typesWithTag:base::SysUTF8ToNSString(mime_type)
159 if (GetPlatformPreferredExtensionForMimeType(mime_type, &ext)) {
168 base::SysUTF8ToCFStringRef(mime_type));
195 if (GetPlatformPreferredExtensionForMimeType(mime_type, &ext)) {
Dfilename_util_internal.h26 void EnsureSafeExtension(const std::string& mime_type,
41 const std::string& mime_type,
55 const std::string& mime_type,
/external/python/google-api-python-client/googleapiclient/
Dmimeparse.py34 def parse_mime_type(mime_type): argument
44 parts = mime_type.split(";")
85 def fitness_and_quality_parsed(mime_type, parsed_ranges): argument
96 (target_type, target_subtype, target_params) = parse_media_range(mime_type)
122 def quality_parsed(mime_type, parsed_ranges): argument
132 return fitness_and_quality_parsed(mime_type, parsed_ranges)[1]
135 def quality(mime_type, ranges): argument
148 return quality_parsed(mime_type, parsed_ranges)
169 for mime_type in supported:
171 (fitness_and_quality_parsed(mime_type, parsed_header), pos, mime_type)
/external/autotest/utils/frozen_chromite/third_party/googleapiclient/
Dmimeparse.py35 def parse_mime_type(mime_type): argument
45 parts = mime_type.split(';')
82 def fitness_and_quality_parsed(mime_type, parsed_ranges): argument
94 parse_media_range(mime_type)
116 def quality_parsed(mime_type, parsed_ranges): argument
126 return fitness_and_quality_parsed(mime_type, parsed_ranges)[1]
129 def quality(mime_type, ranges): argument
142 return quality_parsed(mime_type, parsed_ranges)
163 for mime_type in supported:
164 weighted_matches.append((fitness_and_quality_parsed(mime_type,
[all …]
/external/libbrillo/brillo/http/
Dhttp_utils.cc66 const std::string& mime_type, in PostTextAndBlock() argument
71 url, data.data(), data.size(), mime_type, headers, transport, error); in PostTextAndBlock()
76 const std::string& mime_type, in PostText() argument
84 mime_type, in PostText()
96 const std::string& mime_type, in SendRequestAndBlock() argument
103 CHECK(!mime_type.empty()) << "MIME type must be specified if request body " in SendRequestAndBlock()
105 request.SetContentType(mime_type); in SendRequestAndBlock()
125 const std::string& mime_type, in SendRequest() argument
133 CHECK(!mime_type.empty()) << "MIME type must be specified if request body " in SendRequest()
135 request.SetContentType(mime_type); in SendRequest()
[all …]
Dhttp_transport_fake.cc123 const std::string& mime_type) { in AddSimpleReplyHandler() argument
126 const std::string& mime_type, in AddSimpleReplyHandler()
129 response->ReplyText(status_code, reply_text, mime_type); in AddSimpleReplyHandler()
132 url, method, base::Bind(handler, status_code, reply_text, mime_type)); in AddSimpleReplyHandler()
223 std::string mime_type = brillo::mime::RemoveParameters( in GetFormField() local
225 if (mime_type == brillo::mime::application::kWwwFormUrlEncoded && in GetFormField()
239 const std::string& mime_type) { in Reply() argument
245 {response_header::kContentType, mime_type}}); in Reply()
250 const std::string& mime_type) { in ReplyText() argument
251 Reply(status_code, text.data(), text.size(), mime_type); in ReplyText()
[all …]
Dhttp_transport_fake.h61 const std::string& mime_type);
216 const std::string& mime_type);
220 const std::string& mime_type);
233 const std::string& mime_type) { in Reply() argument
236 Reply(status_code, data.data(), data.size() * sizeof(T), mime_type); in Reply()
242 void Reply(int status_code, const T& data, const std::string& mime_type) { in Reply() argument
245 Reply(status_code, &data, sizeof(T), mime_type); in Reply()
Dhttp_utils.h62 const std::string& mime_type,
85 const std::string& mime_type,
101 const std::string& mime_type,
161 const std::string& mime_type,
172 const std::string& mime_type,
187 const std::string& mime_type,
199 const std::string& mime_type,
210 const std::string& mime_type,
/external/flac/src/share/grabbag/
Dpicture.c135 if(0 == strcmp(picture->mime_type, "image/png")) { in local__extract_resolution_color_info_()
185 else if(0 == strcmp(picture->mime_type, "image/jpeg")) { in local__extract_resolution_color_info_()
240 else if(0 == strcmp(picture->mime_type, "image/gif")) { in local__extract_resolution_color_info_()
316 else if (*obj->data.picture.mime_type == '\0' && !local__extract_mime_type_(obj)) in read_file()
406 if(0 == strcmp(obj->data.picture.mime_type, "-->")) { /* magic MIME type means URL */ in grabbag__picture_parse_specification()
424 …(strcmp(obj->data.picture.mime_type, "image/png") && strcmp(obj->data.picture.mime_type, "-->")) || in grabbag__picture_parse_specification()
445 char mime_type [64] ; in grabbag__picture_from_specification() local
450 safe_strncpy(mime_type, mime_type_in, sizeof (mime_type)); in grabbag__picture_from_specification()
463 if (mime_type_in && ! FLAC__metadata_object_picture_set_mime_type(obj, mime_type, /*copy=*/true)) { in grabbag__picture_from_specification()
487 if (strcmp(obj->data.picture.mime_type, "-->") == 0) { /* magic MIME type means URL */ in grabbag__picture_from_specification()
[all …]
/external/flac/src/test_grabbag/picture/
Dmain.c30 const char *mime_type; member
76 …flac_snprintf(s, sizeof(s), "%u|%s|%s||pictures/%s", (uint32_t)pf->type, pf->mime_type, pf->descri… in test_one_picture()
78 …flac_snprintf(s, sizeof(s), "%u|%s|%s|%dx%dx%d/%d|pictures/%s", (uint32_t)pf->type, pf->mime_type,… in test_one_picture()
83 …fn_only? FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER : pf->type, pf->mime_type, pf->description… in test_one_picture()
90 obj->data.picture.mime_type, in test_one_picture()
101 if(strcmp(obj->data.picture.mime_type, pf->mime_type)) in test_one_picture()
/external/python/apitools/apitools/base/py/
Dutil.py166 def AcceptableMimeType(accept_patterns, mime_type): argument
181 if '/' not in mime_type:
183 'Invalid MIME type: "%s"' % mime_type)
190 def MimeTypeMatches(pattern, mime_type): argument
196 in zip(pattern.split('/'), mime_type.split('/')))
198 return any(MimeTypeMatches(pattern, mime_type)
Dtransfer.py583 def __init__(self, stream, mime_type, total_size=None, http=None, argument
592 self.__mime_type = mime_type
608 def FromFile(cls, filename, mime_type=None, auto_transfer=True, argument
614 if not mime_type:
615 mime_type, _ = mimetypes.guess_type(path)
616 if mime_type is None:
620 return cls(open(path, 'rb'), mime_type, total_size=size,
625 def FromStream(cls, stream, mime_type, total_size=None, auto_transfer=True, argument
628 if mime_type is None:
631 return cls(stream, mime_type, total_size=total_size,
[all …]
/external/cronet/net/proxy_resolution/
Dpac_file_fetcher_impl.cc53 constexpr bool IsPacMimeType(base::StringPiece mime_type) { in IsPacMimeType() argument
59 return base::EqualsCaseInsensitiveASCII(pac_mime_type, mime_type); in IsPacMimeType()
158 std::string mime_type; in Fetch() local
161 if (!DataURL::Parse(url, &mime_type, &charset, &data)) in Fetch()
296 std::string mime_type; in OnResponseStarted() local
297 cur_request_->GetMimeType(&mime_type); in OnResponseStarted()
298 if (!IsPacMimeType(mime_type)) { in OnResponseStarted()
300 << mime_type; in OnResponseStarted()

12345