OLD | NEW |
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 "content/browser/indexed_db/indexed_db_dispatcher_host.h" | 5 #include "content/browser/indexed_db/indexed_db_dispatcher_host.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "storage/browser/database/database_util.h" | 25 #include "storage/browser/database/database_util.h" |
26 #include "url/origin.h" | 26 #include "url/origin.h" |
27 | 27 |
28 namespace content { | 28 namespace content { |
29 | 29 |
30 namespace { | 30 namespace { |
31 | 31 |
32 const char kInvalidOrigin[] = "Origin is invalid"; | 32 const char kInvalidOrigin[] = "Origin is invalid"; |
33 | 33 |
34 bool IsValidOrigin(const url::Origin& origin) { | 34 bool IsValidOrigin(const url::Origin& origin) { |
35 return !origin.unique(); | 35 return !origin.opaque(); |
36 } | 36 } |
37 | 37 |
38 ::indexed_db::mojom::Status GetIndexedDBStatus(leveldb::Status status) { | 38 ::indexed_db::mojom::Status GetIndexedDBStatus(leveldb::Status status) { |
39 if (status.ok()) | 39 if (status.ok()) |
40 return ::indexed_db::mojom::Status::OK; | 40 return ::indexed_db::mojom::Status::OK; |
41 else if (status.IsNotFound()) | 41 else if (status.IsNotFound()) |
42 return ::indexed_db::mojom::Status::NotFound; | 42 return ::indexed_db::mojom::Status::NotFound; |
43 else if (status.IsCorruption()) | 43 else if (status.IsCorruption()) |
44 return ::indexed_db::mojom::Status::Corruption; | 44 return ::indexed_db::mojom::Status::Corruption; |
45 else if (status.IsNotSupportedError()) | 45 else if (status.IsNotSupportedError()) |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 AbortTransactionsForDatabaseOnIDBThread( | 396 AbortTransactionsForDatabaseOnIDBThread( |
397 base::OnceCallback<void(leveldb::Status)> callback, | 397 base::OnceCallback<void(leveldb::Status)> callback, |
398 const url::Origin& origin) { | 398 const url::Origin& origin) { |
399 DCHECK(indexed_db_context_->TaskRunner()->RunsTasksInCurrentSequence()); | 399 DCHECK(indexed_db_context_->TaskRunner()->RunsTasksInCurrentSequence()); |
400 | 400 |
401 indexed_db_context_->GetIDBFactory()->AbortTransactionsForDatabase( | 401 indexed_db_context_->GetIDBFactory()->AbortTransactionsForDatabase( |
402 std::move(callback), origin); | 402 std::move(callback), origin); |
403 } | 403 } |
404 | 404 |
405 } // namespace content | 405 } // namespace content |
OLD | NEW |