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

Side by Side Diff: third_party/WebKit/Source/platform/testing/weburl_loader_mock.h

Issue 2105713002: Render process changes for ResourceTiming sizes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@resource_timing_sizes_browser_process
Patch Set: Initialise encoded_body_length for sync XHR to data: URLs Created 4 years, 5 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef WebURLLoaderMock_h 5 #ifndef WebURLLoaderMock_h
6 #define WebURLLoaderMock_h 6 #define WebURLLoaderMock_h
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "public/platform/WebURLLoader.h" 9 #include "public/platform/WebURLLoader.h"
10 #include "wtf/WeakPtr.h" 10 #include "wtf/WeakPtr.h"
11 #include <memory> 11 #include <memory>
12 12
13 namespace blink { 13 namespace blink {
14 14
15 class WebData; 15 class WebData;
16 struct WebURLError; 16 struct WebURLError;
17 class WebURLLoaderClient; 17 class WebURLLoaderClient;
18 class WebURLLoaderMockFactoryImpl; 18 class WebURLLoaderMockFactoryImpl;
19 class WebURLLoaderTestDelegate; 19 class WebURLLoaderTestDelegate;
20 class WebURLRequest; 20 class WebURLRequest;
21 class WebURLResponse; 21 class WebURLResponse;
22 22
23 const int kRedirectResponseOverheadBytes = 300;
24
23 // A simple class for mocking WebURLLoader. 25 // A simple class for mocking WebURLLoader.
24 // If the WebURLLoaderMockFactory it is associated with has been configured to 26 // If the WebURLLoaderMockFactory it is associated with has been configured to
25 // mock the request it gets, it serves the mocked resource. Otherwise it just 27 // mock the request it gets, it serves the mocked resource. Otherwise it just
26 // forwards it to the default loader. 28 // forwards it to the default loader.
27 class WebURLLoaderMock : public WebURLLoader { 29 class WebURLLoaderMock : public WebURLLoader {
28 public: 30 public:
29 // This object becomes the owner of |default_loader|. 31 // This object becomes the owner of |default_loader|.
30 WebURLLoaderMock(WebURLLoaderMockFactoryImpl* factory, 32 WebURLLoaderMock(WebURLLoaderMockFactoryImpl* factory,
31 WebURLLoader* default_loader); 33 WebURLLoader* default_loader);
32 ~WebURLLoaderMock() override; 34 ~WebURLLoaderMock() override;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 bool is_deferred_ = false; 68 bool is_deferred_ = false;
67 69
68 WeakPtrFactory<WebURLLoaderMock> weak_factory_; 70 WeakPtrFactory<WebURLLoaderMock> weak_factory_;
69 71
70 DISALLOW_COPY_AND_ASSIGN(WebURLLoaderMock); 72 DISALLOW_COPY_AND_ASSIGN(WebURLLoaderMock);
71 }; 73 };
72 74
73 } // namespace blink 75 } // namespace blink
74 76
75 #endif // WebURLLoaderMock_h 77 #endif // WebURLLoaderMock_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698