| 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 "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "content/public/browser/notification_source.h" | 8 #include "content/public/browser/notification_source.h" |
| 9 #include "content/public/browser/notification_types.h" | 9 #include "content/public/browser/notification_types.h" |
| 10 #include "content/public/browser/render_frame_host.h" | 10 #include "content/public/browser/render_frame_host.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 function_->SetRenderViewHost(NULL); | 123 function_->SetRenderViewHost(NULL); |
| 124 } | 124 } |
| 125 virtual void RenderFrameDeleted( | 125 virtual void RenderFrameDeleted( |
| 126 content::RenderFrameHost* render_frame_host) OVERRIDE { | 126 content::RenderFrameHost* render_frame_host) OVERRIDE { |
| 127 if (render_frame_host != function_->render_frame_host()) | 127 if (render_frame_host != function_->render_frame_host()) |
| 128 return; | 128 return; |
| 129 | 129 |
| 130 function_->SetRenderFrameHost(NULL); | 130 function_->SetRenderFrameHost(NULL); |
| 131 } | 131 } |
| 132 | 132 |
| 133 virtual bool OnMessageReceived( | |
| 134 const IPC::Message& message, | |
| 135 content::RenderFrameHost* render_frame_host) OVERRIDE { | |
| 136 DCHECK(render_frame_host); | |
| 137 if (render_frame_host == function_->render_frame_host()) | |
| 138 return function_->OnMessageReceived(message); | |
| 139 else | |
| 140 return false; | |
| 141 } | |
| 142 | |
| 143 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE { | 133 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE { |
| 144 return function_->OnMessageReceived(message); | 134 return function_->OnMessageReceived(message); |
| 145 } | 135 } |
| 146 | 136 |
| 147 UIThreadExtensionFunction* function_; | 137 UIThreadExtensionFunction* function_; |
| 148 | 138 |
| 149 DISALLOW_COPY_AND_ASSIGN(RenderHostTracker); | 139 DISALLOW_COPY_AND_ASSIGN(RenderHostTracker); |
| 150 }; | 140 }; |
| 151 | 141 |
| 152 ExtensionFunction::ExtensionFunction() | 142 ExtensionFunction::ExtensionFunction() |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 SyncIOThreadExtensionFunction::SyncIOThreadExtensionFunction() { | 378 SyncIOThreadExtensionFunction::SyncIOThreadExtensionFunction() { |
| 389 } | 379 } |
| 390 | 380 |
| 391 SyncIOThreadExtensionFunction::~SyncIOThreadExtensionFunction() { | 381 SyncIOThreadExtensionFunction::~SyncIOThreadExtensionFunction() { |
| 392 } | 382 } |
| 393 | 383 |
| 394 ExtensionFunction::ResponseAction SyncIOThreadExtensionFunction::Run() { | 384 ExtensionFunction::ResponseAction SyncIOThreadExtensionFunction::Run() { |
| 395 return RespondNow(RunSync() ? MultipleArguments(results_.get()) | 385 return RespondNow(RunSync() ? MultipleArguments(results_.get()) |
| 396 : Error(error_)); | 386 : Error(error_)); |
| 397 } | 387 } |
| OLD | NEW |