| 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 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 } | 511 } |
| 512 | 512 |
| 513 bool UIThreadExtensionFunction::OnMessageReceived(const IPC::Message& message) { | 513 bool UIThreadExtensionFunction::OnMessageReceived(const IPC::Message& message) { |
| 514 return false; | 514 return false; |
| 515 } | 515 } |
| 516 | 516 |
| 517 void UIThreadExtensionFunction::Destruct() const { | 517 void UIThreadExtensionFunction::Destruct() const { |
| 518 BrowserThread::DeleteOnUIThread::Destruct(this); | 518 BrowserThread::DeleteOnUIThread::Destruct(this); |
| 519 } | 519 } |
| 520 | 520 |
| 521 content::RenderViewHost* | |
| 522 UIThreadExtensionFunction::render_view_host_do_not_use() const { | |
| 523 return render_frame_host_ ? render_frame_host_->GetRenderViewHost() : nullptr; | |
| 524 } | |
| 525 | |
| 526 void UIThreadExtensionFunction::SetRenderFrameHost( | 521 void UIThreadExtensionFunction::SetRenderFrameHost( |
| 527 content::RenderFrameHost* render_frame_host) { | 522 content::RenderFrameHost* render_frame_host) { |
| 528 // An extension function from Service Worker does not have a RenderFrameHost. | 523 // An extension function from Service Worker does not have a RenderFrameHost. |
| 529 if (is_from_service_worker_) { | 524 if (is_from_service_worker_) { |
| 530 DCHECK(!render_frame_host); | 525 DCHECK(!render_frame_host); |
| 531 return; | 526 return; |
| 532 } | 527 } |
| 533 | 528 |
| 534 DCHECK_NE(render_frame_host_ == nullptr, render_frame_host == nullptr); | 529 DCHECK_NE(render_frame_host_ == nullptr, render_frame_host == nullptr); |
| 535 render_frame_host_ = render_frame_host; | 530 render_frame_host_ = render_frame_host; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 | 629 |
| 635 ExtensionFunction::ResponseAction SyncExtensionFunction::Run() { | 630 ExtensionFunction::ResponseAction SyncExtensionFunction::Run() { |
| 636 return RespondNow(RunSync() ? ArgumentList(std::move(results_)) | 631 return RespondNow(RunSync() ? ArgumentList(std::move(results_)) |
| 637 : Error(error_)); | 632 : Error(error_)); |
| 638 } | 633 } |
| 639 | 634 |
| 640 // static | 635 // static |
| 641 bool SyncExtensionFunction::ValidationFailure(SyncExtensionFunction* function) { | 636 bool SyncExtensionFunction::ValidationFailure(SyncExtensionFunction* function) { |
| 642 return false; | 637 return false; |
| 643 } | 638 } |
| OLD | NEW |