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

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

Issue 16879013: Use chromium logic for database identifier<->origin conversions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove webkit/base/origin_url_conversions Created 7 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 | Annotate | Revision Log
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 "webkit/browser/database/database_util.h" 5 #include "webkit/browser/database/database_util.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "third_party/WebKit/public/platform/WebString.h" 9 #include "third_party/WebKit/public/platform/WebString.h"
10 #include "third_party/WebKit/public/web/WebSecurityOrigin.h"
11 #include "webkit/browser/database/database_tracker.h" 10 #include "webkit/browser/database/database_tracker.h"
12 #include "webkit/browser/database/vfs_backend.h" 11 #include "webkit/browser/database/vfs_backend.h"
13 12
14 namespace webkit_database { 13 namespace webkit_database {
15 14
16 const char DatabaseUtil::kJournalFileSuffix[] = "-journal"; 15 const char DatabaseUtil::kJournalFileSuffix[] = "-journal";
17 16
18 bool DatabaseUtil::CrackVfsFileName(const base::string16& vfs_file_name, 17 bool DatabaseUtil::CrackVfsFileName(const base::string16& vfs_file_name,
19 std::string* origin_identifier, 18 std::string* origin_identifier,
20 base::string16* database_name, 19 base::string16* database_name,
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 char forbidden[] = {'\\', '/', '\0'}; 77 char forbidden[] = {'\\', '/', '\0'};
79 78
80 std::string::size_type pos = origin_identifier.find(dotdot); 79 std::string::size_type pos = origin_identifier.find(dotdot);
81 if (pos == std::string::npos) 80 if (pos == std::string::npos)
82 pos = origin_identifier.find_first_of(forbidden, 0, arraysize(forbidden)); 81 pos = origin_identifier.find_first_of(forbidden, 0, arraysize(forbidden));
83 82
84 return pos == std::string::npos; 83 return pos == std::string::npos;
85 } 84 }
86 85
87 } // namespace webkit_database 86 } // namespace webkit_database
OLDNEW
« no previous file with comments | « webkit/browser/database/database_tracker_unittest.cc ('k') | webkit/browser/database/database_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698