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

Side by Side Diff: content/child/indexed_db/webidbfactory_impl.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 | « no previous file | content/child/storage_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/child/indexed_db/webidbfactory_impl.h" 5 #include "content/child/indexed_db/webidbfactory_impl.h"
6 6
7 #include "content/child/indexed_db/indexed_db_dispatcher.h" 7 #include "content/child/indexed_db/indexed_db_dispatcher.h"
8 #include "content/child/storage_util.h"
8 #include "content/child/thread_safe_sender.h" 9 #include "content/child/thread_safe_sender.h"
9 #include "third_party/WebKit/public/platform/URLConversion.h"
10 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" 10 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h"
11 #include "third_party/WebKit/public/platform/WebString.h" 11 #include "third_party/WebKit/public/platform/WebString.h"
12 12
13 using blink::WebIDBCallbacks; 13 using blink::WebIDBCallbacks;
14 using blink::WebIDBDatabase; 14 using blink::WebIDBDatabase;
15 using blink::WebIDBDatabaseCallbacks; 15 using blink::WebIDBDatabaseCallbacks;
16 using blink::WebSecurityOrigin; 16 using blink::WebSecurityOrigin;
17 using blink::WebString; 17 using blink::WebString;
18 18
19 namespace content { 19 namespace content {
20 20
21 WebIDBFactoryImpl::WebIDBFactoryImpl(ThreadSafeSender* thread_safe_sender) 21 WebIDBFactoryImpl::WebIDBFactoryImpl(ThreadSafeSender* thread_safe_sender)
22 : thread_safe_sender_(thread_safe_sender) {} 22 : thread_safe_sender_(thread_safe_sender) {}
23 23
24 WebIDBFactoryImpl::~WebIDBFactoryImpl() {} 24 WebIDBFactoryImpl::~WebIDBFactoryImpl() {}
25 25
26 void WebIDBFactoryImpl::getDatabaseNames(WebIDBCallbacks* callbacks, 26 void WebIDBFactoryImpl::getDatabaseNames(WebIDBCallbacks* callbacks,
27 const WebSecurityOrigin& origin) { 27 const WebSecurityOrigin& origin) {
28 IndexedDBDispatcher* dispatcher = 28 IndexedDBDispatcher* dispatcher =
29 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); 29 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get());
30 dispatcher->RequestIDBFactoryGetDatabaseNames( 30 dispatcher->RequestIDBFactoryGetDatabaseNames(
31 callbacks, blink::WebStringToGURL(origin.toString())); 31 callbacks, WebSecurityOriginToGURL(origin));
32 } 32 }
33 33
34 void WebIDBFactoryImpl::open(const WebString& name, 34 void WebIDBFactoryImpl::open(const WebString& name,
35 long long version, 35 long long version,
36 long long transaction_id, 36 long long transaction_id,
37 WebIDBCallbacks* callbacks, 37 WebIDBCallbacks* callbacks,
38 WebIDBDatabaseCallbacks* database_callbacks, 38 WebIDBDatabaseCallbacks* database_callbacks,
39 const WebSecurityOrigin& origin) { 39 const WebSecurityOrigin& origin) {
40 IndexedDBDispatcher* dispatcher = 40 IndexedDBDispatcher* dispatcher =
41 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); 41 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get());
42
42 dispatcher->RequestIDBFactoryOpen(name, version, transaction_id, callbacks, 43 dispatcher->RequestIDBFactoryOpen(name, version, transaction_id, callbacks,
43 database_callbacks, 44 database_callbacks,
44 blink::WebStringToGURL(origin.toString())); 45 WebSecurityOriginToGURL(origin));
45 } 46 }
46 47
47 void WebIDBFactoryImpl::deleteDatabase(const WebString& name, 48 void WebIDBFactoryImpl::deleteDatabase(const WebString& name,
48 WebIDBCallbacks* callbacks, 49 WebIDBCallbacks* callbacks,
49 const WebSecurityOrigin& origin) { 50 const WebSecurityOrigin& origin) {
50 IndexedDBDispatcher* dispatcher = 51 IndexedDBDispatcher* dispatcher =
51 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); 52 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get());
52 dispatcher->RequestIDBFactoryDeleteDatabase( 53 dispatcher->RequestIDBFactoryDeleteDatabase(name, callbacks,
53 name, callbacks, blink::WebStringToGURL(origin.toString())); 54 WebSecurityOriginToGURL(origin));
54 } 55 }
55 56
56 } // namespace content 57 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/child/storage_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698