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

Side by Side Diff: content/browser/loader/stream_resource_handler.h

Issue 2476163003: Refactor ResourceHandler API. (Closed)
Patch Set: Minor cleanups, one real fix Created 4 years, 1 month 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 CONTENT_BROWSER_LOADER_STREAM_RESOURCE_HANDLER_H_ 5 #ifndef CONTENT_BROWSER_LOADER_STREAM_RESOURCE_HANDLER_H_
6 #define CONTENT_BROWSER_LOADER_STREAM_RESOURCE_HANDLER_H_ 6 #define CONTENT_BROWSER_LOADER_STREAM_RESOURCE_HANDLER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 16 matching lines...) Expand all
27 // WebCore::BlobURL and and WebCore::SecurityOrigin in Blink to understand 27 // WebCore::BlobURL and and WebCore::SecurityOrigin in Blink to understand
28 // how origin check is done on resource loading. 28 // how origin check is done on resource loading.
29 StreamResourceHandler(net::URLRequest* request, 29 StreamResourceHandler(net::URLRequest* request,
30 StreamRegistry* registry, 30 StreamRegistry* registry,
31 const GURL& origin); 31 const GURL& origin);
32 ~StreamResourceHandler() override; 32 ~StreamResourceHandler() override;
33 33
34 void SetController(ResourceController* controller) override; 34 void SetController(ResourceController* controller) override;
35 35
36 // Not needed, as this event handler ought to be the final resource. 36 // Not needed, as this event handler ought to be the final resource.
37 bool OnRequestRedirected(const net::RedirectInfo& redirect_info, 37 void OnRequestRedirected(const net::RedirectInfo& redirect_info,
38 ResourceResponse* resp, 38 ResourceResponse* resp,
39 bool* defer) override; 39 bool* defer_or_cancel) override;
40 40
41 bool OnResponseStarted(ResourceResponse* resp, bool* defer) override; 41 void OnResponseStarted(ResourceResponse* resp,
42 bool* defer_or_cancel) override;
42 43
43 bool OnWillStart(const GURL& url, bool* defer) override; 44 void OnWillStart(const GURL& url, bool* defer_or_cancel) override;
44 45
45 // Create a new buffer to store received data. 46 // Create a new buffer to store received data.
46 bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, 47 bool OnWillRead(scoped_refptr<net::IOBuffer>* buf,
47 int* buf_size, 48 int* buf_size,
48 int min_size) override; 49 int min_size) override;
49 50
50 // A read was completed, forward the data to the Stream. 51 // A read was completed, forward the data to the Stream.
51 bool OnReadCompleted(int bytes_read, bool* defer) override; 52 void OnReadCompleted(int bytes_read, bool* defer_or_cancel) override;
52 53
53 void OnResponseCompleted(const net::URLRequestStatus& status, 54 void OnResponseCompleted(const net::URLRequestStatus& status,
54 bool* defer) override; 55 bool* defer) override;
55 56
56 void OnDataDownloaded(int bytes_downloaded) override; 57 void OnDataDownloaded(int bytes_downloaded) override;
57 58
58 Stream* stream() { return writer_.stream(); } 59 Stream* stream() { return writer_.stream(); }
59 60
60 private: 61 private:
61 StreamWriter writer_; 62 StreamWriter writer_;
62 63
63 DISALLOW_COPY_AND_ASSIGN(StreamResourceHandler); 64 DISALLOW_COPY_AND_ASSIGN(StreamResourceHandler);
64 }; 65 };
65 66
66 } // namespace content 67 } // namespace content
67 68
68 #endif // CONTENT_BROWSER_LOADER_STREAM_RESOURCE_HANDLER_H_ 69 #endif // CONTENT_BROWSER_LOADER_STREAM_RESOURCE_HANDLER_H_
OLDNEW
« no previous file with comments | « content/browser/loader/resource_loader_unittest.cc ('k') | content/browser/loader/stream_resource_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698