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

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

Issue 1571233003: Fix errors caused by unsafe conversions to/from size_t (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: improved ALLOW_NUMERIC_ARG_TYPES_PROMOTABLE_TO Created 4 years, 11 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
1 /* 1 /*
2 * Copyright (c) 2013, Google Inc. All rights reserved. 2 * Copyright (c) 2013, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 DummyClient() : m_called(false) {} 63 DummyClient() : m_called(false) {}
64 ~DummyClient() override {} 64 ~DummyClient() override {}
65 65
66 // ResourceClient implementation. 66 // ResourceClient implementation.
67 void notifyFinished(Resource* resource) override 67 void notifyFinished(Resource* resource) override
68 { 68 {
69 m_called = true; 69 m_called = true;
70 } 70 }
71 String debugName() const override { return "DummyClient"; } 71 String debugName() const override { return "DummyClient"; }
72 72
73 void dataReceived(Resource*, const char* data, unsigned length) override 73 void dataReceived(Resource*, const char* data, size_t length) override
74 { 74 {
75 m_data.append(data, length); 75 m_data.append(data, length);
76 } 76 }
77 77
78 bool called() { return m_called; } 78 bool called() { return m_called; }
79 const Vector<char>& data() { return m_data; } 79 const Vector<char>& data() { return m_data; }
80 private: 80 private:
81 bool m_called; 81 bool m_called;
82 Vector<char> m_data; 82 Vector<char> m_data;
83 }; 83 };
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 226
227 OwnPtr<DummyClient> dummyClient = adoptPtr(new DummyClient()); 227 OwnPtr<DummyClient> dummyClient = adoptPtr(new DummyClient());
228 OwnPtr<RemovingClient> removingClient = adoptPtr(new RemovingClient(dummyCli ent.get())); 228 OwnPtr<RemovingClient> removingClient = adoptPtr(new RemovingClient(dummyCli ent.get()));
229 raw->addClient(dummyClient.get()); 229 raw->addClient(dummyClient.get());
230 raw->addClient(removingClient.get()); 230 raw->addClient(removingClient.get());
231 testing::runPendingTasks(); 231 testing::runPendingTasks();
232 EXPECT_FALSE(raw->hasClients()); 232 EXPECT_FALSE(raw->hasClients());
233 } 233 }
234 234
235 } // namespace blink 235 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/RawResource.cpp ('k') | third_party/WebKit/Source/core/fetch/Resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698