OLD | NEW |
---|---|
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 "extensions/browser/extension_function.h" | 5 #include "extensions/browser/extension_function.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
434 BrowserThread::DeleteOnUIThread::Destruct(this); | 434 BrowserThread::DeleteOnUIThread::Destruct(this); |
435 } | 435 } |
436 | 436 |
437 content::RenderViewHost* | 437 content::RenderViewHost* |
438 UIThreadExtensionFunction::render_view_host_do_not_use() const { | 438 UIThreadExtensionFunction::render_view_host_do_not_use() const { |
439 return render_frame_host_ ? render_frame_host_->GetRenderViewHost() : nullptr; | 439 return render_frame_host_ ? render_frame_host_->GetRenderViewHost() : nullptr; |
440 } | 440 } |
441 | 441 |
442 void UIThreadExtensionFunction::SetRenderFrameHost( | 442 void UIThreadExtensionFunction::SetRenderFrameHost( |
443 content::RenderFrameHost* render_frame_host) { | 443 content::RenderFrameHost* render_frame_host) { |
444 if (!render_frame_host) | |
Devlin
2016/04/13 19:46:30
Might be worth a comment when this can happen.
lazyboy
2016/04/14 02:07:52
Done.
| |
445 return; | |
444 DCHECK_NE(render_frame_host_ == nullptr, render_frame_host == nullptr); | 446 DCHECK_NE(render_frame_host_ == nullptr, render_frame_host == nullptr); |
445 render_frame_host_ = render_frame_host; | 447 render_frame_host_ = render_frame_host; |
446 tracker_.reset( | 448 tracker_.reset( |
447 render_frame_host ? new RenderFrameHostTracker(this) : nullptr); | 449 render_frame_host ? new RenderFrameHostTracker(this) : nullptr); |
448 } | 450 } |
449 | 451 |
450 content::WebContents* UIThreadExtensionFunction::GetAssociatedWebContents() { | 452 content::WebContents* UIThreadExtensionFunction::GetAssociatedWebContents() { |
451 content::WebContents* web_contents = NULL; | 453 content::WebContents* web_contents = NULL; |
452 if (dispatcher()) | 454 if (dispatcher()) |
453 web_contents = dispatcher()->GetAssociatedWebContents(); | 455 web_contents = dispatcher()->GetAssociatedWebContents(); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
557 ExtensionFunction::ResponseAction SyncIOThreadExtensionFunction::Run() { | 559 ExtensionFunction::ResponseAction SyncIOThreadExtensionFunction::Run() { |
558 return RespondNow(RunSync() ? ArgumentList(std::move(results_)) | 560 return RespondNow(RunSync() ? ArgumentList(std::move(results_)) |
559 : Error(error_)); | 561 : Error(error_)); |
560 } | 562 } |
561 | 563 |
562 // static | 564 // static |
563 bool SyncIOThreadExtensionFunction::ValidationFailure( | 565 bool SyncIOThreadExtensionFunction::ValidationFailure( |
564 SyncIOThreadExtensionFunction* function) { | 566 SyncIOThreadExtensionFunction* function) { |
565 return false; | 567 return false; |
566 } | 568 } |
OLD | NEW |