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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 2902953003: Revert of Allow headless TabSocket in isolated worlds & remove obsolete logic (Closed)
Patch Set: Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « content/renderer/mojo_context_state.cc ('k') | headless/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 6541 matching lines...) Expand 10 before | Expand all | Expand 10 after
6552 6552
6553 void RenderFrameImpl::SendUpdateState() { 6553 void RenderFrameImpl::SendUpdateState() {
6554 if (current_history_item_.IsNull()) 6554 if (current_history_item_.IsNull())
6555 return; 6555 return;
6556 6556
6557 Send(new FrameHostMsg_UpdateState( 6557 Send(new FrameHostMsg_UpdateState(
6558 routing_id_, SingleHistoryItemToPageState(current_history_item_))); 6558 routing_id_, SingleHistoryItemToPageState(current_history_item_)));
6559 } 6559 }
6560 6560
6561 void RenderFrameImpl::MaybeEnableMojoBindings() { 6561 void RenderFrameImpl::MaybeEnableMojoBindings() {
6562 // BINDINGS_POLICY_WEB_UI, BINDINGS_POLICY_MOJO, 6562 // BINDINGS_POLICY_WEB_UI, BINDINGS_POLICY_MOJO and BINDINGS_POLICY_HEADLESS
6563 // BINDINGS_POLICY_HEADLESS_MAIN_WORLD and 6563 // are mutually exclusive. They provide access to Mojo bindings, but do so in
6564 // BINDINGS_POLICY_HEADLESS_ISOLATED_WORLD are mutually exclusive. They 6564 // incompatible ways.
6565 // provide access to Mojo bindings, but do so in incompatible ways. 6565 const int kAllBindingsTypes =
6566 const int kAllBindingsTypes = BINDINGS_POLICY_WEB_UI | BINDINGS_POLICY_MOJO | 6566 BINDINGS_POLICY_WEB_UI | BINDINGS_POLICY_MOJO | BINDINGS_POLICY_HEADLESS;
6567 BINDINGS_POLICY_HEADLESS_MAIN_WORLD |
6568 BINDINGS_POLICY_HEADLESS_ISOLATED_WORLD;
6569 6567
6570 // Make sure that at most one of BINDINGS_POLICY_WEB_UI, BINDINGS_POLICY_MOJO 6568 // Make sure that at most one of BINDINGS_POLICY_WEB_UI, BINDINGS_POLICY_MOJO
6571 // BINDINGS_POLICY_HEADLESS_MAIN_WORLD and 6569 // and BINDINGS_POLICY_HEADLESS have been set.
6572 // BINDINGS_POLICY_HEADLESS_ISOLATED_WORLD have been set.
6573 // NOTE x & (x - 1) == 0 is true iff x is zero or a power of two. 6570 // NOTE x & (x - 1) == 0 is true iff x is zero or a power of two.
6574 DCHECK_EQ((enabled_bindings_ & kAllBindingsTypes) & 6571 DCHECK_EQ((enabled_bindings_ & kAllBindingsTypes) &
6575 ((enabled_bindings_ & kAllBindingsTypes) - 1), 6572 ((enabled_bindings_ & kAllBindingsTypes) - 1),
6576 0); 6573 0);
6577 6574
6578 DCHECK_EQ(RenderProcess::current()->GetEnabledBindings(), enabled_bindings_); 6575 DCHECK_EQ(RenderProcess::current()->GetEnabledBindings(), enabled_bindings_);
6579 6576
6580 // If an MojoBindingsController already exists for this RenderFrameImpl, avoid 6577 // If an MojoBindingsController already exists for this RenderFrameImpl, avoid
6581 // creating another one. It is not kept as a member, as it deletes itself when 6578 // creating another one. It is not kept as a member, as it deletes itself when
6582 // the frame is destroyed. 6579 // the frame is destroyed.
6583 if (RenderFrameObserverTracker<MojoBindingsController>::Get(this)) 6580 if (RenderFrameObserverTracker<MojoBindingsController>::Get(this))
6584 return; 6581 return;
6585 6582
6586 if (IsMainFrame() && enabled_bindings_ & BINDINGS_POLICY_WEB_UI) { 6583 if (IsMainFrame() && enabled_bindings_ & BINDINGS_POLICY_WEB_UI) {
6587 new MojoBindingsController(this, MojoBindingsType::FOR_WEB_UI); 6584 new MojoBindingsController(this, MojoBindingsType::FOR_WEB_UI);
6588 } else if (enabled_bindings_ & BINDINGS_POLICY_MOJO) { 6585 } else if (enabled_bindings_ & BINDINGS_POLICY_MOJO) {
6589 new MojoBindingsController(this, MojoBindingsType::FOR_LAYOUT_TESTS); 6586 new MojoBindingsController(this, MojoBindingsType::FOR_LAYOUT_TESTS);
6587 } else if (enabled_bindings_ & BINDINGS_POLICY_HEADLESS) {
6588 new MojoBindingsController(this, MojoBindingsType::FOR_HEADLESS);
6590 } 6589 }
6591 } 6590 }
6592 6591
6593 void RenderFrameImpl::SendFailedProvisionalLoad( 6592 void RenderFrameImpl::SendFailedProvisionalLoad(
6594 const blink::WebURLRequest& request, 6593 const blink::WebURLRequest& request,
6595 const blink::WebURLError& error, 6594 const blink::WebURLError& error,
6596 blink::WebLocalFrame* frame) { 6595 blink::WebLocalFrame* frame) {
6597 bool show_repost_interstitial = 6596 bool show_repost_interstitial =
6598 (error.reason == net::ERR_CACHE_MISS && 6597 (error.reason == net::ERR_CACHE_MISS &&
6599 base::EqualsASCII(request.HttpMethod().Utf16(), "POST")); 6598 base::EqualsASCII(request.HttpMethod().Utf16(), "POST"));
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
7068 policy(info.default_policy), 7067 policy(info.default_policy),
7069 replaces_current_history_item(info.replaces_current_history_item), 7068 replaces_current_history_item(info.replaces_current_history_item),
7070 history_navigation_in_new_child_frame( 7069 history_navigation_in_new_child_frame(
7071 info.is_history_navigation_in_new_child_frame), 7070 info.is_history_navigation_in_new_child_frame),
7072 client_redirect(info.is_client_redirect), 7071 client_redirect(info.is_client_redirect),
7073 cache_disabled(info.is_cache_disabled), 7072 cache_disabled(info.is_cache_disabled),
7074 form(info.form), 7073 form(info.form),
7075 source_location(info.source_location) {} 7074 source_location(info.source_location) {}
7076 7075
7077 } // namespace content 7076 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/mojo_context_state.cc ('k') | headless/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698