Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / content / browser / transition_request_manager.h
index 0a01878..65b5792 100644 (file)
@@ -13,6 +13,8 @@
 #include "base/basictypes.h"
 #include "base/memory/ref_counted.h"
 #include "content/common/content_export.h"
+#include "content/public/common/transition_element.h"
+#include "ui/gfx/geometry/rect.h"
 #include "url/gurl.h"
 
 template <typename T>
@@ -27,11 +29,12 @@ namespace content {
 
 // This struct passes data about an imminent transition between threads.
 struct TransitionLayerData {
-  TransitionLayerData();
-  ~TransitionLayerData();
+  CONTENT_EXPORT TransitionLayerData();
+  CONTENT_EXPORT ~TransitionLayerData();
 
   std::string markup;
   std::string css_selector;
+  std::vector<TransitionElement> elements;
   scoped_refptr<net::HttpResponseHeaders> response_headers;
   GURL request_url;
 };
@@ -54,13 +57,15 @@ class TransitionRequestManager {
       std::vector<GURL>& entering_stylesheets,
       const GURL& resolve_address);
 
-  // Returns whether the RenderFrameHost specified by the given IDs currently
-  // has any pending transition request data. If so, we will have to delay the
-  // response until the embedder resumes the request.
-  bool HasPendingTransitionRequest(int render_process_id,
-                                   int render_frame_id,
-                                   const GURL& request_url,
-                                   TransitionLayerData* transition_data);
+  // Get pending transition request data from RenderFrameHost specified by the
+  // given IDs and return true if the data exists. For web to web transition, we
+  // will have to delay the response until the embedder resumes the request if
+  // the data exists.
+  CONTENT_EXPORT bool GetPendingTransitionRequest(
+      int render_process_id,
+      int render_frame_id,
+      const GURL& request_url,
+      TransitionLayerData* transition_data);
 
   // Adds pending request data for a transition navigation for the
   // RenderFrameHost specified by the given IDs.
@@ -69,10 +74,18 @@ class TransitionRequestManager {
       int render_frame_id,
       const std::string& allowed_destination_host_pattern,
       const std::string& css_selector,
-      const std::string& markup);
+      const std::string& markup,
+      const std::vector<TransitionElement>& elements);
+  CONTENT_EXPORT void AddPendingTransitionRequestDataForTesting(
+      int render_process_id,
+      int render_frame_id);
+
+  CONTENT_EXPORT void ClearPendingTransitionRequestData(int render_process_id,
+                                                        int render_frame_id);
 
-  void ClearPendingTransitionRequestData(int render_process_id,
-                                         int render_frame_id);
+  // The maximum number of elements is meant to avoid passing arbitrarily large
+  // amount of objects across the IPC boundary.
+  static const int kMaxNumOfElements = 1024;
 
  private:
   class TransitionRequestData {
@@ -81,7 +94,8 @@ class TransitionRequestManager {
     ~TransitionRequestData();
     void AddEntry(const std::string& allowed_destination_host_pattern,
                   const std::string& selector,
-                  const std::string& markup);
+                  const std::string& markup,
+                  const std::vector<TransitionElement>& elements);
     bool FindEntry(const GURL& request_url,
                     TransitionLayerData* transition_data);
 
@@ -93,13 +107,13 @@ class TransitionRequestManager {
       std::string allowed_destination_host_pattern;
       std::string css_selector;
       std::string markup;
+      std::vector<TransitionElement> elements;
 
       AllowedEntry(const std::string& allowed_destination_host_pattern,
                    const std::string& css_selector,
-                   const std::string& markup) :
-        allowed_destination_host_pattern(allowed_destination_host_pattern),
-        css_selector(css_selector),
-        markup(markup) {}
+                   const std::string& markup,
+                   const std::vector<TransitionElement>& elements);
+      ~AllowedEntry();
     };
     std::vector<AllowedEntry> allowed_entries_;
   };