OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/loader/ThreadableLoadingContext.h" | 5 #include "core/loader/ThreadableLoadingContext.h" |
6 | 6 |
7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
8 #include "core/dom/TaskRunnerHelper.h" | 8 #include "core/dom/TaskRunnerHelper.h" |
9 #include "platform/loader/fetch/ResourceFetcher.h" | 9 #include "platform/loader/fetch/ResourceFetcher.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 class DocumentThreadableLoadingContext final : public ThreadableLoadingContext { | 13 class DocumentThreadableLoadingContext final |
| 14 : public GarbageCollected<DocumentThreadableLoadingContext>, |
| 15 public ThreadableLoadingContext { |
| 16 USING_GARBAGE_COLLECTED_MIXIN(DocumentThreadableLoadingContext); |
| 17 |
14 public: | 18 public: |
15 explicit DocumentThreadableLoadingContext(Document& document) | 19 explicit DocumentThreadableLoadingContext(Document& document) |
16 : document_(&document) {} | 20 : document_(&document) {} |
17 | 21 |
18 ~DocumentThreadableLoadingContext() override = default; | 22 ~DocumentThreadableLoadingContext() override = default; |
19 | 23 |
20 bool IsContextThread() const override { return document_->IsContextThread(); } | 24 bool IsContextThread() const override { return document_->IsContextThread(); } |
21 | 25 |
22 ResourceFetcher* GetResourceFetcher() override { | 26 ResourceFetcher* GetResourceFetcher() override { |
23 DCHECK(IsContextThread()); | 27 DCHECK(IsContextThread()); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 private: | 69 private: |
66 Member<Document> document_; | 70 Member<Document> document_; |
67 }; | 71 }; |
68 | 72 |
69 ThreadableLoadingContext* ThreadableLoadingContext::Create(Document& document) { | 73 ThreadableLoadingContext* ThreadableLoadingContext::Create(Document& document) { |
70 // For now this is the only default implementation. | 74 // For now this is the only default implementation. |
71 return new DocumentThreadableLoadingContext(document); | 75 return new DocumentThreadableLoadingContext(document); |
72 } | 76 } |
73 | 77 |
74 } // namespace blink | 78 } // namespace blink |
OLD | NEW |