IndexedDBFactory now ForceCloses databases.
[chromium-blink-merge.git] / content / child / npapi / plugin_url_fetcher.h
blobb7cf4ecfba1dc597b686c0c591c7a95fc59fcab7
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_CHILD_NPAPI_URL_FETCHER_H_
6 #define CONTENT_CHILD_NPAPI_URL_FETCHER_H_
8 #include <string>
10 #include "base/memory/scoped_ptr.h"
11 #include "url/gurl.h"
12 #include "webkit/child/resource_loader_bridge.h"
14 namespace webkit_glue {
15 class MultipartResponseDelegate;
16 class ResourceLoaderBridge;
19 namespace content {
20 class PluginStreamUrl;
22 // Fetches URLS for a plugin using ResourceDispatcher.
23 class PluginURLFetcher : public webkit_glue::ResourceLoaderBridge::Peer {
24 public:
25 PluginURLFetcher(PluginStreamUrl* plugin_stream,
26 const GURL& url,
27 const GURL& first_party_for_cookies,
28 const std::string& method,
29 const char* buf,
30 unsigned int len,
31 const GURL& referrer,
32 bool notify_redirects,
33 bool is_plugin_src_load,
34 int origin_pid,
35 int render_frame_id,
36 unsigned long resource_id);
37 virtual ~PluginURLFetcher();
39 // Cancels the current request.
40 void Cancel();
42 // Called with the plugin's reply to NPP_URLRedirectNotify.
43 void URLRedirectResponse(bool allow);
45 bool pending_failure_notification() { return pending_failure_notification_; }
47 private:
48 // webkit_glue::ResourceLoaderBridge::Peer implementation:
49 virtual void OnUploadProgress(uint64 position, uint64 size) OVERRIDE;
50 virtual bool OnReceivedRedirect(const GURL& new_url,
51 const webkit_glue::ResourceResponseInfo& info,
52 bool* has_new_first_party_for_cookies,
53 GURL* new_first_party_for_cookies) OVERRIDE;
54 virtual void OnReceivedResponse(
55 const webkit_glue::ResourceResponseInfo& info) OVERRIDE;
56 virtual void OnDownloadedData(int len, int encoded_data_length) OVERRIDE;
57 virtual void OnReceivedData(const char* data,
58 int data_length,
59 int encoded_data_length) OVERRIDE;
60 virtual void OnCompletedRequest(
61 int error_code,
62 bool was_ignored_by_handler,
63 const std::string& security_info,
64 const base::TimeTicks& completion_time) OVERRIDE;
66 PluginStreamUrl* plugin_stream_;
67 GURL url_;
68 GURL first_party_for_cookies_;
69 std::string method_;
70 GURL referrer_;
71 bool notify_redirects_;
72 bool is_plugin_src_load_;
73 unsigned long resource_id_;
74 int64 data_offset_;
75 bool pending_failure_notification_;
77 scoped_ptr<webkit_glue::MultipartResponseDelegate> multipart_delegate_;
79 scoped_ptr<webkit_glue::ResourceLoaderBridge> bridge_;
81 DISALLOW_COPY_AND_ASSIGN(PluginURLFetcher);
84 } // namespace content
86 #endif // CONTENT_CHILD_NPAPI_URL_FETCHER_H_