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

Side by Side Diff: content/child/npapi/plugin_host.cc

Issue 1172183002: Move StartsWith[ASCII] to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string_util3
Patch Set: merger Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 #include "content/child/npapi/plugin_host.h" 5 #include "content/child/npapi/plugin_host.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 // A malicious (non-sandboxed) plugin has unfeterred access to OS 457 // A malicious (non-sandboxed) plugin has unfeterred access to OS
458 // resources and can do this anyway without using browser's HTTP stack. 458 // resources and can do this anyway without using browser's HTTP stack.
459 // FWIW, Firefox and Safari don't perform any security checks. 459 // FWIW, Firefox and Safari don't perform any security checks.
460 460
461 if (!buf) 461 if (!buf)
462 return NPERR_FILE_NOT_FOUND; 462 return NPERR_FILE_NOT_FOUND;
463 463
464 std::string file_path_ascii(buf); 464 std::string file_path_ascii(buf);
465 base::FilePath file_path; 465 base::FilePath file_path;
466 static const char kFileUrlPrefix[] = "file:"; 466 static const char kFileUrlPrefix[] = "file:";
467 if (StartsWithASCII(file_path_ascii, kFileUrlPrefix, false)) { 467 if (base::StartsWithASCII(file_path_ascii, kFileUrlPrefix, false)) {
468 GURL file_url(file_path_ascii); 468 GURL file_url(file_path_ascii);
469 DCHECK(file_url.SchemeIsFile()); 469 DCHECK(file_url.SchemeIsFile());
470 net::FileURLToFilePath(file_url, &file_path); 470 net::FileURLToFilePath(file_url, &file_path);
471 } else { 471 } else {
472 file_path = base::FilePath::FromUTF8Unsafe(file_path_ascii); 472 file_path = base::FilePath::FromUTF8Unsafe(file_path_ascii);
473 } 473 }
474 474
475 base::File::Info post_file_info; 475 base::File::Info post_file_info;
476 if (!base::GetFileInfo(file_path, &post_file_info) || 476 if (!base::GetFileInfo(file_path, &post_file_info) ||
477 post_file_info.is_directory) 477 post_file_info.is_directory)
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
1097 } 1097 }
1098 1098
1099 void NPN_URLRedirectResponse(NPP instance, void* notify_data, NPBool allow) { 1099 void NPN_URLRedirectResponse(NPP instance, void* notify_data, NPBool allow) {
1100 scoped_refptr<PluginInstance> plugin(FindInstance(instance)); 1100 scoped_refptr<PluginInstance> plugin(FindInstance(instance));
1101 if (plugin.get()) { 1101 if (plugin.get()) {
1102 plugin->URLRedirectResponse(!!allow, notify_data); 1102 plugin->URLRedirectResponse(!!allow, notify_data);
1103 } 1103 }
1104 } 1104 }
1105 1105
1106 } // extern "C" 1106 } // extern "C"
OLDNEW
« no previous file with comments | « content/child/multipart_response_delegate.cc ('k') | content/child/simple_webmimeregistry_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698