OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // The intent of this file is to provide a type-neutral abstraction between | 5 // The intent of this file is to provide a type-neutral abstraction between |
6 // Chrome and WebKit for resource loading. This pure-virtual interface is | 6 // Chrome and WebKit for resource loading. This pure-virtual interface is |
7 // implemented by the embedder, which also provides a factory method Create | 7 // implemented by the embedder, which also provides a factory method Create |
8 // to instantiate this object. | 8 // to instantiate this object. |
9 // | 9 // |
10 // One of these objects will be created by WebKit for each request. WebKit | 10 // One of these objects will be created by WebKit for each request. WebKit |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "build/build_config.h" | 23 #include "build/build_config.h" |
24 #if defined(OS_POSIX) | 24 #if defined(OS_POSIX) |
25 #include "base/file_descriptor_posix.h" | 25 #include "base/file_descriptor_posix.h" |
26 #endif | 26 #endif |
27 #include "base/file_path.h" | 27 #include "base/file_path.h" |
28 #include "base/memory/ref_counted.h" | 28 #include "base/memory/ref_counted.h" |
29 #include "base/memory/scoped_ptr.h" | 29 #include "base/memory/scoped_ptr.h" |
30 #include "base/platform_file.h" | 30 #include "base/platform_file.h" |
31 #include "base/time.h" | 31 #include "base/time.h" |
32 #include "base/values.h" | 32 #include "base/values.h" |
| 33 #include "content/common/content_export.h" |
33 #include "googleurl/src/gurl.h" | 34 #include "googleurl/src/gurl.h" |
34 #include "net/base/host_port_pair.h" | 35 #include "net/base/host_port_pair.h" |
35 #include "net/url_request/url_request_status.h" | 36 #include "net/url_request/url_request_status.h" |
36 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" | 37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" |
37 #include "webkit/glue/resource_type.h" | 38 #include "webkit/glue/resource_type.h" |
38 | 39 |
39 namespace net { | 40 namespace net { |
40 class HttpResponseHeaders; | 41 class HttpResponseHeaders; |
41 } | 42 } |
42 | 43 |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 }; | 331 }; |
331 | 332 |
332 // use Create() for construction, but anybody can delete at any time, | 333 // use Create() for construction, but anybody can delete at any time, |
333 // INCLUDING during processing of callbacks. | 334 // INCLUDING during processing of callbacks. |
334 virtual ~ResourceLoaderBridge(); | 335 virtual ~ResourceLoaderBridge(); |
335 | 336 |
336 // Call this method to make a new instance. | 337 // Call this method to make a new instance. |
337 // | 338 // |
338 // For HTTP(S) POST requests, the AppendDataToUpload and AppendFileToUpload | 339 // For HTTP(S) POST requests, the AppendDataToUpload and AppendFileToUpload |
339 // methods may be called to construct the body of the request. | 340 // methods may be called to construct the body of the request. |
340 static ResourceLoaderBridge* Create(const RequestInfo& request_info); | 341 CONTENT_EXPORT static ResourceLoaderBridge* Create( |
| 342 const RequestInfo& request_info); |
341 | 343 |
342 // Call this method before calling Start() to append a chunk of binary data | 344 // Call this method before calling Start() to append a chunk of binary data |
343 // to the request body. May only be used with HTTP(S) POST requests. | 345 // to the request body. May only be used with HTTP(S) POST requests. |
344 virtual void AppendDataToUpload(const char* data, int data_len) = 0; | 346 virtual void AppendDataToUpload(const char* data, int data_len) = 0; |
345 | 347 |
346 // Call this method before calling Start() to append the contents of a file | 348 // Call this method before calling Start() to append the contents of a file |
347 // to the request body. May only be used with HTTP(S) POST requests. | 349 // to the request body. May only be used with HTTP(S) POST requests. |
348 void AppendFileToUpload(const FilePath& file_path) { | 350 void AppendFileToUpload(const FilePath& file_path) { |
349 AppendFileRangeToUpload(file_path, 0, kuint64max, base::Time()); | 351 AppendFileRangeToUpload(file_path, 0, kuint64max, base::Time()); |
350 } | 352 } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 // construction must go through Create() | 399 // construction must go through Create() |
398 ResourceLoaderBridge(); | 400 ResourceLoaderBridge(); |
399 | 401 |
400 private: | 402 private: |
401 DISALLOW_COPY_AND_ASSIGN(ResourceLoaderBridge); | 403 DISALLOW_COPY_AND_ASSIGN(ResourceLoaderBridge); |
402 }; | 404 }; |
403 | 405 |
404 } // namespace webkit_glue | 406 } // namespace webkit_glue |
405 | 407 |
406 #endif // WEBKIT_GLUE_RESOURCE_LOADER_BRIDGE_H_ | 408 #endif // WEBKIT_GLUE_RESOURCE_LOADER_BRIDGE_H_ |
OLD | NEW |