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

Side by Side Diff: extensions/browser/lazy_context_id.h

Issue 2940883007: Move lazy event dispatching code out of EventRouter. (Closed)
Patch Set: address comments Created 3 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
OLDNEW
(Empty)
1 // Copyright 2017 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 EXTENSIONS_BROWSER_LAZY_CONTEXT_ID_H_
6 #define EXTENSIONS_BROWSER_LAZY_CONTEXT_ID_H_
7
8 #include "extensions/common/extension_id.h"
9 #include "url/gurl.h"
10
11 namespace content {
12 class BrowserContext;
13 }
14
15 namespace extensions {
16 class LazyBackgroundTaskQueue;
17
18 class LazyContextId {
19 public:
20 enum class Type {
21 kEventPage,
22 };
23
24 // An event page (lazy background) context.
25 LazyContextId(content::BrowserContext* context,
26 const ExtensionId& extension_id);
27 // TODO(lazyboy): Service worker context.
28
29 bool is_for_event_page() const { return type_ == Type::kEventPage; }
30
31 content::BrowserContext* browser_context() const { return context_; }
32 void set_browser_context(content::BrowserContext* context) {
33 context_ = context;
34 }
35
36 const ExtensionId& extension_id() const { return extension_id_; }
37
38 // TODO(lazyboy): Use a generic interface to support service workers.
39 LazyBackgroundTaskQueue* GetTaskQueue();
40
41 private:
42 const Type type_;
43 content::BrowserContext* context_;
44 const ExtensionId extension_id_;
45
46 DISALLOW_COPY_AND_ASSIGN(LazyContextId);
47 };
48
49 } // namespace extensions
50
51 #endif // EXTENSIONS_BROWSER_LAZY_CONTEXT_ID_H_
OLDNEW
« no previous file with comments | « extensions/browser/events/lazy_event_dispatcher.cc ('k') | extensions/browser/lazy_context_id.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698