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

Side by Side Diff: third_party/WebKit/Source/core/fetch/MockImageResourceClient.cpp

Issue 1706083002: Split ImageResourceClient into ResourceClient and ImageResourceObserver [1/2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "core/fetch/MockImageResourceClient.h"
6
7 #include "core/fetch/ImageResource.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9
10 namespace blink {
11
12 MockImageResourceClient::MockImageResourceClient(PassRefPtrWillBeRawPtr<Resource > resource)
13 : m_resource(resource.get())
14 , m_imageChangedCount(0)
15 , m_notifyFinishedCalled(false)
16 {
17 m_resource->addClient(this);
18 }
19
20 MockImageResourceClient::~MockImageResourceClient()
21 {
22 if (m_resource)
23 m_resource->removeClient(this);
24 }
25
26 void MockImageResourceClient::notifyFinished(Resource*)
27 {
28 ASSERT_FALSE(m_notifyFinishedCalled);
29 m_notifyFinishedCalled = true;
30 }
31
32 void MockImageResourceClient::removeAsClient()
33 {
34 m_resource->removeClient(this);
35 m_resource = nullptr;
36 }
37
38 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698