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

Side by Side Diff: storage/browser/database/database_util.cc

Issue 1753403002: Move IsValidOriginIdentifier into appropriate header (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 "storage/browser/database/database_util.h" 5 #include "storage/browser/database/database_util.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "storage/browser/database/database_tracker.h" 10 #include "storage/browser/database/database_tracker.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 full_path = full_path.InsertBeforeExtensionASCII( 94 full_path = full_path.InsertBeforeExtensionASCII(
95 base::UTF16ToASCII(sqlite_suffix)); 95 base::UTF16ToASCII(sqlite_suffix));
96 } 96 }
97 // Watch out for directory traversal attempts from a compromised renderer. 97 // Watch out for directory traversal attempts from a compromised renderer.
98 if (full_path.value().find(FILE_PATH_LITERAL("..")) != 98 if (full_path.value().find(FILE_PATH_LITERAL("..")) !=
99 base::FilePath::StringType::npos) 99 base::FilePath::StringType::npos)
100 return base::FilePath(); 100 return base::FilePath();
101 return full_path; 101 return full_path;
102 } 102 }
103 103
104 bool DatabaseUtil::IsValidOriginIdentifier(
105 const std::string& origin_identifier) {
106 return GetOriginFromIdentifier(origin_identifier).is_valid();
107 }
108
109 } // namespace storage 104 } // namespace storage
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698