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

Unified Diff: chrome/browser/extensions/api/sessions/foreign_session_id.h

Issue 21022018: Sessions API - previously Session Restore API. Supports restoring currently open foreign windows an… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updated Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/sessions/foreign_session_id.h
diff --git a/net/server/http_connection.h b/chrome/browser/extensions/api/sessions/foreign_session_id.h
similarity index 21%
copy from net/server/http_connection.h
copy to chrome/browser/extensions/api/sessions/foreign_session_id.h
index b0e37663d4f61b696ced07c31d9b9cfdfb11b6f2..318d137fd3436276a9aec127e7ece83b8b9a955a 100644
--- a/net/server/http_connection.h
+++ b/chrome/browser/extensions/api/sessions/foreign_session_id.h
@@ -1,53 +1,43 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef NET_SERVER_HTTP_CONNECTION_H_
-#define NET_SERVER_HTTP_CONNECTION_H_
+#ifndef CHROME_BROWSER_EXTENSIONS_API_SESSIONS_FOREIGN_SESSION_ID_H__
+#define CHROME_BROWSER_EXTENSIONS_API_SESSIONS_FOREIGN_SESSION_ID_H__
#include <string>
#include "base/basictypes.h"
-#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
-#include "net/http/http_status_code.h"
-namespace net {
+namespace extensions {
-class HttpServer;
-class HttpServerResponseInfo;
-class StreamListenSocket;
-class WebSocket;
-
-class HttpConnection {
+class ForeignSessionId {
public:
- ~HttpConnection();
+ // Constructs a ForeignSessionId object for the given session information.
+ ForeignSessionId(const std::string& session_tag, int id);
not at google - send to devlin 2013/08/12 23:51:34 maybe you need to explain the difference between t
Kristen Dwan 2013/08/15 07:11:56 Done.
+
+ // Constructs a ForeignSessionId, given a string formatted by ToString().
+ explicit ForeignSessionId(const std::string& foreign_session_string);
not at google - send to devlin 2013/08/12 23:51:34 generally nicer to have a static method like Parse
Kristen Dwan 2013/08/15 07:11:56 Done.
- void Send(const std::string& data);
- void Send(const char* bytes, int len);
- void Send(const HttpServerResponseInfo& response);
+ // Returns true if the provided |id| is in the format of a ForeignSessionId.
+ static bool IsForeignSessionId(const std::string& id);
- void Shift(int num_bytes);
+ // Returns the compressed std::string representation of a ForeignSessionId.
+ std::string ToString();
- const std::string& recv_data() const { return recv_data_; }
+ std::string session_tag() const { return session_tag_; }
not at google - send to devlin 2013/08/12 23:51:34 return a const std::string& here
Kristen Dwan 2013/08/15 07:11:56 Done.
int id() const { return id_; }
private:
- friend class HttpServer;
- static int last_id_;
-
- HttpConnection(HttpServer* server, StreamListenSocket* sock);
+ // Associated session tag for this foreign entry.
+ std::string session_tag_;
- void DetachSocket();
-
- HttpServer* server_;
- scoped_refptr<StreamListenSocket> socket_;
- scoped_ptr<WebSocket> web_socket_;
- std::string recv_data_;
+ // ID corresponding to this foreign entry.
int id_;
- DISALLOW_COPY_AND_ASSIGN(HttpConnection);
+
+ DISALLOW_COPY_AND_ASSIGN(ForeignSessionId);
};
-} // namespace net
+} // namespace extensions
-#endif // NET_SERVER_HTTP_CONNECTION_H_
+#endif // CHROME_BROWSER_EXTENSIONS_API_SESSIONS_FOREIGN_SESSION_ID_H__

Powered by Google App Engine
This is Rietveld 408576698