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

Side by Side Diff: third_party/WebKit/Source/platform/loader/fetch/MockResourceClient.cpp

Issue 2723923002: Yukari: organize platform/loader/testing (Closed)
Patch Set: add missed files Created 3 years, 9 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 "platform/loader/fetch/MockResourceClient.h"
6
7 namespace blink {
8
9 MockResourceClient::MockResourceClient(Resource* resource)
10 : m_resource(resource),
11 m_notifyFinishedCalled(false),
12 m_encodedSizeOnNotifyFinished(0) {
13 m_resource->addClient(this);
14 }
15
16 MockResourceClient::~MockResourceClient() {}
17
18 void MockResourceClient::notifyFinished(Resource* resource) {
19 CHECK(!m_notifyFinishedCalled);
20 m_notifyFinishedCalled = true;
21 m_encodedSizeOnNotifyFinished = resource->encodedSize();
22 }
23
24 void MockResourceClient::removeAsClient() {
25 m_resource->removeClient(this);
26 m_resource = nullptr;
27 }
28
29 void MockResourceClient::dispose() {
30 if (m_resource) {
31 m_resource->removeClient(this);
32 m_resource = nullptr;
33 }
34 }
35
36 DEFINE_TRACE(MockResourceClient) {
37 visitor->trace(m_resource);
38 ResourceClient::trace(visitor);
39 }
40
41 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698