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

Side by Side Diff: third_party/WebKit/Source/core/fetch/MockResourceClient.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 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/MockResourceClient.h"
6
7 #include "testing/gtest/include/gtest/gtest.h"
8
9 namespace blink {
10
11 MockResourceClient::MockResourceClient(Resource* resource)
12 : m_resource(resource),
13 m_notifyFinishedCalled(false),
14 m_encodedSizeOnNotifyFinished(0) {
15 ThreadState::current()->registerPreFinalizer(this);
16 m_resource->addClient(this);
17 }
18
19 MockResourceClient::~MockResourceClient() {}
20
21 void MockResourceClient::notifyFinished(Resource* resource) {
22 ASSERT_FALSE(m_notifyFinishedCalled);
23 m_notifyFinishedCalled = true;
24 m_encodedSizeOnNotifyFinished = resource->encodedSize();
25 }
26
27 void MockResourceClient::removeAsClient() {
28 m_resource->removeClient(this);
29 m_resource = nullptr;
30 }
31
32 void MockResourceClient::dispose() {
33 if (m_resource) {
34 m_resource->removeClient(this);
35 m_resource = nullptr;
36 }
37 }
38
39 DEFINE_TRACE(MockResourceClient) {
40 visitor->trace(m_resource);
41 ResourceClient::trace(visitor);
42 }
43
44 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/MockResourceClient.h ('k') | third_party/WebKit/Source/core/fetch/MockResourceClients.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698