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

Unified 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, 10 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/loader/LoadingContext.h
diff --git a/third_party/WebKit/Source/core/loader/LoadingContext.h b/third_party/WebKit/Source/core/loader/LoadingContext.h
new file mode 100644
index 0000000000000000000000000000000000000000..ceceb4033fba466a50da9a2cb23b819c6332f43d
--- /dev/null
+++ b/third_party/WebKit/Source/core/loader/LoadingContext.h
@@ -0,0 +1,54 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef LoadingContext_h
+#define LoadingContext_h
+
+#include "core/CoreExport.h"
+#include "core/dom/TaskRunnerHelper.h"
+#include "core/frame/UseCounter.h"
+#include "platform/heap/GarbageCollected.h"
+#include "platform/weborigin/KURL.h"
+#include "wtf/Forward.h"
+#include "wtf/Noncopyable.h"
+
+namespace blink {
+
+class Document;
+class ResourceFetcher;
+class SecurityOrigin;
+class WebTaskRunner;
+
+// An abstract interface for top-level loading context.
+// This should be accessed only from the thread where the loading
+// context is bound to (e.g. on the main thread).
+class CORE_EXPORT LoadingContext
+ : 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.
+ WTF_MAKE_NONCOPYABLE(LoadingContext);
+
+ public:
+ static LoadingContext* create(Document&);
+
+ LoadingContext() = default;
+ virtual ~LoadingContext() = default;
+
+ virtual bool isContextThread() const = 0;
+
+ virtual ResourceFetcher* getResourceFetcher() = 0;
+ virtual SecurityOrigin* getSecurityOrigin() = 0;
+ virtual bool isSecureContext() const = 0;
+ virtual KURL firstPartyForCookies() const = 0;
+ virtual String userAgent() const = 0;
+ virtual RefPtr<WebTaskRunner> getTaskRunner(TaskType) = 0;
+ virtual void recordUseCount(UseCounter::Feature) = 0;
+
+ // TODO(kinuko): Try getting rid of dependency to Document.
+ virtual Document* getLoadingDocument() { return nullptr; }
+
+ DEFINE_INLINE_VIRTUAL_TRACE() {}
+};
+
+} // namespace blink
+
+#endif // LoadingContext_h

Powered by Google App Engine
This is Rietveld 408576698