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

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

Issue 2049363003: Adds support for headless chrome embedder mojo services (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes for Sami Created 4 years, 5 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
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 5882 matching lines...) Expand 10 before | Expand all | Expand 10 after
5893 DCHECK(SiteIsolationPolicy::UseSubframeNavigationEntries()); 5893 DCHECK(SiteIsolationPolicy::UseSubframeNavigationEntries());
5894 if (current_history_item_.isNull()) 5894 if (current_history_item_.isNull())
5895 return; 5895 return;
5896 5896
5897 Send(new FrameHostMsg_UpdateState( 5897 Send(new FrameHostMsg_UpdateState(
5898 routing_id_, SingleHistoryItemToPageState(current_history_item_))); 5898 routing_id_, SingleHistoryItemToPageState(current_history_item_)));
5899 } 5899 }
5900 5900
5901 void RenderFrameImpl::MaybeEnableMojoBindings() { 5901 void RenderFrameImpl::MaybeEnableMojoBindings() {
5902 int enabled_bindings = RenderProcess::current()->GetEnabledBindings(); 5902 int enabled_bindings = RenderProcess::current()->GetEnabledBindings();
5903 // BINDINGS_POLICY_WEB_UI and BINDINGS_POLICY_MOJO are mutually exclusive. 5903 // BINDINGS_POLICY_WEB_UI, BINDINGS_POLICY_MOJO and BINDINGS_POLICY_HEADLESS
5904 // They both provide access to Mojo bindings, but do so in incompatible ways. 5904 // are mutually exclusive. They provide access to Mojo bindings, but do so in
5905 const int kMojoAndWebUiBindings = 5905 // incompatible ways.
5906 BINDINGS_POLICY_WEB_UI | BINDINGS_POLICY_MOJO; 5906 const int kAllBindingsTypes =
5907 DCHECK_NE(enabled_bindings & kMojoAndWebUiBindings, kMojoAndWebUiBindings); 5907 BINDINGS_POLICY_WEB_UI | BINDINGS_POLICY_MOJO | BINDINGS_POLICY_HEADLESS;
5908 DCHECK_EQ((enabled_bindings & kAllBindingsTypes) &
5909 ((enabled_bindings & kAllBindingsTypes) - 1),
Charlie Reis 2016/06/27 17:30:11 Am I misreading this? It looks like it's checking
alex clarke (OOO till 29th) 2016/07/29 09:06:23 No :)
5910 0);
5908 5911
5909 // If an MojoBindingsController already exists for this RenderFrameImpl, avoid 5912 // If an MojoBindingsController already exists for this RenderFrameImpl, avoid
5910 // creating another one. It is not kept as a member, as it deletes itself when 5913 // creating another one. It is not kept as a member, as it deletes itself when
5911 // the frame is destroyed. 5914 // the frame is destroyed.
5912 if (RenderFrameObserverTracker<MojoBindingsController>::Get(this)) 5915 if (RenderFrameObserverTracker<MojoBindingsController>::Get(this))
5913 return; 5916 return;
5914 5917
5915 if (IsMainFrame() && 5918 if (IsMainFrame() &&
5916 enabled_bindings & BINDINGS_POLICY_WEB_UI) { 5919 enabled_bindings & BINDINGS_POLICY_WEB_UI) {
5917 new MojoBindingsController(this, false /* for_layout_tests */); 5920 new MojoBindingsController(this, MojoBindingsType::FOR_UI_BINDINGS);
5918 } else if (enabled_bindings & BINDINGS_POLICY_MOJO) { 5921 } else if (enabled_bindings & BINDINGS_POLICY_MOJO) {
5919 new MojoBindingsController(this, true /* for_layout_tests */); 5922 new MojoBindingsController(this, MojoBindingsType::FOR_LAYOUT_TESTS);
5923 } else if (enabled_bindings & BINDINGS_POLICY_HEADLESS) {
5924 new MojoBindingsController(this, MojoBindingsType::FOR_HEADLESS);
5920 } 5925 }
5921 } 5926 }
5922 5927
5923 void RenderFrameImpl::SendFailedProvisionalLoad( 5928 void RenderFrameImpl::SendFailedProvisionalLoad(
5924 const blink::WebURLRequest& request, 5929 const blink::WebURLRequest& request,
5925 const blink::WebURLError& error, 5930 const blink::WebURLError& error,
5926 blink::WebLocalFrame* frame) { 5931 blink::WebLocalFrame* frame) {
5927 bool show_repost_interstitial = 5932 bool show_repost_interstitial =
5928 (error.reason == net::ERR_CACHE_MISS && 5933 (error.reason == net::ERR_CACHE_MISS &&
5929 base::EqualsASCII(base::StringPiece16(request.httpMethod()), "POST")); 5934 base::EqualsASCII(base::StringPiece16(request.httpMethod()), "POST"));
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
6306 // event target. Potentially a Pepper plugin will receive the event. 6311 // event target. Potentially a Pepper plugin will receive the event.
6307 // In order to tell whether a plugin gets the last mouse event and which it 6312 // In order to tell whether a plugin gets the last mouse event and which it
6308 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6313 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6309 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6314 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6310 // |pepper_last_mouse_event_target_|. 6315 // |pepper_last_mouse_event_target_|.
6311 pepper_last_mouse_event_target_ = nullptr; 6316 pepper_last_mouse_event_target_ = nullptr;
6312 #endif 6317 #endif
6313 } 6318 }
6314 6319
6315 } // namespace content 6320 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698