summaryrefslogtreecommitdiffstats
path: root/content/browser/transition_request_manager.h
diff options
context:
space:
mode:
authorzhenw <zhenw@chromium.org>2014-11-07 11:25:40 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-07 19:25:57 +0000
commit9fb0481da9c5a809052611df341796c9cb6367d4 (patch)
tree876cd7e542c7f4637ff2644079a00c56884c6f9d /content/browser/transition_request_manager.h
parentcaa8c58cb570091ea27d8d75a406022ef8e0e82d (diff)
downloadchromium_src-9fb0481da9c5a809052611df341796c9cb6367d4.zip
chromium_src-9fb0481da9c5a809052611df341796c9cb6367d4.tar.gz
chromium_src-9fb0481da9c5a809052611df341796c9cb6367d4.tar.bz2
Navigation transitions (web to native app): Use TransitionElement struct to pass data
In the original CL 652953008, the layout test failed because transition elements were got on UI thread in navigator_impl.cc. This CL passes the data to TransitionRequestManager with TransitionElement struct, but defers passing transition elements to TransitionPageHelper on Java side. So navigator does not need to get the transition elements during navigation. And the Java side will fetch the transition elements later. ref: https://codereview.chromium.org/652953008 BUG=370696 Review URL: https://codereview.chromium.org/698043002 Cr-Commit-Position: refs/heads/master@{#303270}
Diffstat (limited to 'content/browser/transition_request_manager.h')
-rw-r--r--content/browser/transition_request_manager.h29
1 files changed, 15 insertions, 14 deletions
diff --git a/content/browser/transition_request_manager.h b/content/browser/transition_request_manager.h
index 3db4d87..65b5792 100644
--- a/content/browser/transition_request_manager.h
+++ b/content/browser/transition_request_manager.h
@@ -13,6 +13,7 @@
#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"
@@ -33,8 +34,7 @@ struct TransitionLayerData {
std::string markup;
std::string css_selector;
- std::vector<std::string> names;
- std::vector<gfx::Rect> rects;
+ std::vector<TransitionElement> elements;
scoped_refptr<net::HttpResponseHeaders> response_headers;
GURL request_url;
};
@@ -57,10 +57,11 @@ 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.
- CONTENT_EXPORT bool HasPendingTransitionRequest(
+ // 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,
@@ -74,8 +75,7 @@ class TransitionRequestManager {
const std::string& allowed_destination_host_pattern,
const std::string& css_selector,
const std::string& markup,
- const std::vector<std::string>& names,
- const std::vector<gfx::Rect>& rects);
+ const std::vector<TransitionElement>& elements);
CONTENT_EXPORT void AddPendingTransitionRequestDataForTesting(
int render_process_id,
int render_frame_id);
@@ -83,6 +83,10 @@ class TransitionRequestManager {
CONTENT_EXPORT 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 {
public:
@@ -91,8 +95,7 @@ class TransitionRequestManager {
void AddEntry(const std::string& allowed_destination_host_pattern,
const std::string& selector,
const std::string& markup,
- const std::vector<std::string>& names,
- const std::vector<gfx::Rect>& rects);
+ const std::vector<TransitionElement>& elements);
bool FindEntry(const GURL& request_url,
TransitionLayerData* transition_data);
@@ -104,14 +107,12 @@ class TransitionRequestManager {
std::string allowed_destination_host_pattern;
std::string css_selector;
std::string markup;
- std::vector<std::string> names;
- std::vector<gfx::Rect> rects;
+ std::vector<TransitionElement> elements;
AllowedEntry(const std::string& allowed_destination_host_pattern,
const std::string& css_selector,
const std::string& markup,
- const std::vector<std::string>& names,
- const std::vector<gfx::Rect>& rects);
+ const std::vector<TransitionElement>& elements);
~AllowedEntry();
};
std::vector<AllowedEntry> allowed_entries_;