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

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

Issue 2877583002: Refactor ImageLoader::UpdateFromElement(kUpdateForcedReload) (Closed)
Patch Set: Rebase Created 3 years, 7 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/ImageLoader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2004, 2009 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2009 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 void UpdateFromElement(UpdateFromElementBehavior = kUpdateNormal, 80 void UpdateFromElement(UpdateFromElementBehavior = kUpdateNormal,
81 ReferrerPolicy = kReferrerPolicyDefault); 81 ReferrerPolicy = kReferrerPolicyDefault);
82 82
83 void ElementDidMoveToNewDocument(); 83 void ElementDidMoveToNewDocument();
84 84
85 Element* GetElement() const { return element_; } 85 Element* GetElement() const { return element_; }
86 bool ImageComplete() const { return image_complete_ && !pending_task_; } 86 bool ImageComplete() const { return image_complete_ && !pending_task_; }
87 87
88 ImageResourceContent* GetImage() const { return image_.Get(); } 88 ImageResourceContent* GetImage() const { return image_.Get(); }
89 ImageResource* ImageResourceForImageDocument() const {
90 return image_resource_for_image_document_;
91 }
92 89
93 // Cancels pending load events, and doesn't dispatch new ones. 90 // Cancels pending load events, and doesn't dispatch new ones.
94 // Note: ClearImage/SetImage.*() are not a simple setter. 91 // Note: ClearImage/SetImage.*() are not a simple setter.
95 // Check the implementation to see what they do. 92 // Check the implementation to see what they do.
96 // TODO(hiroshige): Cleanup these methods. 93 // TODO(hiroshige): Cleanup these methods.
97 void ClearImage(); 94 void ClearImage();
98 void SetImageForTest(ImageResourceContent*); 95 void SetImageForTest(ImageResourceContent*);
99 96
97 // Image document loading:
98 // When |loading_image_document_| is true:
99 // Loading via ImageDocument.
100 // |image_resource_for_image_document_| points to a ImageResource that is
101 // not associated with a ResourceLoader.
102 // The corresponding ImageDocument is responsible for supplying the response
103 // and data to |image_resource_for_image_document_| and thus |image_|.
104 // Otherwise:
105 // Normal loading via ResourceFetcher/ResourceLoader.
106 // |image_resource_for_image_document_| is null.
100 bool IsLoadingImageDocument() { return loading_image_document_; } 107 bool IsLoadingImageDocument() { return loading_image_document_; }
101 void SetLoadingImageDocument() { loading_image_document_ = true; } 108 void SetLoadingImageDocument() { loading_image_document_ = true; }
109 ImageResource* ImageResourceForImageDocument() const {
110 return image_resource_for_image_document_;
111 }
102 112
103 bool HasPendingActivity() const { 113 bool HasPendingActivity() const {
104 return has_pending_load_event_ || has_pending_error_event_ || pending_task_; 114 return has_pending_load_event_ || has_pending_error_event_ || pending_task_;
105 } 115 }
106 116
107 bool HasPendingError() const { return has_pending_error_event_; } 117 bool HasPendingError() const { return has_pending_error_event_; }
108 118
109 bool HadError() const { return !failed_load_url_.IsEmpty(); } 119 bool HadError() const { return !failed_load_url_.IsEmpty(); }
110 120
111 void DispatchPendingEvent(ImageEventSender*); 121 void DispatchPendingEvent(ImageEventSender*);
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 bool has_pending_error_event_ : 1; 191 bool has_pending_error_event_ : 1;
182 bool image_complete_ : 1; 192 bool image_complete_ : 1;
183 bool loading_image_document_ : 1; 193 bool loading_image_document_ : 1;
184 bool element_is_protected_ : 1; 194 bool element_is_protected_ : 1;
185 bool suppress_error_events_ : 1; 195 bool suppress_error_events_ : 1;
186 }; 196 };
187 197
188 } // namespace blink 198 } // namespace blink
189 199
190 #endif 200 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/ImageLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698