OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This is a port of ManifestParser.cc from WebKit/WebCore/loader/appcache. | 5 // This is a port of ManifestParser.cc from WebKit/WebCore/loader/appcache. |
6 | 6 |
7 /* | 7 /* |
8 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 8 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
9 * | 9 * |
10 * Redistribution and use in source and binary forms, with or without | 10 * Redistribution and use in source and binary forms, with or without |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 const wchar_t* type_start = line_p; | 265 const wchar_t* type_start = line_p; |
266 while (line_p < line_end && *line_p != '\t' && *line_p != ' ') | 266 while (line_p < line_end && *line_p != '\t' && *line_p != ' ') |
267 ++line_p; | 267 ++line_p; |
268 | 268 |
269 // Look for a type value we understand, otherwise skip the line. | 269 // Look for a type value we understand, otherwise skip the line. |
270 InterceptVerb verb = UNKNOWN_VERB; | 270 InterceptVerb verb = UNKNOWN_VERB; |
271 std::wstring type(type_start, line_p - type_start); | 271 std::wstring type(type_start, line_p - type_start); |
272 if (type == L"return") { | 272 if (type == L"return") { |
273 verb = RETURN; | 273 verb = RETURN; |
274 } else if (type == L"execute" && | 274 } else if (type == L"execute" && |
275 CommandLine::ForCurrentProcess()->HasSwitch( | 275 base::CommandLine::ForCurrentProcess()->HasSwitch( |
276 kEnableExecutableHandlers)) { | 276 kEnableExecutableHandlers)) { |
277 verb = EXECUTE; | 277 verb = EXECUTE; |
278 } | 278 } |
279 if (verb == UNKNOWN_VERB) | 279 if (verb == UNKNOWN_VERB) |
280 continue; | 280 continue; |
281 | 281 |
282 // Skip whitespace separating type from the target_url. | 282 // Skip whitespace separating type from the target_url. |
283 while (line_p < line_end && (*line_p == '\t' || *line_p == ' ')) | 283 while (line_p < line_end && (*line_p == '\t' || *line_p == ' ')) |
284 ++line_p; | 284 ++line_p; |
285 | 285 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 fallback_url, is_pattern)); | 373 fallback_url, is_pattern)); |
374 } else { | 374 } else { |
375 NOTREACHED(); | 375 NOTREACHED(); |
376 } | 376 } |
377 } | 377 } |
378 | 378 |
379 return true; | 379 return true; |
380 } | 380 } |
381 | 381 |
382 } // namespace content | 382 } // namespace content |
OLD | NEW |