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

Side by Side Diff: content/child/indexed_db/indexed_db_callbacks_impl.h

Issue 2370643004: Port messages sent by WebIDBFactoryImpl to Mojo. (Closed)
Patch Set: Addressed most of dcheng@'s feedback. Created 4 years, 2 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
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 #ifndef CONTENT_CHILD_INDEXED_DB_INDEXED_DB_CALLBACKS_IMPL_H_
6 #define CONTENT_CHILD_INDEXED_DB_INDEXED_DB_CALLBACKS_IMPL_H_
7
8 #include "content/common/indexed_db/indexed_db.mojom.h"
9 #include "mojo/public/cpp/bindings/associated_binding.h"
10
11 namespace blink {
12 class WebIDBCallbacks;
13 }
14
15 namespace content {
16
17 class ThreadSafeSender;
18
19 // Implements the child-process end of the pipe used to deliver callbacks. It
20 // is owned by the IO thread. |callback_runner_| is used to post tasks back to
21 // the thread which owns the blink::WebIDBCallbacks.
22 class IndexedDBCallbacksImpl : public indexed_db::mojom::Callbacks {
23 public:
24 IndexedDBCallbacksImpl(blink::WebIDBCallbacks* callbacks,
25 scoped_refptr<ThreadSafeSender> thread_safe_sender);
26 ~IndexedDBCallbacksImpl() override;
27
28 // indexed_db::mojom::Callbacks implementation
cmumford 2016/10/11 18:30:54 nit: end comment with ':'
Reilly Grant (use Gerrit) 2016/10/11 23:46:13 Done.
29 void Blocked(int64_t existing_version) override;
30 void Error(int32_t code, const base::string16& message) override;
31 void SuccessDatabase(
32 int32_t database_id,
33 indexed_db::mojom::DatabaseMetadataPtr metadata) override;
34 void SuccessInteger(int64_t value) override;
35 void SuccessStringList(const std::vector<base::string16>& value) override;
36 void UpgradeNeeded(int32_t database_id,
37 int64_t old_version,
38 blink::WebIDBDataLoss data_loss,
39 const std::string& data_loss_message,
40 indexed_db::mojom::DatabaseMetadataPtr metadata) override;
41
42 private:
43 class InternalState;
44
45 // |internal_state_| is owned by the thread on which |callback_runner_|
46 // executes tasks and must be destroyed there.
47 InternalState* internal_state_;
48 scoped_refptr<base::SingleThreadTaskRunner> callback_runner_;
cmumford 2016/10/11 18:30:54 DISALLOW_COPY_AND_ASSIGN(IndexedDBCallbacksImpl);
Reilly Grant (use Gerrit) 2016/10/11 23:46:13 Done.
49 };
50
51 } // namespace content
52
53 #endif // CONTENT_CHILD_INDEXED_DB_INDEXED_DB_CALLBACKS_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698