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

Side by Side Diff: components/html_viewer/html_frame_apptest.cc

Issue 1323233004: Adds better security checking to OnCreatedFrame() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 | « no previous file | components/web_view/frame.h » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "base/auto_reset.h" 5 #include "base/auto_reset.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 bool got_callback = false; 202 bool got_callback = false;
203 frame_connection->Init( 203 frame_connection->Init(
204 application_impl(), BuildRequestForURL(url_string), 204 application_impl(), BuildRequestForURL(url_string),
205 base::Bind(&OnGotContentHandlerForRoot, &got_callback)); 205 base::Bind(&OnGotContentHandlerForRoot, &got_callback));
206 ignore_result(ViewManagerTestBase::DoRunLoopWithTimeout()); 206 ignore_result(ViewManagerTestBase::DoRunLoopWithTimeout());
207 if (!got_callback) 207 if (!got_callback)
208 return nullptr; 208 return nullptr;
209 FrameConnection* result = frame_connection.get(); 209 FrameConnection* result = frame_connection.get();
210 FrameTreeClient* frame_tree_client = frame_connection->frame_tree_client(); 210 FrameTreeClient* frame_tree_client = frame_connection->frame_tree_client();
211 ViewTreeClientPtr tree_client = frame_connection->GetViewTreeClient(); 211 ViewTreeClientPtr tree_client = frame_connection->GetViewTreeClient();
212 frame_tree_.reset(new FrameTree(result->GetContentHandlerID(), view, 212 frame_tree_.reset(
213 frame_tree_delegate_.get(), 213 new FrameTree(result->GetContentHandlerID(), view, tree_client.Pass(),
214 frame_tree_client, frame_connection.Pass(), 214 frame_tree_delegate_.get(), frame_tree_client,
215 Frame::ClientPropertyMap())); 215 frame_connection.Pass(), Frame::ClientPropertyMap()));
216 frame_tree_delegate_->set_frame_tree(frame_tree_.get()); 216 frame_tree_delegate_->set_frame_tree(frame_tree_.get());
217 view->Embed(tree_client.Pass());
218 return result; 217 return result;
219 } 218 }
220 219
221 bool WaitForNavigateFrame() { 220 bool WaitForNavigateFrame() {
222 if (frame_tree_delegate_->waiting_for_navigate()) 221 if (frame_tree_delegate_->waiting_for_navigate())
223 return false; 222 return false;
224 223
225 frame_tree_delegate_->clear_got_navigate(); 224 frame_tree_delegate_->clear_got_navigate();
226 return frame_tree_delegate_->WaitForNavigateFrame(); 225 return frame_tree_delegate_->WaitForNavigateFrame();
227 } 226 }
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 script_value_as_list->GetString(0u, &message_in_child); 469 script_value_as_list->GetString(0u, &message_in_child);
471 } 470 }
472 } 471 }
473 } while (message_in_child != "hello from parent" && 472 } while (message_in_child != "hello from parent" &&
474 base::TimeTicks::Now() - start_time < 473 base::TimeTicks::Now() - start_time <
475 TestTimeouts::action_timeout()); 474 TestTimeouts::action_timeout());
476 EXPECT_EQ("hello from parent", message_in_child); 475 EXPECT_EQ("hello from parent", message_in_child);
477 } 476 }
478 477
479 } // namespace mojo 478 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | components/web_view/frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698