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

Side by Side Diff: third_party/WebKit/Source/core/loader/ThreadableLoadingContext.h

Issue 2715803004: Introduce ThreadableLoadingContext: make threaded loading code one step away from Document (Closed)
Patch Set: . Created 3 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
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 ThreadableLoadingContext_h
6 #define ThreadableLoadingContext_h
7
8 #include "core/CoreExport.h"
9 #include "core/dom/TaskRunnerHelper.h"
10 #include "core/frame/UseCounter.h"
11 #include "platform/heap/GarbageCollected.h"
12 #include "platform/weborigin/KURL.h"
13 #include "wtf/Forward.h"
14 #include "wtf/Noncopyable.h"
15
16 namespace blink {
17
18 class Document;
19 class ResourceFetcher;
20 class SecurityOrigin;
21 class WebTaskRunner;
22
23 // An abstract interface for top-level loading context.
24 // This should be accessed only from the thread where the loading
25 // context is bound to (e.g. on the main thread).
26 class CORE_EXPORT ThreadableLoadingContext
27 : public GarbageCollected<ThreadableLoadingContext> {
28 WTF_MAKE_NONCOPYABLE(ThreadableLoadingContext);
29
30 public:
31 static ThreadableLoadingContext* create(Document&);
32
33 ThreadableLoadingContext() = default;
34 virtual ~ThreadableLoadingContext() = default;
35
36 virtual bool isContextThread() const = 0;
37
38 virtual ResourceFetcher* getResourceFetcher() = 0;
39 virtual SecurityOrigin* getSecurityOrigin() = 0;
40 virtual bool isSecureContext() const = 0;
41 virtual KURL firstPartyForCookies() const = 0;
42 virtual String userAgent() const = 0;
43 virtual RefPtr<WebTaskRunner> getTaskRunner(TaskType) = 0;
44 virtual void recordUseCount(UseCounter::Feature) = 0;
45
46 // TODO(kinuko): Try getting rid of dependency to Document.
47 virtual Document* getLoadingDocument() { return nullptr; }
48
49 DEFINE_INLINE_VIRTUAL_TRACE() {}
50 };
51
52 } // namespace blink
53
54 #endif // ThreadableLoadingContext_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698