Upstream version 8.37.180.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / public / platform / WebServiceWorkerRequest.h
1 // Copyright 2014 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.
4
5 #ifndef WebServiceWorkerRequest_h
6 #define WebServiceWorkerRequest_h
7
8 #include "WebCommon.h"
9 #include "public/platform/WebPrivatePtr.h"
10 #include "public/platform/WebString.h"
11 #include "public/platform/WebURL.h"
12
13 #if INSIDE_BLINK
14 #include "wtf/Forward.h"
15 #include "wtf/HashMap.h"
16 #include "wtf/text/StringHash.h"
17 #endif
18
19 namespace blink {
20
21 class WebServiceWorkerRequestPrivate;
22
23 // Represents a request of a fetch operation. FetchEvent dispatched by the
24 // browser contains this. The plan is for the Cache and fetch() API to also use
25 // it.
26 class BLINK_PLATFORM_EXPORT WebServiceWorkerRequest {
27 public:
28     ~WebServiceWorkerRequest() { reset(); }
29     WebServiceWorkerRequest();
30     WebServiceWorkerRequest& operator=(const WebServiceWorkerRequest& other)
31     {
32         assign(other);
33         return *this;
34     }
35
36     void reset();
37     void assign(const WebServiceWorkerRequest&);
38
39     void setURL(const WebURL&);
40     WebURL url() const;
41
42     void setMethod(const WebString&);
43     WebString method() const;
44
45     void setHeader(const WebString& key, const WebString& value);
46
47 #if INSIDE_BLINK
48     const HashMap<String, String>& headers() const;
49 #endif
50
51 private:
52     WebPrivatePtr<WebServiceWorkerRequestPrivate> m_private;
53 };
54
55 } // namespace blink
56
57 #endif // WebServiceWorkerRequest_h