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

Side by Side Diff: webkit/base/origin_url_conversions.cc

Issue 15995038: Use a direct include of utf_string_conversions.h in google_apis/, gpu/, ipc/, media/, ppapi/, print… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: better 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/base/origin_url_conversions.h" 5 #include "webkit/base/origin_url_conversions.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "googleurl/src/gurl.h" 8 #include "googleurl/src/gurl.h"
9 #include "third_party/WebKit/public/platform/WebString.h" 9 #include "third_party/WebKit/public/platform/WebString.h"
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h"
11 11
12 namespace webkit_base { 12 namespace webkit_base {
13 13
14 GURL GetOriginURLFromIdentifier(const base::string16& identifier) { 14 GURL GetOriginURLFromIdentifier(const base::string16& identifier) {
15 WebKit::WebSecurityOrigin web_security_origin = 15 WebKit::WebSecurityOrigin web_security_origin =
16 WebKit::WebSecurityOrigin::createFromDatabaseIdentifier(identifier); 16 WebKit::WebSecurityOrigin::createFromDatabaseIdentifier(identifier);
17 17
18 // We need this work-around for file:/// URIs as 18 // We need this work-around for file:/// URIs as
19 // createFromDatabaseIdentifier returns null origin_url for them. 19 // createFromDatabaseIdentifier returns null origin_url for them.
20 if (web_security_origin.isUnique()) { 20 if (web_security_origin.isUnique()) {
21 if (identifier.find(UTF8ToUTF16("file__")) == 0) 21 if (identifier.find(UTF8ToUTF16("file__")) == 0)
22 return GURL("file:///"); 22 return GURL("file:///");
23 return GURL(); 23 return GURL();
24 } 24 }
25 25
26 return GURL(web_security_origin.toString()); 26 return GURL(web_security_origin.toString());
27 } 27 }
28 28
29 base::string16 GetOriginIdentifierFromURL(const GURL& url) { 29 base::string16 GetOriginIdentifierFromURL(const GURL& url) {
30 return WebKit::WebSecurityOrigin::createFromString( 30 return WebKit::WebSecurityOrigin::createFromString(
31 UTF8ToUTF16(url.spec())).databaseIdentifier(); 31 UTF8ToUTF16(url.spec())).databaseIdentifier();
32 } 32 }
33 33
34 } // namespace webkit_base 34 } // namespace webkit_base
OLDNEW
« no previous file with comments | « webkit/base/file_path_string_conversions.cc ('k') | webkit/browser/appcache/appcache_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698