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

Unified Diff: third_party/WebKit/Source/core/dom/ClassicPendingScript.cpp

Issue 2827163003: Remove ClassicPendingScript::CreateForTesting() (Closed)
Patch Set: Rebase Created 3 years, 8 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
« no previous file with comments | « third_party/WebKit/Source/core/dom/ClassicPendingScript.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/ClassicPendingScript.cpp
diff --git a/third_party/WebKit/Source/core/dom/ClassicPendingScript.cpp b/third_party/WebKit/Source/core/dom/ClassicPendingScript.cpp
index 589159b27e7245fa70c5be64a17c526470c2eeea..c060bbef3f54ea4f3271619486c887b5a875993e 100644
--- a/third_party/WebKit/Source/core/dom/ClassicPendingScript.cpp
+++ b/third_party/WebKit/Source/core/dom/ClassicPendingScript.cpp
@@ -27,19 +27,11 @@ ClassicPendingScript* ClassicPendingScript::Create(
return new ClassicPendingScript(element, nullptr, starting_position);
}
-ClassicPendingScript* ClassicPendingScript::CreateForTesting(
- ScriptResource* resource) {
- return new ClassicPendingScript(nullptr, resource, TextPosition(), true);
-}
-
ClassicPendingScript::ClassicPendingScript(
ScriptElementBase* element,
ScriptResource* resource,
- const TextPosition& starting_position,
- bool is_for_testing)
- : PendingScript(element, starting_position),
- integrity_failure_(false),
- is_for_testing_(is_for_testing) {
+ const TextPosition& starting_position)
+ : PendingScript(element, starting_position), integrity_failure_(false) {
CheckState();
SetResource(resource);
MemoryCoordinator::Instance().RegisterClient(this);
@@ -49,7 +41,7 @@ ClassicPendingScript::~ClassicPendingScript() {}
NOINLINE void ClassicPendingScript::CheckState() const {
// TODO(hiroshige): Turn these CHECK()s into DCHECK() before going to beta.
- CHECK(is_for_testing_ || GetElement());
+ CHECK(GetElement());
CHECK(GetResource() || !streamer_);
CHECK(!streamer_ || streamer_->GetResource() == GetResource());
}
@@ -143,7 +135,7 @@ void ClassicPendingScript::NotifyFinished(Resource* resource) {
//
// See https://crbug.com/500701 for more information.
CheckState();
- if (!is_for_testing_ && GetElement()) {
+ if (GetElement()) {
integrity_failure_ = !CheckScriptResourceIntegrity(resource, GetElement());
}
« no previous file with comments | « third_party/WebKit/Source/core/dom/ClassicPendingScript.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698