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

Side by Side Diff: content/child/storage_util.cc

Issue 1810193002: Fix effective Origin URLs for IDB + Cache for file:/// pages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Factor out origin->GURL conversion helper 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
« no previous file with comments | « content/child/storage_util.h ('k') | content/content_child.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/child/storage_util.h"
6
7 #include "third_party/WebKit/public/platform/URLConversion.h"
8 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h"
9 #include "url/gurl.h"
10
11 namespace content {
12
13 GURL WebSecurityOriginToGURL(const blink::WebSecurityOrigin& security_origin) {
14 // "file:///" URLs navigated to by the user may have "isLocal" set,
15 // which stringify as "null" by default. Previous code that sent
16 // origins from Blink to Chromium via DatabaseIdentifier would ignore
17 // this, so we mimic that behavior here.
18 // TODO(jsbell): Eliminate this. https://crbug.com/591482
19 if (security_origin.protocol().utf8() == "file" &&
20 security_origin.host().utf8() == "" && security_origin.port() == 0) {
21 return GURL("file:///");
22 }
23 return blink::WebStringToGURL(security_origin.toString());
24 }
25
26 } // namespace content
OLDNEW
« no previous file with comments | « content/child/storage_util.h ('k') | content/content_child.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698