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

Side by Side Diff: public/platform/WebSerializedOrigin.h

Issue 201593002: Add WebSerializedOrigin to represent a serialized Web Origin. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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
« no previous file with comments | « Source/platform/exported/WebSerializedOrigin.cpp ('k') | public/platform/WebSocketHandle.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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 WebSerializedOrigin_h
6 #define WebSerializedOrigin_h
7
8 #include "WebString.h"
9
10 #if INSIDE_BLINK
11 namespace WebCore { class SecurityOrigin; }
12 #else
13 #include <url/origin.h>
14 #endif
15
16 namespace blink {
17
18 // WebSerializedOrigin represents a serialized Web Origin specified in RFC6454.
19 class WebSerializedOrigin {
20 public:
21 WebSerializedOrigin() : m_string("null") { }
22 #if INSIDE_BLINK
23 BLINK_PLATFORM_EXPORT WebSerializedOrigin(const WebCore::SecurityOrigin&);
24 #else
25 WebSerializedOrigin(const url::Origin& origin) : m_string(WebString::fromUTF 8(origin.string())) { }
26 operator url::Origin() const { return url::Origin(m_string.utf8()); }
27 #endif
28
29 const WebString& string() const
30 {
31 return m_string;
32 }
33
34 private:
35 const WebString m_string;
36 };
37
38 } // namespace blink
39
40 #endif // #ifndef SerializedOrigin_h
OLDNEW
« no previous file with comments | « Source/platform/exported/WebSerializedOrigin.cpp ('k') | public/platform/WebSocketHandle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698