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

Unified Diff: chrome/browser/predictors/resource_prefetch_common.h

Issue 10416002: Seculative resource prefetching for URLs CL. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Resolving conflicts. Created 8 years, 6 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/predictors/resource_prefetch_common.h
diff --git a/chrome/browser/predictors/resource_prefetch_common.h b/chrome/browser/predictors/resource_prefetch_common.h
new file mode 100644
index 0000000000000000000000000000000000000000..aab6db15ffc47443a930849abc28c0361db28172
--- /dev/null
+++ b/chrome/browser/predictors/resource_prefetch_common.h
@@ -0,0 +1,46 @@
+// Copyright (c) 2012 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 CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_
+#define CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_
+#pragma once
+
+#include "base/time.h"
+#include "googleurl/src/gurl.h"
+
+namespace content {
+class WebContents;
+}
+
+namespace predictors {
+
+// Represents a single navigation for a render view.
+struct NavigationID {
+ // TODO(shishir): Maybe take process_id, view_id and url as input in
+ // constructor.
+ NavigationID();
+ NavigationID(const NavigationID& other);
+ explicit NavigationID(const content::WebContents& web_contents);
+ bool operator<(const NavigationID& rhs) const;
+ bool operator==(const NavigationID& rhs) const;
+
+ bool IsSameRenderer(const NavigationID& other) const;
+
+ // Returns true iff the render_process_id_, render_view_id_ and
+ // main_frame_url_ has been set correctly.
+ bool is_valid() const;
+
+ int render_process_id;
+ int render_view_id;
+ GURL main_frame_url;
+
+ // NOTE: Even though we store the creation time here, it is not used during
+ // comparison of two NavigationIDs because it cannot always be determined
+ // correctly.
+ base::TimeTicks creation_time;
+};
+
+} // namespace predictors
+
+#endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_
« no previous file with comments | « chrome/browser/predictors/predictor_table_base.cc ('k') | chrome/browser/predictors/resource_prefetch_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698