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

Side by Side Diff: chrome/renderer/prefetch_helper.h

Issue 334483004: Enable resource prefetch from the browser process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: jochen's nits Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
jkarlin 2014/06/17 10:15:33 2014
tburkard 2014/06/17 10:46:52 Done.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_RENDERER_PREFETCH_HELPER_H_
6 #define CHROME_RENDERER_PREFETCH_HELPER_H_
7
8 #include <set>
9
10 #include "content/public/renderer/render_frame_observer.h"
11 #include "third_party/WebKit/public/platform/WebURLLoader.h"
12 #include "third_party/WebKit/public/platform/WebURLLoaderClient.h"
13 #include "url/gurl.h"
14
15 namespace prefetch {
16
17 // Helper class initiating prefetches on behalf of a RenderFrame.
18 class PrefetchHelper : public content::RenderFrameObserver,
19 public blink::WebURLLoaderClient {
20 public:
21 explicit PrefetchHelper(content::RenderFrame* render_frame);
22 virtual ~PrefetchHelper();
23
24 // blink::WebURLLoaderClient implementation
25 virtual void didFinishLoading(blink::WebURLLoader* loader,
26 double finishTime,
27 int64_t totalEncodedDataLength) OVERRIDE;
28 virtual void didFail(blink::WebURLLoader* loader,
29 const blink::WebURLError& error) OVERRIDE;
30
31 private:
32 // RenderViewObserver implementation
33 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
34
35 void OnPrefetch(const GURL& url);
36
37 std::set<blink::WebURLLoader*> loader_set_;
38
39 DISALLOW_COPY_AND_ASSIGN(PrefetchHelper);
40 };
41
42 } // namespace prefetch
43
44 #endif // CHROME_RENDERER_PREFETCH_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698