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

Side by Side Diff: third_party/WebKit/Source/core/loader/LoadingContext.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 LoadingContext_h
6 #define LoadingContext_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 LoadingContext
27 : public GarbageCollectedFinalized<LoadingContext> {
yhirano 2017/03/01 03:41:34 "Finalized" is not needed at this moment.
kinuko 2017/03/01 15:08:29 Done.
28 WTF_MAKE_NONCOPYABLE(LoadingContext);
29
30 public:
31 static LoadingContext* create(Document&);
32
33 LoadingContext() = default;
34 virtual ~LoadingContext() = 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 // LoadingContext_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698