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

Side by Side Diff: content/public/common/url_fetcher_delegate.h

Issue 10386063: Move URLFetcherDelegate to net/ and split URLFetcher between net/ and content/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync to head, fix win component build Created 8 years, 7 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
« no previous file with comments | « content/public/common/url_fetcher.h ('k') | content/public/common/url_fetcher_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_PUBLIC_COMMON_URL_FETCHER_DELEGATE_H_ 5 #ifndef CONTENT_PUBLIC_COMMON_URL_FETCHER_DELEGATE_H_
6 #define CONTENT_PUBLIC_COMMON_URL_FETCHER_DELEGATE_H_ 6 #define CONTENT_PUBLIC_COMMON_URL_FETCHER_DELEGATE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include "net/url_request/url_fetcher_delegate.h"
10
11 #include "base/basictypes.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "content/common/content_export.h"
14 10
15 namespace content { 11 namespace content {
16 12
13 // TODO(akalin): Update all users of URLFetcherDelegate to use
14 // net::URLFetcherDelegate and remove this file.
15
17 class URLFetcher; 16 class URLFetcher;
18 17
19 // A delegate interface for users of URLFetcher. 18 // We inherit from net::URLFetcherDelegate so that we can still
20 class CONTENT_EXPORT URLFetcherDelegate { 19 // forward-declare URLFetcherDelegate (which we can't do with a
21 public: 20 // typedef).
22 // This will be called when the URL has been fetched, successfully or not. 21 class URLFetcherDelegate : public net::URLFetcherDelegate {};
23 // Use accessor methods on |source| to get the results.
24 virtual void OnURLFetchComplete(const URLFetcher* source) = 0;
25
26 // This will be called when some part of the response is read. |current|
27 // denotes the number of bytes received up to the call, and |total| is the
28 // expected total size of the response (or -1 if not determined).
29 virtual void OnURLFetchDownloadProgress(const URLFetcher* source,
30 int64 current, int64 total) {}
31
32 // This will be called when some part of the response is read.
33 // |download_data| contains the current bytes received since the last call.
34 // This will be called after ShouldSendDownloadData() and only if the latter
35 // returns true.
36 virtual void OnURLFetchDownloadData(const URLFetcher* source,
37 scoped_ptr<std::string> download_data) {}
38
39 // This indicates if OnURLFetchDownloadData should be called.
40 // This will be called before OnURLFetchDownloadData is called, and only if
41 // this returns true.
42 // Default implementation is false.
43 virtual bool ShouldSendDownloadData();
44
45 // This will be called when uploading of POST or PUT requests proceeded.
46 // |current| denotes the number of bytes sent so far, and |total| is the
47 // total size of uploading data (or -1 if chunked upload is enabled).
48 virtual void OnURLFetchUploadProgress(const URLFetcher* source,
49 int64 current, int64 total) {}
50
51 protected:
52 virtual ~URLFetcherDelegate() {}
53 };
54 22
55 } // namespace content 23 } // namespace content
56 24
57 #endif // CONTENT_PUBLIC_COMMON_URL_FETCHER_DELEGATE_H_ 25 #endif // CONTENT_PUBLIC_COMMON_URL_FETCHER_DELEGATE_H_
OLDNEW
« no previous file with comments | « content/public/common/url_fetcher.h ('k') | content/public/common/url_fetcher_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698