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

Unified Diff: third_party/WebKit/Source/core/fetch/MockImageResourceClient.cpp

Issue 2559703002: Loading: split MockResourceClients into multiple files type by type (Closed)
Patch Set: [rebase to trunk] Created 4 years 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/fetch/MockImageResourceClient.cpp
diff --git a/third_party/WebKit/Source/core/fetch/MockResourceClients.cpp b/third_party/WebKit/Source/core/fetch/MockImageResourceClient.cpp
similarity index 62%
rename from third_party/WebKit/Source/core/fetch/MockResourceClients.cpp
rename to third_party/WebKit/Source/core/fetch/MockImageResourceClient.cpp
index 8c8c86191fc42c194af86a789a1f53146db68323..970527879f87cdf59932f4772f208d6a53785017 100644
--- a/third_party/WebKit/Source/core/fetch/MockResourceClients.cpp
+++ b/third_party/WebKit/Source/core/fetch/MockImageResourceClient.cpp
@@ -1,8 +1,8 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
+// Copyright 2016 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.
-#include "core/fetch/MockResourceClients.h"
+#include "core/fetch/MockImageResourceClient.h"
#include "core/fetch/ImageResource.h"
#include "core/fetch/ImageResourceContent.h"
@@ -10,39 +10,6 @@
namespace blink {
-MockResourceClient::MockResourceClient(Resource* resource)
- : m_resource(resource),
- m_notifyFinishedCalled(false),
- m_encodedSizeOnNotifyFinished(0) {
- ThreadState::current()->registerPreFinalizer(this);
- m_resource->addClient(this);
-}
-
-MockResourceClient::~MockResourceClient() {}
-
-void MockResourceClient::notifyFinished(Resource* resource) {
- ASSERT_FALSE(m_notifyFinishedCalled);
- m_notifyFinishedCalled = true;
- m_encodedSizeOnNotifyFinished = resource->encodedSize();
-}
-
-void MockResourceClient::removeAsClient() {
- m_resource->removeClient(this);
- m_resource = nullptr;
-}
-
-void MockResourceClient::dispose() {
- if (m_resource) {
- m_resource->removeClient(this);
- m_resource = nullptr;
- }
-}
-
-DEFINE_TRACE(MockResourceClient) {
- visitor->trace(m_resource);
- ResourceClient::trace(visitor);
-}
-
MockImageResourceClient::MockImageResourceClient(ImageResource* resource)
: MockResourceClient(resource),
m_imageChangedCount(0),

Powered by Google App Engine
This is Rietveld 408576698