| OLD | NEW |
| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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, size_t 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 void redirectReceived(Resource*, ResourceRequest&, const ResourceResponse&)
override | 78 bool redirectReceived(Resource*, ResourceRequest&, const ResourceResponse&)
override |
| 79 { | 79 { |
| 80 ++m_numberOfRedirectsReceived; | 80 ++m_numberOfRedirectsReceived; |
| 81 return true; |
| 81 } | 82 } |
| 82 | 83 |
| 83 bool called() { return m_called; } | 84 bool called() { return m_called; } |
| 84 int numberOfRedirectsReceived() const { return m_numberOfRedirectsReceived;
} | 85 int numberOfRedirectsReceived() const { return m_numberOfRedirectsReceived;
} |
| 85 const Vector<char>& data() { return m_data; } | 86 const Vector<char>& data() { return m_data; } |
| 86 DEFINE_INLINE_TRACE() | 87 DEFINE_INLINE_TRACE() |
| 87 { | 88 { |
| 88 RawResourceClient::trace(visitor); | 89 RawResourceClient::trace(visitor); |
| 89 } | 90 } |
| 90 | 91 |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 | 401 |
| 401 TEST(RawResourceTest, CanReuseDevToolsEmulateNetworkConditionsClientIdHeader) | 402 TEST(RawResourceTest, CanReuseDevToolsEmulateNetworkConditionsClientIdHeader) |
| 402 { | 403 { |
| 403 ResourceRequest request("data:text/html,"); | 404 ResourceRequest request("data:text/html,"); |
| 404 request.setHTTPHeaderField(HTTPNames::X_DevTools_Emulate_Network_Conditions_
Client_Id, "Foo"); | 405 request.setHTTPHeaderField(HTTPNames::X_DevTools_Emulate_Network_Conditions_
Client_Id, "Foo"); |
| 405 Resource* raw = RawResource::create(request, Resource::Raw); | 406 Resource* raw = RawResource::create(request, Resource::Raw); |
| 406 EXPECT_TRUE(raw->canReuse(ResourceRequest("data:text/html,"))); | 407 EXPECT_TRUE(raw->canReuse(ResourceRequest("data:text/html,"))); |
| 407 } | 408 } |
| 408 | 409 |
| 409 } // namespace blink | 410 } // namespace blink |
| OLD | NEW |