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

Unified Diff: content/browser/browsing_instance_frame_id.cc

Issue 8760024: Cross-process postMessage (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: New patch, still not quite done Created 9 years 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: content/browser/browsing_instance_frame_id.cc
diff --git a/content/browser/browsing_instance_frame_id.cc b/content/browser/browsing_instance_frame_id.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a4483ad5835fa11d406af748cc404725fb23b1c9
--- /dev/null
+++ b/content/browser/browsing_instance_frame_id.cc
@@ -0,0 +1,42 @@
+// Copyright (c) 2011 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.
+
+#include "browsing_instance_frame_id.h"
+
+namespace content {
+
+BrowsingInstanceFrame::WebKitFrameIdTuple::WebKitFrameIdTuple(int proc_host_id,
+ int64 frame_id)
+ : process_host_id(proc_host_id),
+ frame_id(frame_id) {
+}
+
+bool BrowsingInstanceFrame::WebKitFrameIdTuple::operator==(
+ const WebKitFrameIdTuple& o) const {
+ return o.process_host_id == process_host_id &&
+ o.frame_id == frame_id;
+}
+
+BrowsingInstanceFrame::BrowsingInstanceFrame(int64 id, bool is_top_level)
+ : id_(id),
+ current_webkit_frame_(WebKitFrameIdTuple(-1, -1)),
+ current_route_id_(-1),
+ is_top_level_(is_top_level) {
+}
+
+BrowsingInstanceFrame::~BrowsingInstanceFrame() {
+}
+
+void BrowsingInstanceFrame::UpdateFrame(int new_process_host_id,
+ int new_route_id,
+ int64 new_frame_id) {
+ WebKitFrameIdTuple newWebKitTuple(new_process_host_id, new_frame_id);
+ current_webkit_frame_ = newWebKitTuple;
+ current_route_id_ = new_route_id;
+
+ all_webkit_frames_.push_back(newWebKitTuple);
+ // TODO(supersat): Clear out subframes?
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698