OLD | NEW |
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 "content/browser/frame_host/navigation_handle_impl.h" | 5 #include "content/browser/frame_host/navigation_handle_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "content/browser/browsing_data/clear_site_data_throttle.h" | 10 #include "content/browser/browsing_data/clear_site_data_throttle.h" |
| 11 #include "content/browser/child_process_security_policy_impl.h" |
11 #include "content/browser/devtools/render_frame_devtools_agent_host.h" | 12 #include "content/browser/devtools/render_frame_devtools_agent_host.h" |
12 #include "content/browser/frame_host/frame_tree_node.h" | 13 #include "content/browser/frame_host/frame_tree_node.h" |
13 #include "content/browser/frame_host/navigator.h" | 14 #include "content/browser/frame_host/navigator.h" |
14 #include "content/browser/frame_host/navigator_delegate.h" | 15 #include "content/browser/frame_host/navigator_delegate.h" |
15 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 16 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
16 #include "content/common/frame_messages.h" | 17 #include "content/common/frame_messages.h" |
17 #include "content/common/resource_request_body_impl.h" | 18 #include "content/common/resource_request_body_impl.h" |
| 19 #include "content/common/site_isolation_policy.h" |
18 #include "content/public/browser/content_browser_client.h" | 20 #include "content/public/browser/content_browser_client.h" |
19 #include "content/public/common/browser_side_navigation_policy.h" | 21 #include "content/public/common/browser_side_navigation_policy.h" |
20 #include "content/public/common/content_client.h" | 22 #include "content/public/common/content_client.h" |
21 #include "net/url_request/redirect_info.h" | 23 #include "net/url_request/redirect_info.h" |
22 #include "url/gurl.h" | 24 #include "url/gurl.h" |
23 #include "url/url_constants.h" | 25 #include "url/url_constants.h" |
24 | 26 |
25 namespace content { | 27 namespace content { |
26 | 28 |
27 namespace { | 29 namespace { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 has_user_gesture_(false), | 63 has_user_gesture_(false), |
62 transition_(ui::PAGE_TRANSITION_LINK), | 64 transition_(ui::PAGE_TRANSITION_LINK), |
63 is_external_protocol_(false), | 65 is_external_protocol_(false), |
64 net_error_code_(net::OK), | 66 net_error_code_(net::OK), |
65 render_frame_host_(nullptr), | 67 render_frame_host_(nullptr), |
66 is_renderer_initiated_(is_renderer_initiated), | 68 is_renderer_initiated_(is_renderer_initiated), |
67 is_same_page_(false), | 69 is_same_page_(false), |
68 is_synchronous_(is_synchronous), | 70 is_synchronous_(is_synchronous), |
69 is_srcdoc_(is_srcdoc), | 71 is_srcdoc_(is_srcdoc), |
70 was_redirected_(false), | 72 was_redirected_(false), |
| 73 original_url_(url), |
71 state_(INITIAL), | 74 state_(INITIAL), |
72 is_transferring_(false), | 75 is_transferring_(false), |
73 frame_tree_node_(frame_tree_node), | 76 frame_tree_node_(frame_tree_node), |
74 next_index_(0), | 77 next_index_(0), |
75 navigation_start_(navigation_start), | 78 navigation_start_(navigation_start), |
76 pending_nav_entry_id_(pending_nav_entry_id), | 79 pending_nav_entry_id_(pending_nav_entry_id), |
77 request_context_type_(REQUEST_CONTEXT_TYPE_UNSPECIFIED) { | 80 request_context_type_(REQUEST_CONTEXT_TYPE_UNSPECIFIED), |
| 81 should_replace_current_entry_(false), |
| 82 is_download_(false), |
| 83 is_stream_(false), |
| 84 weak_factory_(this) { |
78 DCHECK(!navigation_start.is_null()); | 85 DCHECK(!navigation_start.is_null()); |
79 GetDelegate()->DidStartNavigation(this); | 86 GetDelegate()->DidStartNavigation(this); |
| 87 redirect_chain_.push_back(url); |
80 | 88 |
81 if (IsInMainFrame()) { | 89 if (IsInMainFrame()) { |
82 TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP1( | 90 TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP1( |
83 "navigation", "Navigation StartToCommit", this, | 91 "navigation", "Navigation StartToCommit", this, |
84 navigation_start.ToInternalValue(), "Initial URL", url_.spec()); | 92 navigation_start.ToInternalValue(), "Initial URL", url_.spec()); |
85 } | 93 } |
86 } | 94 } |
87 | 95 |
88 NavigationHandleImpl::~NavigationHandleImpl() { | 96 NavigationHandleImpl::~NavigationHandleImpl() { |
89 GetDelegate()->DidFinishNavigation(this); | 97 GetDelegate()->DidFinishNavigation(this); |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 | 235 |
228 NavigationThrottle::ThrottleCheckResult result = NavigationThrottle::DEFER; | 236 NavigationThrottle::ThrottleCheckResult result = NavigationThrottle::DEFER; |
229 if (state_ == DEFERRING_START) { | 237 if (state_ == DEFERRING_START) { |
230 result = CheckWillStartRequest(); | 238 result = CheckWillStartRequest(); |
231 } else if (state_ == DEFERRING_REDIRECT) { | 239 } else if (state_ == DEFERRING_REDIRECT) { |
232 result = CheckWillRedirectRequest(); | 240 result = CheckWillRedirectRequest(); |
233 } else { | 241 } else { |
234 result = CheckWillProcessResponse(); | 242 result = CheckWillProcessResponse(); |
235 | 243 |
236 // If the navigation is about to proceed after processing the response, then | 244 // If the navigation is about to proceed after processing the response, then |
237 // it's ready to commit. | 245 // it's ready to commit. Determine the final RenderFrameHost handling it. |
238 if (result == NavigationThrottle::PROCEED) | 246 // Note: if FindFinalRenderFrameHost() returns false, this means that this |
239 ReadyToCommitNavigation(render_frame_host_); | 247 // NavigationHandle was deleted, so return immediately. |
| 248 if (result == NavigationThrottle::PROCEED && !FindFinalRenderFrameHost()) |
| 249 return; |
240 } | 250 } |
241 | 251 |
242 if (result != NavigationThrottle::DEFER) | 252 if (result != NavigationThrottle::DEFER) |
243 RunCompleteCallback(result); | 253 RunCompleteCallback(result); |
244 } | 254 } |
245 | 255 |
246 void NavigationHandleImpl::CancelDeferredNavigation( | 256 void NavigationHandleImpl::CancelDeferredNavigation( |
247 NavigationThrottle::ThrottleCheckResult result) { | 257 NavigationThrottle::ThrottleCheckResult result) { |
248 DCHECK(state_ == DEFERRING_START || state_ == DEFERRING_REDIRECT); | 258 DCHECK(state_ == DEFERRING_START || state_ == DEFERRING_REDIRECT); |
249 DCHECK(result == NavigationThrottle::CANCEL_AND_IGNORE || | 259 DCHECK(result == NavigationThrottle::CANCEL_AND_IGNORE || |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 complete_callback_.Reset(); | 312 complete_callback_.Reset(); |
303 return result; | 313 return result; |
304 } | 314 } |
305 | 315 |
306 NavigationThrottle::ThrottleCheckResult | 316 NavigationThrottle::ThrottleCheckResult |
307 NavigationHandleImpl::CallWillProcessResponseForTesting( | 317 NavigationHandleImpl::CallWillProcessResponseForTesting( |
308 content::RenderFrameHost* render_frame_host) { | 318 content::RenderFrameHost* render_frame_host) { |
309 NavigationThrottle::ThrottleCheckResult result = NavigationThrottle::DEFER; | 319 NavigationThrottle::ThrottleCheckResult result = NavigationThrottle::DEFER; |
310 WillProcessResponse(static_cast<RenderFrameHostImpl*>(render_frame_host), | 320 WillProcessResponse(static_cast<RenderFrameHostImpl*>(render_frame_host), |
311 scoped_refptr<net::HttpResponseHeaders>(), SSLStatus(), | 321 scoped_refptr<net::HttpResponseHeaders>(), SSLStatus(), |
| 322 GlobalRequestID(), false, false, false, base::Closure(), |
312 base::Bind(&UpdateThrottleCheckResult, &result)); | 323 base::Bind(&UpdateThrottleCheckResult, &result)); |
313 | 324 |
314 // Reset the callback to ensure it will not be called later. | 325 // Reset the callback to ensure it will not be called later. |
315 complete_callback_.Reset(); | 326 complete_callback_.Reset(); |
316 return result; | 327 return result; |
317 } | 328 } |
318 | 329 |
319 NavigationData* NavigationHandleImpl::GetNavigationData() { | 330 NavigationData* NavigationHandleImpl::GetNavigationData() { |
320 return navigation_data_.get(); | 331 return navigation_data_.get(); |
321 } | 332 } |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 scoped_refptr<net::HttpResponseHeaders> response_headers, | 376 scoped_refptr<net::HttpResponseHeaders> response_headers, |
366 const ThrottleChecksFinishedCallback& callback) { | 377 const ThrottleChecksFinishedCallback& callback) { |
367 // Update the navigation parameters. | 378 // Update the navigation parameters. |
368 url_ = new_url; | 379 url_ = new_url; |
369 method_ = new_method; | 380 method_ = new_method; |
370 sanitized_referrer_.url = new_referrer_url; | 381 sanitized_referrer_.url = new_referrer_url; |
371 sanitized_referrer_ = Referrer::SanitizeForRequest(url_, sanitized_referrer_); | 382 sanitized_referrer_ = Referrer::SanitizeForRequest(url_, sanitized_referrer_); |
372 is_external_protocol_ = new_is_external_protocol; | 383 is_external_protocol_ = new_is_external_protocol; |
373 response_headers_ = response_headers; | 384 response_headers_ = response_headers; |
374 was_redirected_ = true; | 385 was_redirected_ = true; |
| 386 redirect_chain_.push_back(new_url); |
375 if (new_method != "POST") | 387 if (new_method != "POST") |
376 resource_request_body_ = nullptr; | 388 resource_request_body_ = nullptr; |
377 | 389 |
378 state_ = WILL_REDIRECT_REQUEST; | 390 state_ = WILL_REDIRECT_REQUEST; |
379 complete_callback_ = callback; | 391 complete_callback_ = callback; |
380 | 392 |
381 // Notify each throttle of the request. | 393 // Notify each throttle of the request. |
382 NavigationThrottle::ThrottleCheckResult result = CheckWillRedirectRequest(); | 394 NavigationThrottle::ThrottleCheckResult result = CheckWillRedirectRequest(); |
383 | 395 |
384 // If the navigation is not deferred, run the callback. | 396 // If the navigation is not deferred, run the callback. |
385 if (result != NavigationThrottle::DEFER) | 397 if (result != NavigationThrottle::DEFER) |
386 RunCompleteCallback(result); | 398 RunCompleteCallback(result); |
387 } | 399 } |
388 | 400 |
389 void NavigationHandleImpl::WillProcessResponse( | 401 void NavigationHandleImpl::WillProcessResponse( |
390 RenderFrameHostImpl* render_frame_host, | 402 RenderFrameHostImpl* render_frame_host, |
391 scoped_refptr<net::HttpResponseHeaders> response_headers, | 403 scoped_refptr<net::HttpResponseHeaders> response_headers, |
392 const SSLStatus& ssl_status, | 404 const SSLStatus& ssl_status, |
| 405 const GlobalRequestID& request_id, |
| 406 bool should_replace_current_entry, |
| 407 bool is_download, |
| 408 bool is_stream, |
| 409 const base::Closure& transfer_callback, |
393 const ThrottleChecksFinishedCallback& callback) { | 410 const ThrottleChecksFinishedCallback& callback) { |
394 DCHECK(!render_frame_host_ || render_frame_host_ == render_frame_host); | 411 DCHECK(!render_frame_host_ || render_frame_host_ == render_frame_host); |
395 render_frame_host_ = render_frame_host; | 412 render_frame_host_ = render_frame_host; |
396 response_headers_ = response_headers; | 413 response_headers_ = response_headers; |
| 414 request_id_ = request_id; |
| 415 should_replace_current_entry_ = should_replace_current_entry; |
| 416 is_download_ = is_download; |
| 417 is_stream_ = is_stream; |
397 state_ = WILL_PROCESS_RESPONSE; | 418 state_ = WILL_PROCESS_RESPONSE; |
398 ssl_status_ = ssl_status; | 419 ssl_status_ = ssl_status; |
399 complete_callback_ = callback; | 420 complete_callback_ = callback; |
| 421 transfer_callback_ = transfer_callback; |
400 | 422 |
401 // Notify each throttle of the response. | 423 // Notify each throttle of the response. |
402 NavigationThrottle::ThrottleCheckResult result = CheckWillProcessResponse(); | 424 NavigationThrottle::ThrottleCheckResult result = CheckWillProcessResponse(); |
403 | 425 |
404 // If the navigation is about to proceed, then it's ready to commit. | 426 // If the navigation is about to proceed, check for the final RenderFrameHost |
405 if (result == NavigationThrottle::PROCEED) | 427 // for the navigation. |
406 ReadyToCommitNavigation(render_frame_host); | 428 // Note: if FindFinalRenderFrameHost() returns false, this means that this |
| 429 // NavigationHandle was deleted, so return immediately. |
| 430 if (result == NavigationThrottle::PROCEED && !FindFinalRenderFrameHost()) |
| 431 return; |
407 | 432 |
408 // If the navigation is not deferred, run the callback. | 433 // If the navigation is not deferred, run the callback. |
409 if (result != NavigationThrottle::DEFER) | 434 if (result != NavigationThrottle::DEFER) |
410 RunCompleteCallback(result); | 435 RunCompleteCallback(result); |
411 } | 436 } |
412 | 437 |
413 void NavigationHandleImpl::ReadyToCommitNavigation( | 438 void NavigationHandleImpl::ReadyToCommitNavigation( |
414 RenderFrameHostImpl* render_frame_host) { | 439 RenderFrameHostImpl* render_frame_host) { |
415 DCHECK(!render_frame_host_ || render_frame_host_ == render_frame_host); | 440 DCHECK(!render_frame_host_ || render_frame_host_ == render_frame_host); |
416 render_frame_host_ = render_frame_host; | 441 render_frame_host_ = render_frame_host; |
417 state_ = READY_TO_COMMIT; | 442 state_ = READY_TO_COMMIT; |
418 | 443 |
419 // Only notify the WebContentsObservers when PlzNavigate is enabled, as | 444 GetDelegate()->ReadyToCommitNavigation(this); |
420 // |render_frame_host_| may be wrong in the case of transfer navigations. | |
421 if (IsBrowserSideNavigationEnabled()) | |
422 GetDelegate()->ReadyToCommitNavigation(this); | |
423 } | 445 } |
424 | 446 |
425 void NavigationHandleImpl::DidCommitNavigation( | 447 void NavigationHandleImpl::DidCommitNavigation( |
426 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, | 448 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, |
427 bool same_page, | 449 bool same_page, |
428 RenderFrameHostImpl* render_frame_host) { | 450 RenderFrameHostImpl* render_frame_host) { |
429 DCHECK(!render_frame_host_ || render_frame_host_ == render_frame_host); | 451 DCHECK(!render_frame_host_ || render_frame_host_ == render_frame_host); |
430 DCHECK_EQ(frame_tree_node_, render_frame_host->frame_tree_node()); | 452 DCHECK_EQ(frame_tree_node_, render_frame_host->frame_tree_node()); |
431 CHECK_EQ(url_, params.url); | 453 CHECK_EQ(url_, params.url); |
432 | 454 |
433 method_ = params.method; | 455 method_ = params.method; |
434 has_user_gesture_ = (params.gesture == NavigationGestureUser); | 456 has_user_gesture_ = (params.gesture == NavigationGestureUser); |
435 transition_ = params.transition; | 457 transition_ = params.transition; |
436 render_frame_host_ = render_frame_host; | 458 render_frame_host_ = render_frame_host; |
437 is_same_page_ = same_page; | 459 is_same_page_ = same_page; |
438 | 460 |
439 state_ = net_error_code_ == net::OK ? DID_COMMIT : DID_COMMIT_ERROR_PAGE; | 461 state_ = net_error_code_ == net::OK ? DID_COMMIT : DID_COMMIT_ERROR_PAGE; |
440 } | 462 } |
441 | 463 |
| 464 void NavigationHandleImpl::TransferToRenderFrameHost( |
| 465 RenderFrameHostImpl* render_frame_host) { |
| 466 DCHECK(!IsBrowserSideNavigationEnabled()); |
| 467 if (render_frame_host != render_frame_host_) { |
| 468 // This is an actual transfer. Inform the NavigationResourceThrottle. |
| 469 BrowserThread::PostTask( |
| 470 BrowserThread::IO, FROM_HERE, transfer_callback_); |
| 471 transfer_callback_.Reset(); |
| 472 } |
| 473 render_frame_host_ = render_frame_host; |
| 474 } |
| 475 |
442 NavigationThrottle::ThrottleCheckResult | 476 NavigationThrottle::ThrottleCheckResult |
443 NavigationHandleImpl::CheckWillStartRequest() { | 477 NavigationHandleImpl::CheckWillStartRequest() { |
444 DCHECK(state_ == WILL_SEND_REQUEST || state_ == DEFERRING_START); | 478 DCHECK(state_ == WILL_SEND_REQUEST || state_ == DEFERRING_START); |
445 DCHECK(state_ != WILL_SEND_REQUEST || next_index_ == 0); | 479 DCHECK(state_ != WILL_SEND_REQUEST || next_index_ == 0); |
446 DCHECK(state_ != DEFERRING_START || next_index_ != 0); | 480 DCHECK(state_ != DEFERRING_START || next_index_ != 0); |
447 for (size_t i = next_index_; i < throttles_.size(); ++i) { | 481 for (size_t i = next_index_; i < throttles_.size(); ++i) { |
448 NavigationThrottle::ThrottleCheckResult result = | 482 NavigationThrottle::ThrottleCheckResult result = |
449 throttles_[i]->WillStartRequest(); | 483 throttles_[i]->WillStartRequest(); |
450 switch (result) { | 484 switch (result) { |
451 case NavigationThrottle::PROCEED: | 485 case NavigationThrottle::PROCEED: |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 | 562 |
529 case NavigationThrottle::BLOCK_REQUEST: | 563 case NavigationThrottle::BLOCK_REQUEST: |
530 NOTREACHED(); | 564 NOTREACHED(); |
531 } | 565 } |
532 } | 566 } |
533 next_index_ = 0; | 567 next_index_ = 0; |
534 state_ = WILL_PROCESS_RESPONSE; | 568 state_ = WILL_PROCESS_RESPONSE; |
535 return NavigationThrottle::PROCEED; | 569 return NavigationThrottle::PROCEED; |
536 } | 570 } |
537 | 571 |
| 572 bool NavigationHandleImpl::FindFinalRenderFrameHost() { |
| 573 DCHECK_EQ(WILL_PROCESS_RESPONSE, state_); |
| 574 |
| 575 // Check if the navigation should transfer. This may result in the |
| 576 // destruction of this NavigationHandle, and the cancellation of the request. |
| 577 if (!MaybeTransferAndProceed()) |
| 578 return false; |
| 579 |
| 580 // Inform observers that the navigation is now ready to commit, unless a |
| 581 // transfer of the navigation failed. |
| 582 ReadyToCommitNavigation(render_frame_host_); |
| 583 return true; |
| 584 } |
| 585 |
| 586 bool NavigationHandleImpl::MaybeTransferAndProceed() { |
| 587 DCHECK(render_frame_host_); |
| 588 // PlzNavigate: the final RenderFrameHost handling this navigation has been |
| 589 // decided before calling WillProcessResponse. |
| 590 if (IsBrowserSideNavigationEnabled()) |
| 591 return true; |
| 592 |
| 593 // Subframes shouldn't swap processes unless out-of-process iframes are |
| 594 // possible. |
| 595 if (!IsInMainFrame() && !SiteIsolationPolicy::AreCrossProcessFramesPossible()) |
| 596 return true; |
| 597 |
| 598 // If this is a download, do not do a cross-site check. The renderer will |
| 599 // see it is a download and abort the request. |
| 600 // |
| 601 // Similarly, HTTP 204 (No Content) responses leave the renderer showing the |
| 602 // previous page. The navigation should be allowed to finish without running |
| 603 // the unload handler or swapping in the pending RenderFrameHost. |
| 604 if (is_download_ || is_stream_ || |
| 605 (response_headers_.get() && response_headers_->response_code() == 204)) { |
| 606 return true; |
| 607 } |
| 608 |
| 609 // The content embedder can decide that a transfer to a different process is |
| 610 // required for this URL. |
| 611 bool should_transfer = |
| 612 GetContentClient()->browser()->ShouldSwapProcessesForRedirect( |
| 613 frame_tree_node_->navigator()->GetController()->GetBrowserContext(), |
| 614 original_url_, url_); |
| 615 |
| 616 RenderFrameHostManager* manager = |
| 617 render_frame_host_->frame_tree_node()->render_manager(); |
| 618 |
| 619 // In the site-per-process model, the RenderFrameHostManager may also decide |
| 620 // (independently from the content embedder's ShouldSwapProcessesForRedirect |
| 621 // above) that a process transfer is needed. Process transfers are skipped for |
| 622 // WebUI processes for now, since e.g. chrome://settings has multiple |
| 623 // "cross-site" chrome:// frames, and that doesn't yet work cross- process. |
| 624 if (SiteIsolationPolicy::AreCrossProcessFramesPossible() && |
| 625 !ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( |
| 626 render_frame_host_->GetProcess()->GetID())) { |
| 627 should_transfer |= manager->IsRendererTransferNeededForNavigation( |
| 628 render_frame_host_, url_); |
| 629 } |
| 630 |
| 631 // Start the transfer if needed. |
| 632 if (should_transfer) { |
| 633 // This may destroy the NavigationHandle if the transfer fails. |
| 634 base::WeakPtr<NavigationHandleImpl> weak_self = weak_factory_.GetWeakPtr(); |
| 635 manager->OnCrossSiteResponse(render_frame_host_, request_id_, |
| 636 redirect_chain_, sanitized_referrer_, |
| 637 transition_, should_replace_current_entry_); |
| 638 if (!weak_self) |
| 639 return false; |
| 640 } |
| 641 |
| 642 return true; |
| 643 } |
| 644 |
538 void NavigationHandleImpl::RunCompleteCallback( | 645 void NavigationHandleImpl::RunCompleteCallback( |
539 NavigationThrottle::ThrottleCheckResult result) { | 646 NavigationThrottle::ThrottleCheckResult result) { |
540 DCHECK(result != NavigationThrottle::DEFER); | 647 DCHECK(result != NavigationThrottle::DEFER); |
541 | 648 |
542 ThrottleChecksFinishedCallback callback = complete_callback_; | 649 ThrottleChecksFinishedCallback callback = complete_callback_; |
543 complete_callback_.Reset(); | 650 complete_callback_.Reset(); |
544 | 651 |
545 if (!callback.is_null()) | 652 if (!callback.is_null()) |
546 callback.Run(result); | 653 callback.Run(result); |
547 | 654 |
(...skipping 19 matching lines...) Expand all Loading... |
567 throttles_to_register.push_back(std::move(clear_site_data_throttle)); | 674 throttles_to_register.push_back(std::move(clear_site_data_throttle)); |
568 | 675 |
569 if (throttles_to_register.size() > 0) { | 676 if (throttles_to_register.size() > 0) { |
570 throttles_.insert(throttles_.begin(), throttles_to_register.begin(), | 677 throttles_.insert(throttles_.begin(), throttles_to_register.begin(), |
571 throttles_to_register.end()); | 678 throttles_to_register.end()); |
572 throttles_to_register.weak_clear(); | 679 throttles_to_register.weak_clear(); |
573 } | 680 } |
574 } | 681 } |
575 | 682 |
576 } // namespace content | 683 } // namespace content |
OLD | NEW |