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

Unified Diff: net/base/mime_sniffer.cc

Issue 885443002: Roll Chrome into Mojo. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Rebase to ToT mojo Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/bandwidth_metrics.h ('k') | net/base/mime_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/mime_sniffer.cc
diff --git a/net/base/mime_sniffer.cc b/net/base/mime_sniffer.cc
index ad4212dc2811af7567661052f2cef560fefe8c74..0d1f1169907bd91d1f93404afeee54a7e7e197e9 100644
--- a/net/base/mime_sniffer.cc
+++ b/net/base/mime_sniffer.cc
@@ -110,11 +110,11 @@ namespace net {
static const size_t kBytesRequiredForMagic = 42;
struct MagicNumber {
- const char* mime_type;
- const char* magic;
+ const char* const mime_type;
+ const char* const magic;
size_t magic_len;
bool is_string;
- const char* mask; // if set, must have same length as |magic|
+ const char* const mask; // if set, must have same length as |magic|
};
#define MAGIC_NUMBER(mime_type, magic) \
@@ -209,7 +209,7 @@ enum OfficeDocType {
struct OfficeExtensionType {
OfficeDocType doc_type;
- const char* extension;
+ const char* const extension;
size_t extension_len;
};
@@ -724,7 +724,7 @@ static bool SniffBinary(const char* content,
static bool IsUnknownMimeType(const std::string& mime_type) {
// TODO(tc): Maybe reuse some code in net/http/http_response_headers.* here.
// If we do, please be careful not to alter the semantics at all.
- static const char* kUnknownMimeTypes[] = {
+ static const char* const kUnknownMimeTypes[] = {
// Empty mime types are as unknown as they get.
"",
// The unknown/unknown type is popular and uninformative
@@ -819,7 +819,7 @@ bool ShouldSniffMimeType(const GURL& url, const std::string& mime_type) {
return false;
}
- static const char* kSniffableTypes[] = {
+ static const char* const kSniffableTypes[] = {
// Many web servers are misconfigured to send text/plain for many
// different types of content.
"text/plain",
« no previous file with comments | « net/base/bandwidth_metrics.h ('k') | net/base/mime_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698