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

Side by Side Diff: content/shell/browser/layout_test/blink_test_controller.cc

Issue 2566583002: Change allowed bindings to be per RenderFrame instead of per RenderView. (Closed)
Patch Set: rebase Created 3 years, 10 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/shell/browser/layout_test/blink_test_controller.h" 5 #include "content/shell/browser/layout_test/blink_test_controller.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <iostream> 9 #include <iostream>
10 #include <set> 10 #include <set>
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); 576 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
577 test_phase_ = CLEAN_UP; 577 test_phase_ = CLEAN_UP;
578 } else if (main_window_) { 578 } else if (main_window_) {
579 main_window_->Close(); 579 main_window_->Close();
580 } 580 }
581 main_window_ = NULL; 581 main_window_ = NULL;
582 current_pid_ = base::kNullProcessId; 582 current_pid_ = base::kNullProcessId;
583 } 583 }
584 584
585 void BlinkTestController::HandleNewRenderFrameHost(RenderFrameHost* frame) { 585 void BlinkTestController::HandleNewRenderFrameHost(RenderFrameHost* frame) {
586 // All RenderViewHosts in layout tests should get Mojo bindings. 586 // All RenderFrameHosts in layout tests should get Mojo bindings.
587 RenderViewHost* rvh = frame->GetRenderViewHost(); 587 if (!(frame->GetEnabledBindings() & BINDINGS_POLICY_MOJO))
588 if (!(rvh->GetEnabledBindings() & BINDINGS_POLICY_MOJO)) 588 frame->AllowBindings(BINDINGS_POLICY_MOJO);
589 rvh->AllowBindings(BINDINGS_POLICY_MOJO);
590 589
591 RenderProcessHost* process = frame->GetProcess(); 590 RenderProcessHost* process = frame->GetProcess();
592 bool main_window = 591 bool main_window =
593 WebContents::FromRenderFrameHost(frame) == main_window_->web_contents(); 592 WebContents::FromRenderFrameHost(frame) == main_window_->web_contents();
594 593
595 // Track pid of the renderer handling the main frame. 594 // Track pid of the renderer handling the main frame.
596 if (main_window && frame->GetParent() == nullptr) { 595 if (main_window && frame->GetParent() == nullptr) {
597 base::ProcessHandle process_handle = process->GetHandle(); 596 base::ProcessHandle process_handle = process->GetHandle();
598 if (process_handle != base::kNullProcessHandle) 597 if (process_handle != base::kNullProcessHandle)
599 current_pid_ = base::GetProcId(process_handle); 598 current_pid_ = base::GetProcId(process_handle);
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 } else { 947 } else {
949 printer_->AddErrorMessage(base::StringPrintf( 948 printer_->AddErrorMessage(base::StringPrintf(
950 "FAIL: Unexpected sendBluetoothManualChooserEvent() event name '%s'.", 949 "FAIL: Unexpected sendBluetoothManualChooserEvent() event name '%s'.",
951 event_name.c_str())); 950 event_name.c_str()));
952 return; 951 return;
953 } 952 }
954 bluetooth_chooser_factory_->SendEvent(event, argument); 953 bluetooth_chooser_factory_->SendEvent(event, argument);
955 } 954 }
956 955
957 } // namespace content 956 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/web_ui_extension.cc ('k') | headless/lib/browser/headless_web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698